API parsing with Backbone.js

The next part of the self note series, this time I have to parse JSON using backbone.js.
So in order to parse an API that returns result in JSON you can do the following(not necessarily the best way but it works for me)

(function($) {
var API_BASE = 'your url here';

var parser = Backbone.Model.extend({});

var apiColl = Backbone.Collection.extend({
model: parser,
url: 'form your url here'

});
var apiView = Backbone.View.extend({
el: $('#collection'),
initialize: function() {
_.bindAll(this, "render");
this.collection.bind("all", this.count);

},
render: function() {
$(this.el).html(this.counter = this.collection.length);
return this;

}
}),
events = new apiColl(),
eventView = new apiView({

collection: events

});
events.fetch({
success: function() {
console.log(events.length);
}
});
})(jQuery);

and yes, my ultimate target will be to parse the API and integrate with some open maps.

Even though Backbone’s code is pretty well explained, the main help if stuck comes from stack overflow. So really appreciate the help that I got.

GSOC 2011/OpenStreetMap/Projects

Like every year this years mentoring organizations for Google Summer of Code 2011 has been announced and OpenStreetMap is in this years list as well.

Now as a lot of cheap phones has the capability to click pictures in high resolution,make GPS traces,shoot videos and have a internet connection via WIFI/GPRS or mobile broadband connection. I would really love to see a mobile based OSM mapping application that can utilize this facility and able to do photo tag/Video tag with GPS traces,upload to OSM/Flickr/Youtube, create and edit basic maps.

The idea by Zhijie Shen is here. So in case if you are interested in developing such an application do get in touch with the OSM community.

Apart from this you can find a lot of interesting project ideas here.

Student application for GSOC 2011 starts from March 29th.

Fedora Activity Day@BCREC by dgplug

So finally the Fedora Activity Day which was supposed to be held during Horizon’09 in April was held over two in 14th and 15th May,2009. The reason was that horizon got canceled due to some reason.

Here is a complete jot down of the whole two day experience

Day 1 :

We started a little late.At around 12 noon because of the projector was not working laptops.With  audience size was around 30 we started.

Arindam started by introducing the fedora project to the students. he introduced the Four F’s of the fedora project along with the community as well. He in fact introduce all  bits of the project.

Next was Kishan and Me , we tried to bust most of the misconceptions about linux/fedora in general.

