Category Archives: Uncategorized

Why I like PythonMonk

For a while I have been thinking about learning a dynamic programming language. These are the best days to be a young fella with time on hand. Computing power has become cheap and you no longer have to target one or two OSes from giant monopolies. Heck even Macs are cheaper. And right out the box these machines (Macs) come with everything installed for creating awesome software solutions. If not, whatever you need is just a repository away on GitHub.

My passion is Healthcare IT. I am always on the lookout for good EMRs and Hospital Management Systems that may be implemented for use in 3rd World countries. Once you bring in the restriction of cost, you are pretty much cornered into looking for systems built using free open source solutions. And, most of these are developed in software ecosystems I have not extensively worked in. When I discovered OpenMRS, I was thrilled by the features it offered and, the fact that it was actively being developed and used in African countries was even more reason to gravitate toward it. But. There’s always a but. OpenMRS is built in Java. Although I am not planning on monkeying with the code daily, it helps to be able to roll up your sleeves and just start debugging. The entire ecosystem did not feel like home. The Java ecosystem has matured so much its just wasn’t inviting. Don’t get me wrong. All of this is based on pure gut. I have nothing against Java. But I don’t like it that Oracle now owns Java. Then I discovered GnuHealth. An open source Hospital Management System developed in Python.

Ruby is very popular. It’s a dynamic language. Has matured enough for CodingHorror to pick it up for his next big thing called Discourse. I have the Ruby pickaxe book. My friend Lucid coder raves about it too. But I still wasn’t sure because there are not EMRs or HIS built on Ruby. 

That brings me back to Python. I have been paying a little attention to Python but never seriously. It was time. Having settled on that, next up was to figure out where to begin. Google search threw up several resources. Mainly pointing to Learn Python the Hard Way. This might be the best way to master Python but it certainly will take a while to complete. Then I signed up for Codeacademy. This is good but a little elementary and slow paced for my needs. 

 I realized that my needs are different from the needs of someone wanting to learn a new programming language. Most tutorials target novices. People who have no programming background. But I want to learn how to develop software solutions with a new programming language. Although getting a good grip on fundamentals is paramount, I don’t need to start at learning what variables are, what for loops are or what ifs are. If you do not have a programming background Codeacademy works great. 

As if on cue, the awesome folks at CodeMonk released PythonMonk. I have been “following” the maturity of RubyMonk, although I had not spent time experiencing it. It was like everything was aligning in the heavens. My discovery of GnuHealth. Deciding Python is what I want to learn and the release of PythonMonk.

I signed up and completed the lessons and problems in 2 days.

If I have to sum up the experience of PythonMonk in one phrase, “Mind Blowing” is what I would use.

And here is why.

The lessons are simple with just enough concepts targeting both novices and experienced programmers. People with no background can comprehend the concepts but there is enough intrigue for experienced programmers to relate to learned concepts. The problems presented at the end of each concept build upon what has been learned but don’t let you blindly bang out code. You have to stop and think, no matter how simple the problem is. This, in my opinion, is the biggest differentiation of PythonMonk compared with other tutorials. Anand has done an extremely awesome (I know I cant stop gushing) job putting together these lessons. Monk suits perfectly. Most tutorials present problems which can be completed using only the concepts presented earlier. You can waltz through them. Not here. Not on PythonMonk. 

The last problem of sorting a list by file name extensions is interesting. This problem is what led to my epiphany. The solution is pretty simple. However, it cannot be completed purely by picking up the concepts presented. You have to venture beyond, on your own, learn a bit more and then solve it. The solution needs an extra concept that is not directly presented in  any of the lessons. But if you are the curious type, then you would have learned it on your own building upon the lessons presented and arrived at the simple solution. This is the power of PythonMonk.

I haven’t become a Python expert after completing the lessons on PythonMonk but, these lessons have filled me with enough intrigue and passion to continue my education and have armed me with enough concepts to dig further.

Hats off to you guys at CodeMonk. Thanks for PythonMonk and keep up the awesomeness. 


How to handle TabHost TabChanged event in Mono Android?

Being new to Android development I struggled with this one for some time and hopefully this post will save some poor soul the agony I went through.

After I added a TabHost widget to my Layout I assumed I could attach an event handler to either the TabSpec component or the TabHost itself and listen to these events in the activity. But this does not work. Googling and trolling stackoverflow threw up old references which no longer were valid for 4.0.1 version of the SDK I am targeting.

However the technique is very simple. 

The TabHost has a method named “SetOnTabChangedListener” which takes in an instance of class implementing the IOnTabChangeListener interface. 

So all you got to do is implement IOnTabChangeListener in your Activity and set the listener on the TabHost like so

TabHost.SetOnTabChangedListener(this)

Your activity class needs to implement only the OnTabChanged method and you are golden. This method is called when any tab is clicked and you may do whatever pleases you in the method. The tabId is passed in as a parameter. This is the same string you used when setting yo individual tabs.

