Monday, November 29, 2010

Some old technologies that are not preferred now

CGI, SCGI, FastCGI, mod_python are not the preferred ways of serving web pages now. Modern web development almost always revolves around Web Frameworks. But, after listening to the lecture on the history of JavaScript, I felt an urge to have an understanding of the ways people got things done before understanding the vulnerabilities and arriving at better methods. So, before I jumped into the basics of WSGI, I checked the other server-side options with Python.

I prefer articles explaining theory over how-to kind of tutorials. Having the knowledge of what and why makes the how easy to understand. But, it is not practical all the time, to know all the underlying details. Thanks to Wikipedia which has been my go-to for overview on many things.

Waking up at 5 a.m. in the morning makes the day really longer. Though I had a feeling that I was more productive in the night time, I desperately want to play some game for the sake of playing and also fitness. My current work place at home troubles my concentration and focus in many ways and I need to find a solution quickly.

Saturday, November 27, 2010

Douglas Crockford's Javascript vidoes

I have watched two crockvideos (presentation on JavaScript by Douglus Crockford) yesterday. The first video was about the good stuff in JavaScript. He explained how he stopped worrying about the bad parts and how he started loving it by refining the language to have only good parts. Many of the catch phrases, if I can call them so, form the book were there in this video. Though there is no intentional evangelism, he somehow made me want to learn more JavaScript. Overstating the importance of JavaScript for web is impossible anyway.

The next video was the first of a 5 part series on JavaScript. It was all about the history of the language. The presentation was very interesting despite its length (1hr. 42 min.). He touched upon jacquard looms which led to industrial sabotage in the beginning of the 19th century, punch cards that was used in the early days of computer programming, the mother of all demos by Douglus Engelbart. Then, there was the 'brief history' of programming languages till the invention of JavaScript.

I have printed out the first two chapters from JavaScript Cookbook. Rereading The Good Parts book has been as enjoyable as the first reading.

My brother and I have been planning to go to the indoor stadium in our town to play badminton daily. Badminton is such a good choice to get fit. So, I have bought a cheap Yonex racquet to start playing after a long time. Lately, my productivity has been effected by my sitting posture owing to my chair. I have finally bought a chair which lets me sit upright and comfortable. I have called almost every one of my college friends in the last two days. Everybody is doing well and I wish them all the best.

Friday, November 26, 2010

Douglas Crockford's JavaScript: The Good Parts

My plan for the week was reading this book. I have read it once, as a comprehension or a story and loved it. I am reading it again slowly while trying out the methodologies promoted in the book, and a good book stays enjoyable no matter how many times you read it. I have also started watching the videos by Crockford on YUI theater.

I have finally started learning touch-typing. I have decided to stop hunting and pecking with my right index finger though I am quite accurate and fast with that. After looking for some typing software, I chose GTypist and KTouch. GTypist has been very good. I am spending an hour or more everyday on this.

Once I feel that I have comprehended the Good Parts book, I will read more about JavaScript and do some small projects. I feel an urge to buy the JavaScript Cookbook, but that's on the back burner for now. Next week, I am going to revisit jQuery and learn as much as possible and make some stuff with it. Making a good, useful jQuery plugin will be a great thing to do.

Tuesday, November 23, 2010

A short break and back to work

These are the things that contributed to the two day break -- a friend's visit that's long awaited, an engagement ceremony, an accident to my grand parents and a feeling of burnout. I have gone 42 (wow! what a coincidence) consecutive days reading and learning stuff before breaking on Sunday. I didn't spend the day contemplating, but spent well, talking to Rahul. We bought a bat and played cricket after a very long time, nearly 2 years.

I finished reading Harry Potter and The Deathly Hallows just a day before the movie was released, as wished. I enjoyed the book because of my long time association with all the characters. I have started reading Robinson Crusoe by Daniel Defoe. It has been very good. Happy that I am back to reading fiction, I should read some non-fiction as well -- Autobiographies, History, Philosophy etc. are among my favorites. There's no shortage of books and audio books.

Today, I have started reading JavaScript: The Good Parts by Douglas Crockford. I don't remember reading any programming book which expressed syntax and semantics more crisply and clearly in a straightforward way. I have just read the first 4 chapters and it was a breeze probably because I have already read a guide and a book on JavaScript. Looking forward to finish this book before the weekend. I don't mind rereading it later.

Friday, November 19, 2010

First encounters with Ajax

After several hours of playing around with Ajax, I am finally starting to feel comfortable with it. The chapter HTTP Requests from Eloquent JavaScript is very good for beginners. Then, for more examples and to work with other formats, I have referred the Ajax chapter from jqfundamentals.

