Archive for the 'Articles' Category

03/26 Stanford CS Education Library

Not everyone is lucky enough to enjoy a posh education at Stanford, but it shouldn’t prevent you to go to their Stanford CS Education Library and go through the material there. Pretty basic but good stuff. Currently dealing with Binary Trees (with a focus on C), and I am using this as Erlang tutorials, the DIY variant… There’s probably a good implementation of a binary tree [in the Chapter about Tuples of the Erlang doc], but I didn’t cheat and did it all on my own :D


Binary Search Tree

I have now a semi-functioning implementation of a binary search tree [a last minute “upgrade” of the code borked the lookup function, sigh]. It can, so far, create and add nodes to a parent, left or right; lookup a node well, when I fix the code that is…; calculate the maximum depth, minimum and maximum values, and the overall count of nodes; and mirror the tree – for some reason it took me more than 5 minutes, must be tired…

Note to self: unit tests are fine, as long as they don’t have bugs… Trying to debug a perfectly functioning piece of code because the unit test is bugged is a perfectly rotten way of spending time in front of the ‘puter…

I will probably open soon a code repository for all my Erlang efforts – learning CVS on the way, it cannot hurt. If and when, I’ll post the url.

I wonder how fast my bst would be if I dumped 22,000+ XML nodes, parsed to strings… Not that it would make sense, but it would sure be fun to try!

Erlang

11/29 Warning!

Warning!

Try to ignore what you have learned about conventional, procedural, programming languages, such as Pascal, C, or Fortran. Most of the concepts you learned about conventional programming will impede your learning the principles of programming in a language like Haskell. Haskell follows an entirely different model of computation. Trying to understand Haskell programs in procedural terms is, at this point, a waste of time and effort—confusing, frustrating, and definitely counter-productive. The time for that is when you take a junior- or senior-level course in programming languages. For now, start fresh! Think about new things. You will be dealing with equations and formulas, not those step-by-step recipes that you may have learned about before. You will reason as you would if your were solving problems in algebra. That other stuff is more like telling someone how to do long division.

From Two dozen short lessons [in Haskell].

Short. 290 pages. Sure… Anyway, in for an inch in for a mile, eh?