Windows 8: File Explorer

It’s been a while since my last post, I’ve been quite busy. However, in this post I’d like to take a look at the new file explorer in Windows 8.

Windows 8 File Explorer
Windows 8 File Explorer

Many people have been giving a lot of negative feedback about the fact that Microsoft decided to integrate the ribbon interface as seen in Microsoft Office 2007/2010 and other applications like Paint on never versions of Windows. Personally I think this is a great idea and they should have done this sooner.

In my opinion, this new interface opens up the capabilities of the file explorer to the every day user who often has trouble finding certain commands. The great thing about it is that the poweruser who may think of the bar as a waste of space, can jut hide it with a click of a button.

As you can see in the image, Microsoft also took some time to increase the space available. The bottom bar which showed some file properties and such has been replaced with a simple status bar to free up a lot of additional vertical space, something that will certainly be useful for users with lower screen resolutions, such as many notebook users.

Aside from the new interface I’d also like to discuss some other cool features. The first of which is that it is now possible to open a command window directly from the file menu in the file explorer, including starting it with administrative privileges. It’s of course not a big adaptation, but it’ll take a tine amount of clicks and keys off of the current methods to open this.

Another cool feature is that it is now possible to mount iso and vhd files. For those who are not familiar with either one of these files, an iso file is a sort of disk image archive file, it contains a disk image for an optical disc such as a DVD. Normally one would burn these disk images to an optical disc and insert it into a optical drive to read it, but for quite a while now, applications like Deamon Tools and VirtualCloneDrive have been able to mount these images directly as virtual drives. Windows 8 now natively supports this, removing the need for 3rd party applications. Also new is the ability to mount vhd files which are similar to iso files, but these represent virtual hard drives. The iso files mounts as a virtual optical drive and the vhd files as a virtual hard drive, which both can easily be ejected by right clicking the drive and pressing Eject.

All of these features of course are fairly trivial, but I do feel they add a lot of value to windows as a product as they increase the user experience quite a lot.

Read More

Delphi Certification

Embarcadero recently started a Delphi certification service. This allows you to test your Delphi skills and get certified by Embarcadero. The certificate is meant to show employers that you are well educated in the usage of Delphi and all of it’s concepts. If you hold a Delphi XE license, you are able to take the certification test free of charge (unless you have an academic license like me). Otherwise the entry free for the test is $49, which is affordable, while ensuring that people don’t take the test lightly. A master certification test is also available, passing this would identify you as an elite member of the Delphi community. The master test can however only be taken at a licensed Delphi certification center at a fee of $149.

Read More

Delphi: Remove Directory Recursively

If you ended up looking for this, then you probably came to the conclusion that Windows.RemoveDirectory() can not remove a directory that has files/directories in it.

About.com proposes the following solution: http://delphi.about.com/cs/adptips1999/a/bltip1199_2.htm

I can assure you that this solution is valid and works. However, the code as it is proposed there will move the deleted folder into the recycle bin which is something you will want to avoid more often than not. The following code I modified to remove that effect:

Another way of doing this is recursing through all directories and removing all files before you remove the directories as seen here, but I imagine that might be slower as in the method above, the OS takes care of that internally:

Read More

Delphi: Exposing Protected Properties

On occasion you’ll find yourself wanting to access a a protected property from a class in a different unit. If this is a 3rd party unit, you’ll often not want to modify it’s source code. So how do you access it? Sub-classing the class as you might have guessed, however, you can do this in very little code.

Delphi will allow any class to use protected properties from other classes as long as they are in the same unit. We can use this to our advantage. By creating a subclass, we can essentially use this to access protected values in the class we’re sub-classing, it works the same way, because your subclass is in the unit you need it in. All you have to do, is cast the object to the subclass and you’re set to access the protected property.

unit Example;

interface

uses
  Classes;

type
  TStringListEx = class(TStringList);

implementation

function SLChanged(const SL: TStringList): Boolean;
begin
  Result := TStringListEx(SL).Changed;
end;

end.

Read More

Elementary OS 0.2 Jupiter

Elementary OS 0.2 Jupiter is the first stable release of Elementary OS and was release just over 10 days ago. I’ve been using the OS on one of my production machines for a week now and I’d like to share some of my thought about the OS.

