Monday, 5 November 2012

Database Designer Tool

I am a very visual person. I like to see animations in a UI. I even have blogged about liking the new UI from Microsoft's latest Windows installment, why because everything is there and it's visually easy.

So that leads me on to my methodology to database design. I have mentioned before that I like to use PGSQL. Recently I have had some work to do that required MySQL. However, the database design was done already and I was touching up the code for someone else. So I needed to see the database design in a visual way. I tried to make diagrams, but when we are talking about hundreds of database tables, views and other goodies, I was just wasting time, or at least it felt like it.

So I looked online for Database designers for MySQL. I found an excellent helping from a company called Micro Olap. They have a couple of products for various database types. The ones of interest to me were the Postgres and the MySQL database designers. Including (and this was very important for me) a trial of their software.

So I downloaded the MySQL trial and within 5 minutes I had a working diagram of the hundreds of tables. How? The software included a reverse engineer feature that worked on the database that I was using. It had a lot of options but I quickly found what I wanted and ignored the rest so the best thing to do would be to have a look for yourself.

Then when it appeared you have a huge area that you can move about and see the data tables and views in relation to one another. It is similar to the database designer that you get with Visual Studio but for more useful database engines.

After a small amount of time I felt proficient enough with the software to say that I enjoyed using it. Whilst it may not be the sort of thing that you are after, especially if you prefer to see your data in a less visual way (there are people still like that out there!) but for me it answered my problem for me and I didn't have to write out all the tables by hand (which was a bonus because years of computer use have left my writing hand as out of shape as retired dosser!)

The pricing is as follows (for the products that I was interested in ):
MicroOLAP Database Designer for MySQL (Personal/Educational license)

MicroOLAP Database Designer for PostgreSQL (Personal/Educational license)

Wednesday, 31 October 2012

Windows 8 Now that I'm using it

So it's the biggest release of Windows in my computer history. I don't really remember the leap to Windows 95, so I can't really comment on how that changed my life for better/worse. However, the leap from Vista I only remember from the smug XP sidelines, I successfully avoided Vista (although annoyingly my mother has recently inherited a Vista laptop that runs slower than a sleeping snail), and felt thrilled and excited when my hard drive crashed which gave me an excuse to move to 7. So why did I move to 8 and how have I found it?

I moved over to 8 for a couple of reasons. Firstly, I want to develop for the new metro UI. That might seem strange, but I actually quite like the neat side scrolling action, and the fact that XAML has a use outside of winforms replacement.

Secondly, I love the price of Windows 8. I got the £25 ish update from windows 7 and that is just too good. (especially since you get the pro version).

Finally, my wife said she liked the design, and that was the last straw.

So how do I get on with Windows 8. The first thing to note is that the installation and upgrade allowed me to keep all of my files and most of my applications. A few needed re-installing (such as postgres server, synergy and other service based applications). This suited me as I have not long done a full reformat so there isn't much bloat on my PC anyway. With this option selected though, it is a whole evening of your life that you are never getting back (I think Windows owes me several of those already!!).

Next up was the change in the way things work. So the new metro interface is basically a large, fullscreen Start Menu. View it like this and things don't get as bad. I use the keyboard a lot in normal computer use so using "Win Key" for opening the menu or "Win Key" + "C" for the "Charms" menu isn't a hardship for me, although I can imagine this being annoying for mousers.

The whole OS has the feel of being better on a tablet, however, this by no means stops you from using the operating system on a desktop PC. I have two monitors and this is as usual much more useful, but has it's downsides with Windows 8. The charm menu can be a nightmare to get up on the left hand monitor!

The metro UI apps are a spot unusual. you have to either ALT + F4 to close or you return to the home screen in order to "hide" them. The idea is that all of your most useful apps are "in-memory" so that you can boot them up quicker next time. The problem with this is two-fold. Firstly, in memory means that you have to have the memory, although, tbh I haven't noticed this being a problem as of yet. Secondly, to close an app, you have to either mouse to the left edge, right click on the app and then choose to close it, or do it from the new look task manager. This can be rather frustrating if you need to close an app down, there just isn't a close button in site!

