It started after a discussion with Sankarshan, Rahul and Kushal. We needed a system (a web application) to manage student projects. Google Summer of Code was using this framework called Melange. So I was thinking in the lines of developing a similar application using Ruby on Rails, which could be used by Fedora Summer Coding program or similar programs like the DGPLUG Summer Training.
I thought it up as in idea for this year's Fedora Summer Coding. But then I thought maybe I could start up on the project and develop some existing funtionality, so that the student coding on it would have an idea of what's in the books and get something to start on. Maybe add some new features or something.
I have been developing it for the past three weeks. I have some code which I have hosted on GitHub.
Here us a list of the features the web application currently has:
User Management:
* Authentication of three different types of users:
0. Guest user (unauthenticated user)
1. Admin
2. Mentors
3. Students
* Project listing and About page available to unauthenticated user.
* User listing.
* User profile with information about project activities.
Projects Ideas
* Mentors and Students able to add project ideas.
* Mentors can volunteer to mentor a project of their choice.
* Project proposers and mentors can edit project ideas.
* Project proposers can delete project ideas without any mentor.
* Admin can add/edit/delete all projects.
Proposals from students
* Students able to submit proposals for all projects.
* Students able to edit proposals.
Dashboard
* A user dashboard having current logged-in users project activities.
A lot more work needs to be done. I will soon create a task list for Fedora Summer Coding.
If you are a students who wants to work on FSoC as a part of Fedora Summer Coding follow guidelines mentioned in the wiki.
FSoC is liscenced under GNU AFFERO GENERAL PUBLIC LICENSE version 3.
Posted from GScribble.
Thursday, April 29, 2010
Tuesday, April 20, 2010
Defining various roles via ActiveRecord Associations using Ruby on Rails
I have a User model. and I have a Project model.
Now a User could be associated with a Project in three ways,
* It could propose as project
* It could mentor a project
* It could be a student working on a project
I had added three foreign keys in my Project model,
Now how do I associate the three foreign keys with the User object?
Solution:
Add the following associations to your Project model:
Now you can access your user from the Project instance like this:
where project is an instance of Project model and proposer, mentor, student would be instances of the User model.
Foreign keys changed to match Rails conventions as proposed by Shakthi Kannan
Updates:
To access the assiciations from the User model, use the following associations:
From your user model you can access the associations from your User instance like this:
Posted from GScribble.
Now a User could be associated with a Project in three ways,
* It could propose as project
* It could mentor a project
* It could be a student working on a project
I had added three foreign keys in my Project model,
t.integer "proposer_id"
t.integer "mentor_id"
t.integer "student_id"
Now how do I associate the three foreign keys with the User object?
Solution:
Add the following associations to your Project model:
belongs_to :proposer, :class_name => "User", :foreign_key => "proposer_id"
belongs_to :mentor, :class_name => "User", :foreign_key => "mentor_id"
belongs_to :student, :class_name => "User", :foreign_key => "student_id"
Now you can access your user from the Project instance like this:
@proposer = project.proposer
@mentor = project.mentor
@student = project.student
where project is an instance of Project model and proposer, mentor, student would be instances of the User model.
Foreign keys changed to match Rails conventions as proposed by Shakthi Kannan
Updates:
To access the assiciations from the User model, use the following associations:
has_many :project_proposals, :class_name => "Project", :foreign_key => 'proposer_id'
has_many :project_mentorships, :class_name => "Project", :foreign_key => 'mentor_id'
has_many :project_internships, :class_name => "Project", :foreign_key => 'student_id'
From your user model you can access the associations from your User instance like this:
@project_proposals = user.project_proposals
@project_mentorships = user.project_mentorships
@project_internships = user.project_internships
Posted from GScribble.
Monday, April 19, 2010
gscribble + blogger
Hi,
Its been long I had been expecting Blogger support for Roshan Singh's gscribble.
This weekend Roshan sent me an RPM, and told me to test it. So that is what I am doing right now.
It fetches all my recent posts, and gives me an option to edit it. Although I do not get to see pictures in the 'Visual' mode.
Also it would have been great if I was able to write/edit my posts directly from the 'Visual' tab.
I see the gscribble logo I had made for Roshan on the notification area. Clicking it hides the gscribble window. Clicking it again, revives the window, but the tab switches to 'Visual' and the 'Categories' pane has to be resized again.
Now I'm going to publish this blog, but I see two buttons below: 'Post' and 'Publish'. Which one to click?
Posted from GScribble.
Its been long I had been expecting Blogger support for Roshan Singh's gscribble.
This weekend Roshan sent me an RPM, and told me to test it. So that is what I am doing right now.
It fetches all my recent posts, and gives me an option to edit it. Although I do not get to see pictures in the 'Visual' mode.
Also it would have been great if I was able to write/edit my posts directly from the 'Visual' tab.
I see the gscribble logo I had made for Roshan on the notification area. Clicking it hides the gscribble window. Clicking it again, revives the window, but the tab switches to 'Visual' and the 'Categories' pane has to be resized again.
Now I'm going to publish this blog, but I see two buttons below: 'Post' and 'Publish'. Which one to click?
Posted from GScribble.
Friday, March 26, 2010
HTML attachments in sup
For all those who don't know I've been using sup to read my office mails.
Sup has a terminal based UI, and like all other terminal based UIs it hates HTML attachments. Even I hate HTML attachments. But some people don't, and they continue to send mails in HTML.
Keying 'enter' on the attachment tells,
'Couldn't execute view command, viewing as text.'

