Tuesday, May 24, 2011

Codepad & Pastebin : Two really good tools

I came across some really awesome tools and I thought I should share them for the greater good of the world of noob developers. While working, you must have felt the need to share a certain snippet of code with a friend or people in IRC channels for support and it gets really pissing off for both you and them when you email them lines of code or even worse, paste your output in IRC channels which encourages not more than 1-2 lines.

Codepad is a nice tool wherein you can paste a code in the window and the output is displayed and a URL is given for the whole page which contains the code and the output. It supports a number of languages and sharing is a lot easier now since it's just a URL.

Similarly, pastebin is a similar tool where you just paste stuff..anything practically..more of like a cloud clipboard. You could paste code, output of a certain command that needs to be shared etc. It offers syntax highlighting et al. A cleaner tool than pastebin is http://paste.pocoo.org/

Monday, May 23, 2011

A git's perspective of Github

I recently started using Github while I was working on OSS projects and would like to give my perspective on it. Simply brilliant! A part and parcel of nearly every OSS project, Github is a wonderful tool for developers because you are able to create a project, let anyone in the world fork your project and only you can commit it to the main repository if needed. Founded by Linux founder, Linus Trovalds and Tim Preston Werner, git is a distributed version control. This wonderful article by the co-founder  Tim is definitely worth a read to understand the basics of Git.

Also, if you prefer learning by doing, you can visit http://pcottle.github.io/learnGitBranching/?demo  Choose levels option at the bottom right of the page to go through all the levels.

Github may put you off initially especially if you have been using SVN, because of its complexity but it definitely has a lot of candies under its belt. Starting with the Github help, you can create a repository, watch other developers' repositories, fork them and commit changes to repositories you have created. I use Github on Linux, it's a lot simpler there. Read this to get started.

SVN (Source version control) was used primarily before github (and is still used) for software development and I have used both of them. SVN is a lot simpler then github with fewer commands because there is only one repository - the one on the server. Unlike in git, where you can commit changes locally to your computer (very useful when you are offline), SVN doesn't let local commits. So, if you don't have an internet connection, you actually have to copy paste your code if you are using SVN. For more differences between SVN and github, visit this post or this.

Another distributed version control is Mercurial. I haven't used Mercurial yet but most open source softwares use Github though I know many enterprises which use Mercurial. It is also called hg, the command-line name for this version control (notice: Hg = Mercury :P). A really funny but informative analogy comparing Mercurial to Github can be read here.

P.S: You can follow me on Github here.

Friday, May 13, 2011

Angry Birds now on the Web: Google I/O

This was the first Google I/O conference I saw (online obviously, the tickets for the event in San Francisco were sold out in 58 minutes!). It was brilliant. There was a hell lot of good news including a flat rate of 5% for chrome app developers, ability to make in-app payments etc. All announcements during Google I/O can be viewed here. A loyal follower of the Firefox browser, I have now actually completely moved to Chrome.

But the best of all is the news that Angry Birds is now available as an app on the Chrome Web store. That's right, now whatever be your operating system, you can still play. Complete game with all levels plus a 'chrome destination' which has a 'chromy' landscape. And the best part of it all, you can play it offline on the chrome browser. The game is stored locally on the computer. Brilliant, right? Just go ahead and play! Plus, if you still are not ready to download chrome, you can play it on any browser here.



Chromebooks were also announced during Google I/O, notebooks with the Chrome OS released by a few companies like Samsung and Acer. With a brilliant battery life and a really small startup time, it really seems to be a good buy.


The latest of WebGL and HTML 5 were made known and all in all, it was just brilliant. Here are some of the chrome experiments, some of which use WebGL. The countdown looked really cool. However, I had installed the latest version of Chrome on Ubuntu but the WebGL experiments didn't work giving a message saying that "WebGL is not supported by this browser". If I am not wrong, WebGL is still not yet completely supported by many browsers including Chrome on Linux. Chrome on windows should be supporting it.

Tuesday, May 10, 2011

GSoC and Me

This was the first year I had applied to the internship program by Google, the Google Summer of Code. Its 2011 edition had quite a few interesting open source softwares as mentor organizations. Apart from the usual heavyweights like Wordpress, Drupal and the likes, one which caught my eye was a personal finance management software GnuCash. It has some pretty cool features like getting stock prices automatically updated, creating reports and budgets, importing files from other financial softwares etc. It also makes the accounting process a more transparent one since the user has to enter where the money is moving to and from where ( else you would have a very conspicuous ‘Imbalance’ Account).

