Wednesday, 20 February 2013

Respect for Base Libraries

Always in projects look for opportunities to build up a strong set of base libraries. Even if you are writing throwaway code, may be some one-off testing application that tests something you've built, if there are some functions that can be "outsourced" to a base library, take the opportunity to do so. That way, your base libraries will mature and develop until all application development becomes a trivial task.

Friday, 8 February 2013

Storing C# Strings in an Oracle Database

This is not an Oracle blog, and Windows Joe has no intention of turning it into such. However, since Oracle coding is occasionally required by the Windows programmer, occasional clarifications on the aforementioned technology are sometimes warranted.

In addition, such posts may be of interest to database enthusiasts wanting to refresh the basics.

One such, is the popular newbie question (and also asked by experienced bods who haven't touched Oracle in a long time) is what datatype to use for string data?

VARCHAR - not to be used. Why - because Oracle says so. It may work, but is not recommended.
VARCHAR2 - the recommended way to store strings (or more precisely, VARIABLE LENGTH character strings).
CHAR - for fixed length character strings.Using this type to store variable length strings is a waste of space.

So in 95% of cases, you need a VARCHAR2 to represent strings in an Oracle database.

If in Doubt, Write It Out

One can borrow this adage from mathematical problem solving, to solving difficult programming tasks.

Sometimes a task is difficult not because it is intellectually difficult per se, but due to the fact that it requires tracking of very precise details e.g. when writing code to transform one peculiar date format to another data format. In this case, the visualisation of the data may be different, but also be semantically different e.g. if going from a super-precise representation (say, one which captures picoseconds) to one which has lower information content (e.g. rounding to nearest second).

In this case, explicitly writing out the various layers of the problem in a Word document may be your best bet to programming an accurate solution quickly and effectively.

Note: pico = 10^-12 (next notch up from nano = 10^-9).

Learning the MAXIMUM from Every Implementation Task

Software is REPLETE with tasks that can be classified as "mere implementation". In these tasks, there is no sophisticated algorithmic development, no calculations of time or space complexity. There is just the coding: which might be C#, might be SQL, or something else. Maybe you've done a dozen similar implementations. But there is always more that can be learned, for example, reviewing how the task, once accomplished, fits into the greater whole. Not seeing the task as a task, but a component of a greater whole. REMEMBER, the whole is greater than the sum of its parts (Aristotle, Metaphysica).

The Art of Remote Desktop


Logging Another User Off

Log in to another remote desktop machine ON THE SAME DOMAIN:

quser /server:[server name]
logoff [session id] /server:[server name]

quser will return the USERNAME, SESSIONNAME and ID (Session Id) which you can use in the logoff command.

View tasks on another machine

tasklist /S [server name]

Tuesday, 5 February 2013

Where is Sort on the Crazy Excel Ribbon?

It's on the Data tab (just after Page Layout and Formulas). You will see a Sort icon which looks like a box with A|Z Z|A written on it. It's in a "frame" in the Ribbon called "Sort & Filter".