I should really thank firebug, for without it many things could have been tedious. I have used plain text, html, JSON, JSONP formats to exchange data till now. As I wanted to work with Python, I created a simple HTTP server (using BaseHTTPServer) to go through the basics tutorials. Then, I have used the appengine devserver to go ahead. In the process, I have also learned about the json module in Python(from 2.6) and simplejson which is the same but can be used for Python 2.5. On Google App Engine, it can be imported using from django.utils import simplejson.

Initially, I was creating the landing page for my experiments using the get method of a requestHandler class. It was difficult to edit the html code that way. Then, I felt like an idiot when it dawned upon me that I could just use a static html file. Many small lessons along the way made me happy. Editing HTML, JavaScript in vim wasn't easy (out of the box). I expect it to be better after some tweaking around.

After all the coding I have done over the last two days, I feel a need for a code blog. I have been thinking about buying a custom domain and host a personal website using a Python based CMS. Until then, I think I can use a blog or github pages. This blog can continue to be my learn log.

Wednesday, November 17, 2010

Finished the 'Fundamentals' part of 'jQuery Fundamentals'

I have read 'jQuery fundamentals' over the last two days. It is a great book for people looking to get started with jQuery. I was in no hurry while reading and it just took me around 6 hours to finish the 'basics' part of the book.

The target audience is beginners. The writing is to-the-point examples are all very good. There are introductions to new concepts that are not strictly jQuery wherever required. There are exercises at the end of some chapters which showed what's possible with the basic knowledge acquired in those chapters. They guide us through making some very popular scripts like drop-down navigation menus, photo slideshows, tabbed navigation, hints in text-boxes etc.. There is a chapter on Ajax and some advanced stuff towards the end but I have left it for later.

I was not able to concentrate at times. It was like this xkcd comic. I have found that switching off the wireless router has wonderful effects on productivity. I have also enabled the no-procrast thing on HackerNews hoping that it will help me focus. It has worked till now though there is a temptation to delete cookies or open it in a different browser. More jQuery and Lisp ahead. Need to play with Ajax on App Engine as well.

Monday, November 15, 2010

DOM and some VIM

DOM is not a new topic for me, but I have never cared enough to study it properly. I have started that process now. After all, it is the most important use of JavaScript for now and it is what made JavaScript popular. 'Eloquent Javascript' gave a gentle introduction to the topic. I am planning to read the guide at MDN too. Then, I will dive into jQuery to play around. Ajax is one of the topics I still do not understand properly at a level I will like to. Need to spend some time on that too.

I moved to the next vim casts which were about basic editing. I have been using most of these commands for a very long time. There were some new things there. I have almost never used the visual mode. Using visual mode block-wise was fantastic. I thought previously that yanking and pasting in vim suck because they were only to edit complete lines, but I immediately understood how foolish I was. It should have come to me earlier, if I had ever experimented a bit with them (we can use yw to yank a word etc. and p to paste/put after and P to paste/put before).

There is a lot to be done and many fun-filled days ahead. I am happy that the sabbatical is working out quite well and hopefully keep it short. I can't wait to get into action and solve some complex problems. There is always the opportunity to create something on my own anyway. I should get hosting space and a custom domain, but I will worry about that later.

Sunday, November 14, 2010

A little more of Lisp and JavaScript

Continuing 'Land of Lisp' from where I left yesterday, there were some more functions to finish the Hunt-the-Wumpus game's program. I haven't finished the chapter yet because I slacked off a bit. I would recreate the game in my flavour to understand it better.

From 'Eloquent JavaScript', I finished the chapters on Regular Expressions very quickly, thanks to the excellent chapter on RegEx in Python by Mark Pilgrim. The next chapter was a crash course on Web Programming. It was a good introduction intended for absolute beginners. It refreshed my knowledge about the web, HTML a bit. And it introduced me for the first time to JavaScript, the client-side scripting languages. All along, I have been learning JavaScript, the programming language. It was disappointing to see that the next chapters haven't been updated since 2007. I will still read.

I have not been making anything these days. It's all been learning. So, I have decided to create something over the next week on GAE and launch. It will be a simple app involving some simple server-side lookup and some client-side effects based on the values returned. I have some ideas but haven't finalised on what it should be.

Saturday, November 13, 2010

I ran again, after two years

And it felt good. It was only about 300-400m, but I could feel my whole body after a very long time. After the first round (2km) of walking, I felt like running and thought I could run the whole of the second round, but just after the first 20% or so, I gave up. My heart was pounding crazily and my lungs felt unbearably heavy, I had to stop. I felt amazingly good. I am going to continue this.