Next we decided to actually give the students a demo of what the busted few minutes ago. Debashree, Amrita, Arpita showed them inkscape and gimp. Rangeen, me and arindam showed them video and music in Fedora.Along with Rangeen showing them KDE 4.2 and it attracted attention. Every machine in the Lab was running FEL live cd since there was no persmission to install Fedora in those machines[:(].

Whole of this continued till 2:10 and we decided to take a break.

After break we continued, this time 15 more students from electronics and communication branch came and joined us.

We introduced IRC to students and gave them a brief demo of it.

Then Rangeen started with FEL. He introduced GNUSim8085 and Ktechlabs which attracted most interest. There was power cut and outside was cloudy, so it was dark. but somehow even with UPS ans trailing machines rangeen continued.After the UPS gave up. We formed small groups of 8-9 and used out 5 laptops to demonstrated FEL. The session went along over 2 hours.It was a comprehensive demonstration and was a good one.

Due to lack of power, we decided to call it a day and gained permission to continued over the next day.

Day 2 :

We started day 2 with Some basic commands by Harsh Verma (a new fedora ambassador from dgplug). He showed them efficiently. Even showed the use of man and info pages. Me and Arindam  helped Harsh with this session. We showed them chmod , file permissions and a word of caution”not to login as root in GUI”.

The next session was vi by Dibyanshu. He gave a very good session on vi and showed most of the cool stuffs. I, personally liked the session very much.This guy is very new to dgplug but is showing great enthusiasm.

We took a break of 20 min and returned . Ratnadeep started with his GCC session. We decided to take on small assignments and started doing them using GCC. Ratnadeep did gave a comphensive demo of GCC and did well. Arindam decided to help them using Anjuta IDE and the same assignments were done using that.

This went till almost 5pm, power went out again. But I took my java session in my laptop. Showed them openjdk, the difference between openjdk and sun jdk. And how to install sun jdk in fedora using alternatives. This went on till 5:45pm and decided to call it a day.

The feedback was good. event though number of audince was less but it showed enthusiasm. Hope to get good contributors from this pack. There will be a post FAD session after the semester exams to keep nurturing this enthusiasm.

Over and all the session was successful and a good one.

With this session we  gained permission to install fedora in a machine. And me and Arindam decided to use this as a local mirror for the labs and students. Need to sort out some techical difficulties though. It currently behaves like a mirror in a box.More on this soon.

My cam’s battery gave up in mid ways so didnt clicked much , anyways pics are here :

Past few days (including mukti09)

Last few days were hectic to me as there was lot of things that was happening around me .

6th Feb : It was Mukti 09 day ,  a national level tech fest on opensource at NIT Durgapur . Me and Arindam had to do a talk cum workshop there .Our Pre Mukti talk was canceled due to bandh and got 3 hr slot , It was scheduled at 5:00 PM .

However we decided to go a little earlier because we along with Indranil Das Gupta and Yu Yu Din were suppose to go and visit Bijra High School .It was at around  12:30 PM when we reached there ,met with Indranil Das Gupta and Yu Yu Din and started for Bijra ,but before we left the campus we called Pradeepto and took him too .At around 1:51 PM Debayan called us up  for setup at fedora stall as they are lacking volunteers but we were already on our way to Bijra .

In Bijra , there were lots of stuff that were happening , Bijra school is getting lot of aids from different section of society and they are utlizing it for a good cause .Both Yu Yu and Pradeepto liked it very much . and lot more things were discussed .

We returned to NIT campus at around 4:30 PM and headed toward IT department where our ” A day with fedora ” were suppose to be done .We started a 30 min  late at around 5:35 PM .Satya came along but she was too tired as she just finished a talk .

There were some 50+ DVD’s that were distributed along with registration kits , I asked Debayan for 15 more DVD’s to distribute in the event just as we were on the start , Nevertheless we started with Arindam’s introductory talk on “Introduction to Fedora” , He had some cool slides where  he showed ” Freedom | Friends | Features | First ” of fedora project .He also showed some cool videos like ‘Truth Happens ‘ , A video showing new features of F10 ,starring stickster and gergdek .Next was my turn , I gave talk on “Myths about Linux ,Busted with fedora ” where i showed basic misconceptions on usage of Linux . A video on ” Why fedora ” by gregdek is shown along with the talk .

Finally we conducted a small workshop on ” How to create bootable live usb for easy use “  . The local mirror of NIT was b0rked and Debayan mailed us regarding that a day before , anyways we continued with as much we can , and finally got 8 machine getting all that we need . Arindam hosted his local FTP server so that people find it easier to download .The workshop went alone and was quite successful .We faced a lot of questions , a guy from NIT agartala said the workshop was useful as  he can now got a solution to their connectivity problems . Finally we ended with the “Choice” video .

We had dinner there and finally returned home at around midnight .

7th Feb : Me along with Arindam ,Indranil Das Gupta and Yu Yu Din boarded the 6:14 AM train and went to Kolkata where IDG had to give talk . We went to IDG’s office and waited and finally went to Science City where talks were held . M Arulraj gave a talk on Open GIS . IDG gave his talk , I don’t remember the tittle of talk though . and one talk was on FOSS in bio informatics by Mr. Sudip Kundu .

Finally we all went to kafuluk at china town and had our lunch cum dinner there ./me and Arindam went to my house at sontosepur .

8th Feb : Woke up early and came back to Durgapur by taking 7:30 AM bus . It was “brigade cholo ” day , the bus we took was the last bus available as most buses were hijacked to bring in people . Reached Durgapur at around 10:30 AM and went back to NIT Durgapur at around 12 noon , On way to IDG’s talk ,we went where stalls were hosted , apart from Dominos and CCD rest were empty .IDG’s talk on “Indian FOSS Community was superb ” and at it was the last talk of mukti 09 .

NIT Lug guys did a superb organizational effort to bring up such a event and overall it was awesome to see so much participation .

Fedora Event pics are here .

Random Scriblings

Theres quite lot to  say :

1. Gave one more talk on OSM at mukti 09

2. Visited Kolkata Book Fair and help folks at IOTA stall .It was awesome .Detailed blog coming up

3. Fedora talk at mukti 09 on 6th .Event page up (need suggestions)

4.Visited bijra today and had lot of feedback (complaints) from them .

5. Got a lit of petrol almost decades after recent price cut for RS 50.

6. Harman Baweja still cant act .

7. Sign of twitter becoming mainstream in India .Read here.

First Barcamp and Tweetup at Kolkata

At last kolkata got its way to barcamp and tweetup , Though situation of the city made its presence on the people attending the barcamp.

I reached barcamp venue at IITKGP EXT center at around 10:15 AM .The preparation were still going on , However people started coming only after 11 . However organiser decided to wait for a little long for some more people to come up .

At around 11:30 AM things started , Sessions were superb , the timeline can be found here .

I did a session named “fun with JOSM” in which i introduced OpenStreetMap and JOSM and it did  earned some attention .

Some of the interesting session were by Shwetank Dixit , Amitabh Choudhary,YuYu Din,etc .

At around 6Pm things packed up .

on the note : IIT KGP guys did a good organising on there part ,wifi were working ,and food was good .

The Barcamp twitter followup can be found under hashtag #bckol ,

And hey #bckol is a trend in twitter : see here .

After Barcamp we decided to had a tweetup , There was a little confusion over the place but we decided to move to Mani Square for the Tweetup .There were seven people ,@subhodip,@aritra_m ,@indradg,@imba ,@epandu ,@yuyudin and @tathagata .

The tweetup followup can be searched under hashtag #tweetupkol

Indradg wasnt a twitter user but after the tweetup he is :)

The tweetup was superb as we come to know many people and it was fun .

Group Photo

So , The barcamp has finally started in kolkata and its our turn to keep the momentum up .

Fedora on mac ..rocks