spec = TabHost.NewTabSpec(“home”);

There you have it. Enjoy.


Opening an iPhone 3G – Be Extra Careful

This post is not a tutorial on how to open an iPhone 3G. There are numerous good guides on the web and YouTube. If you are looking for a guide, I suggest the excellent iFixIt guides here. However, all the guides and videos I have come across use the first generation iPhone and not the 3G. This is strictly my opinion and is based on a sample size of 1. I am using my iPhone 3G as a reference. When I opened my iPhone I was surprised to find an extra connection, which, had I not been careful, could have easily ripped and damaged the device.

Installing and using the crappy AT&T Navigator busted the speaker on my iPhone. My iPhone is on permanent mute, vibrate only mode. Can’t hear a thing from the speakers. No phone rings, no marimba tune. I managed to find a repair store in Atlanta which wants to charge $100. It’s still cheaper than the other options and no, I did not get the AppleCare. I know, hindsight. However, the store has not returned my call since November. I found the replacement dock connecter+speaker assembly on Amazon.com for $19. Next step was to replace the broken part. Haven’t found time to do it yet, because, if I completely damage the phone I need time to run to the AT&T store and get the cheapest phone so I don’t miss any calls.

Here are the tools you will need to open the iPhone. Some guides suggest using a flat screwdriver to pry open the top, after removing the bottom screen.

iPhone Opening ToolsI do not recommend doing that, because the potential of you damaging the phone is very high. The cheap plastic suction cup can be found at any Home Depot or Lowes. Get the one shown in the picture. The hook comes in handy pulling the lid open and the suction is good enough. A thin gasket lines the glass cover of the iPhone and using a knife or any other tool to pry open the lid will damage the gasket. 

Also recommend keeping a magnet handy as the screws are tiny and you don’t to lose any. The magnet will come on handy if you drop any screw. Another tip, take pictures of each step so you can use it was a guide to help you put the device back together. Yet another tip, backup your iPhone before attempting to open it. Better safe than be sorry.

The picture on the right, borrowed from iFixIt.Com should the iPhone open. One thing to note is there is no connector connecting the top to the bottom like the one I found in my iPhone.

iPhoneOpen

iPhoneConnector

 

The picture on the left is the dock assembly. The connector shown is attached to the top of the iPhone where the arrow points to in the picture on the right. The very first time you try to open your iPhone 3G using the suction cup, you will find that a little extra pull is required. Don’t just yank the top. You will need a couple of tries before you can successfully dislodge the top, but knowing that there is connector will help you be extra careful.

Good luck.


How Android devices can leapfrog the iPhone

I love my iPhone and it’s a great platform for delivering all kinds of applications. Just like the ad says, there is an app for everything (at least it seems like that). The bottleneck, however, is the AppStore and Apple’s stranglehold on the device. You can’t just re-purpose the device without jail-breaking. The iPhone is versatile, yet, constrained. If you look at the numbers published here on GigaOM, you can see the extent of iPhone’s market and its economy. Android or any other device has a lot of catching up to do.

However, I think there is opportunity here for Android to completely blindside Apple and make Android devices indispensable. Google can do that, not by courting consumers, but by collaborating with makers of complex software systems like HMSes (Hospital Management Systems).

A hospital is a complex system and a truly integrated solution is mind-boggling. It takes a lot of brain power to comprehend the enormity of implementing such a project at even a mid-size hospital. There are processes within processes and to top that everything is highly regulated. It’s a question of life or death. Literally.

The typical architecture of HISes (Hospital Information Systems) is client-server, mostly implemented in Java. Large established hospitals still run mainframes but the basic architecture is client-server. The textbook approach of modernizing such “legacy” systems is to go the web applications route with a heavy mix of web-services to make everything “service-oriented”. You would probably throw in lots of JSP (Java Server Pages) pages and expect them to run in a browser. So the browser becomes your client accessing the application functionality. Then, you sprinkle the campus with desktops running browsers and you have your setup.

My proposal is this. Instead of using $500 desktop based browser clients to access system functionality why not access the functionality from $200 Android devices? Heck, with bulk orders, these could even cost about $100. These devices will access the required functionality via Android apps. Just imagine what would happen if Google and McKesson were to collaborate. McKesson’s Paragon Community HIS can dole out app features via Android apps. Google could subsidize these devices and could reduce the overall implementation cost of the system. Granted not all application features can be appified. (I invented this word, if anyone patents it, you heard it first here). But I suspect most of the features can be. So instead of nurses or hospital staff needing to go back to their stations to access the system, they can whip out their Android devices, and perform their tasks right at the point of the service. No need to make entries on paper charts and then transfer them into the system back at the station. Just tap them into the device. Throw in a pico-projector into the device and you have the option of viewing the data on a large screen. Like, say, you want to view the blood glucose chart of a patient or the vital signs charts. The possibilities are endless.