I continued reading Land of Lisp. I have done the graph making exercise again with my own example. It was to represent members and relations in a family graphically. Graphviz is an amazing package. You can just create a dot file following some syntax and you can convert these dot files into different graphical formats. What I have done just scrapes the surface and there is a lot beneath it.

I used folds in vim for the first time. It's a great feature. I initially thought it was a part of some plug-in. I need to improve my touch typing too, if I ever want to call myself a programmer. The problem has always been 'dedicating time for typing exercise'. I don't use the SHIFT keys properly and hunt and peck for numbers and special-symbols. This is bad and has to go away soon.

Friday, November 12, 2010

Exploring the Land of Lisp, slowly.

In the chapter that followed, the simple text game that was designed to be played at the clisp console is taken one step ahead. We created a game specific REPL. Many concepts are introduced in the process. The game REPL used it's own read, eval and print functions to do the specific tasks. The author warned about the vulnerabilities that come with read and eval.

The next chapter was very short and it was dedicated for lambda.
LAMBDA: A function so important it deserves it's own chapter
Then, we went beyond basic lists in Chapter 7. Dotted lists, pairs, circular lists, association lists were discussed and then visualising trees and graphs. The book chose the free, open source Graphviz is chosen graph visualizations, which looked pretty interesting. I got it from Ubuntu Software Center. I haven't finished the chapter yet.

It rained in the evening and I couldn't go out for walking. I have been suffering from severe head-aches lately. Is it because of the excessive reading from the bright laptop screen? I think it has something to do with my spectacles which have been bought recently. I will go for a check-up again. Over all, a mixed day.

Thursday, November 11, 2010

Landed in the '(Land of Lisp)

The last two days haven't been great in terms of the time I spent learning. But, one good news is that I have started reading Land of Lisp by Dr.Conrad Barski. I had decided that I would not read any other lisp book till I completed SICP. But, as I started reading LoL, I was hooked to it. The introduction really led me to read the other chapters and now, I don't feel like stopping it. SICP is going to take some time because of this and some other side projects.

A few pages discussed the history of Lisp and how to get CLisp on your computer etc.. On Ubuntu, clisp installation needed just one command, as is the case with thousands of other software. Once the lessons started, I was confused after the vague introductions to code-mode and data-mode etc., but there were a few "we will discuss this in great detail in Chapter X". The book has a good flow and though the cover, comics and video give a not-so-serious feel to it, they were used in moderation.

I liked the way Scheme code looked. There was no need to see data very differently from procedures. Having to write (function function-name) or using #' as shorthand did not look pretty. There must be reasons behind this special treatment of functions which, I hope and think, will be explained in the book. Dr.Barski himself told that CLisp is about raw power and Scheme is about elegance and mathematical rigor. One of the many strange cartoons that have already passed compares CLisp to a wolf and Scheme to a beautiful sheep full of wool.

I have started going out for walking in the evening with my father. I somehow need to hack my daily schedule to get as much out of it as possible. I am reaching saturation sooner than before (while reading). Music helps, but even that hasn't helped these days. Should I think about relaxing the stress a bit? Or should I keep training my body and mind to take it?

Tuesday, November 9, 2010

Striving for eloquence in Javascript

I have always wanted to learn JavaScript, to do cool things, after witnessing the awesomeness everywhere on the web. My previous start with Eloquent JavaScript ended pretty soon after I reached the difficult(then) stuff. But, this time, after reading the JavaScript guide at MDN, I have decided to get comfortable with JavaScript. I downloaded the free book and started reading from my laptop.

The book is really enjoyable for a beginner like me. I have read through the first four chapters dealing with values, variables, flow, functions and error handling. Then started the chapter on Functional Programming. This took me some time to finish. The author made up interesting stories to form a base for the exercises and explanations. 'The programming book by the recluse' in chapter 7 was fun. He has introduced the traditional functions from functional programming one by one. The over enthusiastic use (as confessed by the author himself) of forEach, map, reduce, filter, negate, compose, any, every etc. didn't cause much trouble for me after the experience with SICP.

The next chapter, Searching, was not intended to introduce new concepts in JavaScript. It posed two similar problems from graph theory. I took some time to understand the algorithms and worked through the exercises with some difficulty. I need to finish this chapter and two more tomorrow.

Another extremely useful thing was - the JavaScript editor+console within the book. With basic syntax-highlighting and auto-indent, it was really helpful. Having coded in Python and Scheme for sometime, I was having troubles with semi-colons initially, but got into the zone after sometime. Cross-compilers like pyjamas and coffeescript were in news recently but I will concentrate on learning js for now and then dive into jQuery.

