Tuesday, April 16, 2013

Basics on setting up Git and GitHub using Eclipse

Setting up Git user preference in eclipse:
- Select Window > Preferences > Team > Git > Configuration to set them up
- To add your user, use the user.name as key and your real name as value
- Repeat the procedure for your email address: user.email

To create a local Git repository:
- Right click on the project and go to Team > Share Project
- In the "Configure Git Repository" dialog box, selct the "Create" button to create a new repository
- Provide a Name for the project repository (could be same as the project-name itself). Click on Finish
- Click Finish in the original dialog box

To commit the whole project, folder or a single file:
- Right click on the resource to be committed and press commit
- In the Commit dialog box that opens, enter a sensible commit message. Choose the file/s to be committed
- Press "Commit" button to commit changes to the local repository. Press "Commit and Push" button to commit changes to the GitHub (or any permanent) repository
- You can also open the "Git Staging" view and take a look at all the "Unstaged Changes" area
- Drag and drop the files (to be committed to local repo.) to the "Staged Changes" area
- Type in a commit message in the "Commit Message" area. Press one of "Commit" or "Commit and Push" buttons to commit the file/s

To upload a project to GITHub repository:
- Open "Git repositories" view in eclipse
- Right click on the project (in Git repositories tab) to be uploaded to Git Hub and select the "Push" option
- In the dialog box that opens, enter the git hub URI of your repository. The Rest of the the entries would be filled up by eclipse itself. Click Next
- In Source Ref chose the master [branch] option from the drop down. Click the Add Spec button
- Click Next to press finish or press finish directly
- The project would get upload to GitHub. Check GitHub repository to ensure this has happened

Reference:
I followed this excellent article by Lars Vogel.
http://www.vogella.com/articles/EGit/article.html

Thursday, April 19, 2012

Campaign against Drunk Driving in Nepal

Below I have briefly discussed about the “Campaign against Drunk Driving or Drink and Drive in Nepal”.

These days it has become a very common sight to see Traffic personnel giving alcohol consumption tests to vehicle drivers. The campaign started off back in December of last year. And up until a few days ago, they were using their sensing ability to monitor alcohol consumption by the drivers. Now as reported by news sources, "Breathalyzer" machines have been introduced for this purpose. This should render the process more accurate and efficient.    

Another aspect to this campaign is that there is a policy of “Zero tolerance on drink-driving” which to be fair can be considered overly strict and a bit unreasonable as well. It would be better to set up a threshold of alcohol consumption beyond which a person could be penalized.

Another interesting development in this campaign is that the Government has decided to award 15% of all Revenue collected through fines to the Traffic police. Given the amount of hard work put up by the department, they do deserve it. But, a problem could be that personnel could be enticed to punish (public) rather than prevent (mishaps).

Hence, to conclude the campaign is a very good move considering public welfare and security but improvements, wherever applicable, must be made.

Wednesday, February 1, 2012

Sandy's Birthday Dec 8,2011


We took these pictures for a small birthday celebration for our dearest friend Sandeep Dhakal known to us as "Sandy". In the pictures we have myself (Ashish Karki), Ashish Raj Dhungana, Sandy, Vijaya Bhandari and my Mom and Dad.
Once Again, Best Wishes to Sandeep. Wishing for his prosperous future.
Posted by Picasa

Friday, January 27, 2012

Canopy clustering algorithm

Canopy clustering algorithm

It is an unsupervised pre-clustering algorithm performed before a K-means clustering or Hierarchical clustering.
It is basically performed to speed up the clustering in the case of large data sets, in which a direct implementation of the main algorithm may be impractical due to the size of the data set.

Algorithm

Start with a set/list of data points and two distance thresholds T1 > T2 for processing.

  1. Select any point (at random) from this list to form a canopy center.
  2. Approximate its distance to all other points in the list.
  3. Put all the points which fall within the distance threshold of T1 into a canopy.
  4. Remove from the (main/original) list all the points which fall within the threshold of T2. These points are excluded from being the center of and forming new canopies.
  5. Repeat from step 1 to 4 until the original list is empty.
For an exhaustive study please go through a paper by McCallum, Nigam and Ungar, located at http://www.kamalnigam.com/papers/canopy-kdd00.pdf

References:

  1. Andrew McCallum, Kamal Nigam and Lyle H. Ungar, Efficient Clustering of High-Dimensional Data Sets with Application to Reference Matching
  2. https://cwiki.apache.org/MAHOUT/canopy-clustering.html
  3. http://en.wikipedia.org/wiki/Canopy_clustering_algorithm

Wednesday, January 25, 2012

jQuery document.ready() function

jQuery document.ready() function: syntax and features

JavaScript provides us with load() function in order to perform specific action whenever the DOM gets loaded (i.e. a page gets rendered). One issue with this function is that it is not triggered until all the elements within the page (including the images) get displayed. With $(document).ready() function, all the event driven codes in JavaScript are guaranteed to be run once the DOM is ready.

The syntax for .ready() is illustrated by the following example:
            $(document).ready(function(){
                        alert('This code is triggered once the DOM is ready');                               
// perform other necessary actions if any
            });

A short way to write the same function is as follows:
            $(function(){
                        alert('This code is triggered once the DOM is ready');                               
// perform other necessary actions if any
            });

A simple reason that we can shorten our code is that any function which is passed as an argument to the jQuery constructor is bound to the document ready event.

Another very important feature of $(document).ready() is that it can be used or referenced more than once within a document. So the following piece of code would be possible (within a single file):
            $(document).ready(function(){
                        // some piece of code
            });
           
            $(document).ready(function(){
                        // other piece of code
            });

One scenario where more .ready() could be used more than once is when we have a common JavaScript which is referenced across a given project. And, there is another JavaScript which is referenced in a particular file. We would then be using the following references in that particular file:
<script src="/js/common-file.js" type="text/javascript"></script>
<script src="/js/specific-file.js" type="text/javascript"></script>

References:
  1. http://think2loud.com/653-jquery-document-ready-howto/
  2. http://api.jquery.com/ready/
  3. http://docs.jquery.com/Tutorials:Multiple_$%28document%29.ready%28%29




Sunday, September 18, 2011

Crystal Reports: the very basics

Introduction:
Crystal Reports is a report generating program, popularly called report writer, which allows users to create a variety of reports from different sort of data sources. It was originally developed by Crystal Services Inc. as a report writer for their accounting software. It is currently under the ownership of German software corporation SAP.
It was bundled into Microsoft Visual Studio from versions 2003 to 2008. Since the 2010 version of visual studio, it is available as a separate download from SAP website as free software.
Supported Data sources:
Crystal Reports supports a variety of databases such as MySQL, Oracle, Microsoft Sybase and PostgreSQL. Spreadsheet programs such as Microsoft Excel are also accessible via crystal reports. Data can also be fed through text files and XML files.

Further details and demo project will be added soon.
References:
         i.            http://en.wikipedia.org/wiki/Crystal_Reports
       ii.            Various online websites