It has been two months since i bought my macbook .I mostly use my desktop for daily work and mac OSX was serving me well . However due to need i started setting fedora on my mac . Arindam did that previously and his fedora installation was fine .

After installation , i found that apart from common issues like wifi and touchpad , sound was missing as well .

So decided on a google search ,which reaveled some post from forums . I tried them and everythings is working good .

Here is a small compilation of those methods .

1. Wifi and sound

these four are needed

kmod-ndiswrapper-1.52-30.lvn9.i686.rpm
kmod-ndiswrapper-2.6.25-14.fc9.i686-1.52-30.lvn9.i686.rpm
ndiswrapper-1.52-1.lvn9.i386.rpm
R151517.EXE

P.S : Well , rpmfusion.org is finally here and all these packages are transferred to rpmfusion.org . Please use

yum install rpmfusion-free-release rpmfusion-nonfree-release

and search for above packages . Plus with rpmfusion its better for updating .

Thanks to Thorsten for pointing me out .

now

mkdir wifidriver
unzip -a R151517.EXE -d wifidriver/
cd wifidriver/DRIVER/
su
# install ndiswrapper and the wifi driver
rpm -Uhv *ndiswrapper*rpm && rm -i *ndiswrapper*rpm
/sbin/modprobe ndiswrapper
ndiswrapper -i bcmwl5.inf && rm -rf wifidriver && rm -i R151517.EXE
echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/soundcard
echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist
echo "blacklist ssb" >> /etc/modprobe.d/blacklist
echo "blacklist b43" >> /etc/modprobe.d/blacklist
# ndiswrapper is used for wlan0
echo "modprobe ndiswrapper" >> /etc/rc.d/rc.local
echo "alias wlan0 ndiswrapper" >> /etc/modprobe.d/ndiswrapper
/sbin/service NetworkManager restart

and reboot the mac .

Pommed helps in  controling the LED and keyboard backlight, soundcard, infrared remote and more. :

wget http://downloads.diffingo.com/diffingo-repo/diffingo.repo -O \
/etc/yum.repos.d/diffingo.repo
yum install pommed

pommed starts as a startup service .

For touchpad its synaptic that comes to the rescue .
The xorg.conf as of my machine is here :xorgconf




However after an update to 2.6.26-6 kernel , and subsequent update of ndiswrapper , even though wireless was working ,my sound got muted in kde  which was fixed soon .
And on KDE4, a red light appears from the headphone jack . It indicates that digital audio got enabled instead of analog .This happens if IEC958 module gets enabled . So sometimes it ignores a headphone plugged it . 
It can be switched off by :

 volume control > switches > IEC958 (dechecked ) . 

or It can be reset with a toothpick though if it remains on even while using mac osx ,better to do a google search for this or post in a mac forum 
Enjoying my mac :p 

Back from Axis 08

Axis 08 is a tech fest organised by NIT Nagpur . We (me ,Susmit, Arindam ) went there and conducted seminar cum workshop . (our scheduled of 3.5 hrs were genoursly extended to above 8 hours over three days .) Now i am back home and have a nice time with Fever . I am down and not in a postion to write detailed blog post . However susmit is writing one .you can see it here .All photos that were taken by me and arindam were being uploaded by arindam . you can see them  here

I want to get well before the puja’s i dont want to miss it anyway.

Hey ! Today was Dgplug’s Birthday .

Four years ago today was the day when dgplug was born .

We are the Linux Users’ Group of Durgapur. The group officially started on Sep 8, 2004. A few small brains grouped together to populate Linux in the locality.

Kushal suggested us to hold a meetup on this regard . However due to many circumstances it was changed from a regular/normal meetup to a birthday party celebration .

We selected Food Court a.k.a Wonder vatika   as our venue .12 noon was the time selected .

I reached the place a little early and was roaming around when everyone arrived . We moved upto to our selected place .

Apart from Ajitesh , Ria , Arindam and me all are new contributer/members of Dgplug . So I started with history of dgplug as i have heard when i joined it .Ajitesh took it from there and gave a nice details .

Then we decided to share what we learnt after joining dgplug . We started alphabetically

Amrita , Arpita , Debahree are three girls who have done lot of work with inkscape after joining dgplug . They also attended the summer training conducted by dgplug over irc .

An quote from Debashree : ” I never liked drawing in computer before i used Inkscape “

Ratnadeep (rtnpro) and Kishan are newest memeber of the lug but had shared their experience over the summer training .

This consisted for over an hour when Arindam arrived ..he was just one  and a half hours late from scheduled time .But he made it to the lunch .

After lunch .. me , Ajitesh ( one important member of Bijra High School Project) , Arindam (KDE, OSM, Fedora contributer ) . Ria (KDE, Fedora ) contributer shared our views and what we learnt after joining the lug . these were little long ones :P

Finally “whats the plan” for next two to three months were discussed .. mainly with rtnpro and kishan ..

Sunny_slls has joined the fedora docs team and he siad he is looking forward to it .

Since first year has already got enrolled in college .. we had a decision to go and approach them ..and make them aware of us .. a regular routine every year ..but is fun to do .

It was around 4:30 pm when we finally packed up and headed home .

View pics here and here