MapQuest tiles through Leaflet.js

Cross posted from geohackers.in.

Leaflet.js by default supports Cloudmade’s awesome map tiles. The Open MapQuest project also provides beautiful tiles, which are now used at OpenStreetMap.org. To use these tiles all you have to do is to change the map preamble as follows.

The Cloudmade maps layer looks like this.

Change the preamble to.

Zoom level based marker interaction using Leaflet.js

With Arky I was creating a map of the Mozilla l10n teams world wide and decided to use Leaflet.js. He send across a CSV data sheet which contained the geo-tagged teams and other information. Wrote a Python script to generate markers corresponding to Leaflet.js (Yes, my JS skills suck). When we laid the markers on the map, we found that it looked all crowded and difficult to locate one team quickly. I took this discussion to the HasGeek channel and Nigel showed me the Ubuntu Loco Global Events map. The markers in the map changed based on the zoom level of the map. That is pretty neat idea to handle crowded map markers. But they were using Google Maps.

I wanted to make this happen with Leaflet.js and OpenStreetMap data. Leaflet.js is perhaps the best, easy and intuitive interactive mapping library that I’ve come across. I spent some time in the documentation and came up with this idea and voila! – it worked.

Leaflet.js provides several events, the one which we will use is zoomend. This event gets triggered whenever the zoom level of the map changes. Exactly what we need. This is how I did it.

If you have a bunch of markers, use LayerGroup, that will give you better control. You can now add/remove the entire marker set by the LayerGroup handler.

The Droidcon India 2011

Droidcon India 2011 was the first Indian edition of the international Android conference. I was part of the team of HasGeek to pull out the event. I do not have words to express the fun, learning and bonding we had while organizing one of the biggest conferences in Bangalore.

It’s been four months since I moved to Bangalore and now I know, that was the best decision I took in my life so far. And the biggest reason I did that was because of my friends here. They are a bunch of geeks and writers and the best that can occur in my life.

It will be difficult to list out the stuff I did at Droidcon but I was with the tech support team along with Kingsly and Praneeth. We had the toughest task that every geek conference in India has – Internet. Setting up Internet and providing optimal bandwidth to 500 people is not an easy task. Getting all of them online at the right time is not even imaginable at this point of time in India. The infrastructure at the venue were super awesome. Plenty of power over Ethernet access points, ports and other network gears. But the bandwidth was 2mbps, which makes it literally impossible to get such a huge crowd online.

We tried several plans, including getting someone else do this task. But the quote that Kiran got from Tata/Airtel were over 2 Lakhs and hence we decided to take this our own and do what the best we could. Kingsly is a pro-sys admin. Yes Zainab, you said it right – he is the God. He laid out the plans and worked towards it. Issues after issues. Complaints and bad faces. We got it all. I was loosing, but Kingsly and Praneeth would pat my back saying, “Kid, this is fine. Everything is under control”. I know, I’m a kid.

On the 17th, Kingsly reached the venue at 7.45AM which is really  a touch task considering his work and hectic life. I woke up to his message and rushed to the venue. And soon Yuvi, Anu and Praneeth joined us. We discovered the venue’s network gears and declared that space as the Network Operations Center (which turned out to be the Non Operation Center).

Apart from the network, since the place had less number of power sockets to provide 500  people sufficient power to charge their laptop and for the sponsors to setup their booths, the other task was to lay out power cables and plan proper power distribution. We had cell phones to laptops and printers to ‘plasma’ TV’s to power up from two power sources. Two weeks before the event, me and Yuvi got the plan in place and got an electrician to get the cables and sockets ready. Laying them out was a task. Yes, if we laid the cable just like that, people will trip over and it will be a mess altogether. We carefully laid them out and plastered. Yes, we did it.

I have learned so much from all these. Really. And the one of the reasons which kept me going, even while it ached from my bums to toe was the fun we had. I could see Kiran and Zainab stressing out too much. Kiran would not say that, he would just hide that in his sharp eyes. But Z, would easily spill that out and come rushing asking “Is everything smooth?”.  A week before the event, the only worry I had was, since Kiran and Z were stressing out too much, they might as well fall sick.  Kingsly would say “There will be disorder even on the day 1, no point in worrying now”. Francesca was super awesome and supportive. We have known each other only since 2 months and the bonding is something. Every problems and win will finally end up in a hug.