Elementary OS is an Ubuntu remix, though things aren’t all that different. The only real difference between Ubuntu and Elementary OS is the interface. Elementary OS uses a custom built shell that runs on top of Gnome. The shell is clearly designed to resemble Mac OSX. The interface looks very sleek and tidy, is very responsive and overall I must say that it works really well.

As for functionality, the interface unfortunately doesn’t really add any, at the bottom of your desktop you will see a dock such as in Max OSX, opened programs will show up on the dock and you can easily stick them to do the dock to quick launch them. Aside from the dock, the interface seems to actually reduce the functionality of the Ubuntu desktop environment. The Desktop itself is completely gone, you can no longer put any files or folders onto the desktop and aside from this you no longer have multiple desktop support.

The OS still has a couple of bugs to iron out, often folders like Documents won’t launch and there’s a few other minor bugs.

Overall even though there’s some reduced functionality and small bugs, I must say I’m very satisfied with this new distro, the new interface looks very clean and is fun to use, it reduces that basic feel to Gnome while retaining the performance.

Note that you can use Ubuntu Tweak to bring back a lot of the functionality that was removed.

Read More

Delphi 64-bit Compiler Preview

Ever since Embarcadero has been in charge of Delphi’s development, they have made great strides to bring the language back from the brink of death. From the start they have therefor also been developing a 64-bit compiler for Delphi, which unfortunately has been postponed for quite some time. I can’t really blame them, if the product isn’t finished, there’s no point in releasing it, it would only make matters worse, but now, finally they have started giving Beta testers access to the 64-bit compiler preview.

As usual, also with this new compiler, Embarcadero has dedicated huge efforts towards keeping backwards compatibility as much as possible. This results in the face that most old Delphi code will still compile with this 64-bit compiler. The size of Integers, Int64, and most other datatypes have gone unchanged. However, NativeInt for example has the size of the integer on the system you’re on. Pointers on 64-bit are also 8 bytes, but as long as you always use SizeOf or similar methods that don’t rely on specifying a size of a datatype manually, your code should work in 64-bit. If you have any dependencies on dll libraries or activex components, these will have to be upgraded to 64-bit versions as well of course.

The final edition of the 64-bit compiler should be included in the next release of Delphi, the XE2 release. In XE3 the compiler will also compile code from C++ builder into 64-bit applications and libraries. Alongside the 64-bit compiler, Embarcadero also promises to include a cross-platform compiler in RAD Studio XE2 which can compile 32-bit applications to Mac OSX and possibly Linux. The additions of these new features may finally revitalize the interest of developers in this language as most other mainstream language already have at least in some way the ability to compile to 64-bit platforms and platforms other than MS Windows.

You can sign up to get into the beta program for the 64-bit compiler, if you have a license to RAD Studio XE, Delphi XE or ToolCloud, you may get priority access to the beta.


 

Read More

Delphi XE Starter

A while back in a post I mentioned that Embarcadero had plans to release a new Delphi license for hobbyists and others with a low price so people can get access to a license easier in case they don’t require it for commercial development. Embarcadero has now indeed come through with that promise and is now selling the Delphi XE Starter Edition on their website. There is only a starter edition available for Delphi, none of the other products like RAD Studio or C++ Builder and a license in the US store is priced at $199. Alongside this there are also upgrades available to Delphi Professional and RAD Studio Professional at reduced costs when coming from the Starter Edition.

The most important question regarding this new license is fairly obvious of course. What’s the difference with the Professional Edition? There are a few restrictions put in place. The Starter Edition is fully functional, there shouldn’t be any restrictions there, however, you can use it for commercial development if your yearly revenue stays under $1000. For small companies the usage is also permitted if their total revenue stays under $1000 and have less than or 5 people using the product for development. Once these conditions are no longer met, you are required to upgrade to the Professional edition. The academic licenses for Professional and will remain available.


 

Read More

Java: Download File

The following code will allow you to download a file in java from a source URL to a target File.

public static void download(URL orig, File dest) throws IOException {
	OutputStream os = null;
	InputStream is = null;
	try {
		byte[] buf;
		int count, length = 0;
		os = new BufferedOutputStream(new FileOutputStream(dest));
		is = orig.openConnection().getInputStream();
		buf = new byte[4096];
		while ((count = is.read(buf)) != -1) {
			os.write(buf, 0, count);
			length += count;
		}
	} finally {
		is.close();
		os.close();
	}
}

Read More