Welcome to www.tattvum.com !
Simplify. Automate.

Arduino? Good. Then?

posted 5 Aug 2010, 03:35 by S V Ramu   [ updated 15 Aug 2010, 02:14 ]

At last, after an year of drooling, confusion, latter some desperation, and then some desperado, I'm into micro-controllers now! Arduino to be precise, and Atmel's  if you want the heart of it. Come to think of it, one year is pretty quick in my time scale of learning new stuff. I have languished far longer to learn some other things. All the same, the journey has just began, and miles to go before I can be an happy camper in the embedded electronic world. 

Oh yea, I sure don't know why I tread this new long path of micro-controllers now (mid-life crisis? but then I have had one 'crisis' after another all my life), and surely not sure how much focus I'm willing to give it. Did I knew that, when I was a toddler (young at 20) doing Fibonacci series with BASIC? Nah! It never seem to change, you scratch an itch, that leads to something, then something, then you just wonder how you have been with out. I'm quite sure it will not lock out my other interests (it is bit scary you know?! I think about circuits, motors, in the middle of the night).

I'll grow over it, just a new wife, will mellow. I still love Software (pays me) and Math (entertains me), and I expect electronics to be somewhere between that range. 

How it all started

It was early last year, when the surprisingly genial 
 popped out of blue, who coaxed me (well, I was already seeking a distraction from java) to help with some C coding (not even C++) for some embedded project he was doing with his colleagues (thus got to know, tele faceless, all the same good friend Vimalendra). It was some Client-Server code, so I dusted my C, pointers (ouch), and took care of the software part alone. Hardware used by his team was weird for my soft brain. iMote. I figured out that it is some wireless popular board, but that is about it on the hardware side. Anyway the association went interesting, as I glimpsed the challenge of VoIP, in all its toughness (latency is the key enemy). I must write about it separately sometimes. 

In a lull moment, when the above project was over (just a week, but it looked like eons), I was kind of embarrassed that I know nothing about this iMote. Then, as you know with internet searches, the inner-you comes into play, and shapes your search. Was iMote costly?! And even all others in that league were costly. So how does a old Java guy like me color a search? I searched for "open hardware", and soon I was listening to the deafening praise of Arduino, from everywhere. 

Enter Arduino

Arduino is cool. The then $50 pricing (or was it?) by itself was luring for me (now has gone to $35). What added to my surprise was, long long time back, a distant cousin of mine, who is into embedded systems, commented, that the embedded programming requires costly hardware, as you need to use UV to burn some EPROM. My stingy brain stopped its dream right there. I specialize in the art of 'pay no money to learn'. And why do I love Open Source? Its a free lunch (ok beer) stupid, and hence the party. 

So when I saw this $50 tag on a true blood micro-controller development board, I was desperate to get it. More searches, and found that it is lot cheaper (Rs.1200) in India somewhere north, if you sacrifice some elegance and some comforts. Can I? Oh sure. Now the greed took over.. how low can the board cost? Give up USB support (requires FTDI chip), in exchange for serial port (MAX232 will do), you slash Rs.500-700. Wow, and trade ATMega168 to its less endowed sibling ATMega 8, you can shave another 50 Indian rupiah. Well where can I get it, I want it somewhere nearby in my city (ok ok my village), I have no intention of travelling on some pilgrimage to just get this. I was in fact prepared to make the board from scratch (naive fool's dare).

When I searched for "arduino chennai", then I saw Simple Lab's workshop post in some forum. But I was already in mood to go low tech.

Going back in time and friendship for help

Looks like this electronic itch is nothing new for me. I found that my old comrade Senthil has already bought me a full shebang of starter kit for me, and that too some 5-10 years back! Breadboard, wires, led, preset-potentiometers, some transistors, a neat desktop power supply with variable voltage, even a manual multimeter. Man, isn't it true, that "You see it when you believe it". All this was with me all along, and I never even glimpsed it. 

It all came back to my mind in a flood. Long long time back, he used to show his "Disco light", with just LED, Transistor, Diode, Capacitor and Resistor, a pair of each. Give some regulated low volt power to it, and the two LED started blinking alternatively. Why?! There ended my whole quest for electronics. Many years latter I learnt this "disco" was one of the famed pinnacle of analog electronic physics (called oscillators). Everywhere I looked I only saw differential equation nightmare. Of course I love math, but it is one thing to know what calculus is, and it is another to live and breath it. Now I know, that for a software guy like me, analogue electronics is a whole new world. I took the burning stick from the wrong end and threw it with shock. 

What was the 'right' end then? Embedded system. It is all software, but you use little of electronics to connect with the hard world. That was the luring dose for me. Bits and bytes don't scare me, but voltage do. So what I see in Arduino was the necessary graded ramp into the world of electronics, and hopefully robotics (ok don't laugh).  