I woke up this morning to Zainab’s post about Droidcon. Mine would never ever come even close to that. But I had to do it. I’m squashed even when I write this from my bed. But the energy from the bonding we built all these days pushes me to write.  I’m sure that I won’t be able to write every wonderful moment which we had all these days.

Yes. I’ve been part of several geek event as participant, speaker and organizer. But Droidcon was the best ever.  Last minute sponsors backing out, printer confusions, NFC card data bugs and what not. We survived all of them. The most intense problem that we solved happened during the last few minutes of the conference. NFC card readers and the bugs in the script, duplicates and fake IDs. We had them all.

I’ve made new friends who are journalists, geeks and designers. Parag, Vamsee, Chintan, Rasagy, Ankita, Aral, Soham, Akshay, Arvi, Billy, Sidharth, Noufal and everyone. And all I have for you folks right now is a big hug. Thank you so much. We did it.

LaTeX Training and Career Tips, talk at MES College of Engineering.

Back in Bangalore after 6 days of awesome fun in Calicut. Took a break for Eid and hit home on Friday. Couple of mark lists and course certificates remained to be collected from the college. Hence I was planning a visit to MES this time. Spoke to Sajith Sir and found that Tuesday is a holiday, and decided to take Wednesday off and go to college.

After sometime, I ended up agreeing to do a LaTeX training for the final year computer science students on the same day. Later the Head of Department spoke to me over phone asking if I could share my experiences as a consultant and freelance hacker in Bangalore. So to sum up, this was it. Find everything related to the training here.

I took the early 6.45AM train to Kuttippuram and that was a ride into memories. It’s been four months since I stepped out of the campus and the long four years came rushing. Just bliss. Hung around a bit here and there and decided to get started with my work. Had to get no due confirmation from all the labs and departments. That was some work. Met Ranjith and Sharath, and that was totally wonderful.

The talk began a 1.30PM. I was supposed to talk around an hour but it was easily stretched to 3 hours straight. I was excited. The LaTeX part was easy. I knew students will doze off. Sessions right after lunch is perhaps the difficult to handle. Managed to get them ride through the very basics of document preparation and surprisingly there were a bunch of M.Tech students who had specific questions. We discussed over them and solved a few. Rakesh sir and Sajith sir added things which I missed to speak out. 1.5 hours. All good.

The next track was sharing my experiences and showcasing why the students need not run behind corporate jobs. I started off with the things which I achieved over the small period of 3 months in Bangalore. Shared some nightmares, fun filled events etc. Spoke about Geohackers, Azim Premji Foundation, Boost Tech and HasGeek. In fact, I asked them to start a github account and get some visibility as soon as possible. There you go, lot of question and I quickly moved to “Clients from Hell”, pause, laughs, applause :)

I was done. Three hours and my throat ached like anything, but my heart filled with joy when the Head of Department had his take on what I spoke and how he noticed our batch to be one of the best outgoing in his two minute roundup. I was excited. I literally cried.

Thank you so much for having me speaking in the campus again, everyone.

 

 

Getting a Huawei EC159 USB Modem working on Ubuntu 11.04

The EC159 just like any USB modem gets detected as a USB mass storage or virtual CD-ROM when connected to Linux boxes. Yes, usb-modeswitch should take care of this and make it available as a GSM Modem. Unfortunately, the usb-modeswitch configuration skips this particular device, and that’s what I felt.

I decided to run usb-modeswitch to manually configure the modem by the following steps:

1. Get the latest release of usb-modeswitch

2. Build and install it.

3. Plug in the modem and run lsusb. Note down the vendor ID and Product ID.

For example:  Bus 002 Device 002: ID 8087:0020 Huawei

The vendor ID is 0×8087 and Product ID 0×0020

