Friday, 8 February 2013

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".

Thursday, 31 January 2013

How to I put a Unicode Character in my C# String?

Answer: Use a Unicode character ESCAPE SEQUENCE - representing a SINGLE Unicode character. C# uses a 16 bit character encoding for Unicode code points. BACKSLASH U.

Unicode codes are all here. To use in C#, lower-case the U and remove the + sign.

Example:

public static string sigma = '\u03C3'.ToString();

Maths requires use of "Greek and Coptic" character subset of Unicode, Coptic being an adapted Greek alphabet that was being used in Egypt.

Saturday, 19 January 2013

What is Software Science? Let's ask Sedgewick.

What's the latest book on software science you have recently read?

Wait - first off, what IS software science?

If you had to teach a course called software science to cover the more scientific aspects of modern computing, what would it include? Probably the following:
  • basic algorithmic knowledge, like how to analyse an algorithm (time complexity and space complexity - yes this is still important, e.g. when programming for small devices) and the classic algorithms like quicksort and bubblesort, what their characteristics are
  • basic knowledge on audio compression technology like MP3 and Ogg Vorbis and the underlying concepts
  • working knowledge of maths underneath RSA and other cryptographic protocols and algorithms (prime numbers, number theory)
  • basic computational physics for use in programming physics engines and ray tracers used in game development
What are the "great tomes" of software science?

Consider the first category of "basic algorithmic knowledge". Robert Sedgewick's 1983 tome simply-named "Algorithms" is always a firm favourite with students, and even covers a bit of linear programming as well (albeit under "Advanced Topics). There is also a fantastic book called "Computer Algorithms C++" by Ellis Horowitz (University of Southern California) and Sartaj Sahni (University of Florida) and Rajasekaran Florida) published in 1996, which delves quite nicely into parallel algorithms also, which is getting more fashionable with the whole Google map-reduce malarkey.

Caveat: Sedgewick says you probably need about a year's worth of programming experience to get the most out of his book.

In terms of audio and multimedia technology (one of the areas of computer science strongly influenced by maths and more traditional engineering disciplines, like electronics engineering) most of the information can be gleaned from the web but there are of course books available too. One such is Digital Audio Signal Processing, Udo Zolzer, Wiley, 2008 (the book has been described as "useful" but not very accessible).

For RSA, Shneier's Applied Cryptography is a must (highly praised by Dr. Dobbs Journal when it first came out). For computational physics, try: David Eberly's Game Physics, 2003. To get the most out of this book, you really need to get psyched about mastering Newtonian and Lagrangian dynamics.

Ogg Vorbis Sound Files

What are Ogg Vorbis sounds files a.k.a. .ogg files? Ogg Vorbis is an audio compression format comparable to MP3. Ogg is a container format for audio, video and metadata maintained by xiph.org. Vorbis is the specific audio compression scheme used.

According to the Vorbis technical specification, the codec is based on the Modified Discrete Cosine Transform (MDCT) which is also used in the MP3 format. Vorbis is, however, computationally simpler than MP3 but requires more working memory.