Wednesday, December 24, 2008

The very last post

Yup, this is the very last post on this blog. No, I don't give up :) I just moved my blog to free hosting service I was writing about (and now my blog is being powered by WordPress engine ;)

So... this is the address of my new blog: http://notonlyzeroesandones.site40.net/

See ya.

Monday, December 15, 2008

Usability & User experience

A few days ago I wrote a short note about the importance of GUI. But GUI alone - the set of graphical widgets, that present information and allow to perform actions - is not everything one should consider when creating application. The second, very important thing while designing application is to focus on how this application will be used, make it as easy as possible, create interface that will be easy (so easy, that users will not have to read documentation just to get to know how to perform some tasks, that application is capable of performing), interface that will not be annoying (avoid forcing user to click in many places to perform one action) and many more. Wikipedia's definition of usability is: "Usability is a term used to denote the ease with which people can employ a particular tool or other human-made object in order to achieve a particular goal. Usability can also refer to the methods of measuring usability and the study of the principles behind an object's perceived efficiency or elegance." So, I think, there is no need, to explain further what 'usability' (in terms of designing software) is. Let's face some real-world examples:

Control Panel link in Start Menu (Windows 95)

Windows 95 GUI was fresh, and gave much better user experience than the old GUI designed for Windows 3.x. Although there were a lot of small 'bugs' or things that were possible (not at the first sight) but were not easy to achieve. One of them, was creating a menu (link) to control panel in Start Menu. It was possible. The only things one should do, was to find proper key in Windows Registry (well, not the key, but it's GUID was to be found), and create a folder, which name was GUID itself. This kind of folder pointed directly to the content of Control Panel. The same trick worked for other special folders. Anyway, the thing is, that some of my friend, that were proud Mac owners at the time, claimed, that it 'stupid'. Stupid, because it so hard to do, and Mac allows to do such things just using drag & drop technique.

Fonts in cmd.exe

When you look a little bit closer to cmd.exe (or command line console - if you prefer) you realize, that this ugly bitmap font (the default one) hasn't changed for a long, long time. It is default font, and it looks the same (or rather: is as much ugly) in Vista and in Windows 95. Can't it be changed? Of course, it can. And again, it could be made by digging and changing Windows Registry.

Where does my tab-close button go? (Mozilla Firefox)

Firefox was one of the first browsers that incorporated tabbed browsing - something that many of us can not imagine surfing without. But there is some strange behaviour of Firefox, when it comes to tab-closing button. If you have only few tabs open - it is always placed on every tab (on the right side on the tab title). But what happens, when user opens more, and more tabs? Well... the button disappears! Simply, none of the tabs has it. Why? I don't know. What's the solution? Ctrl+T for new tab, in the address bar type famous "about:config", browser.tabs.closeButtons' value should be 1 (to show tab closing button for all tabs), and browser.tabs.tabClipWidth's value should be way smaller than default 140 (this value is the minimal width of the tab title, if its smaller, tab close button is being not displayed).

Did you expect that there is still so many to do in the field of user experience, usability? Is there anything that software designer could do, to make their applications better? Of course! In the first two examples the changes are obvious. In the first case, managing special folders should be the same as 'normal' folders, so copying them, linking to them should be possible - there is even better solution: a wizard that will let anyone personalize its start menu (similar to what it is being done right now in Windows XP and Vista, but it could be a bit more user friendly, IMO).

I am wondering, what is so hard in making 'Courier New' or 'Lucida Console' (both of them are TrueType fonts) the default font for cmd.exe? Those fonts look a lot better than default bitmap font (which is so ugly, that I wonder how anyone can actually work with console that has this font set).

And the last issue... I assume that the worst thing in the case of 'disappearing tab close button' is that it is silent. You're just surfing the web, opening more, and more pages, maybe close your browser, and restart it the very next day... and there is a moment, that you realize the buttons are gone. And it's so strange, because 'they were always present, on all the tabs', right? So first of all, I think that Firefox should warn user (but not with standard message box dialog that nobody ever reads) that tab closing buttons will not be displayed anymore (as long, as tabs are so narrow). I think, this message box, should have some animation showing that the button is being 'kicked off' from tab titles (it's not hard to do, just a small gif containing about 8 frames of animation will do). The message box (or dialog box - better) could provide a smart wizard, that will let user choose how the browser should behave. That's it. I think, it would be much better, and less confusing for many people.

Usability could be taught on example, there are dozens of applications around, and it is sometimes a good idea to think if they work the way users expect, or users are just used to applications' design? How many clicks does it take to perform a simple action? And how many different ways exist that allow to perform a specified task? Are all the ways obvious? Does user need to go over and over to some kind of menus to change some properties during work? Are the most common tasks and options grouped? How? Are messages easy to understand to anybody (not only some techie guys)? There's definitely more question that software designer focused on GUI and usability should ask while (re)designing.

At the very end I would like to point that there are some books that should be interesting for people who think that designing GUI and usability is not just a waste of time and resources. First book I think is worth reading is "User Interface Design for Programmers" by Joel Spolsky (it is also worth to take a look at his blog). The other book I think is worth reading is "Why Software Sucks And What You Can Do About It" by David S. Platt (there is a sample chapter available on David's book page). Have you ever thought that there is no point in thinking about some small parts of the application? David presents great example: the message that user gets when they want to close application and their work was not saved. Is the standard message easy to understand to anyone? It definitely should, right? There is a thin line between sticking to standard solutions used in GUI design we see in modern apps, and the need of improving user experience. If nobody at Microsoft thought that problem of Office was in its poor GUI - Ribbon would never appeared. The same thing is with context menus: why options (entries, whatever) are being placed one under another? Is it really comfortable? Or was it the most simple solution (rendering rectangle is the simplest what you can actually do in graphic environment). I've seen lately some proposals to change standard context menus to circles (all the options are equally available in terms of 'mouse distance'). There's a lot more to think about. I just hope that modern apps are going to be more and more easy to use (so they make us all more productive, and we'll all have more time to relax and enjoy our lives).

Thursday, December 11, 2008

FreeMind alternative, really?

For quite a long time I have been using FreeMind as a mind mapping software for day-to-day basis. I am used to it, but its ugly user interface (and especially those ugly fonts!) keeps me searching for replacement from time to time. Recently I spent another hour searching for alternative. I have found XMind. XMind was a commercial only application before, but now a free version is also available. The differences between PRO and free versions are not crucial for me, and I didn't even thought about spending money on the PRO version (you may check detailed feature comparison). Anyway, lets start testing it. First impression? Whoa! It is beautiful! Ctrl+Shift+Esc... and hm... XMind allocates about 60MB at the very beginning. A bit too much I think... (and I didn't start working! I just run the app!) A few more clicks (importing my mind map created in FreeMind) and... yup, definitely it is eye-catching. Fonts on the mind map are very well antialiased, all the shapes looks very nice, same as connecting lines. The whole structure is very clean, icons are big enough to notice them at the first sight. Mind map is actually colored but it does not look like a fireworks during fiesta - no need to be worry about it ;) The impression while using are, although, mixed. The app looks great, but sometimes user does not have good experience of application's responsiveness... what am I talking about? I have tested both apps (XMind and FreeMind - just for comparison) with the same mind map (created originally using FreeMind). This mind map consists of 76 object (including the 'root' one). The maximum depth is 6 levels. As you see it was not very complicated. And while using XMind I had the feeling that my quite new cpu (2.6GHz Core2Duo) is lacking some power... yes ;) Collapsing / expanding and moving whole mind map (even if big part of it was already collapsed - so not visible) was quite slow. Much better impression is being made while scrolling with scrollbars than "dragging workspace" (right-click & drag). There are two panes that I think should be incorporated into FreeMind: outline and properties. Outline is special view that lists all objects on workspace in hierarchy. It would be great if clicking on anything in outline made it active in main view... It does not work that way at the moment (it is very strange, because one expects that). Properties pane is used to quickly change properties of workspace and how it is being rendered. It allows changing outlook of workbook (workspace), user may change default shape, default type of connector lines and font. Properties pane makes a lot of work easier and allows to quickly change whole outlook of current workbook (workspace) in very convenient way (it is very easy to see how the structure will look if one uses different font or connector lines type). A few minutes passed, time to see how much memory does XMind consume... 180MB. Well... it is way too much. Working with XMind is easy. One do not have to search through help to find how something should be done. User interface is really well designed, there are dozens of predefined shortcuts, so most of the work could be done without touching mouse. It may be a power of being used to, but I think that +/- (XMind) for collapsing / expanding is worse than just hitting space bar. But customizing XMind's shortcuts is really easy, and there is always a possibility to revert all changes and restore default settings. XMind allows using one of predefined themes - bunch of predefined colors and properties, that change the way your scheme looks like. Another couple of minutes... and XMind uses about 290MB (hey, and some said that Vista's memory consumption is huge, so how do you call that?). The best thing about XMind is that is not only a mind mapping software. It allows creating many different types of structures: fishbones, spreadsheet, organizational, tree and logic charts (and mind maps of course ;) There are a few more things that XMind has to offer: markers, notes, creating relationships, boundaries (creating a special shape around selected objects) and a few more.

FreeMind is much smaller application than XMind. Working with FreeMind sometimes fools user: application behaves as if it was doing a lot of hard work, even if the only thing that is happening is just mouse cursor moving over objects. The (default?) behaviour of selecting object that mouse cursor is over gives user kind of a quirky feeling... the selection is not immediate, and it seems lto be a task very hard to achieve. There are a lot of useful shortcuts in FreeMind (and personally I think that they are much better designed than those in XMind). Creating and managing mind maps is easy, but one has to stop focusing on how ugly the app and mind maps created using it are... Being the opposition of XMind - FreeMind consumes only a fraction of memory that XMind does. At the beginning it allocates about 50MB, and if minimalized, this value drops to only few MBs. Sometimes (after using it for quite a while) it take about 20-30 MB more, but I didn't see it allocating more than 100. The biggest issues with FreeMind are related to its poor GUI design and ugly outlook. The fonts look horrible and whole mind maps too (fonts are not antialiased, so as shapes and connecting lines). If you select all objects on mind map and try to change font - be aware that those object which are not visible (collapsed) will not have its properties changed - not really nice surprise after expanding.

So... Is XMind worth trying? Definitely yes. Am I going to give up using FreeMind? No. Two biggest issues are: memory consumption (it is hardly possible to use it as a background app with almost 300MB allocated by such a simple app) and lack of possibility to export created mind maps into FreeMind again. Mixing FreeMind (and especially its small resource allocation) and xmind (almost everything else ;) is the way to create the perfect mind mapping application.

So, just to sum everything up:

FreeMind:

Pros:

  • free
  • small
  • available for many platforms (written in Java)
  • small memory & resource consumption
  • shortcuts are very well designed, for most of the time one does not have to use the mouse at all

Cons:

  • ugly (especially fonts - not antialiased (even if one sets up antialiasing for all apps)
  • GUI is far from being convenient
  • responsiveness while selecting objects... one may sometimes feel some strange delays
  • still in BETA
  • if there are some objects hidden, hitting Ctrl+A (select all) and changing font (for example) does not have any effect on those objects that are collapsed... don't like it.

Xmind:

Pros:

  • free
  • beautiful
  • creates very good looking mind maps / charts
  • it is much more than mind mapping software - it could be used for designing variety of things structures
  • outline view is definitely a big plus (or rather to say it will be a good thing if they improve it a bit)
  • properties view - very good idea
  • imports FreeMind's and MindManager's mind maps
  • able to store mind maps online (but hey, who really needs this kind of feature in the era of free online storage services?)
  • based on Eclipse, so it is easy to use to all those people used to Eclipse environment
  • available for many platforms: Windows, Mac, Linux...
  • portable version available (quite big, but it has java included, so it may be possible to use it on machine that does not have Java Runtime installed)

Cons:

  • huge, HUGE, AMAZING, ridiculous... memory consumption (it may be related to using Eclipse framework, which itself is memory hungry app, but... 300 MB?)
  • lacks export to FreeMind and /or MindManager (it seems that even PRO version is lacking this functionality)
  • slow (while moving mind map around, collapsing / expanding - even if animations are turned off)
  • selecting object on outline view does not select the same object on the main workspace, so outline is somewhat useless...
  • portable version is HUGE: ~110MB of free space is required
  • you have to register to download it (God bless GuerillaMail? ;)

Last minute news: at the time of finishing this note, XMind was allocating 450MB... no comments...

Sunday, December 07, 2008

Color customization in CodeRush XPress

A while ago DevExpress introduced a new, totally free product for developers using Visual Studio - CodeRush XPress. I found it quite helpful, so it became one of the plugins I am using during my day to day developer activities. However, I was looking for possibility to change default colors (I have black background in my VS environment, so not all the colors are easy to notice), and couldn't find one. Recently, I have found the solution on DevExpress site. It's a pity, that one must be aware of this magic key combination, instead of being able to configure plugin behaviour from VS options menu. Anyway, after pressing Ctrl+Shift+Alt+O (easy to remember, right? all the modifier keys and 'O' as in Options ;) you will see an option dialog, with dozen of things to change (or better: 'personalize'):

CodeRush XPress' option dialog.

Friday, November 28, 2008

Modern UI

Office 2007 UI is one of the things that forced many people to think about UI of their own applications. I remember while working for one of the companies in - we were all impressed by the new UI. We planned to change the outlook of our application and make it more convenient for the end-user (and looking somewhat similar to Ribbon UI). I have just found a site on MSDN that describes all the things that people who want to create office 2007-like GUI should take under consideration (Ribbon guidelines). You may also be interesting in watching a 1.5 hour presentation by Jensen Harris, who describes the process of designing Ribbon UI. He shows many prototypes and talks about research that Microsoft has conducted while designing Ribbon. The amount of work is impressive and if you're interested in creating modern GUI's this is definitely what you should see. The guidelines are what every developer / designer responsible for designing GUI should see, and think of. I have seen many applications that seem to be created 'by developers and for developers'. It is amazing how easy it is to make application hard to use, by making its GUI completely different that other similar application use (however sometimes innovation is what makes application better - just like in the case of Office applications).

Apple is a company that is believed to create and design the best user interfaces (although I am definitely not a keen on Apple, but I have to admit, that their applications look really neat, and they make apps really easy to use). There is a great site devoted to Apple developers that describes how should application be designed to meet all the standards for 'true Mac app'. I does not matter if one is a Mac developer or not - most of the things described are universal. It is a strong belief that 'good looking applications sell' - so why not spend a little bit more time on designing GUI - just to make sure that there were no pitfalls made that will prevent the app from gaining popularity? Command-line interfaces are gone, and creating GUI is not the same as creating GOOD GUI (it is definitely something more than just putting some controls on the form). Why not to learn from the best? Why not to use all the experience they want to share with?

Saturday, November 22, 2008

Disk problems? I hate it!

There is one thing I hate about computers: sometimes something doesn't work and it takes a lot of time to figure out what is causing troubles. I am really happy when everything works as I am expecting. I am aware that it is important to create backups - I prefer to devote small amount of time every day / week than have to spend all day repairing and trying to get my data back. Unfortunately I am also eager to check a lot of things that shows up - new operating systems' versions (different Linux distribution for example), different compilers, tools etc. As far as it does not involves playing with disk partitions I feel quite safe - only thing that I have to do is just to create backup of the environment I am currently using. However when it comes to repartitioning or changes in partition sizes (sometimes, I had to do it - no matter how much I am trying to avoid it) it takes much more time than expected. A few days ago I have decided to change organization of partition on my old desktop machine. I didn't expected it to take so much time...

The strangest thing that happened to me recently was... incidentally loss of a whole partition (the one with quite important data on it... and of course the one I didn't backed up earlier ;) At the beginning I thought that everything is lost... but after a while I realized, that it have to be possible to recover at least some of the information. It should be possible - just like in case of deleting files. If nothing has been saved on the same place - the information is still there, the issue is that OS somehow does not see it. After a few click I had the first tool. Next couple of seconds, and... the tool informs me, that it found the lost partition, it allows me to see all the data on it... but... I am not able to recover them, because the full version of the software (the one you have to pay for) is needed for the write operation. I didn't want to waste my time, and wait for the code, so I started to search for the free alternative. After a while I have found TestDisk utility. It is completely free, and it is available in many version for different OSes. It is not as much friendly as earlier mentioned commercial app (TestDisk is a console application) but it does its job very good. After a few moments I had all my data back. And everything is ok (media are playable, archives have been tested and are error free). The best thing is that this utility (TestDisk) comes as a part of great LiveCD called PartedMagic. The LiveCD consist of a bunch of disk utilities, among them: GNUParted (partition tool able to resize, move, create, delete partitions...), TestDisk (partition recovery tool) and PhotoRec (file recovery). I advise to download PartedMagic's iso image, burn it, and have it always somewhere near - just in case...

A while ago, I went to my friends and they were having a problem - some application (which was really a state of the art when it comes to its design...) stopped working, because there were no sufficient free space on system partition (only 7 GB free...). They tried to reinstall this app on different partition - nothing changed - it claimed about insufficient free space on system drive. And that's where another utilities I use come in handy: Junction Link Magic and Winbolic. What do these utilities allow? To be short: creating junction points (directory symbolic links, NTFS junction or however you'll call it). The thing is just to create a special link pointing to a directory on a different drive or partition (that has a lot of free space) and thus overcome the limitation of "insufficient free space". It works similar to standard links, but it is transparent for all applications - the paths are not being changed, and from the view of application or file operations it is the same as it was before creating junction point. A few clicks in Winbolic (this one is my favorite) and everything was back to normal, app was starting without any complaint (all thing was about creating symbolic link for application's preferences stored in AppData...).

Similar technique I often use to avoid repartitioning my drive, and still be able to use all its space. When I give up some new and fancy Linux distribution (for any reason) - I just format the partition and link them to an empty directory (this is possible using Windows built in Administrative Tools -> Computer Management -> Disk Management). The only thing you have to do is to remove any drive letter that is assigned to drive, and mount the drive to any empty directory to any of the partitions you use. From now on all the space from the specified partition (or drive) is accessible through the directory you've chosen. It works very similar to mounting drives / partition in Linux distributions. I find it much more convenient than having a lot of drive letters that you have to switch through to find something.

Tuesday, November 18, 2008

Visual SourceSafe to SVN migration.

After struggling with VSS for quite some time I decided to switch to SVN with all my private projects. I have used SVN before and I think it is great, but never had enough time to migrate all the projects. I thought that such an operation could not be painless. History of all changes was crucial for me - I did not want to devote all those information held by VSS just because of the migration. I started looking for some kind of script I could use... and I was very lucky, because almost immediately I found the solution that did all the work for me. VssMigrate is a command line C++ utility developed by a bunch of folks (y

ou will find all the info on the utility site). At the project page one will find a bunch of releases (bug fixes, additional features...) - personally I think the best idea is follow author's advice and download one of the latest (the one with 'tim2' suffix seems to be the latest one - it automatically removes VSS bindings). VssMigrate seems to be quite mature and as much developer-friendly as could be - the only thing one has to do is to configure this tool by editing .config file. It did take me, however, a couple of minutes to configure it properly, but when I figured out the proper values... the migration was quick as lightning. Below you may find configuration that worked for one of my projects:

1 <add key="VSSWIN32" value="C:\Program Files\Microsoft Visual SourceSafe"/>
2 <!-- # VSS\\Win32 directory which contains ssapi.dll-->
3 <add key="VSSDIR" value="d:\VSS"/>
4 <!-- #VSS repository directory (contains srcsafe.ini)-->
5 <add key="VSSPROJ" value="$/RegionCreator/"/>
6 <!-- #VSS project to start at (ie $/Product)-->
7 <add key="VSSUSER" value="<user>"/>
8 <!-- #User to use for VSS commands, use blank for none-->
9 <add key="VSSPASSWORD" value=""/>
10 <!-- #password to use for VSS commands, blank is OK-->
11 <add key="SVNUSER" value="<computer_name>\<user_name>"/>
12 <!-- #User to use for SVN commands, use blank for none-->
13 <add key="SVNPASSWORD" value=""/>
14 <!-- #password to use for SVN commands, blank is OK-->
15 <add key="SVNURL" value="file:///D:/Svn/RegionCreator"/>
16 <!-- #URL to use for the root of the check in-->
17 <add key="SVNPROJ" value="trunk"/>
18 <!-- #SVN project to start at (ie $/Product)-->
19 <add key="SVNREVPROPSPATH" value="d:\Svn\db\revprops"/>
20 <!-- #SVN Repository directory (ends in [RepositoryName]\db\revprops\)-->
21 <add key="WORKDIR" value="c:\Temp\vss"/>
22 <!-- #Directory under which files and directories will be created as work progresses-->
23 <add key="DEBUG" value="1"/>
24 <!-- #turn on debug output, blank is OK-->
25 <add key="AUTORETRY" value="1"/>
26 <!-- #if a command fails to run, it will be run automatically 1 time before failing-->


Thanks to the comments, and sample values - editing config file was not such a big hassle as I was expecting. Just to make it even clearer - I will describe some properties that may not be obvious at the beginning:

  • [line 5] "VSSPROJ" should hold internal path of a project inside VSS.
  • [line 19] "SVNREVPROSPATH" should point into "db\revprops" that is located right under the folder when SVN repository was created
  • [line 21] "WORKDIR" is a temporary directory used during the migration process. The directory must exist before running migration utility.

I am not sure if I have configured it properly, but it worked for me as a charm. The only disadvantage I can think of is that it is impossible to import all the content of VSS at once. One has to change configuration for every project that needs to be copied to SVN. It just take me about 15 minutes to move 8 solutions (most of them consisting of 3-4 projects).

And at the end... it is a good idea to remove source control bindings before releasing your sources, right? And why do it manually if there is another great tool that does all this work? :)

Tuesday, November 11, 2008

svn hosting service

Having your sources (the private projects) only on one machines is not a good idea. The need of creating backups is obvious, but much more convenient for any developer is to be able to store source files in outer version control system. A few weeks ago I have discovered Assembla. It was a great site, that offered free svn hosting (200MB of space), free trac and many more services that most of developers would find very useful. Unfortunately I just got an email from Assembla, where the staff informs that within a month they stop offering private free spaces. You just have to decide if you want to convert your space to public one (i.e. publicly available to anyone) or you prefer to pay for a private one. Well... I choose neither. Instead I started looking for an alternative. It is quite hard, because Assembla was not only a svn hosting, but for me it was the most important service. I think that XP-Dev and Codespaces are worth trying. I just hope that there will be a free svn hosting service for all people developing free projects (not only open source, but also closed source free). I think it will be a great loss if there is no such a possibility.

Saturday, November 08, 2008

the best things in life are for free, huh?

A few weeks ago I started searching for some place to have a WordPress powered blog hosted. I didn't want to buy a hosting. First hosting service I have tested was WordPress.com. Although it allows to create a blog for free there are way too many limitations (limited amount of skins you may use, no FTP access - so uploading binary files is not convenient). Then I tested Blogsome, Blogetery, and a few others similar services that gives WordPress powered blogs for free, but none was the one I was looking for. I realized, that it would be the best for me to have a free hosting that would allow me to install WordPress and manage it by myself instead of having a blog hosted on some site that specializes in hosting blogs for free. I didn't believe it could be possible, but after a couple of hours (very, very exhausting) searching through the Web I have found the best (and FREE) hosting service - http://www.000webhost.com/. Yup, it is REALLY free. For free you get: 350MB of disk space, 100GB of transfer (per year I think), PHP, MySQL and mod_rewrite Apache module (this on is not a must, but I am sure you'll want to use it). Setting your own blog is not very hard. It just takes a couple of minutes - after unpacking and copying WordPress source files, you have to configure it, create a database... and you're ready to blog! What is mod_rewrite for? Well... it just makes all blog permalinks looks much better than default http://yourblog/?p=456 and allows them to look more 'human': http://yourblog/2008/11/03/just-a-test.

But what is the biggest advantage of having WordPress blog set up by yourself instead of using WordPress.com or Blogger.com that deal with all the hassle by themselves? Well... let's suppose that you would like to have something more than 'just a blog'. Let's suppose, that you would like to have a blog looking more like a personalized homepage, that main part is blog. What to do? Blogger.com does not allow to create additional pages - you may of course use Google Sites, but I gave up after a couple of hours trying to create the site the way I wanted. WordPress is much more flexible. You may create a lot of additional pages, the may even be organized in a hierarchy - anything you want. The second thing is that hosting additional files on Blogger is not possible - you got to put files somewhere else... convenient? Don't think so. The last thing (maybe not the most important) is ability to change the look of your blog. WordPress.com gives you a bunch of skins to choose from, the same is on Blogger - having your blog hosted on hosting service like http://www.000webhost.com/ gives you total freedom to apply new themes, manage them, upload binary files, install additional plugins to WordPress... you are the person who decides what you need. And for me, there is another advantage of WordPress - it works well with Windows Live Writer (I am not a keen on built in blog editors).

There are of course other blog engines, but from those I have tested WordPress seems to be the most flexible and the cheapest :) I am planning to move my blog to a WordPress powered one in a couple of weeks. And if you ever wondered if there is a possibility to have your own blog/site hosted for free - do not hesitate and try what http://www.000webhost.com/ has to offer. If you're interested in setting up your blog in http://www.000webhost.com - I think some info on configuring WordPress may be useful (just pay attention that 'localhost' is not a proper value for 'DB_HOST' in config file - but you'll find information what should be there on hosting service's information pages; the same is with enabling mod_rewrite - everything you need to know you will find on http://www.000webhost.com information pages).

Happy blogging! :)