4. Run usb_modeswitch -H -v <vendor ID> -p <product ID>

5. Now modeprobe using the same vendor and product ID

sudo modprobe usbserial vendor=<your’s here> product=<your’s here>

6. Your device will start working like a charm!

Do let me know in the comments if you are stuck.

The very special Pycon 2011

Download the talk and watch the video.

This edition of Pycon was in fact very special in different perspectives. I came to know that my talk was selected from Kartik. It has been a while since I hacked on Python with Android but I did follow the updates and new releases. 4 days before the conference, I managed to buy a Samsung Galaxy S 2 which looked to me as a brilliant phone and couldn’t wait to start hacking.

Since Praveen was in Pune, I didn’t have to look for other option to crash in. Took a bus overnight to Pune reached there on Friday (16th September), went to Pravi’s place. That was my first longest bus journey. Bangalore – Pune 846 KM. Reached the venue late in the afternoon, met couple of friends. Felt good to have given Noufal, Pradeepto and bunch of other guys, a face, with whom I interacted online.

My talk was on day 2. Didn’t have much to talk either. I was planning to scratch the surface and tell the people what to look for and where to find them – to write apps in Python for Android. The talk was scheduled in Track 2 which was apparently a hall with less capacity. 5 minutes after starting the talk, someone came in and said we need to move to the main auditorium given that the crowd who wanted to attend my talk won’t fit into this small hall. We wrapped up and moved to the auditorium.

Now, the pressure was on me. I really didn’t have any idea what these people might be expecting and whether my talk would help them get even closer to it. I started off with this disclaimer and showed them how sweet and beautiful Python code can be when compared to Java on Android – a pause – loud applause. That made my day. Couple of guys were really interested and they interrupted me to ask questions. I hope that I’ve answered them all. Few people came to me and I just gave them a better idea of the architecture and how things work. All went well. Phew! I should thank Nijad for keeping track of what examples and text I should be sharing with them.

Praveen, Labeeb and Vishnu wanted me to cook ghee rice. Labeeb said he can make chicken curry. I was a bit nervous and called up mom to ask how much rice should I cook. Met Nikhil and Sandy in Pune. Hung out with them and then crashed to Pravi’s place, where we ended up cooking!

Data, Visualizations and Evidences.

Yesterday marked a month since I moved to Bangalore. Flooded with interesting assignments from both work places. The first two weeks went into hard-core scraping and data conversion. Taking down/mirroring couple of National Informatics Center’s servers etc. Incidentally, we started doing some analytics and couple of them are showcased here.

Third week of my life in the big city started with associating with the startup called Boost Tech. My role with them mostly involved designing a data dashboard, identifying data variables, visualizing them and bringing evidences from the research. Brij, the CEO, handed to me two of Edward Tufte’s awesome books on visualization of quantitative information. I’m enjoying my weekends and some hours of the weekdays, cruising them and exploring new ways of infographics.

College is over.

That’s it. It’s been over a week since I’ve packed everything and got home. College is over. All the wonderful time in the campus and awesome hostel are memories. Sigh. No pictures to post. No good words to say. I said good bye to all the loving friends and the hope of catching them on facebook all the time keeps us going.

I’m alive!

I haven’t been blogging for a while. But I’m ALIVE! The not really good days have been hunting mixed with feelings of happiness and whatever.
It’s exams again. The final one.

AndroidCamp Bangalore

I’m sleep deprived and tired to write down all the awesome time I had at the AndroidCamp.
Jobless in the bus, so I should attempt to write something.

AndroidCamp was one of the best unconference that I’ve been to in Bangalore. I was so excited when Kiran and Kesava came up with this idea. I remember the discussions on the list that there were more than 200 sign ups within 48 hours of announcement.
Soon I found the proposals website proposals.androidcamp.in a wonderful idea that all unconferences should adopt.
Met a bunch of interesting people who do 100 other things around Android. I was too happy to find that there are people who hate Java and love Android :)

So copying from Manish Sinha. :)
Read it all here. http://milky.manishsinha.net/2011/04/02/android-camp-bangalore/