A second attempt at Ligne Claire style

Filed under: Artwork/Portraits/Caricatures by Hari
Posted at 14:38 IST (last updated: Thu, Oct 10, 2013 @ 15:31 IST)

Here is my second attempt at drawing in the Ligne Claire style as pioneered by Hergé, the creator of Tintin.

Man pointing

Attempt at Ligne Claire style comic

Filed under: Artwork/Portraits/Caricatures by Hari
Posted at 12:41 IST (last updated: Thu, Oct 10, 2013 @ 14:39 IST)

I have been  a big fan of Tintin and Hergé since childhood and I've always admired the clean style of drawings employed in his work. The style is called "ligne claire" (French for clear line) and is a fairly difficult style of illustration (known for its precise lines and attention to details, including backgrounds). Here I've just attempted that style in a single panel. I have a long way to go though! There are some incredibly talented ligne-claire artists out there, and I can only aspire to reach those levels some day.

Ligne Claire style comic

Is Gnome/Udisks mounting your removable media read-only? Check fstab

Filed under: Tutorials and HOWTOs by Hari
Posted at 19:07 IST (last updated: Mon, Sep 16, 2013 @ 19:24 IST)

For some reason Gnome kept mounting all my VFAT/FAT32 external USB mass storage devices as read-only. Frustratingly, I had no idea what was going wrong. After a lot of googling around and poking for solutions, including PolicyKit and permissions related to plugdev, none of which seemed to point to the root cause, I finally edited my /etc/fstab file and guess what! I found these lines in it (I had obviously added them long ago for some reason I cannot recollect now):

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). #
#
<file system> <mount point> <type> <options> <dump> <pass> /dev/mapper/linux-root / ext4 errors=remount-ro 0 1 /dev/mapper/linux-home /home ext4 defaults 0 2 /dev/mapper/linux-swap none swap sw 0 0 /dev/sdb1 /media/usb0 auto rw,user,noauto 0 0 /dev/sdb2 /media/usb1 auto rw,user,noauto 0 0

Commenting out the two lines at the end did the trick and automounting (with read/write) worked again:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). #
# <file system> <mount point> <type> <options> <dump> <pass> /dev/mapper/linux-root / ext4 errors=remount-ro 0 1 /dev/mapper/linux-home /home ext4 defaults 0 2 /dev/mapper/linux-swap none swap sw 0 0 # /dev/sdb1 /media/usb0 auto rw,user,noauto 0 0 # /dev/sdb2 /media/usb1 auto rw,user,noauto 0 0

Yes, this seems too obvious at first sight, but I didn't remember that I had added these entries in /etc/fstab at all and moreover, I had forgotten that /etc/fstab can play some subtle tricks with automounting tools.

Hope this bit of information is helpful to anybody else running into this problem.

Musings on Functional Programming and Haskell

Filed under: Software and Technology by Hari
Posted at 11:25 IST (last updated: Sun, Sep 8, 2013 @ 11:50 IST)

Caveat: I am not a computer programmer by profession. I am a hobbyist who loves to dig around programming in my free time. Many of the words used in this essay may not necessarily be formally correct and I invite knowledgeable people to share their feedback.

Since I've been fascinated by Haskell for a while now, I thought this would be a good time to post my general thoughts on Functional programming with respect to Haskell in particular.

To be honest, like most others coming from an imperative (procedural) programming background, functional programming was daunting. There were so many new concepts and some mathematical jargon used in Haskell tutorials that initially put me off, but then I kept digging deeper. I don't claim to understand most of the advanced concepts yet, but I have got a feel for functional programming that I think could act as a basis for future learning.

Haskell is a wonderfully abstract, pure functional programming language with features such as non-strict evaluation and a strong powerful static typing system and a rich set of useful libraries. To understand functional programming, here are some ideas I feel will help newbies (like me). There are a lot of tutorials that introduce FP in terms of purity, referential transparency etc. I assume that you have read those. Here I am going to try to condense my thoughts on how best FP can be understood without getting bogged down in theory.

Without further ado then...

Read more...

Tic Tac Toe (a.k.a Noughts and Crosses) in Haskell

Filed under: Tutorials and HOWTOs by Hari
Posted at 10:21 IST (last updated: Mon, Sep 16, 2013 @ 14:33 IST)

A couple of years ago, I had written a C++ version of an AI playable Tic Tac Toe program. I have now written a similar version in Haskell, which uses the same kind of logic as the C++ one. I thought it would be kind of challenging to try a program like this in Haskell, but it turned out to be quite easy, as a matter of fact. I wrote this as a way to revisit Haskell while trying a non-trivial exercise.

I am sure there are better Tic Tac Toe programs/algorithms implemented in Haskell that illustrate more advanced techniques than the ones I have used, but still, I think mine would be a bit easier to understand for a newbie and is perfectly adequate for a simple game like this.

Simply the algorithm I used for the AI is this:

  1. Check for any winning move and make it.
  2. Check for opponent winning move and block it.
  3. Check if the center of the board is free and occupy it.
  4. Check if any one of the corners are free and occupy it.
  5. Occupy any other free cell.

That's about it. This makes the game unwinnable from a human player point of view (which is what most TicTacToe AIs implement). The best result that can be achieved is a draw. Pretty boring game, but still... In fact, the game can be won by the human player as pointed out in the comment by Jonathan below.

Read more...

A revival of interest in PC games

Filed under: Software and Technology by Hari
Posted at 11:41 IST (last updated: Sat, Aug 17, 2013 @ 11:41 IST)

Of late, I've had a mild revival of interest in PC games. I've always been a fan of Real Time/Turn Based Strategy games, simulations and world-building games and to me, gameplay has always been the key, rather than graphical glitz or sound effects. Over the years, I've been a fan of games like Age of Mythology, Seven Kingdoms, Civilization, FreeCiv and so on. I've also had fun playing hardcore rail simulators like Microsoft Train Simulator, Auran Trainz and OpenBVE.

Now, a long time ago, I used to play a game called Transport Tycoon by Microprose. It was a fun, addictive transport network building game with the option of building several types of transportation networks  including land (road and rail) and air. The biggest fun was building a complex railway system and watching your miniature trains run flawlessly from point to point and make you a hefty profit. The challenge was to make sure your transport company stays afloat while servicing your bank loan, maintenance costs, infrastructure costs and so on.

And then, I recently discovered OpenTTD, an open source re-make of the old classic Transport Tycoon Delxue. Old fans of TT and TTD will find the screenshot below quite familiar.

OpenTTD

It has several enhancements over the orginal and provides for hours of fun and entertainment as you lay out tracks and roads and send you trains, buses and planes on their way.

It is addictive and fun. But be warned: it is a time sucker and it can make your family mad at you for spending hours in front of the computer!