Friday, September 19, 2008

Visual Studio & SVN integration

SVN is nowadays one of the most popular version control systems. There is a great tool for Windows called TortoiseSVN - it is very popular, easy to use and has a lot of features. But... it is not very convenient while developing. The need to switch from Visual Studio just to check-in, resolve conflicts... well it is definitely not what I want. I wanted to have a tool that integrates with Visual Studio just like Microsoft's Visual Source Safe or TFS does. Quite a while ago I tried AnkhSVN, but it didn't work as good as I wanted - it had a heavy impact on my Visual Studio (sometimes I had to wait very long to be able to do anything - because VS tended to freeze).

Few months ago I found out that many people praise VisualSVN. It is not a plugin (just like the old AnkhSVN) - it uses SCC interface, so it behaves just like VSS/TFS. Some people says that the only thing they dislike is that they feel it just a wrapper for TortoiseSVN (VisualSVN just launches TortoiseSVN's dialogs for most of the operations). I think it is not a disadvantage - TortoiseSVN is a great client, so if there is a way to use not, and not be forced to switch from Visual Studio to Explorer / Total Commander / any other shell... that's just great (for me). The only disadvantage of VisuaSVN is that one have to pay for it. In the past it was very cheap (19$) but after gaining popularity it became much more expensive - now it costs 50$ (but there is a way to get it for free - one just have to be active developer involved in open source project).

Well... I wanted to find a free alternative, and that's how I found Garry Bodsworth's special settings, that integrates TortoiseSVN with Visual Studio. It is free. It is fast (there is no impact on Visual Studio performance). It contains both: version for VS2008 and VS2005. Perfect? Well... almost ;) It is just a setting file, so 'Pending Checkins' won't work, there is no mechanism showing new files or changed files in projects / solutions...