It shows the entire HTML code and, that's ok if you know how to read HTML, but who wants to read html?
So enter pipe.
I press pipe '|' key which invokes the shell pipe on the attachment. Then I type in 'elinks' and press enter.
Voila.

P.S. : On Fedora, yum install elinks. Elinks is a terminal based web browser. :-)
Sup has a terminal based UI, and like all other terminal based UIs it hates HTML attachments. Even I hate HTML attachments. But some people don't, and they continue to send mails in HTML.
Keying 'enter' on the attachment tells,
'Couldn't execute view command, viewing as text.'

It shows the entire HTML code and, that's ok if you know how to read HTML, but who wants to read html?
So enter pipe.
I press pipe '|' key which invokes the shell pipe on the attachment. Then I type in 'elinks' and press enter.
Voila.

P.S. : On Fedora, yum install elinks. Elinks is a terminal based web browser. :-)
Monday, March 22, 2010
RubyConf Day 2
Sunday, March 22nd
Bangalore
I reached some 15 minutes late. Nick Sieger was already taking on "Exploring Rails 3 through choices". He was taking about/demoing some cool features coming up in Rails 3. I like the lazy querysets part, which was missing in Rails and was already available in Django.
Pradeep Elankumaran, a US based entrepreneur, then took the stage and talked about the huge trend of startups in India. The session was very interactive with Pradeep talking on "The Startup Mindset" and the people in the audience chipping in with their views/experiences on the startup trend. I was listening intently and reflecting why I am not ready to do a startup at this stage of my career. The discussion ate into the lunchtime.
Pradeep also mentioned and thanked Satish Talim and his efforts in spreading Ruby as a language in India.
Lunch was good.
Post lunch I sat through Sarah Taraporewalla's session "Taming of the View". She talked on how/why Rails erb templating sucks and mentioned other ways of developing good Views including a tool she developed called Slippers.
Vineet Tyagi talked next on how he build his Web Application Server, WebROaR. It was cool how he compared building an appserver to building a house and went ground up. He was very good at explaining stuff, it was like slitting in a classroom.
I then took a coffee break. I later realised I missed an awesome talk by Brian Guthrie on Advanced Ruby Idioms. The next talk "Hacking and learning from Open source Ruby (Open source Rubyisms)" by Sreekanth Vadagiri went totally over my head.
The last show at RubyConf India, 2010 was ThoughtWorks Founder/Chairman Roy Singham. I looked up Ry on the internet and found that he does not have a significant online presence, quite a surprising thing for the leader of a Company like ThoughtWorks. He talked about agile and other recent trends in the software industry and how they have been producing good results. There was a minor flame war between Roy and Obie when he mentioned the split between the Ruby and Rails community. He mentioned that the 28 women at RubyConf India was the maximum attendance for women at ant Ruby/Rails conference in the world. He wanted us to use our enthusiasm and help the not so fortunate people in India.
It was 6pm and I had to run to the BLR Airport for my flight at 8:30pm. What happened there is another story.
That's all.
Bangalore
I reached some 15 minutes late. Nick Sieger was already taking on "Exploring Rails 3 through choices". He was taking about/demoing some cool features coming up in Rails 3. I like the lazy querysets part, which was missing in Rails and was already available in Django.
Pradeep Elankumaran, a US based entrepreneur, then took the stage and talked about the huge trend of startups in India. The session was very interactive with Pradeep talking on "The Startup Mindset" and the people in the audience chipping in with their views/experiences on the startup trend. I was listening intently and reflecting why I am not ready to do a startup at this stage of my career. The discussion ate into the lunchtime.
Pradeep also mentioned and thanked Satish Talim and his efforts in spreading Ruby as a language in India.
Lunch was good.
Post lunch I sat through Sarah Taraporewalla's session "Taming of the View". She talked on how/why Rails erb templating sucks and mentioned other ways of developing good Views including a tool she developed called Slippers.
Vineet Tyagi talked next on how he build his Web Application Server, WebROaR. It was cool how he compared building an appserver to building a house and went ground up. He was very good at explaining stuff, it was like slitting in a classroom.
I then took a coffee break. I later realised I missed an awesome talk by Brian Guthrie on Advanced Ruby Idioms. The next talk "Hacking and learning from Open source Ruby (Open source Rubyisms)" by Sreekanth Vadagiri went totally over my head.
The last show at RubyConf India, 2010 was ThoughtWorks Founder/Chairman Roy Singham. I looked up Ry on the internet and found that he does not have a significant online presence, quite a surprising thing for the leader of a Company like ThoughtWorks. He talked about agile and other recent trends in the software industry and how they have been producing good results. There was a minor flame war between Roy and Obie when he mentioned the split between the Ruby and Rails community. He mentioned that the 28 women at RubyConf India was the maximum attendance for women at ant Ruby/Rails conference in the world. He wanted us to use our enthusiasm and help the not so fortunate people in India.
It was 6pm and I had to run to the BLR Airport for my flight at 8:30pm. What happened there is another story.
That's all.
Sunday, March 21, 2010
RubyConf India, Day 1
Saturday, March 21st
Bangalore
Arrived yesterday(Friday). Staying with my friends at BTM Layout. Its a bit far from the RubyConf venue.
Reached a bit late to the conference, (due to some venue location problems). I got my speaker/delegate kit. Ola Bini had already started with his talk on "The Future of Programming languages". He was talking of various programming languages and different programming paradigms, with special reference to Ruby.
Obie Fernandez came next with his talk titled - "Blood, Sweat and Rails 2010". His talk was pretty fun. From what I gather he worked with ThoughtWorks and now has his own company called HashRocket(both RubyConf India sponsors). His talk was filled with anecdotes from his work experience and their work culture. He also talked about Rails best practices. He used a lot of 'expletives' and was reprimanded for that.
After lunch(which was very tasty), I could be found sitting at the Sessions Hall(Track 1) looking through my slides and writing notes. There were a lot of people attending at the room, so I was a bit nervous. Ivan Porto Carrero could not make it to India so they set up a Skype video call for his talk - "IronRuby: The Ruby &.NET Love Child". There was a lot of technical glitches and the talk finished fast. I was next.
Because of all the confusion in the previous talk, the attendance had rarefied. I was feeling a bit more confident as a result(don't ask me why). I did not screw up much during my talk(except for the RoR requires a steep learning curve part, which the audience did not approve of; followed by a heated discussion). I had made my slides using Latex+Beamer(was an interesting experiment, came out good). I have shared them here.
I rushed to the main hall, where they were setting up a video call with Yukihiro (matz) Matsumoto, the developer/designer of Ruby. His talk was called 'Ruby 124C141+'. The name referred to a science fiction novel of a similar name. 124C41 meant "one to foresee for one", and he was basically all about the future of Ruby Language. His talk was interesting and informative. The audience went crazy.
After that I attended Sitting in Sai Venkatakrishnan & Hari Krishnan's talk "Concurrency patterns with Ruby"(which I did not pay much attention to) and "Mortal Kombat" presented by SlideShare Designer, Arun J and Lead Developer, Kapil Mohan(which was pretty interesting, and they addressed the code-embedded-in-template problem by using hquery).
I had lost my Relience Netconnect Datacard which I found mentioned on Gautam Rege's tweet.
Pre and during dinner I spent my time talking to the other delegate/speakers. Interacting with them was good fun. I had to leave at 8:30pm, otherwise I would not have got a bus back.
Stay tuned for Day 2.
Bangalore
Arrived yesterday(Friday). Staying with my friends at BTM Layout. Its a bit far from the RubyConf venue.
Reached a bit late to the conference, (due to some venue location problems). I got my speaker/delegate kit. Ola Bini had already started with his talk on "The Future of Programming languages". He was talking of various programming languages and different programming paradigms, with special reference to Ruby.
Obie Fernandez came next with his talk titled - "Blood, Sweat and Rails 2010". His talk was pretty fun. From what I gather he worked with ThoughtWorks and now has his own company called HashRocket(both RubyConf India sponsors). His talk was filled with anecdotes from his work experience and their work culture. He also talked about Rails best practices. He used a lot of 'expletives' and was reprimanded for that.
After lunch(which was very tasty), I could be found sitting at the Sessions Hall(Track 1) looking through my slides and writing notes. There were a lot of people attending at the room, so I was a bit nervous. Ivan Porto Carrero could not make it to India so they set up a Skype video call for his talk - "IronRuby: The Ruby &.NET Love Child". There was a lot of technical glitches and the talk finished fast. I was next.
Because of all the confusion in the previous talk, the attendance had rarefied. I was feeling a bit more confident as a result(don't ask me why). I did not screw up much during my talk(except for the RoR requires a steep learning curve part, which the audience did not approve of; followed by a heated discussion). I had made my slides using Latex+Beamer(was an interesting experiment, came out good). I have shared them here.
I rushed to the main hall, where they were setting up a video call with Yukihiro (matz) Matsumoto, the developer/designer of Ruby. His talk was called 'Ruby 124C141+'. The name referred to a science fiction novel of a similar name. 124C41 meant "one to foresee for one", and he was basically all about the future of Ruby Language. His talk was interesting and informative. The audience went crazy.
After that I attended Sitting in Sai Venkatakrishnan & Hari Krishnan's talk "Concurrency patterns with Ruby"(which I did not pay much attention to) and "Mortal Kombat" presented by SlideShare Designer, Arun J and Lead Developer, Kapil Mohan(which was pretty interesting, and they addressed the code-embedded-in-template problem by using hquery).
I had lost my Relience Netconnect Datacard which I found mentioned on Gautam Rege's tweet.
Pre and during dinner I spent my time talking to the other delegate/speakers. Interacting with them was good fun. I had to leave at 8:30pm, otherwise I would not have got a bus back.
Stay tuned for Day 2.
Friday, February 26, 2010
GNUnify '10 or How I managed not to screw up my talk on Dorrie
Kushal Das just came out with his blog post on his Python Workshop at GNUnify '10 and I realised I hadn't published any on my experiences.
So here goes.
I sent in my proposal for GNUnify '10 on 5th of Feburary, which was apparently the last day. So when the first schedule came out, I wasn't listed and my proposal showed a "Pending" status, so I thought maybe I would visit as a delegate.
By some twist of fate the proposal suddenly got accepted, and since my talk was on Dorrie, I realised that meant I had to add some more features to it so that my talk is not the same as the one I gave at FOSS.IN/2009.
Unfortunately there was little time to do that and combined with my sudden realisation the day before GNUnify was to start, that it would start on Friday(the next day) and not Saturday, I found myself at the event without any slides or new features.
Day 1, GNUnify I could not do anything useful as my laptop was being used by Mr. Amit Shah, the KVM developer. I however attended both his talks and found them quite interesting. (Was wondering why KVM is never demonstrated as an example by professors teaching Computer Science students about Virtual Machines and how much interest that would gather from the classroom.)
That night and the next morning (Day 2), I spend trying to add proper spin building messages into the web interface and getting a "Download ISO" link up. Then I updated my slides.
Right before my talk Hiemanshu Sharma was talking about "Building your own Fedora Remix" and I thought that would be an apt introduction to the next talk (which was my talk on Dorrie), which dealt with a "Web interface for building your own Fedora Remix". Unfortunately, Hiemanshu's talk was predominantly lacklustre and lost quite a bit of the audience.
I went up next with my talk on Dorrie. This talk, as compared to one I delivered at FOSS.IN, was went pretty awesome. I was talking and not blabbering and managed to connect with whatever people were present in the audience.
Here is a picture of me waiting for the "Download ISO" link to turn up.(Courtesy Kushal Das)

You can download my slides from here.
So here goes.
I sent in my proposal for GNUnify '10 on 5th of Feburary, which was apparently the last day. So when the first schedule came out, I wasn't listed and my proposal showed a "Pending" status, so I thought maybe I would visit as a delegate.
By some twist of fate the proposal suddenly got accepted, and since my talk was on Dorrie, I realised that meant I had to add some more features to it so that my talk is not the same as the one I gave at FOSS.IN/2009.
Unfortunately there was little time to do that and combined with my sudden realisation the day before GNUnify was to start, that it would start on Friday(the next day) and not Saturday, I found myself at the event without any slides or new features.
Day 1, GNUnify I could not do anything useful as my laptop was being used by Mr. Amit Shah, the KVM developer. I however attended both his talks and found them quite interesting. (Was wondering why KVM is never demonstrated as an example by professors teaching Computer Science students about Virtual Machines and how much interest that would gather from the classroom.)
That night and the next morning (Day 2), I spend trying to add proper spin building messages into the web interface and getting a "Download ISO" link up. Then I updated my slides.
Right before my talk Hiemanshu Sharma was talking about "Building your own Fedora Remix" and I thought that would be an apt introduction to the next talk (which was my talk on Dorrie), which dealt with a "Web interface for building your own Fedora Remix". Unfortunately, Hiemanshu's talk was predominantly lacklustre and lost quite a bit of the audience.
I went up next with my talk on Dorrie. This talk, as compared to one I delivered at FOSS.IN, was went pretty awesome. I was talking and not blabbering and managed to connect with whatever people were present in the audience.
Here is a picture of me waiting for the "Download ISO" link to turn up.(Courtesy Kushal Das)

You can download my slides from here.
Subscribe to:
Posts (Atom)