The failed first step

So, wide-eyed, I vowed to make my Arduino myself, from scratch. Convinced Senthil to buy me the ATMega, max232, the capacitors, parallel post female plug. I'm going to make it and program it with parallel port, nothing less. Oh I'm also going to solder it myself, so I bought a cheap soldering iron, I checked with him to give me a short quick course on soldering (he he). BTW, while I'm at it, let me also make the purchase as economical as it can be be. So there I was in famed geek town called Ritche street, with Senthil. Stupid, and naive I might be, but you cannot blame me for diligence. I researched each part of the schematics and component on Internet for 3-4 months. 

So what happened then? I had mistakenly bought ATMega16 with 40 pins, instead of the intended 28 pin DIP version of ATMega168. Just missed that last 8, but that gave me dozen extra pins to scratch my head with. I also realized that solder does not stick even if I ram the rod inside the board (my condescending well wishers and so many youtube videos latter clarified, that you should not put your lead solder on the iron, but on the pin, and pray - yet to try). My IC on breadboard jumped out, as I didn't push it enough, in the fear of harming the pins. And that max232 chip with some four capacitors, just confused me to no end. 

So what of it all? The 40 pin is now sleeping in my box, awaiting resurrection or a decent burial. It just reminded me of my school lab session on Vernier Calipers (VC). Some good teacher corrected me, that with VC, you cannot write the results with ending 3rd decimal zero, as that is pseudo precision. When the instrument itself is capable of only measuring 2 decimal places of a milli meter, adding a 3rd zero is a falsity. If you are new to a subject, more planning will not lead you to a flying start, it will just make your failure a glorious one. Well, it was so for me, but that was an essential slap to be more focused on incremental improvements. Also, I did learn a good deal of theory, though it burned me some 400 Indian bucks in the process. 

Seeing light at the end of the breadboard

So I renewed my link with Prakash of Simple Labs, whom I found while searching for Arduino in Chennai. Last year, he sold me a cute serial ATMega8 board for Rs.490. Man, was I happy when I saw those blinken' LEDs!! 

After all this hunt, this was ecstasy for me. Here I can just hook up the professional board to the serial board, install software, write and send code over wire to the little chip out there, and the lights blink as I dictated (oh yea a couple blew up). This was inexplicably satisfying for me and novel. As a software professional, I always deal in abstract. Yea there is this GUI, but it is all virtual. The software GUI sure gets the job done, but all it can crank up is more information. The sweet hard world outside the software purview is blissfully untouched. Now, that can all change. I can break and confuse even the hardware. With micro-controllers, I'm one with the world. My software has a reality, good or evil as I choose, and good or bad as I'm capable of. This kind of completes a loop for me. I remember proudly saying my erstwhile employer, during an interview, that I want to Simplify and Automate everything. Young, and fresh from coding 1000 lines, that was
. But after millions of lines of code, and rewrites, unachievable deadlines, missed customer requirement, I painfully realize how fragile the code can be, how little its reach in solving the real world problems is. 

Oh yes, my electronics cannot cure the world of poverty. But I'm sure a happy man, and I'm hooked to know more. And you know what, I made the blinking 'Disco' light again, now with Arduino. Also not just two LEDs, but three, and all permutations of it. I'm still no wiser on oscillators, or differential equations, but there it was the 3 blinking LEDs, in complex patterns, as I wrote in code. 

Then the lull

I hardly learn from mistakes. So what I do after this milestone of making LED blink? I made more LEDs to blink. And more. For a whole year, my new arduino, did nothing, dusty, and once in a while powered some LED. Why? I was researching on motors, parallel programmers. Oh yes, the same old parallel programmers. I still wanted to build the arduino on a bread board. There were some quite descriptive pages on that, but I never came close, as I still have to put the bootloader into a fresh ATMega, and for that I need a parallel programmer, which I did build (taking 2 hours, and countless youtube videos, to solder 6 resistors with the pin and wires), but which doesn't seem to be working. Stuck again.

So what do you do when you are stuck? I dream on. I told Senthil I want to make a full project. Saw my son's new Rubik's cube, so I said, it would be cute to build a Cube Solver. I was so happy about the idea's novelty. When checked, looks like every man and his dog, do Rubik's cube solver as their "I've arrived" project. Well rediscovery is nothing new to me, it is in fact a kind of mark of fitness. So there I go tap tap and do the only thing I know, code the logic. In Arduino you can write C++ and call it as a header file. Neat, so there was the code, and I tested it with 20 random virtual turns, which it solves with 200-300 moves (tested over 100,000 trials). 300? Well that will take eons with a crude machine, and I'll have no audience. So I learnt the god's algorithm and the lore, and it seems you can solve with 21 moves max practically, if you do some nifty algorithm. Well, well, all this software is fine, where is the hardware? You are building an electronic project or the same old abstract software stuff? But for that I need motors, I need to bend metals to hold the cube...