So instead of trying to create web clients or thin desktop clients, makers of complex software systems should focus their effort on developing downloadable android apps of their applications’ functionality. And McKesson, if you are looking for someone to lead up such an effort, you know where to find me.


pixels2soundBytes – End of an experiment

I am a huge fan of Scott Hanselman and religiously listen to Hanselminutes, one of the best technical podcasts. I also enjoyed the short lived science focused The Brainfood podcast. Podcasts were all the rage couple of years ago and everyday brought a new one. I wanted to join in on the fun and given that I am not as eloquent as Scott or Jeff Atwood of codinghorror and stackoverflow.com fame, I figured I could piggy back on the success of technology leaders and create a podcast. I first contacted Scott and he was gracious enough to respond to my email.

My idea was to render interesting blog posts and articles written by industry leaders like Scott, Jeff and, others as audio. My premise was, given the relentless march of technology we seldom find time to read articles. So I posited that I could convert hand picked (by me) blog posts and articles to audio and make them available as podcasts that you can listen to driving to work or fixing breakfast. Scott alerted me to odiogo a service that can convert written text to audio. It does a good job. Check it out. I brushed Scott’s hint aside and contacted some of my favorite bloggers and requested their permission to use their blog posts and articles in my podcast. Everyone granted me permission and I was thrilled.

I borrowed a studio quality from my colleague Greg Johnson and with music from The Podsafe Music Network (now musicAlley), Audacity and an account on libsyn, I put together the podcast. My co-workers listened and encouraged me. Finding great articles to render as audio was easy given the caliber of bloggers I had permission from. However, interest has, at best been, muted. Only 325 downloads. That’s for all 11 episodes. Hanselminutes logs that number is the first 5 minutes of being uploaded.

Of late, given extreme pressure at work and my interest in Healthcare IT and iPhone apps, it’s been hard to find time to research and put together an episode of pixels2soundBytes. It takes me a week to put together an episode, which includes time needed to find the articles, render them as audio, edit the recording, and compose an episode with music. I have become an expert in Audacity.

So, with no time to spare, I have decided to end the experiment and will close my podcast account with libsyn. If you are looking for a cheap podcast host, libsyn is a no-frills, affordable excellent host. The basic account costs $6/- per month and is more than enough for a budding podcast.

I would like to thank the following technology leaders for granting me permission to use their blog posts and articles in my experiment. I really appreciate all your help.

I would also like to thank my colleague Greg Johnson for lending me a great studio quality microphone. Thanks are also due to Scott Hanselman for responding to ALL my emails.

Last but not least, a big thank you to all those who downloaded pixels2soundBytes and tolerated my accented rendering of great blog posts and articles. Thanks for your support.


myOpenId CallVerifID limitation

I like the two-factor authentication feature of myOpenID powered by CallVerifID. The two-factor authentication works like so. You determine that a website offers compelling features and are ready to authenticate yourself (think stackoverflow.com). Provide your user id (userid.myopenid.com). You will be redirected to myOpenId.com. You enter your password. And wait. Within 15 seconds your phone rings and only after you verify over the phone, will the authentication proceed to the next step. I use this to logon to my HealthVault.

Great! Has always worked like a charm for me. But…

This month I am in Bangalore. Although CallVerifID is available in 30 countries, it’s not available in India, yet. So, for the entire month of July, I can’t authenticate on any website that offers openID authentication. For HealthVault, I can use my Windows Live ID as a backup but I suspect that I have two accounts on HealthVault, one tied to my myOpenId ID and the other tied to the Windows Live one. I can’t disable CallVerifID on myOpenId because myOpenId uses CallVerifID to logon to my myOpenID account. For now dead in the water. I am not ready to give up on the CallVerifID feature. I like it. Very much. Just need to figure out a way to make it globally portable even if CallVerifID is not available in the country I travel to. I guess the one piece of critical link in the chain is the ability to receive a phone call.


Sponsor an episode of stackoverflow podcast

Here we go again. Hopefully, third time is a charm or it could turn out to be a third strike. And I am out. After failing not once, but twice, I am going to try again. This time, it’s yet another favorite community leader, Jeff Atwood of Coding Horror fame. Jeff and Joel Spolsky, co-founded stackoverflow.com, a go-to site for anything and everything computer programming. They also record a weekly podcast which is nothing but conversations on IT and is hosted on IT Conversations by The Conversations Network.

On behalf of all the programmers who have benefited from stackoverflow.com, I am organizing a fundraiser to raise money to sponsor an episode of the stackoverflow podcast. I got in touch with the folks at The Conversations Network and gathered that it costs about $500 to host and produce one episode of the stackoverflow podcast.

Fellow developers, let’s come together and raise money to sponsor an episode. I suggest a donation of not more than $10. With 550 pledges, we will have enough to cover the cost of an episode after fundable.com has taken its cut.

Let’s do it. Click here to go to the fundraiser page.

TIA

kick it on DotNetKicks.com