Other than these few annoyances and differences, the hype about how difficult it will be to adapt is greatly exaggerated. My wife, who is no computer expert, has been using it for 1 day and already doesn't need my help to use the same apps that she was using before. My opinion is that the desktop now almost has the same feel to it that the latest Ubuntu releases have with the HUD feature, which means that even if you are coming from a non-windows background, you should find plenty familiar with the setup.

Would I recommend Windows 8 to anyone? Yes but with the condition that you keep your mind open and don't rely on other's opinions.

Sunday, 19 August 2012

Emacs vs Vim vs Notepad

I like a little controversy on  a Sunday. Therefore, I thought I would spend my Sunday afternoon, curtains drawn to stop the glare, typing a little article to describe my humble opinions on the biggest question that faces the modern man.


I have seen MANY articles from biased, dogmatic sources that claim one or the other is the pinnacle of text editing, and whilst I don't agree that it is not an important subject, I am going to try to be neither biased nor dogmatic in my analysis here.

Also a note before we get in to the nitty gritty of the article; I am BY NO MEANS a power user of ANY text editor. I have made some minor adjustments to my main text editor (which will remain nameless according to the above paragraph) but as I do most of my work in HTML, CSS , Javascript , Python and C#; most of the time I am in one of the following:
  • Visual Studio
  • Eclipse
  • Aptana Studio
I have also been known to dabble with Butterflies now and again.

I am going to tackle the editors in reverse order to the title as these are the orders that I tried them out first.

Notepad, Notepad2 and Notepad++ are what I would call traditional editors. Notepad++ has an AWESOME tabbing feature distinctly lacking in the other two, notepad 2 has debatabely better syntax highlighting and notepad is probably faster.

I like Notepad (for this section this encompasses all three above mentioned programs) as it is simple to use and requires NO brainpower which is a massive boon for someone like me.

Further more, as far as graphic user interfaces go on a text editor, I would say that any of the Notepads are far and above nicer than the other two that we will discuss today. However, they all are really just for inputting text and have no further use other than that. Notepad++ does have more in the way of plugins and probably could be put in to its own category for that reason alone, but none of the customization that is possible in Emacs is available as easily with Notepad. 

Vim was the first "keyboard only" text editor I tried. This is my own phrase for Vim and Emacs as I don't really know what to call them otherwise.

Vim is an interesting idea. You have an input mode and I forget what they call it but basically and editing mode. Switching between the two is as easy as clicking on i or esc (depending on current mode) and moving around the document can all be done using the keyboard (without going over to the arrows)

The principle idea was great for Vim, and I know people who swear by it, however, I found it immensely illogical and the learning curve just seemed to intense. I found that I was still looking up the docs after a day of using it to do simple things and I also found that looking up the docs was not fun.


I tried Emacs when I got bored of Vim. I was put on to the idea by a blog (I forget which, sorry!) and thought that it looked like a great alternative to Vim.

The important thing for me was to not have to move over to the arrow keys and also to be able to bulk perform actions. This was easily possible in Emacs and in fact, working through the tutorial allowed me to learn and remember these commands quickly.

Which brings me to my next and possibly most difficult to explain point. I found Emacs more logical, more easy to remember and perhaps most importantly for me, more fun in documentation than Vim. As I was in the market for a quick text editor that I would invest some time in, this won me over.

However, the down side to using either Vim or Emacs is that you will need almost exclusively need to use them in order to stop yourself from getting in to bad (notepadesque) habits or from having a lot of missing characters when using normal notepad. The thing is that it is SO different using these "keyboard only" text editors, that you will find yourself as frustrated with it as if you were going from touch typing QWERTY to touch typing DVORAK. However, in a similar way there are benefits to spending the time in learning to use them wisely.

One final thing to note about the emacs editor is that it has a language (emacs lisp) that allows you turn Emacs in to much more than a text editor. However, due to time restraints and laziness I never looked deeply enough into it for it to ever be more than just a novelty.