In one dingy cafe corner, Senthil rubbed it in "you'll take 6 months to know motors". Truth is more painful. Yes, I was going nowhere. 

The workshop and the grant

So again back to Prakash, and a helper stint in a workshop one weekend, my gloom has given way a bit. All lessons learnt? I wish life is that simple. Collecting my pieces, but thanks to Simple Labs, I can now light up an LCD, show the room temperature. A small consolation. 

Oh yea I dream more now (does it ever stop?). How about a color sensor based Master mind game? Oh yea, as usual others have done it already, but still a worthy goal. And I want my motors. Motors are scary because it needs extra things like controllers, else my board can burn (no never), and motors ain't cheap. But for all things moving, motors are the key movers.  

So, people who can, do it; who cannot, will teach; and who cannot even do that, will write about it. And here I'm story telling, what I know best. Go man, stop whining, fire some motors, blend the software cloud with arduino, make some net connected gadget... (dream on).

Equalities with Sums of Powers

posted 19 Dec 2009, 06:11 by S V Ramu   [ updated 19 Dec 2009, 06:17 ]


In my previous birth I aspired to be a mathematician (but in a previous.previous birth, I wanted to be an artist... that is a different story. And in previous.previous.previous...)

Of many 'secret formulas'  that I found at that time, one simple and beautiful one continues to make me smile. Having seen enough rediscoveries first hand, I share this more for the joy. But if you do find in some place that they have posted some million dollar prize for this, do alert me (I'll give you a cut). Now a teaser...

+ 4 + 6 + 7 + 10 + 11 + 13 + 16 + 18 + 19 + 21 + 24 + 25 + 28 + 30 + 31
+ 3 + 5 + 8 + 9 + 12 + 14 + 15 + 17 + 20 + 22 + 23 + 26 + 27 + 29 + 32

Did that catch your interest?! No big deal? Oh yeah, you can always find two sets of numbers whose sum is equal. But two equal sized sets of positive integers should get some marks for "cuteness" right? No? At least, note that together it is all the numbers from 1-32, 16 in each set, none repeated! Come on, that should surely raise some tingles from the mathematician in you! Nope? Well, no worries, more surprises up the sleeves...

12 + 4+ 62 + 72 + 102 + 112 + 132 + 162 + 182 + 192 + 212 + 242 + 252 + 282 + 302  + 312 
22 + 32 + 52 + 82 + 92 + 122 + 142 + 152 + 172 + 202 + 222 + 232 + 262 + 272 + 292 + 322

Ah that SHOULD stump you! See the beauty. Same set of 32 sequential numbers split into two sets, each squared, summed, and the answer is same. I cannot stop starring at it for hours together. To preach the convert, here is more...

13 + 4+ 63 + 73 + 103 + 113 + 133 + 163 + 183 + 193 + 21+ 243 + 253 + 283 + 303  + 313 
23 + 33 + 53 + 83 + 93 + 123 + 143 + 153 + 173 + 203 + 223 + 233 + 263 + 273 + 293 + 323

Now, even a math doctor out there should see this as a gem. The same two sets of positive integers, when summed together remains equal, even when you square and cube it! I have missed many a nights just seeing this elegance. 


OK, let me cut the hype and go for some history, and oh yeah the derivation and proof. 

The above equation is not a one-off case. It is a cute sample of a general rule, which I stumbled upon when trying (dreaming maybe) to solve an OR (Operation Research) Problem. The problem is: If you are given n books, and asked to arrange it into two stacks, so that the stack height difference is minimal, is there an algorithm that will work always? Looks like this is a NP-complete problem, that is, any know algorithm will take exponentially longer times, as you increase the number of books. Well, I didn't solve this problem (Of course, if I had, I would not be here writing articles on some old number tricks).

But what happened was, while trying to test with easy book thickness, say integers, the above patterns came. Staring point is...

1  2
4  3

That is simple stack right? Surely no big deal for the OR goal, but you can see the direction...

+ 4  =  2 + 3

In general,

(a + d1) + (a + d4)  =  (a + d2) + (a + d3)
if,  d1 + d4  =  d2 + d3

This is kind of obvious from above. The key is a's quietly gets cancelled. On the first sight, this a should 'almost' go away even if you square each. 

(a + d1)2 + (a + d4)2   ----   (a + d2)2 + (a + d3)2
So,  d12 + d42 + 2a(d1 + d4)  ----   d22 + d32 + 2a(d2 + d3)
But from above equation in d's,  d12 + d42   ----   d22 + d32

Whatever this inequality be, it is independent of the 'a'. So if we have proper d's as above, then even squares of them will differ, so if you flip that same d's squares, but with a different starting a, then the total sum should be same for both stacks. 

(a + d1) + (a + d4) + (b + d2) + (b + d3)  =  (a + d2) + (a + d3) + (b + d1) + (b + d4)
(a + d1)2 + (a + d4)2 + (b + d2)2 + (b + d3)2  =  (a + d2)2 + (a + d3)2 + (b + d1)2 + (b + d4)2

This is neat, and looks like this can be generalized to higher powers. before that some examples...

+ 4  =  2 + 3
12 + 42  ----  22 + 3

The difference is 4 and similarly for a different a, but same d's

10 + 13  =  11 + 12
102 + 132  ----  112 + 12

The Pattern

Instead of going more rigorous, we can see the pattern is:

A  | V  |2  VA  |3  VAAV  |4  VAAV AVVA  |5

Here say, if A = 14 - 23 then V = 23 - 14, is the reverse. Attaching a ruby script (SumOfPowersEqualities.rb) for generating this logic. You can direct the std out to a html file (say ruby SumOfPowersEqualities.rb > soap.html).

My Ubuntu

posted 3 Jul 2009, 21:42 by S V Ramu   [ updated 5 Jul 2009, 00:07 ]

I'm on Ubuntu for more than 6 months now! Trivial eh? For me it was a long sweet road, with sweeter prize at the end. Consciously I tried to avoid writing about it prematurely, since I have many time installed linux, only to frustratingly move away back to old windows. This time I started with 8.10 (some how 8.04 attempt failed) as it was released, and even upgraded online to 9.04 without any permanent damage!

Once you stick, Linux grows on you. Off late, I even feel that a strange new OS is becoming more popular than Ubuntu, on other people's PC: Windows. No exaggeration, but I'm so much at home with ubuntu, that even the old monopoly look alien and unatural. Strangely I'm proud that I can feel so close to linux, more so after almost 5-10 years of earnest attempts.

Move to open cross platform tools : Step 1

Sometime back I realized with a shock that migrating to Linux can happen only after I migrate all my applications. Obvious now, but at that time, it was a shock to be forced to accept so much change in the day-to-day habits just for the vanity of moving to a then less usable and less popular platform.


I distinctly remember settling into firefox 0.8 some half a decade before (2004). Before that, I dabbled with the then shiny new (yet already down played) Netscape 6, recognizing that browser addiction is a tough part of the migration. That is when I heard of the new and light-weight software whose name (Phoenix) was in debate. So, I know this baby from when it was named, and I have seen it only growing. Though my attempts with the early 0.6 was not pleasant, I sure have trusted and lumbered on. Now more options are coming, and yet the old choice is still looking good and seriously competing, but more importantly the innovations at Mozilla is seemingly much faster and deeper now (thanks to Chrome?). Ubiquity, Weave, Snowl, Prism, Jetpack, Bespin, Personas, <video>, @font-face,...  man! is the list growing? Anyway, web is lot more interesting now with Google Wave, Cloud, and lot more, but that is a different story.


Migration out of Outlook Express was much more painful for me. Thunderbird was simply not comfortable at that time. After much pain I moved to Mozilla suite. Initially my Internet bandwidth was around 3K/sec (Hutch GPRS over 6610), and the obscure download progress indicator in mozilla mail client was confusing. Soon Thunderbird (TB) took over and I never seriously tried SeaMonkey. I remember the sense of relief when TB introduced global inbox (relatively simple things, but all matters when breaking a habit). The loss of Mozilla suite was mainly in loosing Composer, which was latter compensated by Nvu, and then again by Kompozer. Now, after seeing GMail offline, surely a heavy mail client looks silly. Fortunately there is Snowl (though some of my earlier queries to forums were discouraging), though not fully usable yet. With this, Google Docs is mostly replacing my composer needs (many time TB's new mail editor), more so with spell checkers (and surely we need a standard open editor alternative for the possible Google 'Hegemony').


Then I needed an open, cross-platform spreadsheet app. For many, MS Office is one another serious lock-in into windows. Thank fully the curiously named OpenOffice.org (I remember using the StarOffice 5.2 before) came out, and even Abiword (thus Eric Sink led me to Joel and onwards to developer to entrepreneur inspiration). I was not a serious presentation user then, and when recently Google gave the online version, it was just only right time for me. All I needed was a simple spreadsheet (I'm not into serious macros or VBA). Again off late, browser looks like a decent candidate for being the whole office app (the recent openoffice efforts is not keeping nimbleness seriously in the agenda). One good thing that has come out is ODF, which is now an ISO standard (so is OpenXML, but ODF is relatively more popular), and thus format lock-in of MS is seriously dented.


I worshiped Slava Pestov, and used his jEdit it for long time till its end. I discovered jEdit somewhere in its 3.x version. My initial dowload had a serious copy paste performance problem, and maybe I settled for some early 4.x.

"At this time we were using jEdit text editor. But we were following it from its pre 3.0 stage (at that time it had a nasty bug with copy-paste). jEdit has this nice feature of presenting just the editor for you, and putting all other functionality behind. Being in Java it was inherently slower than TextPad and others, but provided all those functionality in an unbelievable open design. Any new extraneous functionality was a plugin jar, all to itself, but amazingly working together with the rest of the application."

- old article

At that time there was good competition between Jext and Jedit. But around same time, both projects were abandoned when Netbeans 4.0 came about under the heat of Eclipse 3.1 (I remember seeing eclipse as a proprietary company when I was researching jedit, and decided against it, that it is too big and closed). Even Romain Guy of Jext moved over to Sun/Netbeans (and then to Google) and that is when I eyed netbeans too and eventually switching to it.

Java and other things...

After the hard nuts were broken, the other tools like GIMP, MinGW, and GnuWin32, were natural but not ultra important for the eventual migration. Of course Java was a big part of this migration. Sometime back when I switched from Delphi 3 to Java 1.2, and gleefully saw that the same jEdit jar file worked when drag and dropped from Windows to Linux through Samba (It was Red Hat before Fedora and before RHEL then) that I was convinced of Java's WORA.


When all things looked set and ready for my complete Linux embrace, I was using IBM Sametime chat client in my day job. Now I have to migrate from this, and that too convince all who I work with. Fortunately there was Gaim, which was a nice open source, cross-platform, multi-protocol chat client. After some search, and even some buggy early versions, settled on the sametime plugin (now merged with the main release). Going forward, we even installed our own Jive jabber server, and XMPP was a natural protocol for Pidgin. Anyway, as with all things, the browser replaced this too. When my company migrated to Google Apps, the all-in-browser google chat client simply ridiculed any heavy desktop client.

Make the move : Step 2

Even while transitioning the tools to its open cross-platform alternatives, I constantly tried to install the linux itself. Alas, not every developer is system savy. They know code, and algorithms, and of course the computer box, but if they are like me, they will not dare open the PC, or debug windows installation. My theory is, it is not just fear, else it won't be so prevalent, but more to do with hardware cost (what if I break a board or chip?), and more importantly the bad example set by Microsoft in not having enough documents for the system internals.


So, when an linux installation ask me to 'partition' the HDD while installing, that just scares me off. So, many of my tries till 2006 was either mirred by my incomplete (pidgin was the last) tools transition, or my ignorance to the OS installation jargons (primary HDD, IDE, MBR), and that was too much. If even a new machine (so first you need another machine) installation was discomforting, dual boot was literally scary (what if I loose my data). Thus began my minimal education to understand the OS installation, boot model. But all was theoretical and I never dared to test it out.


Then I noticed Ubuntu 6.06 (Dapper Drake). I think this is the first Ubuntu I installed, but had problems. It remained in my other machine, but rarely used. I think somewhere then ubuntu made ext3 as its default file system. The key thing was it was a journaling file system, which means "Such file systems are less likely to become corrupted in the event of power failure or system crash". The first time I saw an ext2 FS going dead on power failures, that gave me shivers, but ext3 made it easy. 

Automatic network configuration

After ext3, my problem was internet. At that time, though there were windows software to setup driver, linux had to fend for itself, and that it did poorly. Only recently with 8.10 it had automatic network management. Before that I somehow scrambled to read and setup PPoE for my modem, but it was not so easy, and that made me uncomfortable, as I was already living most of my professional life in internet.


With internet under control, it was all there. Almost. USB hot swap gave new fears. What if I need to dump our digital camera content? What about other hardware compatibility like USB blootooth dongle? That gave a pause, but some ubuntu 8.x solved that like a magic. Does Linus read my mind?! Basically linux kernel, and the distributions were focusing an the low hanging fruits: Drivers and device utilities. That was good for me.


About this time, I saw Compiz, and that was too much of an eye candy to miss. But I was unable to convince myself to shell out more money for a graphics card, just for this eye candy. I have been an utilitarian all along. But an accidental testing of Nvidia card, thanks to my system service person, convinced me of linux power. When windows 2000 could not use that card's driver, ubuntu 8.04 worked like magic (almost out of box).

Unsupported Windows 2000

And all along, my windows 2000 was threatening to abandon me. I owed not to move to XP, lest I'm lured. But when successively, Google Lively (now dead), Google Chrome (then no linux either), announced no support for its software in Win2K, that made me think. Win2K is dying. I remember moving to it from W95 long back, being ignorant. When VirtualBox too shunned win2k, it was clear that this is a dead end, as I cannot test any new software, even in a sandboxed simulated environments.


So when Ubuntu 8.10 Intrepid Ibex came along, I ran out of all excuses. But frankly installation was still painful before this. So I have been watching the progress of Wubi. And that being included natively in 8.10 changed it all. Like any windows software, here I'm installing ubuntu linux inside windows, yet all my hardware, network, is identified smoothly. I went with this linux-inside-windows version for many months, before long I was feeling embarrassed being unable to go free of windows.


Then dared to use LVPM. Like copying a folder, it copied my whole linux and I was ready to go... Alas not so easy. I did a safe thing, had two HDD. So while using LVPM I moved the linux to other free HDD, and in my bios, made that the primary HDD (Hard Disk Drive), and tried booting up. Nope. Fortunately when I switched back my HDD, all was fine with windows. Now more study of GRUB, and I dared to edit the sacred menu.lst! But before this attempt, I remember once installing it in the same windows hard disk by mistake, and I was locked out of even windows. Was that very scary! Some reasoning made me think of my old 7.10 ship it cd, booted up, hunted for MBR reseting linux tool, some USB mangling, and reset MBR... whew back to windows. So this second time when I have linux in the separate HDD, I was calm and collected. menu.lst edit did the trick, I was straight into ubuntu, in the same machine, with just a change in BIOS. Windows away in the separate HDD, at last.


I'm a ubuntu man now fully. Slowly and slowly, I never logged into windows, but for IE. And then I installed VirtualBox with Windows XP, and there I was inside Linux, with even the shiny Chrome and IE8! Ironical twist of role. For some reason I was never comfortable with Ie4linux over Wine, and this virtualBox eased that pain.


Though there was GIMP, the simple MS Paint feature of transparent selection mode, was so important for my Wink patch activity (while on it, also learn some hidden tricks). I did learn some GIMP tricks to do most of it, but was never comfortable. If only I can have MS Paint equivalent... Why equivalent, I can have the real thing. Wine allowed me to run MS Paint exe/dll directly on linux (legality not too clear). Amazing. Almost a similar feeling like seeing Java WORA, but a different technology (API level emulation). For some reason, this made all my pains worth it. I'm now in linux proper and whats more I have all my windows goodies with me. Even Google Sketchup 7 executable installed smooth on wine! I'm in cloud nine.

Half yearly OS upgrade

My final test was, to upgrade to next version of the OS. 9.04 came. So many alphas, it looked like eons, and I desperately wanted to see the upgrade (It also had OO.0 3 and FF 3). Finally, being unable to wait for the final release, I upgraded to 9.04 RC2. Some hiccups, some retries, some personal cursing, whew now in 9.04. And when the final came, only very few packages got upgraded. So here I'm not only established in linux, but even survived an upgrade. Nothing else can be more satisfying. Now I can write this article with confidence. This is my ubuntu, my linux, and it is here to stay with me.

Taste linux, and you'll just love it.

Home Page - 2009-02-14

posted 14 Feb 2009, 00:31 by S V Ramu   [ updated 14 Feb 2009, 00:40 ]

Object Oriented Build Management [Read this article]

Have you ever wondered how a build tool can make big impact to the way we code and deliver? If you have then this is where you will find your answers, if you have not, you will get more questions and some answers to them as well! This article will explain about some of subtle aspects of build management using Maven tool drawing parallel to various object oriented concepts that we are familiar with and how that can be applied to build management. Here we will also see how migrating to an build using maven can help the project in making the development a lot easier, to have a better Java code management and how it aids in getting it to the new level in configuration management.

...So the concept is to have these extra meaning (only those which may not vary too much from project to project) built in to the configuration management system, apart from creating sub-projects. This conventions to tag the semantics of the files could be denoted by its root folder name (src/main/java) or a special file (POM file) inside a folder denoting a special meaning (say that it is group, or a parent POM). This makes it more object-oriented and easy to separate them and have an appropriate root folder structure for the same.

This article brings in another perspective of applying object oriented principles to build management using Maven 2. In summary, we saw about how it helps in code health, configuration management restructuring and libraries management to our advantage, and all of these with our 'sub-project' thinking. It does not cover various nitty-gritty of 'how' each of them can be done using Maven...

Home Page - 2007-12-22

posted 28 Nov 2008, 20:29 by S V Ramu   [ updated 29 Nov 2008, 04:15 ]

What is Balance? [Read this article]

Recently I floated in a 12ft deep swimming pool for an hour! This was my first time ever and I'm 34 years of age. No huffing and puffing, no extra inborn lung/body capacity, and yet there I was, and even the hand leg movements is just to relax and not to float. Don't believe me? Or maybe you believe this, and also assume that I'm kind of a mystic who can walk on water!? Of course probably not the second, but that is the kind of extreme stance we take when we encounter an balance act. If something is fantastic, either it has to be impossible practically, or it is some awesome mystery. Maybe there is another uninteresting option, that of meticulous practice: Kind of go daily to the field, slog it out, practice all day, and slowly you become a master. So anything fantastic is either one of these 3 options: Impossible, Mysterious, or Boring. Right? So not worth trying for? Now all ye non-swimmers, and even swimmers who cannot do the above, how do you see it? I can assure you I really did this (call me, I can show you), I'm no born swimmer, and finally this does not take years of boring practice (in fact I feel I can teach this to anybody interested, in under 10 minutes).

Ah! There you see it, it is kind of a trick. Right? The 4th reason for anything fantastic is a secret trick? Maybe there is a 5th reason then.

...Programing is not natural. If you consider basic global variable based programming, all you need are only 4 concepts: Maybe statements (assignment and expression), Variables, Loops, Branch. This is the complete set for even full mastery, and you might take say 1-2 hours to explain all in detail with an example. And yet the newbie cannot program even simple "Add all numbers below N" like non-trivial 3-liners. So what is the problem? Teaching methods? Maybe a programing gene?! Nope. The confidence to be able to break any logical problem into a program is also a 'Balance'. Why a balance, why not just term it as a knowledge? As we saw, not all all knowledge is a balance. Memorizing is not a Balance. You don't forget programming if you have not learned to do it once. It does not come really incrementally but only in snaps.

Home Page - 2005-09-27

posted 28 Nov 2008, 20:28 by S V Ramu   [ updated 29 Nov 2008, 04:13 ]

AJAX Nirvana [Read this article]

...Ok now for how to use Ajax. Let us go to the extreme and see. Every time I read about ajax it is only about some aspect of of the GUI being enhanced by Ajax. Like some suggesting edit boxes, some nifty validations etc. But what is the maximum that ajax can do to the Web GUI? Can we totally change the way we create web GUI?

Think of that...! The server data model being same, and the whole GUI being developed in various ways. If CSS changed the way we skin the look and feel (colors, fonts, images, and layout) of the web application, this Ajax, and the consequent standaloneness allows even the interactions and the behavior to be skinnable...

Every time I hear about the issues of Ajax, it is about it not allowing a website like usage patterns. Like, no proper back button handling, no bookmarkability, complexity of JS coding etc. But have they all ever known what it takes to build a serious desktop client with VB, Delphi or Java? Remember Ajax is used for building web applications, not web sites of static pages. And that means all the complexity and issues of an application will be true for it. And who said that a web application should be like a web site!?

Home Page - 2005-04-15

posted 28 Nov 2008, 20:27 by S V Ramu   [ updated 5 Jul 2009, 00:18 ]

What to Test? [Read this article]

JUnit, beyond doubt is a remarkable paradigm. Yes, not a small and almost trivial piece of code, but a way to think about testing itself. What is testing after all? Testing is just asserting your expectations! And that is just what JUnit does. It just calls/uses the code to be tested, and asserts if the return value and the expected value matches as we expect. This much is clear. And hence the apt quote from JUnit.org,

Never in the field of software development was so much owed by so many to so few lines of code.
Martin Fowler

...And hence comes the revelation, that the Unit Tests and the Mock Objects, both are mocks. Where Mock Objects mocks the Library, Unit Tests mock the client! So what to test? Mock the clients! That is, create a dream client that will use your component fully, and assert. By the way, this also sheds light on using asserts. Use asserts profusely in your component! Because after all, every component that uses its dependencies, act as a Unit Test for them, as a Mock Client. Maybe assert can merit more exploration in the DBC direction, but it seems its nexus with testing is clear.

Home Page - 2004-04-25

posted 28 Nov 2008, 20:26 by S V Ramu   [ updated 5 Jul 2009, 00:22 ]

AOP, Proxy, and Metadata [Read this article]

AOP in its basic spirit, can be realized if you understand the nice capabilities that are possible when we can intercept any method call, or other joinpoints. Of course, understanding this way, will not teach you the various idioms in decomposing an application into aspects. That is an art (at least for now). It is like saying, that by knowing inheritance or polymorphism, conjuring the need for design patterns is not trivial at all. But that does not mean that the basic techniques are any different. It is only that knowing the tools of the trade doesn't make you a good craftsman. Knowing to play flute will not necessarily make you a musician.

My assumption all along, was that to intercept method calls, you need an AOP tool... Then I stumbled upon java.lang.reflect.Proxy. I now remember seeing it before, but have never thought of it to be useful, at least for my daily needs. The amazing thing is, it is there from J2SE 1.3...

...Without Annotation, we have to use naming conventions, or the method signature. Now we can elegantly do that with Annotation (or Metadata).

 Why Calculus? [Read this renamed article]

The title of this article was originally published as Volume of Sphere & Calculus. But in all its internal drafts it was provocatively called as Why Calculus? In fact, it was written mainly to understand the reasons for the existance of the math disicpline called Calculus. So after some insistance from Ganesh, the title was reverted back to its old glory. Incidently, the URL was all along having this old name, hence no change in the URL.

Home Page - 2003-11-22

posted 28 Nov 2008, 20:23 by S V Ramu   [ updated 5 Jul 2009, 00:30 ]

Using Unicode [Read this article]

In Unicode character set, each character is represented by two bytes. Thus a Unicode string is a sequence not of individual bytes but of two-byte words. Check more about Unicode .

We created the XML file and changed using XSL file, thus transforming the XML to HTML. And to our surprise, we were able to see only junk characters in the 'TeamName'...

...We tried to set the encoding to 'utf-8', 'utf-16' and so on... But at last our problem came to end when we set the encoding to 'iso-8859-1'.

 TJ Ragam 0.2 [PoPP - TJ Ragam 0.2]

The updated TJ Ragam is available in the Proof of Principle Prototype (PoPP) archive. The main change is the architecture of the parser. Maybe I'll elaborate about this some day, if it is found interesting (especially if you compare with the 0.1 release). The goal of generating the .mid file, with the same time-duration as we hear, is still not very clear, though it seems to be working.

 OSS Tools 0.3
[CheckList - OSS Tools 0.3]

After a long time, the checklist of Open Source Software Tools - 0.3, is updated. The URL's are working now. The goal here is not to confuse you with choice, but to state only the things that seem to work in our experience. But for now, since the choices are equally interesting in some respects, all that we consider as a useful tool is listed.

 Tattvum Article Template 0.2 [PoPP - TArticle 0.2]

For easing the article submission and the formatting of it for publication in the TATTVUM site, we encourage you to download this HTML Article template zip file. It contains the HTML pre-publication version of a TATTVUM article. You can use this tagging model for your own article, by suitably breaking your article into blocks, and copy pasting it in this template, before sending it to us. This will greatly simplify our work. This template is also a reasonably flexible model to streamline your own thinking process.

This updated version Includes a sample article as HTML and a separate article.css, to simplify the HTML page. This was standalone earlier ( during the 0.1 version), now it is included as a project in PoPP archive.

Home Page - 2003-10-19

posted 28 Nov 2008, 20:22 by S V Ramu   [ updated 5 Jul 2009, 00:34 ]

J2ME and Java Landscape [Read this article]

It all started with the good fortune of getting a Nokia 6610 handset for GPRS connection, thanks to my employer. Though I primarily use it as a modem and not so much as a cell phone, the fact that it is java enabled, prompted me to try that out. This being the first time ever that I come anywhere near J2ME, the process was bit frustrating but very exciting. The verdict is, J2ME is cool and pretty easy!

...The J2ME is divided into the VM of its own (JVM, KVM, CVM), then the core API called the Configuration, the linguistic abilities of Java, which are very related to the VM implementation itself, and then the Profile, which depend upon the Configuration, and add more vertical (device dependent) capabilities to the platform. Beyond this you can have many Optional Packages (like an API for Bluetooth etc.), which can be added to suite your need. Of course there are dependencies between the profiles and the Configuration. For example the MID profile need CLD Configuration (more latter). And FP can only run with CDC, and not with CLDC...

...It all started with a simple HelloWorld program (just one class file, and one method overload), using Nokia Developer Suite for J2ME, 2.0. I thought of explaining that program to you all, but it is shamefully trivial. Instead I have done the survey route of the whole terrine of small device programming with Java using J2ME. Maybe in an another installment, I can explain a non-trivial program, at least moderately useful to me, in detail. I have few ideas. Let me try and and then brag about that to you. No! games are too far away from my mind now. I'm thinking of some useful numerical applications. OK, till then happy Java-J2ME time!

1-10 of 42