All those things that Garry's settings lacks are provided by the latest, totally rewritten version of AnkhSVN! Now AnkhSVN works not as a plugin, but as SCC package - the integration is done the way it should be. The impact on Visual Studio performance is not noticeable. 'Pending Checkins' works just like with VSS / TFS, managing newly added, changed or deleted files in solutions / projects is much simpler - thanks to showing all the changes right in the solution view. Personally I think that TortoiseSVN's dialogs are better ;) so at the moment I am using both - Garry's settings and AnkhSVN. Garry's settings allows me to use very well known by me mechanisms provided by TortoiseSVN, and AnkhSVN shows me all the changes I have made recently - it saves me a lot of time, and I am sure I won't miss any file while doing heck-in.

Friday, September 05, 2008

Automatic system backups

The need of creating backups is obvious. Data is the most important thing on everyone's PC. But how about all the environment? What about system, it's configuration, configuration of all installed applications? A while ago a new idea was presented - image creating software. The first was (I think) Norton Ghost. At the very begging the app was very, very small (just a little bit bigger than 100 kilobytes) and run under DOS (so yes, you did have to have a DOS bootable diskette, or ability to boot into plain old DOS environment). This kind of software became more and more popular, and nowadays there are dozens of applications you may choose from. There is, however, one I would like to present - special version of Acronis True Image available under the name of "MaxBlast" at Seagate's site. This software is free for everyone who has Maxtor or Seagate hard drive installed in their PC. I am not sure which version of Acronis True Image is being available under the label of MaxBlast, but as far as I remember it is version 10.0 (there is version 11.0 of Acronis True Image available). So what is so great about this software except it's price? Well, it suits my needs very good: it creates really small images (although it takes a lot of time, if you choose the maximum compression level), and allows to restore images in a very convenient way - you just decide what you want to do, and if you choose to restore whole system partition (the one you actually work on) the software boots before windows, and makes all operations necessary to restore your previous environment.