GnuCash was the only organization I applied to with the proposal of developing an RSS feed reader within the GnuCash window where the user can track how his stocks are performing, how the competitor shares are performing and expert advice from financial newspapers etc. My proposal, however was not accepted :( Nevertheless, my work at GnuCash including fixing bugs, building from source, playing around with the code and editing glade files has got me really interested in Open Source Software development. You definitely feel really good when you see your first patch committed.

I have attached my GSoC proposal lest Google should remove the proposals from their page.

Title: Live news feed from financial newspapers as a GnuCash plugin

Abstract:

GnuCash is a multi-platform account management software. It has a number of features including adding accounts for equities you have invested in. However apart from stock prices updates, there is no plugin in GnuCash which gathers live news feed from financial newspapers and brings it to the user without him/her having to open a browser and scan sites to see how his portfolio is performing, stock news, news about the companies invested in and feeds from blogs of stock market experts. The plugin I wish to implement works like an RSS reader and allows users to track any information (available on the internet) related to the stocks he has invested in. The user can view the entire original web page, by clicking on the summary which acts like a link and opens in a browser. This plugin would be a step towards making the GnuCash software a more internet based one.

Benefit to the users:

While GnuCash gives a platform for users to keep a record of their equities and keep track of stock price updates automatically, it is better to provide a more personalized approach with respect to "HOW" or "WHY" the stock price actually changed and this plugin comes into play scanning financial news feeds and bringing the news right into the window of GnuCash.
I felt the need for this because I usually open my browser for financial news in sites like www.economictimes.com to know about the latest developments in the companies I have invested in. This plugin would bring this relevant information in GnuCash without having to go elsewhere.
Moreover, the support for gtkmm widgets is relatively new and the documentation for it is still in the nascent state. I wish to improve this documentation and develop plugin support using this technology, thereby encouraging a larger pool of developers to develop quality plugins using it. I feel GnuCash has not yet tapped into this area and if done so, it would greatly increase the functionality of GnuCash.

Project Details:


GnuCash has a lot of features including accounting for equities and shares. GnuCash allows the user to select automatic updation of stock quotes through the Price Editor. However, any change in these quotes, big or small, will definetely have the user asking for more information like for example, the reasons for these changes, how is the market performing in general, how are competitior shares performing etc. And for this, the user will have to open his browser and views news from finance newspapers and advice from stock market experts. This is why I thought of creating a plugin which functions like an RSS feed in the GnuCash window itself and scans financial news and other stock news and expert advice from newspapers and other sources selected by the user beforehand. Thus, a personalised live news feed is available to the user in GnuCash itself.
Possible implementation methods available are:
·         A webkit window which loads an HTML page with embedded javascript which is saved in the gnucash's installation path.
·         Using C code to implement gtk widgets
·         Using C++ code to implement gtkmm widgets
·         Using Scheme to write a plugin

I have seen and tweaked around the existing support for the first three technologies in GnuCash.

I have looked into some plugins developed using gtk and also the webkit rendering done for the reports in GnuCash. I have narrowed my choice of implementation down to 2 methods -

- Webkit window using html and javascript
- gtkmm widgets.

Support for gtkmm widgets is a relatively new functionality. However, I feel gtkmm is the implementation method I would choose because of the functionality it provides and the ability to mix C code if necessary. It can also be easily integrated in the codebase of GnuCash.

Currently, I am developing some test menu plugins similar to the bi_import plugin and have familiarized myself with how the UI and backend code can be implemented. These plugins can live in src/plugins/ . They will be included under Tools in the menu toolbar. On clicking, the action in the ui.xml file will be called. I am working on different actions that a plugin can perform.

Also with respect to GnuCash functionality and working, I am going through a couple of existing minor priority bugs and getting more familiar with the source code.

Deliverables:

·         A plugin wherein the user gets personalized live news feed from financial newspapers and other sources.
·         The plugin will have the following features:
  The RSS Feed tab in the Edit>Preferences window will show the feeds subscribed to under the folders the user has created in a tree view form. For example, if the user has created a folder called Blogs, the blogs subscribed to by the user will be displayed under it. So is the case with a folder called Financial Newspapers. I have created a Mockup by editing the preferences window in src/gnome-utils/preferences.glade file using the Glade Interface Designer.
      Buttons on the left will open up another window. For example, the add button will open a window where the user can add feed urls. (mockup)
  Edit and delete the feed urls and organize the feed urls into specific folders.
   GnuCash Feed window displaying the summary of the link in the feed. This will be under Tools>RSS Feeds. If a user wants to see a more detailed report, the user can click on the title which acts as a link to see the complete web page through a browser.

If time permits, I plan to include some of these functionalities described below. I intend to implement some of these ideas after the GSoC as an ongoing effort to improve the plugin functionality:

·         Support for APML – Attention Profiling Mark up language
 APML is an open standard (in APML.xml) that encapsulates our interest through our feed urls in an open standard way. Having this information, we can use it to communicate or choose proper feeds, enable/ disable feed based on our attention value.
·         Offline availability of feed content and better organization of feed urls
Based on user input, the plugin chooses how much data (in terms of MB) should be cached for future offline reading and for how long. Also based on this information, we can suggest to users to delete feed urls that do not have updates for a threshold time, which can again be set by the user itself.
·         User can remove specific news feed based on keywords.
Sometimes, newsfeeds from a particular feed URL can be overwhelming and users might want to restrict the newsfeed by choosing only topics within a particular feed that they are interested in. This seems to be a challenging idea, but after implementing the current functionality of the plugin, I could decide on the feasibility of this feature. We can also make use of the APML profile to automatically enable/disable news items from news feed. 
  

Project Schedule:

Before 23 May
·         Study in detail the Glib library, and implementation of widgets and integration of plugins with the codebase of GnuCash
·         Develop test plugins using the above mentioned implementation methods.
·         Bond with development community and ask for suggestions and feedback on the test plugins developed
·         Work on the UI and back end design of the plugin

23 May – 11 June
·         Develop the code to display the GnuCash Feed window for displaying the RSS feeds within gnucash.
·         Develop the menu for the plugin and other UI related work.
·         Modify the makefile for including the plugin in the building and configuration step.

12 June – 11 July
·         Develop the RSS Feeds tab under Edit>Preferences for viewing and adding feeds.
·         Develop code to allow users to create folders for related feed urls.
·         Develop the Add dialog box and Edit dialog box for the plugin.
·         Document the code using doxygen.

12 July – 15 July
Mid Term Evaluation

13 July – 9 August
·         Develop the code to display the URLs within the GnuCash Feed Window and show a short summary of the link.
·         Work on the rendering of the web pages and other intricate user design details, by taking advice from mentors and other developers.

     10 August- 22August
·         Complete the documentation and test for bugs.
·         Write up a developer documentation manual that would help other developers to build plugins for GnuCash easily.
·         Buffer time for any unforeseen delays.

Bio/Programming Experience:

I am undergraduate student studying Computer Science and Engineering in NITK Surathkal, India.

I have built GnuCash from source. Using svn, I checked out the source on my linux system. I have built other softwares from source and am very comfortable with svn commands and creating patches.

C and C++ are my favourite languages and have coded almost all my projects using these languages for the past 4 years. In Grade 12, I created an air travel management software using C++ (graphics included) with a friend of mine as a course project. As part of my course work in my fourth semester, I am currently working on developing the popular game, Tetris. It uses the C++ graphics library, OpenGL.

I am also very good at web development and have a strong command over HTML, PHP, MySQL and JavaScript. I am a part of the Web Club at NITK and I have created many websites. Notable ones among them include the website for the Student Union of my college (NITK) which is currently hosted on a free server for development purposes. We are in the final phase, just fixing a few bugs and filling content. It should be moved to the NITK server by the end of April. It will have the details of all students of the college on its database and in the near future, we intend to include sms feature and fees payment through it. I have also lent a helping hand to the development of the site for Eforea, the Entrepreneurship cell of NITK which was made using Joomla. I have also created a basic test Facebook application using HTML and JavaScript and I intend to make more advanced apps using the Graph Protocol and Facebook API.

I am also good at assembly level programming. We are currently learning Microprocessor and Interfacing (Intel 8086 microprocessor) using TASM (Turbo Assembler). As part of this course, I am currently working on developing a speed sensor to detect speed of cars on highways. It uses 2 piezoelectric sensors to detect the entry and exit of cars on a particular strip of road of known length. The time is calculated using a timer and the speed is thus calculated and displayed on seven segment display board.

I am an avid fan of the Linux operating system and a user of Ubuntu for the past 2 years. I have experience in Windows as well. However for this project I will be using linux for development purposes. I have good experience using the gcc compiler, the Gnu Debugger and doxygen for development, testing and documentation.  

Moreover, apart from programming, I am very interested in finance and keep a constant watch on the stock market. I have appeared for and passed India's National stock Exchange (NSE) certified financial module, “Financial Markets”.

Why GnuCash?

GnuCash is a finance management software that has helped me get a better understanding of the world of finance. I have been using it for some time and I am proud to say that GnuCash has definitely helped me be moneywise keeping track of my finances.  When I came to know that it was selected for GsoC 2011, I really wanted to be a part of the project. In fact, this is the only proposal I have sent for this year's edition of GSoC.

I believe that coding for open source communities is something that would require skill and diligence from my part and I am very passionate about this. GnuCash is a very good desktop application for managing finance. I would like to add more functionality that makes it more internet based and the RSS feeds plugin is a first step.

I hope to be a part of the GnuCash team during GSoC, and post-GSoC, and would love to see my code being shipped as part of a release in the near future. Apart from my love for programming, my interests in finance and being a part of the developer community of a software I regularly use, have triggered me to contribute to this project.

Thursday, May 5, 2011

Facebook Messages (a.k.a Free International SMS)

Facebook messages page as you all know has been completely revamped. It now has much more functionality than before. Firstly, you get an email account with <fbusername>@facebook.com allowing you to send mails from Facebook to other email providers like Gmail, YahooMail etc. (If you haven't yet created  an fb username, do so asap. You can then login with your username rather than your email id and anyone in the world can view your profile with the link www.facebook.com/yourfbusername.) You can add attachments and even a pic/video with your webcam. Do check it out. It is pretty cool.

But the best thing is the fact that you can sync your cell number with Facebook messages. This can be done on the messages page of your facebook account after having created an email id with facebook. You will be sent an sms confirmation and Bingo! So, the next time someone sends you a message on facebook, you will also get it on your phone as a text message if he checks the 'send to phone' box while sending a message. You could also reply using your phone.

An awesome way to send free international sms, huh! Check this link out for more details.

Adding Facebook contacts to Gmail - Decoded!

It's official. How to add facebook contacts into your gmail contacts? Many of my facebook 'friends' were quite irritated with facebook's one way door policy which allows import of contacts from Gmail, hotmail etc but not the reverse. The catch here is that email ids we enter in our personal info is displayed as an image rather than text, which means you would have to add each one individually until now ofcourse. Prolificious claims to be able to do this, converting this image to text and adding contacts to your gmail. I don't know how far this is true as I have never used it myself because of its 'suspicious', shady name. So, is Mark Zuckerbeg still too good at grabbing stuff but giving nothing in return apart from Facebook, ofcourse? Well, his protective armour has been stripped. And it's a sight to behold.



To put things straight, YahooMail has already done it. So, my inactive yahoo ID did come of use finally. It's simple. Import contacts from Facebook using Yahoo's import feature under Tools in the YahooMail contacts page. Then, download the yahoo contacts as a csv file on your computer. After this, all you have to do is go to Gmail and import the csv file and voila! You are ready to go.

Go ahead, lets hope you have not forgotten your Yahoo! password. And if you are utterly jobless, trawl through the 1000+ emails in your Yahoo! inbox. I am in 666 and counting.

Wednesday, May 4, 2011

Ubuntu Synaptic Manager unable to install any new packages

This was a major problem for me in the initial stages as an Ubuntu noob. The synaptic manager simply didn't install any new packages saying there were from unreliable sources. Changing the repositories to global and fiddling with the settings of the Synaptic Manager had no effect. Its a big turn off when you can't install VLC player and other stuff just when you were beginning to think Ubuntu was awesome.

I finally got a way around it last week. I changed the server which was used for the installation of packages. It was set to the default server (server for India). This can be changed by going to System>Synaptic Package Manager>Settings>Repositories>Ubuntu Software>Download from:
Here you choose Other.. and Select Best Server. It will try pinging a few servers and after a few seconds..Bingo! You have got the best server to install packages. For me, it was somewhere in Indonesia!

I cannot guarantee whether this might work for you. But, if changing repositories and other settings in Software Sources doesn't get you anywhere, try this out.

Spellcheck not working in OpenOffice

I am pretty sure many of you must have come across this problem in OpenOffice. The spell check simply doesn't seem to work. I always had this problem when I used it in Ubuntu 10.04 and it still lingered in Ubuntu 10.10.

I remember scanning forums after forums but never quite got an answer. I however got it fixed last night. The language settings in my OpenOffice were set to English(India) for which spellcheck is not supported. It is only supported by a few default languages like English(USA) and English(UK). After changing back the language setting to English (UK), spellcheck is working again :). This can be done by changing to English(UK) in Tools>Language>For All Text.

This may or may not work for you. But, I am pretty sure this is atleast one of the main reasons most people's spellchecks don't work in OpenOffice including a few of my friends.