JavaScript is failing the spell check here. Isn't the spell checker written in JavaScript? :P

Monday, November 8, 2010

A bad start to a day spoils it.

Today, I have learned an important lesson. It's not a lesson just in programming or productivity alone. It's an important one in both and a lot more - A day that starts bad has disappointment written all over it. After what happened today, I have decided to start all my coming days with the most important task at hand. There needs to be an end to the childish dragging that happens between waking up and taking bath. Alas! I have been talking about avoiding bad starts, but it is important to have a good start too.

The fact that it all happened after reading articles about productivity from PG and SwaroopH is more depressing for me. As PG mentioned, Internet is the new TV and it's difficult to escape with it being finger-tips away. In the beginning of my sabbatical, I had a resolution to connect to the WWW only for 30 minutes before I write my dairy and sleep. I somehow didn't maintain that and I am finding myself in this situation now. I often fail the tests of self-control but my regrets are more painful these days.
Regret for wasted time is more wasted time.  ~Mason Cooley
SICP was taking too much of my time, but I thought it was worth it. I need to contemplate my plans regarding SICP though. The learning is going very slowly and I think it can wait. I have hit a block with GAE because of the lack of Javascript and Ajax knowledge. I need to spend more time developing because I agree with all those experienced hackers who say that it's the best way to learn more. Learning from a book is important, but it will take you only so far. How will you explore more, if you don't know what you need?

Apart from the life lesson, I have read this wonderful article Why, oh WHY, do those #?@! nutheads use vi? by the creator of ViEmu. I have watched a few more of Derek Wyatt's vimcasts. I wish to start reading Harry Potter and The Deathly Hollows (a gap of 2.5 years after the 6th) and finish reading before the movie releases on 19th. The first six books were immensely enjoyable.

Sunday, November 7, 2010

Learn me a Vim and Git for great good!

I have been postponing these for a few months - getting better at Vim and getting started with Git. I have downloaded the vim casts by Derek Wyatt some time back. Get Started with Git from A List Apart was what I chose for Git.

I have used vim now and then since college, but never got serious enough until now. I have seen people who scrolled mouse indefinitely (or pushed the down arrow for an hour) to reach the ten thousandth line and hated them for that reason alone. Now that I have started some coding, I have found myself doing a lot of jkhl in vim. So, felt it was time I started climbing the dreaded learning curve. I had good time with IDLE for Python, but I had to move to one of the real editors. I never really liked IDEs. So, an oath of allegiance to Vim. (I am still using Dr.Racket for scheme though.)

This is probably the first time I have ever used Version Control. I was very impressed with Git and started using it right away. The tutorial I mentioned earlier was very good. I had some doubts regarding merging of branches etc., need to learn more. My wait for the day I can proudly push a repository to github should not be very long.

Installed GoldenDict in place of my old favourite Stardict. The interface is much better and the integration of Wikipedia and other web dictionaries including UrbanDictionary was excellent. My search for good en-en dictionaries ended up in some Russian websites and I had to use a website translator for the first time.

My respect for Linus Torvalds grew even more after using Git. Creating two of the most popular software used by developers is no ordinary feat. These books - Learn you a Haskell for Great Good and Learn you some Erlang for Greater Good have been on hacker-news over the last two days. Hence, the post title.

Saturday, November 6, 2010

Started keeping notes with Zim

I have been having a lot of problems keeping track of the things I have learnt. My todo lists are always a mess and without them my days feel like a mess. So, I have decided to look for a simple note making tool which has some good wiki capabilities. My first search for 'wiki notes' was in the Ubuntu Software Repository (I did not like Tomboy which came with Meerkat). Zim was good enough. The manual is beautiful too. There is a GTD article and a plugin to handle ToDos (need to check these out).

The markup language was easy to learn. The feature I liked the most is clickable checkboxes which can be nested. Creating a todo list with checkboxes was simple. Notebooks, subpages can be created. Links can be added to pages within the wiki. There is an option to start a server which serves the whole wiki. Pages can be exported to html or latex. I wish to work with LaTeX sometime.

Some good alternatives are Basket, Tiddlywiki, Tiddly Backpack. The first impression is that Zim is minimal and sufficient. I will check that Basket out if my needs demand so. I have also started experiments with the post-it notebook that has been in the shelf for a while.

Pen and Paper still work for me for small notes. But, for keeping learn logs, todo lists- Zim for now. The first day with self-created todo in Zim was successful, I should say, because 'writing a blog' was one of the tasks.