There is one thing, I think would be very handful for a lot of people. Possibility of storing configuration on-line. I imagine it should work like this: all applications will use the same way of storing all its settings (for example somewhere in Applications Data). Zipping those files should not be a problem. And of course it should be possibile to restore the configuration in only few clicks. I would like it to be connected with one of the free file storing services (Dropbox, Microsoft's SkyDrive or any other). Advantage of such a behavior is obvious - one could save a lot of time in case of reinstalling system and all applications (and it is not always possible to restore previously created system image - sometimes you just install your system from scratch, for example after acquiring new machine...).

Anyway... going back to system backups. They are really important, but what I have learned while working with Windows is that registry files are crucial. Sometimes you may wonder what happened, and after deep investigation you realize that one (or more) of registry files is broken. So... what to do? Creating system backup everyday is not convenient (and as I said before - it takes a lot of time. Personally I create full system backup once a week only). But there is a way to keep those vulnerable files in safe place in case something happens. There is even a small and handy application written that does this task for you - Erunt. I started using this small tool a while ago, and after a couple of weeks I have spotted an interesting article that shows how to configure Erunt using task scheduler, so it is being run every time your Windows starts. It is great, but... those backup files are a bit too big (registry backup on my Vista based laptop takes about 80MB for each day - for me it is definitely too big). I started to create a small batch, that you may find useful. So, here it is:

  1: @echo off
  2:
  3: set root=AutoBackup
  4: set maxfiles=5
  5:
  6: "erunt\AUTOBACK.EXE" %root%\#Date# sysreg otherusers 
/noconfirmdelete /noprogresswindow
  7:
  8: rem setting date variables
  9: set day=%DATE:~7,2%
 10: if %day:~0,1% == 0 (set shortday=%DATE:~8,1%) else (set shortday=%DATE:~7,2%)
 11: set month=%DATE:~4,2%
 12: if %month:~0,1% == 0 (set shortmonth=%DATE:~5,1%) else (set shortmonth=%month%)
 13: set year=%DATE:~-4%
 14:
 15: rem setting archive and folder names...
 16: set archive_name=%year%-%month%-%day%
 17: set folder_name=%shortmonth%-%shortday%-%year%
 18:
 19: rem compress the registry backup files...
 20: cd %root%
 21: rem backup command: "c:\program files\7-Zip\7z.exe
a -r -t7z -mx9 <archive name> <directory>
 22: "c:\program files\7-Zip\7z.exe" a -r -t7z -mx9 %archive_name%.7z %folder_name%
 23: cd ..
 24:
 25: rem ...removing folder...
 26: rd /S /Q %root%\%folder_name%
 27:
 28: rem ...checking if there are some old-registry backup files 
that should be deleted
 29: @if exist files.txt ( del files.txt )
 30: cd %root%
 31:  @set filenum=0
 32:  @dir *.7z /b /o:-n > ..\files.txt
 33:
 34:  for /f %%f in (..\files.txt) do (
 35:   call ..\autorun-del.cmd %%f
 36:  )
 37: cd..
 38: if exist files.txt ( del files.txt )
and (thanks to the limitations of batch files) the second, very small batch:
  1: set /a filenum=filenum+1
  2: if %filenum% GTR %maxfiles% ( del /F /Q %1 )
How does it work? The idea is simple. After creating folder that contains backup of all registry files - the folder and its' content is being compressed. Then, the folder is being deleted. At the end the script checks if there are too many backup files (i.e. if amount of backup files is greater than the one you set in 'autorun.cmd') - if so, the oldest file(s) are deleted. I have set the script to run before logging into Windows, but you can of course run the script manually (if using Vista with UAC remember to give it proper privileges). Archives containing backups of registry files are created per-day - if the script is being run more then once - it updates the content of the archive. I assumed that:
  • the folder where Erunt is stored is named 'Erunt'; both batch files should be located in the Erunt's parent folder
  • archives with registry backup files are stored in Erunt's sibling-folder. The folder's name is 'AutoBackup' (you may change it - folder name is stored in %root% variable)
  • default amount of backup archives is 5 - it may be changed by editing %maxfiles% - thanks to compression one archive is only about 11MB, so even storing backups of last two weeks is not a big-deal.
After struggling with windows batch files, I solemnly promised myself not to use it any more. Next time I will have to create anything like this, I will use PowerShell or Python ;) Batch files are a real pain. Hope someone finds it a bit helpful. For me it is a way to be more confident that in case of system damage I will be able to recover my environment very fast.