I am still undecided as to which the best of the three are. Due to a massive amount of laziness and the fact that the IDEs that I use have only buggy support at best for EMACS I tend to use NOTEPAD more often. Is this because it is better? Honestly, I don't know, I suppose it is for me is the best answer I can give.

Vim was just not fun enough for me and I have no interest in learning any more about it unless someone can give me a non-subjective reason to. Emacs is great, however, I always felt that I was using a tool at about 1% of its potential and because of this I never really got the benefit of all the hard work that I was putting in mentally to using it. Maybe one day I will get on to using it more fully if ever I have to leave my IDEs behind. At the moment the only language I use EMACS for is C and that is VERY rare. 

Tuesday, 3 July 2012

Equals or ==?

So Android is pretty ubiquitous now. New tablets/phones coming out with the version 4 upgrades and awesomeness. I personally love my Android phone. No, it's not expensive, but I love it!

However, this is where I get to moan. I have never really touched Java before Android came out. Some people swear by it, I swear at it! It's not that Java is an aweful language, in fact there are some really nice features. However, from a C# point of view it is somewhat like learning Polish after learning Russian.

You see the slavic languages are very similar. The have a similar verb conjugation and many similar verbs, and then you get to the important bit, the verb that is the difference between like and love and it lets you down and changes. (Russian love transliterated is "lubit" in Polish lubic is to like).

