Tuesday, March 06, 2012

Does constantly compromising make you worse?

That's what Rocky says in his post - http://rockyj.in/?p=248. The corresponding Reddit thread is at http://www.reddit.com/r/programming/comments/qi9rd/musings_on_india_and_technology/.

There is one valid point - that we do compromise a lot when it comes to quality in India. As a product integrator, I spend a lot of time pulling in code from others. I do compromise a lot when it comes to the software delivered to me. It could schedule slips, shoddy documentation or just plain bad code. Yet, I take it all in with the hope that it will improve in time. Maybe I should stop doing that.

What I don't agree with Rocky is that there are *only* shoddy programmers in India because we compromise all the time. That's flat out wrong. There are some excellent programmers that I have worked with.

The flip side to compromising, is that I think India is *the* place for you support your customers. We can patch it, fix it, hack it, change it etc all in the goal of getting customers to production. I have seen this often. There is a different skill to getting software out of the door and shipping it to a customer. Its a very special skill to then get that software to integrate and work in the customer's stack.
Its one thing to write software that stands alone, but its a completely different thing to make it work with other peoples code. That's where the India brigade comes in.

Getting the software to work in a customer's world. While shoddy programmers in India will still struggle, the good ones will get that software to bend and work. If it means compromising on longer term quality to get a customer to production, so be it.

Sunday, February 19, 2012

Ubuntu Core - Alpha2 with both armel and armhf

I didn't expect it, but armhf seems to be part of ubuntu-core for precise. That's pretty surprising because I remembering seeing a number of packages that didn't build for armhf about a month back.

Nevertheless, its good if armhf and armel is part of ubuntu-core. The only question is whether we will get all the community supported packages on both or only Cannonical ones? I'm specifically interested in not running Unity and much rather have LXDE running. The only question is whether there will be LXDE armhf packages in addition to armel ones.

Sunday, February 05, 2012

Aquamacs vs. Emacs


Aquamacs does seem more natural than the standard Emacs.

I'm a new Mac user switching over from a PC and having emacs is a must. What Aquamacs does is make emacs more OSX oriented. While this can be confusing, especially if you are coming from Linux (like, I am) in general things seem ok.

The font is better for sure. More reviews to follow as I test things out.

Saturday, February 04, 2012

OSX Emacs Drag and Drop


By default, I find that drag and drop on OSX does not work in the same way that it would on Windows. On Windows, a new buffer is created. On OSX, the file is opened in the same buffer. Googling around gave me - http://stackoverflow.com/questions/1850292/emacs-23-1-and-mac-os-x-problem-with-files-drag-and-drop.

Adding the following text worked fine -

Sunday, December 18, 2011

An unscientific comparision of different tiling window managers

I was intrigued by tiling window managers and decided to try using them. If you don't know what they are, here's the wikipedia page - http://en.wikipedia.org/wiki/Tiling_window_manager

I spent Saturday installing and trying them on out on my ubuntu box. Since I run ubuntu on a virtual box, unity is very sluggish. I explored StumpWM, DWM, Bluetile and finally Awesome.

StumpWM

I started with StumpWM because I drawn by its implementation. Its implemented in Common Lisp and that was very interesting to me. It means we can change stuff around and they will instantly appear and be accessible.

DWM

DWM is the granddaddy of all Tiling Window Managers. Its the antithesis of StumpWM because nothing is configurable. You want to change something? Modify the code and rebuild it.

Bluetile

Bluetile is very user friendly. Its built on top of xmonad but the key difference is that unlike xmonad you don't have to install a full Haskell development environment. Configuration is limited to a few items only. 

Awesome

And finally Awesome. What can I say? Its really awesome! Highly configurable, with a number of layouts, themes and yet quite thin.

Implementation

  1. StumpWM - Common Lisp. This makes is very configurable and changes are instantaneous. Unfortunately you need to download and install a CL implementation and a couple of libraries.
  2. DWM - Straight up C. Less than 2000 lines of code. 
  3. Bluetile - Haskell. 
  4. Awesome - C and Lua. Lua makes configuration easy and that part of the Awesome if very well documented. 

Dynamic or Manual

  1. StumpWM - Manual. It means you need to place windows by yourself. After trying the others, I found this to be a little painful because the point of tiling is productivity. If you have to set things up yourself, then you lose that part.
  2. DWM - Dynamic.  It sets up the layout for you
  3. Bluetile - Dynamic with a couple of different layouts to choose from. Its also very easy to switch between the layouts
  4. Awesome - Dynamic with a number of different layouts and tiling algorithms. 