Sunday, August 31, 2008

Universal(?) Disk Format...

Funny thing, but when I hear that something is 'universal' I am starting having doubts. Not about universality. No. About usefulness. I wonder if something that is 'universal' is capable of doing one thing the proper way. In Poland we have a saying: 'If something is quite-good in many areas, it is not good enough in any of them'.

Few days ago, I received an .iso image that was created as an udf image. I am using the free version of Alcohol 52%, so I mounted it immediately... and saw only information, that 'this disk was created as an udf image, and your system does not support this format' (or something like this). I tried to mount it on my alternative os - Ubuntu 8.04 (also using udftools) - but it didn't work too. I Googled for a while, and found a solution - the free version of Elby's Virtual Clone Drive. I mounted the image to a new virtual drive... and it worked! It seems that Elby's virtual drive is the only free software that is capable of mounting disks in udf format (or udf 2.x - I didn't checked the version). I didn't get rid of Alcohol 52% (mainly because of it shell integration) but Vritual Clone Drive is just a good addition when needed.

Thursday, June 12, 2008

Aspect oriented programming

I have heard about aspects during studies. I was not very interested in it and did not have any need to learn about it more. What I've heard was mainly about 'reusable code' and about 'software patching'.

Software patching was explained to me as a method to make some changes in software not being forced to make changes in sources and compile it again. So, what is the advantage? As you know, after deploying new version of application that someone out-there is using, test team should make everything what is possible to make sure, that the fixes in new version did not brake anything (and did not make any new bugs).

