Monday, October 17, 2011

NetBeans squashed button bug

For a while I've been having a problem with NetBeans 7.0.1 which is sometimes creating buttons that look squashed, like a sausage. I haven't noted a pattern that causes this bug to occur, but I finally found a solution. You have to Clean and Build Main Project (Shift+F11), and then the buttons will render correctly when you run the project.

Saturday, October 8, 2011

SQL String Concatenation in Informix, MySQL and SQL Server

Like selecting the top N rows, syntax for string concatenation is DBMS-specific. The following are examples for Informix, MySQL and SQL Server.

Informix

select name || ' ' || surname
from customer;

MySQL

select concat(name, ' ', surname)
from customer;

Note: the MySQL concat() function can accept any number of arguments.

SQL Server

select name + ' ' + surname
from customer;

Friday, October 7, 2011

How to build the Boost libraries

The Boost libraries for C++ are distributed in source form, and can be easily built by following these instructions. From the Boost root directory, simply run the following two commands:

bootstrap
.\b2

Tuesday, October 4, 2011

Run as different user, in Windows 7

Here's a little gem from a friend of mine. In Windows 7 we all know how to right click and "Run as administrator". But how do you run a program as a different user, perhaps as an administrator on a different domain? The answer: when you Shift + Right click, you get an additional "Run as different user" option.

Thanks, Microsoft, for hiding stuff from us. You really know all about usability.

Monday, October 3, 2011

SQL Top n Rows in Informix, MySQL and SQL Server

Different dialects of SQL allow you to obtain the first n rows, resulting from a query, in different ways. The following are examples in Informix, SQL Server, and MySQL. Tip: to get the last n rows, simple switch the order by clause (from ascending to descending, or vice versa).

Informix

select first 5 *
from customer;

MySQL

select *
from customer
limit 5;

SQL Server

select top 5 *
from customer;

HTML Access Keys

The HTML accesskey attribute is very useful usability feature that is reminiscent of shortcut keys in standard desktop applications. This allows you to define particular key combinations for your navigation links (e.g. Shift+Alt+H for Home). Originally, these access keys used the Alt key, but they would clash with the browser menu (which also uses the Alt key, by convention), so they were changed to use Shift+Alt in most browsers.

Firefox, Safari, Chrome and Internet Explorer use Shift+Alt for access keys. The first three will follow the link when you press the key combination, while IE (always the black sheep of browsers) will just focus it, so you have to press an additional ENTER to follow the link. I don't know what the developers were thinking. What's the point of just focusing a link?

It is up to the site to make the access keys evident, often by underlining the particular character that triggers the link - a convention typical of application menus. However, by pressing the Shift+ESC key, the Opera browser brings up a full list of access keys in a particular page, even if they are obscure. Subsequently pressing the access key character (e.g. Shift+ESC+H) will trigger the link.

Juicy Studio has a really good article on the topic.

Saturday, October 1, 2011

uCertify PrepKit Review

Introduction

We live in a competitive world. This is evident at every level, from technology giants like Microsoft and Google wrestling with one another for market share, to technology professionals fighting to get that prestigious new job with that particular company. The ones who make an extra effort to distinguish themselves from the rest are ultimately those who win. Certifications are one way of gaining this edge over the rest.

Today, hundreds of certifications exist, and they cover just about every IT job, including support, analysis, development, management, security, and much more. Many people choose to attain a certification in order to gain and demonstrate expertise in a particular subject, sometimes leading to promotions and/or pay rises as well. However, obtaining a certification is a difficult goal that requires long-term commitment, and in doing so, one must have access to the right preparation material.

Some people attend a course to prepare for a certification, while others opt to teach themselves through books and other material. There are also many commercially available preparation engines that serve not only to teach the subject, but also to serve as mock exams. This is very useful because free mock exams are usually very hard to find or non-existant, and having a feel for what the exam will be like is very important. Ultimately, there is no single correct way of preparing oneself, and a combination of learning methods may be the best solution.

This article reviews uCertify's PrepEngine, which is one such preparation engine. The PrepEngine allows you to use one or more PrepKits, each of which provide learning and test materials for a particular certification. This review is based on the MCTS: Windows Application Development with Microsoft .NET Framework 4 (C#) PrepKit. However, uCertify has PrepKits for just about any certification you can think of doing.

Dashboard


The main screen for the particular PrepKit you are using is called the Dashboard. The preparation materials are organised into four categories for easy access. At the top are two tabs: Practice Test and Study Helper. Practice Test incorporates the PrepEngine's test engine, that will allow you to take a variety of tests in order to gauge your level of preparation for the real certification exam. Study Helper allows you to navigate through pages that teach you each topic you need to know, in a step-by-step manner.

Beneath these two tabs is the Enhance your understanding section. The resources in this section are more intended for when you have already covered the material required for the certification, and need to consolidate that knowledge before taking the exam. Finally, the Track your progress section lets you monitor your progress and determine your readiness to take the exam.