Conclusion

  1. StumpWM - I didn't like it that much unfortunately because placement is manual and it seems very "raw". Its very closely tied to Emacs and Screen philosophy and so even the prefix key by default is CTRL-T. The best part is that it uses CL and so, you can change things, add new commands/shortcuts without restarting stuff. The sky's the limit for the things you can do, but its elitist in the sense you need to understand common lisp to do that. Its not a problem for me but that may not appeal to everyone.
  2. DWM - Very minimal. As long as you don't fight the flow its great. Unfortunately, I had to read the code to understand what the different shortcut keys. I even uninstalled it because I didn't know how to start. Once I read the code, I found that dmenu is tied to Mod4 (Windows Key) + P, then things started to work. One funny thing though was that firefox didn't show up. Looks like it doesn't play nice with firefox and so, I suspect it will not play nice with other GUI driven applications
  3. Bluetile - Super easy to get started with. Sadly, there is not much configuration that you can and so, its more like a demo for tiling rather. Plays nice with gnome as well. I wanted to install xmonad once I saw it but didn't want to download and install a bunch of stuff that I wouldn't use. If you are a haskeller, then go to xmonad directly, There's even a configuration available to make it look like bluetile.
  4. Awesome - I found this to be the best. Awesome is a fork of dwm with the explicit idea of configuration.Tons of layouts and plus it understands and implements several Freedesktop standards. So, it plays nice with gnome and you get menu integration as well. Only part I didn't like was the name because it makes googling difficult. Its the only one in the list for which the first hit on Google isn't the windowing manager. I also found that resizing didn't work. I'm not sure why but didn't spend time on it. Googling also showed up another person complaining about the same thing but no solution.
So,  I liked Awesome in the end. Its newbie friendly. The only real grouse is that you can't google for it easily. Bluetile is also very nice. DWM and StumpWM is more tuned for the power users. I really like the small size of dwm and the dynamic configuration of stumpwm but those points in themselves don't sell.

Once you use tiling for windows, there's no going back. One note of caution though. Other than Awesome and DWM, the others don't work with lightdm's menu without tweaking on Ubuntu 11.10. In all cases, you lose the panel (unless you install it yourself and its no longer part of GNOME 3).

Friday, December 16, 2011

Get a working ubuntu armel system from ubuntu core

This uses qemu-arm to set things up in 10 simple steps

1. Download the latest rootfs from http://cdimage.ubuntu.com/ubuntu-core/daily/current/
2. sudo untar it into a directory say arm-rootfs
3. cd arm-rootfs
4. cp /usr/bin/qemu-static-arm usr/bin. This will run for every command
5. cp /etc/resolv.conf etc/. This is so that we can get network access
6.  for m in `echo 'sys dev proc'`; do sudo mount /$m ./$m -o bind; done
5. Now sudo chroot . /bin/bash
6. apt-get update
7. Now run all the commands you need to finish downloading and installing software.
8 In the end unmount all the bound points  - for m in `echo 'sys dev proc'`; do sudo umount ./$m; done
9. Create the a tar ball
10. Publish!

Tips from  http://omappedia.org/wiki/OMAP_Ubuntu_Core

Monday, November 28, 2011

OE vs Ubuntu ARM

As I spend more time looking into Ubuntu, I can't but help see the huge differences in philosophy. OE still seems very amateurish, very hobby oriented, while Ubuntu reminds me of IBM and processes. To contribute to OE, one sends a patch. To contribute to Ubuntu one needs to first read through their wiki and understand all the Business Process Jargon.

More later

Saturday, November 19, 2011

Rootstock makes it easy

Tried out rootstock yesterday. It really rocks. I have been using Openembedded at work for over a year now, but rootstock is quite different. OE follows the Gentoo philosophy where you start from scratch and build everything. Rootstock on the other hand just puts together a filesystem by downloading pre-built .debs from ubuntu.

On the whole, OE allows for more fine-grained control but for Rootstock seems to be much easier to use.

Tuesday, October 04, 2011

Quicklisp updated

Quicklisp has been updated - http://blog.quicklisp.org/2011/10/october-1-quicklisp-dist-update-now.html.

Time to run (ql:update-dist "quicklisp").


Monday, October 03, 2011

Installjammer - what does the future hold

Its been over a month now that InstallJammer is no longer in active development. Damon has copied the project over sourceforge and its new home is http://sourceforge.net/projects/installjammer/

I use IJ all the time and his support has been fantastic. After 10 years of development and support its time he took a break and did something else. Best of luck Damon!

Now, if someone can step in and carry it forward.

Wednesday, September 28, 2011

Language fads

R-Bloggers has a post about hipster programming languages where they talk about the emergence of Clojure, Scala and Coffeescript.

While I'm not really experienced in any one of them, I wonder about what's the venerable languages that these cool cats are missing. C is a must for the embedded system work that I do for sure and what is cool is often size reduction. In an environment where every byte counts and memory access is key, C remains king.

Now if we can get more lisp or scheme usage in the embedded world.

Tuesday, September 27, 2011

Latest version of tiny core linux available

Introduction to Tiny Core Linux

Tiny Core Linux is minimal linux distribution. It's really small and comes in 3 flavors

  1. Core - which the base system
  2. Tiny Core - Core + FLTK based desktop
  3. Core Plus - Tiny Core + a lot more