The example describing the technique of 'software-patching' I was given was: lets imagine a big financial system being used by a bank or a financial company. Lets image, that the financial law in a country is being changed, so changes to the system are necessary. Traditional way is to make changes (I mean: write some additional code fixing the way system calculates taxes...) and deliver it to the client. (Of course, there is way better approach - at the stage of analysis someone could have been such a clever person who could predict this situation, and think of it, so decision could have been made not to use fixed tax rates but to store the tax rate into a special 'configuration' table in database, or in config files. But... lets think for a while, that the system we are considering changing was not created in this situation in mind).
So what is the aspect approach? It is based rather on idea of 'plugins' than one-big monolith. So, the idea is to deliver additional code, that will be called before, or after a specified function / procedure, so it may change the behaviour of the whole application. In the example, the code should take the return value from the function that calculates tax, and should add the amount so the height of the tax would be calculated properly.

There are of course some problems in delivering the patches, but... it was just an example ;)

The second approach's goal is rather to help in the stage of creating application, than stage of patching it. It is being used during development. The common situation is that it is more and more complex to split code into proper layers. In business / logic layer there is always some code that is totally technical: exception handling, logging, etc. At the very beginning it may not be a big problem, but when application grows it become more and more significant (. Thanks to aspect oriented approach we may use .NET attrributes and inform the compiler that before/after this specified functions (or bunch of function which names contains specified characters: "OnClick" for example) some additional code (delivered in separate function) should be run.
Sounds like very interesting idea, isn't it?