The Dashboard is simple and intuitive. A small thing that could have been done better is the list of features on the right part of the Dashboard. When you get used to the product, you will ignore them, so about half of the screen space is wasted. The Study Helper and Track your progress sections could be placed on the right, allowing instant access to all the product's features without scrolling or tabbing. Hints about the features could still be provided in the form of a random tip, either at startup or in a corner. However, I will point out that this is a very minor usability issue and in no way detracts from the product's rich feature set.

Although I will go over each category separately in this review, you will actually be going from one to another all the time. For example, going over the Exam objectives (Enhance your understanding section) is a good place to start, after which you can take a Diagnostic test (Practice Test section) or go over the study material in the Study Helper section. The flexibility of uCertify is that you can do things in any order you want, and everything is customisable for your convenience.

Study Helper


The Study Helper is a collection of learning resources organised by exam objective. Each chapter explains the exam objectives, covers each topic, and lets you take short quizzes (with answers provided) to see that you've grasped the concepts. Navigation is easy by using the buttons in the panel at the bottom, and keyboard shortcuts enhance the product's accessibility.


A little glitch I noticed is that although the Prior (Back) button is disabled when you're at the beginning, the Next button remains enabled when you're at the very end. This happens not just in the Study Helper section but throughout the PrepKit.

Enhance your understanding


The resources in this section are quite varied, so I'll go over them briefly. Exam objectives, as I noted earlier, is a good place to start, because it gives you a general overview of all the topics you need to know. You can get this same information at the beginning of each chapter in the Study Helper section, but here it is available all in one place.


Flash cards are cool way of assessing your knowledge without having to take a whole test. Basically you are asked questions which are the same as the topic titles from the Study Helper chapters. After you write what you think is the correct answer, you can check your answer against the Study Helper material there and then. One thing I noticed, however, is that the Dashboard says that there are 167 flash cards, when in reality there are only 155.

Study notes also give you access to the Study Helper material, using a different view. Like with flash cards, the Dashboard says there are 167, but in reality there are 155. 167 is actually the total number of study notes, articles, how to's and study tips combined, so the PrepEngine evidently has got some of its numbers wrong.



Now we come to the Articles. After seeing 155 study notes and flash cards, there are... 2 articles? And both about LINQ, which is just a tiny part of this MCTS? The articles are intended as technical articles written by industry experts, and they do go into some depth, but the choice of topics could have been better. Even the dog below has something to say about this (image borrowed from here).


The Study tips contain general information about the certification aside from the curriculum itself, including background information about the exam, test procedures, and checklists for the skills you need. I'm saying "checklists" because there were two study tips that were exactly identical except for the tense of the initial verb (see below).


The How To's are step-by step guides to configuring specific things in Visual Studio.

Practice Test


This section is probably the most important part of the PrepEngine. You can read a book to prepare for the MCTS, and it might even have a CD with a mock test or two. However the PrepEngine's test engine is much more flexible and will allow you to test your knowledge in the particular certification you are following.



There are several different types of tests you can take. The diagnostic test is a quick test that gauges your general ability before you actually get serious about learning all the certification material. Most of the questions are multiple choice, but then you also get some weird stuff like the above, and the results screen incorrectly shows that you've answered them, even if you skipped them. Also, you get tired very quickly of every question saying that you work at uCertify.

Then you get practice tests among other things. These aren't different at all from the diagnostic test, and the PrepEngine's greatest strength is that you can customise the tests as you like. By using learn mode, you can see the correct answer and an explanation for each question as you go along, right after you answer. Tests can also be customised by topic, by the amount of time you have available, etc. There are also useful features that let you tag questions, write notes about them, etc.

While these tests will help you, and while uCertify does guarantee that you will pass, always keep in mind that these aren't the questions you will see in the exam. Certification exams keep their questions secret, and the best that software like this can do is try to come close based on the exam objectives. Passing a practice test in no way means that you'll do great in the certification exam.

Track your progress


This section gives you statistics about your progress. Since your test progress is always tracked, even when you take a test just to look at how it works, my progress looks pretty awful:


Nonetheless, this is good because you can monitor your strengths and weaknesses by topic or by test. This allows you to prioritise by focusing on the topics you are not so good at.

Conclusion

uCertify's PrepKits pack quite a lot of useful material to help you achieve the certification you want.. The PrepEngine is built with usability in mind, and it is easy to find the information you need. There are several little bugs throughout the product; however none of these significantly affect the preparation experience. While it is always a good idea to compare features with competing products before acquiring something like this, uCertify's PrepKits are no doubt a good choice to complement a book and/or course in helping you sharpen your skills and go through the exam with confidence. As I already mentioned, however, certification tests are ultimately very different from mock tests, so you should never be overconfident.

Dogfooding

Some companies deploy and use their software within the company itself. This is known as dogfooding, and Coding Horror has a pretty good article about it. Dogfooding is pretty useful to let a software product undergo day-to-day use (for proper testing) before it is released to clients.