The interesting this is that there are ARMs download as well i.e for RaspberryPi (ARMv6) and AllWinner A10 (ARMv7).

Download Tiny Core Linux

Pick it from http://distro.ibiblio.org/tinycorelinux/downloads.html. The latest release is 5.1 (as of Nov 28, 2013) and details are in the announcement at http://forum.tinycorelinux.net/index.php?topic=16293.0

Friday, June 24, 2011

Introducing Playground Scheme

So, I've forked Tinyscheme. I have Playground Scheme setup Github - https://github.com/shortsightedsid/playground

So far the changes have been with regards to cleanup only.
  • Lots of Whitespace and formatting changes. Tinyscheme has varying whitespace and so its quite difficult to read
  • Directory Structure changes.




Tuesday, July 06, 2010

Creating PDF files from Common Lisp

The CL-PDF library allows you to create PDF files directly from common lisp. The easiest way to use cl-pdf (or for that matter many other libraries) is to download and install LibCL. CL-PDF comes with LibCL and makes the installation a snap.

I have a hello world pdf program written.
Just run this and it will generate a PDF with a big Hello World!

Monday, July 05, 2010

SICP on the iPAD

SICP in ePub format

If you want to read SICP (and you should!), on the iPad, then you are in luck. The digital format is old school HTML pages generated from texinfo. While there is nothing wrong in that format per-se, it just doesn't allow you read this wonderful book on an iPad (or another other tablet for that matter).

iBooks uses ePub as the ebook format. Just download SICP in ePub format from here (Ian Eure's git tree), add it to your iTunes library and sync. That's it. 

The link shared above is a git tree on github and it's always nice to fork and fix any issues that you find. The actual download link is also present on the github project.

SICP on other devices

If you have a Kindle, then Jonathan Patt's sicp-kindle git tree on github is the place to go. I don't know much about Kindle (don't have one), and instructions are from http://irreal.org/blog/?p=274

PDF version

Finally, there is always the PDF version that you can download from http://sicpebook.files.wordpress.com/2012/11/sicp.pdf

Paperback Edition of the SICP

Of course, another option is to get the dead wood edition from MIT press directly - http://mitpress.mit.edu/books/structure-and-interpretation-computer-programs. Then again, having a paperback or hardcover is nice if you have a personal library shelf. I learnt that this can be a pain esp. when moving/changing houses because you will need to pack everything up and unpack them once you are in your new place.

Sunday, April 25, 2010

The smallest h264 encoder

Nice post on the smallest h264 encoder. Obviously it doesn't really do anything other than just add the right NAL header information.

Thursday, April 01, 2010

Cross compiling TCL for ARM

Refer http://objectmix.com/tcl/15449-how-cross-compile-tcl8-4-tk8-4-arm-linux.html

Also change the Makefile. Replace "./tclsh" with "tclsh". That way we run the build system's tclsh to install rather than the freshly built tclsh.

Sunday, January 31, 2010

Thinlisp

Came across Thinlisp today while browsing cliki. Sounds interesting - develop in CL and then deploy in C. Its similar to ECL in the way of using C as a bridge but in reality its completely different. ECL is a CL implementation that uses C as a compiler. Thereby you can generate very small and very efficient standalone executables.

Thinlisp on the other hand, is supposed to work on any CL implementation. It uses CL to generate C. It works with a subset of lisp and doesn't support any garbage collection. I had a look at it today, its pretty old. The code looks like its been abandoned by Gensym. Nevertheless, I decided to give a try. Will post results as I get going it with, but I do expect some amount of bit-rot. Vladimir Sedach seems to have hacked at it a few years back, and has posted tarball. That would be my starting point.

Saturday, January 16, 2010

functions in plists

Common Lisp Plists are easy. A plist is just a list with properties. Any element with ":" prefixed is a property. The next element to a property is its value. We can then manipulate the plist using functions such as getf and setf. We give the property name to getf/setf and they fetch/set the appropriate property.

Here's a simple plist
'(:name "sid" :language "lisp")

Now, if we want to put in a function in the plist as a value, then the quote will not work.
'(:name "hello" :function (lambda () (format t "Hello World~%"))) ; Bad

The correct way is to backquote the plist and comma-escape the lambda.
`(:name "hello" :function ,(lambda () (format t "Hello World~%"))) 


We can then extract the function using getf and then finally call it using funcall. If we want to use an existing function, then we need to not only comma-escape but also add a #' so that the reader knows that a function symbol follows.

In C the equivalent would be to have a struct with a function pointer. What makes Lisp cool is that
  1. You can define an anonymous function in the plist itself
  2. You can have functions with different arity, inputs etc.. all in a list of plists. Lisp won't complain, but in C, the function pointer needs to be function of a particular signature only.
  3. Lisp also allows you to define structs which are more powerful than just plists, but a plist is good enough for this example.