About the second approach, I have heard recently - last Saturday - to be more precise. I have attended to Gael Frateur's lecture during CodeCamp (held in Krakow). I must admit, that I really enjoyed the presentation, and I think it was really worth attending to and listening. Now I am preparing one of my small projects to benefit from AOP concepts.

Aspect oriented programming is not very widely know or used, but there are surprisingly many solutions for different languages (and platforms) available - so I think anyone interested in it would be able to find something suitable (there are a lot of projects for .NET and Java, there are some for C++ and also for Python and even Lua! - this list seems to be quite comprehensive ).

There are two projects for .NET platform I have read about (and tried to use in very, very simple test projects):
  • LOOM.NET - it has two different weavers: Gripper and Rapier. Gripper is static, and Rapier is dynamic one.
  • PostSharp - this solution is based on post-compiler approach, just to cut that short: it is intended for development, not software patching
Right after the presentation, I talked a while with Gael Frateur (the creator of PostSharp) and he assured me, that he is thinking about adding a dynamic weaver to PostSharp .

For me, aspect oriented programming is very interesting technique. I am planning to devote more time and investigate the possibilities and limitations of AOP in the nearest future.

Sunday, February 24, 2008

Problems uninstalling VS 2003?

Recently I was just trying to get rid of some apps I would not use any more. I found out that I still have VS 2003 installed. VS and MSDN takes about 3GB of space so I almost immediately launech "Add Remove Programs" and clicked "Remove". As for my surprise VS did not want to unistall. It just showed me again the dialog box where I could choose which features I would like to install. I repeated procedure several times, but nothing changed. In the act of desperation, I just deselected everything and clicked "install". Then (just at the very begging of installation) clicked "cancel", and started the procedure again from clicking "remove" in "Add Remove Programs". And... it worked.

One thing that struck my mind is that installing / uninstalling applications is still a pain. If you are to install / uninstall several applications... you are to waste some time sitting in front of your PC and waiting for any actions you should take. Why there is no possibility to choose many apps to deinstall? Why is it still so hard to install several apps one after another? Why can't you just have the possibility to "batch" installation processes? Why nobody though of making installers able to read some "setup configuration" (so that you could specify some basic options for installation like: destination folder, type of installation: full / minimal - custom will need of course your assistance...). PC hardware and OS'es changed a lot in recent years, but maintaining your software is still not as painful as it should be. When will we see new better setup technology? Will we see it at all?

Saturday, February 09, 2008

GMail coloured labels hack

A while ago Google announced that their GMail accounts offer label coloring (you may define color for every label you've created). I checked it immediately after I had heard about it. It worked, and I really like this feature. But some of my friends were unable to use it. Their GMail just did not have any label-palete that is used to define labels colors. The thing just drove me crazy. I did not know what was the reason of such a behaviour of Google's mail service. I thought that it takes time to migrate all account, but... I just found a solution ;) It appears that you have to change language of your GMail account into English-US. I've tried it and it works! So... if you would like to use coloured labels - try to set language into 'English-US'. It should work for you (unless your account is not migrated... ;)

Friday, January 25, 2008

VS 2008 & C# 3.0

I have been using VS 2008 & .NET Framework for my personal needs for quite a while and I would like to share some of my thoughts about the new technology. As for changes in C# 3.0 - you can find complete list of changes in .NET Framework (and C#) on MSDN , all those new things in C# 3.0 are also explained in details on Daniel Moth's Blog (under "Orcas" OR "Visual Studio 2008" labels and there is a great post that describes most of the new features in VS2008 and .NET 3.5). There is even an event about .NET 3.5 you may be interested to watch.

One thing in C# 3.0 I don't really like are extension methods. At the beginning - when I first read about this new feature I thought that it was cool. The idea that you may add new behaviour to the types you did not create (and have no sources to rebuild them) seems very attractive, but... after thinking about it a bit longer I have changed my opinion. Now I think that this feature brings more harm than good. It makes something looks different than it really is. It may confuse person that is going through the source code and is looking for bugs in it (because why should you not trust methods of String type or any onther type that comes in BCL? Yes, I know that you may right-click and choose 'Go to definition' - but my point is that this feature makes your code harder to read). I think static helpers are much better solution (and you do have to write static helpers to use extension methods...).