The same thing happened with Java. I'm feeling confidant in the fact that I can write code without looking up syntax just because it's SO similar to C#. So much so that when i evaluated two variables with a

     if(var1 == var2) { // Do Something... }

statement, saw in debugging that they had the same value I expected that the // Do Something... code would run. WRONG! Turns out that the == in Java is COMPLETELY different to C#!

"EEEJIT!" you say. "Java is a better and older language than C#"

"No need to be rude!" Say I "C/C++ is an even older an more widely known langauge than even Java"

So how do we get around this evilness? Why does this happen?

Java-Samples states : "the equals( ) method compares the characters inside a String object. The == operator compares two object references to see whether they refer to the same instance"

So the equals() method was what I needed. Tbh I had not been so dissapointed by a language inconsistancy since the lack of switch in python. I look forward to comments and suggestions (clean ones please) about what I'm missing in Java that makes it better than either C# and/or Python. 

Sunday, 20 May 2012

New Site and more soon

Well this is more of an update than a rambling. I have just finished putting together a new site for a client. It was fun to do although due to distance and for both of us this being an in between other work type of job, the site took longer than I am usually happy with.

The site is available at and as you can probably tell it is for a herbal clinic. The owners are friends of mine and their clinic is really nicely set out and they have all sorts of cool decorations and more importantly a deep knowledge of their craft.

The main tasks with the site were to get past my lack of horticultural knowledge. We chose a CMS so that the owners could blog for themselves and also change the content themselves, and this helped me to not have to blag as if I knew anything about herbal medicine.

The logo was done by an independant party, and excellent designer Chloe Miller. The choice of green  as the main color was partly chosen by the logo design but more by the nature of herbal medicine. In actual fact there were several logos done in numerous colors.

We have some more sites in the pipeline and underway. Look out for a builder's site, Jaqal couture and more...

Finally, a note as to why there have been fewer blog posts of late. We are house sitting and so I have had to use a laptop to do my work, which is HORRIBLE! I know that a lot of people use laptops and do great amounts of work on them, however, I am old-fashioned in my computer use and I find that the mouse tracker thingy is no where near sufficient for my comfort. On top of that, I am sharing the laptop with my wife who likes to spend money using it!

Tuesday, 8 May 2012

Ubuntu 12.04 First Thoughts and synergy fix.

As I am rather an impulsive sort of person I thought that I would give an opinion on Ubuntu 12.04 only a few days after upgrading my server machine. (Server as in I keep my important files that I share with other machines, not as in I server apache websites!)

So my first thought? Well I was really excited by the idea of the HUD - not just because it seems like a term from a gaming interface, but also because the idea means we can escape EVER bringing a space hogging ribbon bar over to ubuntu (result!!). However, to note that Libre office (a default Ubuntu app) does not support this beast makes me want to cry in my cornflakes. ;-( However, the dream is there for future releases.

So the next thing I looked at was the black background that it gave me? Why? I had used one of the default wallpapers in the previous release of Ubuntu. A lovely autumnal walkway reminiscent of a parisienne path. However, on the new update, my favorite wallpaper has sadly been extinguished! With no real replacement amongst the defaults (and the fear of losing it again next release) I decided to use a picture. At least that is easy in Ubuntu!

Now today, and the reason for sharing this article, I'd had enough of clicking ctrl, stopping synergy, starting synergy and then going through the whole process next time i need the ctrl, shift or alt keys. Apparently the latest version of Ubuntu is incompatible with the stable release of synergy.

Google to the rescue and it appears that the Beta is fine. So I installed direct from the website on the Linux machine. At this point it must be noted that I am a moron, especially as when I tried to run it I nearly threw the cat across the room (a plan foiled due only to a lack of feline in the flat) when it still did not work. Then the moment of eureka when I remembered that the Windows machine would most probably need updating too.

Now as updates to beta versions of products go, I am yet to find anything that I do not like and particularly on the Windows version of Synergy. User interface is easier than going deaf in a night club and I was back up and running in no time. What's more, the ctrl button works!!!

So, what do I think of Ubuntu 12.04? For me it has caused numerous, small headaches. However, I LOVE Ubuntu. I was talking to collegue in the office the other day who said that he could not wait to get home to work on Ubuntu again (the office is nearly all Windows 7/XP). He could not stop thinking about it! Whilst he might just be the saddest person I know, I share his sentiments about using Linux in general and the rush that it gives you. Furthermore, the user base and community (aside from bearded zealots) are superb and what's more, IT'S FREE!

So the big question is, will I ever do all of my work on Ubuntu? hmmmn, probably not anytime soon, C# is still mainly a Visual Studio beast, despite the advancements of Mono. Although, given time and incentive (this mainly means when Windows 8 is released and I can't take any more metro, ribbon bar in the explorer, which is by the way a complete break of Microsoft's own usage terms for the Ribbon bar and HUGE BUTTONS that are useless not on a mobile device after being hit with a hammer on the fingers.......) I might just move over to the lovely Linux for good. Here's to the future!

Tuesday, 1 May 2012

Android Programming - Yes I know it's Java!!

So this week has lead to me getting to that point in my interminable list of projects to do where I finally bit the bullet and started doing some development for Android.

The first thing that struck me with Android development is Java. I could not believe that I was being forced in to such an unusually bloated language for such a small device. However, I instinctively feel that the guys behind it must have a much better undestanding than me so, let them get on with it. The interesting thing is that it is not a standard JVM but rather runs on the Dalvik VM.

So I decided to go for the new kid on the block Intellij Idea as an IDE. I looked into the Eclipse, and didn't much like it. I installed and almost immediately went with Intellij and haven't looked back. I realize this is subjective, however, I don't care! ;-)

The second thing I learnt was that you need to have a kettle handy for the first time you run the emulator. Closely related is the fact that you never want to close the emulator until you are sure that you are done debugging. This is somewhat due to the fact that the time it takes for the emulator to load the first time is comparable to my grandmother crossing the road, walking up the stairs and putting a brew on for me!

But when you get past all of that, I was really impressed with the layout tools, the xml resources and how easy they were to use, the simple differences between activities, services and broadcast receivers and how they all fit together with the Java language. (it nearly turned me to Java for desktop apps but not quite!) Everything by default is well layed out in the various folders and I feel that I automatically know where I should look for changes to be made after only a day looking into it, and I am no master by any stretch.

A few more interesting features took my eye (and it is possible that these are IDE specific):

[1] Awesome debugging and logging in the Android tab
[2] Git support  (oh yes!!!!)
[3] The DDBM (Dalvik Debug Monitor) has Emulator control where you can call the phone. Great for the app I am writing and also for feeling that you have friends without having to talk to them on the phone!!
[4] Good support network. I can't belive that in the relatively short time that Android has been about, I can find someone else somewhere who has done, is trying to do, will do something that I am trying to do and documented it online (go to love Google for that). This is something that even Python and C# have not yet managed despite the slightly longer life they have led.

So all in all, I really like programming for the Android and would recommend it to anyone! Programming is fun again!! Actually it was always fun but now we have an emulator which means that debugging is more interesting for my long-suffering wife :-)

Monday, 9 April 2012

My Favorite Relational Database.

When I first started programming; I mean really programming and not just bashing websites together with HTML/CSS; I went through a huge amount of tutorials for c#. I found video tutorials a great way to learn how Visual Studio works, how to write code and how to connect to a database and show the data in a half decent way.

However, one thing I have noted with the trends in Microsoft technology is how they favor their own brands of tech over others (not surprisingly). This is ok, until it comes to relational databases! Every tutorial I went through was based on MSSQL or the compact version. Whilst I know their are jobs around for these technologies and they integrate with Visual Studio much better than anything else does at the moment; I hate MSSQL. Heres why...

One of the first ASP.NET sites that I programmed for a local company (that was stupidly simple in that it just showed workers for their business.) was a great testing ground for me to learn Linq. I so wanted to learn linq that I did the project using MSSQL as a back end. I had used it before and had nightmarish problems with deployment which I will not go in to here. (or to any one other than a psycologist. )

So I am all fired up for going into a linq2sql project and getting all the benefits of a DAL without writing it. Wahoo! However, the customer was almost immediately unhappy about certain fields that they had asked for and others that they wanted to add in. Therein lay the first problem. The changing of the database was SO slow, even (or especially) in VS. Then you have to update the DataContext which took an age!

After some time they outgrew the shared host that they had been given, and we got them set up on a Cloud server. I took the oppurtunity to change the database structure to PGSQL (which is pretty much the only RDBMS that i use now, aside from obligitory MySQL) and boom. The whole app ran like a song even on my local machine.

The next thing i noticed was the bloat of the server for MSSQL. I had a phone call from the client saying that there was an error when trying to upload a picture. I looked in to it and voila! the Harddrive was full. I thought, that's naff. There isn't that much on it. When, however, I uninstalled the now redundant MSSQL server, I had 2/3 of my hard drive back!!

So although this is only one brief chapter in my pathalogical hatred of MSSQL, I hope that it will warn young devs away from the evil that lurks behind every VS tutorial.

PS. I am now writing an app using MongoDB and I would highly recommend that as well as MVC as it is so nice not to be patronized (as much) by VS!

Monday, 2 April 2012

Safari Issues with FormsAuthentication

So today, one of the customer's that we have had noted that his browser (on the iPhone) was losing his login everytime he closed it. Whilst fighting the urge to make rude comments about his choice of browser/os/life, I decided to see where the issue lay today.

So the long and short of it is this: Safari loves to lose Session Data if it is not persisted. So the way we were forwarding from logon :

FormsAuthentication.RedirectFromLoginPage("Username", false);

Simply did not cut the mustard! We needed to rethink so we put:

FormsAuthentication.RedirectFromLoginPage("Username", true);

Weren't we awesome? Well, whilst this did fix the problem of Safari forgetting everything like your aunty noris, one of our devs came up with the great idea that maybe we should have an ebay-esque, "log me in all day" feature.

This required a little reading and the result was the idea from stack overflow (as most of my google searches seem to end).

Now we choose the timout (default of 30 mins) based on the user selection. Much better! One thing I did note was that the code will default to the timeout if left in the web.config, therefore, keep the tag but remove the timout (if there!) from the tag.

Now, as long as our users have cookies enabled (resist the matrix runs on xp quote) and you are away. Of course, there may be more elegant solutions, however, we got it working!

Sunday, 1 April 2012

Welcome to my blog

Hi all. This blog is going to be all about programming and other aspects of life that are touched by computer use. I am not a programming master and as such I often come across new things that I learn in my travels. As I do so I will share them here and you all can get involved too.

One thing that I feel passionate about in the sphere of programming is the place of Open source and community software. Therefore, if I produce a tool, library or other set of code that I think will be useful, I will definately share it on either sourceforge or github (or both if I am feeling energetic.)

Contact me for more information or for a full CV!