For me personally, the two new features I may call timesavers (and yes, they are great ;) are:
  • automatic properties - I think most of us feel that C# lack this feature. It is not so uncommon to create a simple property (such that you do not have to add more code into getter or setter than automatic property does. And as for me - I think that you should consider creating special Get/Set methods instead of property when Get/Set operation is complicated. This way someone using your class is aware that this particular operation could take a long time and it should not be called too frequently).
  • anonymous types - great idea connected to LINQ. Sometimes it is very convenient to be able to create a variable of an unknown type (and don't be forced to create implentation for the new type first).
Partial methods. Some people seem to think of them as a way not to emit method metadata (if method is not implemented). I just wonder why there is so much misunderstanding about the concept of partial methods. The funny thing is that a lot of people think of them rather as a Conditional attribute. I think this is the most powerfull of new features added in C# 3.0. Thanks to it you may be able to provide some mechanism very similar to "aspect programming" (just provide some methods like before and after and if it will be needed the user may implement them and be sure that actions take place in right time.

One thing I really do NOT like in VS2008 is that there is still no support for XNA Game Studio 2.0. I do not like it that I just have to switch to older version of VS, I lack some new features in VS 2008. I hope that XNA team will soon release new version of XNA GSE that will work fine with Orcas.

And the last thing about new Visual Studio is... I have already encountered a bug connected to WPF designer. It just stopped working some day. It was impossible to add new control, change properties of controls... I started to search for some solution to this problem, and I found out that I should delete all TBD files (everything is described in details on MSDN forum). Kinda strange for me... but it is not the first time that deleting helps VS to recover from some strange behaviour. I remember that I had a problem with VS 2005 after installing some add-ons (from Microsoft). My keyboard just stopped working in VS (well... it did not stop working at all, but some keys just seemed not to work - enter, space - those are two I remember). Resetting all options to default did not help. After googling for quite a while I just found suggestion to delete VS settings... yup, it worked ;) Now I think, that I will try to delete VS settings at the very beginning if something brokes again...

Thursday, January 24, 2008

RSS readers with synchronization

Since the moment I discovered rss feeds I can hardly imagine living without it. But... there is one problem with rss for me. Readers. I have tested various readers and I could not find one that would suit all my needs:
  • possibility to use the reader on many machines (I am thinking about some kind of synchronization)
  • I am keen of desktop programs - so it would be nice to have a desktop application (that could stay in system tray while working) and to be notified when new things appears
  • it would be great if there would be possibility to use web based client - in case when installing desktop software is not possible (for example: reading feeds using some pda's...)
For a long time I have been thinking that the best solution is Google's web based rss reader. It has almost everything I want. There is also a lightweight version made especially for older pda's and phones (Google Reader Mini) and a bit more sophisticated wrapper on Google Reader for mobile devices that can handle not only static html (ReaderMini - currently still in beta).
Google Reader and all similar solutions have one big advantage - you do not have to think about synchronizing state of your feeds. You just log on - on any machine you are currently working on - and that's it. You got everything you need. But not everyone is a keen of 'software inside a browser'. Web based rss reader does not alert you about updated feeds - but there are some plugins for Firefox (and for others web browser too, I think) that will pop information about latest changes in your feeds. The biggest problem with Google Reader for me is that when I want to use Google's search engine - I am logged. I don't like it. I feel like Google knows much more about me that I would like them to.

Thats why I have started to write my own small application based on Google Reader that would stay in system tray and alert me about new feeds and allow me to read the content not having to bother about synchronization issues. I have found Nial Kennedy's article about Google Reader API, I have also find some gossips about Google's will to release Google Reader API to public in near future. Unfortunatelly it seems that Google no longer wants to make Google Reader API available to wide range of programmers all over the world. Later - after digging up for a while - I have found a small utility by BrianDotty called Google Reader Notifier - that allows you to have information about new feeds presented in the well known 'tray ballon' way (yup, I did use Reflector The Great ;> to see how to log into Google Reader ;) Another thing I have found was complete (I think) API for Google Reader written in C#. It is a pitty that there are no links for the applications that are using this API (GReader Desktop, GReader Mobile - both mentioned on the main page of the 'Google Reader .NET API').
After few days going through the code it stroke me that it is totally pointless to create another feature-rich rss reader. The best thing would be just to embedd a WebBrowser control in an application that could reside in system tray and provide some information about the feeds (how many feeds are unread and so on). So I just cut out all those things that were 'extra' and build a simple application with .NET WebBrowser control. It worked great but... it seems to consume a lot of memory. After using it for a while I have realized that it allocated about 60-70MB of RAM! And even the special trick with minimize-restore did not help much. I was wondering if it was a problem with WebBrowser control or with Google Reader. Hard to say at the moment but I plan to investigate this issue further on. The simpliest solution (embedded WebBrowser control) has one big advantage: you may go to your Google Calendar / GMail / Google Notebook with only a few clicks (and yes, you do not have this feeling that Google knows everything about you - whenever you use their search engine ;)

A few days ago I have found information about free NewsGator desktop application for reading rss feeds that has ability to synchronize information about your feed's state between various machines. I tried it... and I think it is great. The desktop application is well known FeedDeamon that is now given by NewsGator for free. It almost perfect. You are able to use desktop or web based version of the reader - so all the time you know what have you read and what is still marked as to-read or important. There is one thing As for me FeedDemon lacks easy retrieval of older content for selected feed. Using Google Reader I got used to being able to see what were the previous posts / entries in selected feed. You just scroll down - and thats it - Google Reader automatically gets them for you (if there are any). I must say that FeedDemon is really easy to use and does not need a lot of memory - after having it run for more than 20 hours it did not consume more than 20MB.

I you are just like me - and synchronization and availability of desktop reader are the most important for you - you should give NewsGator a try - but I will give my application another chance and see what is the real problem with such a hughe memory consumption.