Programming and writing about it.

echo $RANDOM

Category: Links

Defragmenting Linux filesystems

If you use Linux, one thing that really might have not yet considered is defragmenting your filesystems– something which you were quite often familiar, in case you have switched over from M$ Wind0ze.

Polish Linux group has got a nice article on Defragmentation of Linux filesystems

Advertisement

Java client for del.icio.us using NetBeans

del.icio.us is a bookmarking service where you can save, share your favorite/useful URL’s.

It has a REST API: http://del.icio.us/help/api/. Using this API you can design clients (web/desktop) to use the service. NetBeans 6.1 comes bundled with the APIs for popular web-services, which includes del.icio.us.

In this post, I shall code a simple Java console client for del.icio.us to fetch your recent posts. (For details, please refer https://api.del.icio.us/v1/posts/get?‘ at http://del.icio.us/help/api/posts)

You may download the complete NetBeans 6.1 Beta project here

Needless to say, you will need a del.ico.us account to follow this post.

  • Create a new project


  • Insert a method ‘getPosts()’ in the ‘Main’ class generated:


  • /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */

    package deliciousclient;

    /**
    *
    * @author amit
    */
    public class Main {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {

    getPosts();
    }

    private static void getPosts() {

    }

    }

  • Expand the Web Services node and hence expand the ‘Del.icio.us’ node to finally descend to the ‘delicious.posts_get’ API call.

  • Once you are there, click on it and drag it onto the body of the ‘getPosts()’ method. You will be asked to configure the API parameters, which you can either set to your own values or leave the default values

  • The method will now look like this:

  • private static void getPosts() {

    try {
    String tag = "xml";
    String dt = null;
    String url = "";

    String result = DeliciousService.getDeliciousPostsGetResource(tag, dt, url);
    System.out.println("The SaasService returned: "+result);
    } catch (java.io.IOException ex) {
    //java.util.logging.Logger.getLogger(this.getClass().getName()).log(java.util.logging.Level.SEVERE, null, ex);
    ex.printStackTrace();
    }

    }
  • You will observe that some new classes have been added to your project. They are classes which take care of the REST API calls to the del.icio.us service

  • But before running your project and hence using the service, you will have to provide your del.icio.us account details in the ‘profile.properties’ file in the ‘org.netbeans.saas.delicious’ package. For eg.

  • username=amitkumarsaha
    password=password

  • Run the project, you should get back the the XML representation of the result.

Thus, we have seen how easy it is to design a del.icio.us client using NetBeans 6.1. Similarly the other APIs can also be explored!

API Documentation

  • You can view the API documentation by a ‘Right-Click’ on the service name,and you will be taken to the relevant API documentation (you will need to be online for this)

Happy NetBeaning!

Links for today

Podcast Links for today

Couple of podcasts I heard yesterday from India Knowledge@Wharton:

Links for today: Web 2.0, Mashups, Podcasts

Links for today: Psychology of Facebook and more..

Some NetBeans Posts around the web

Here are links to some blog posts you will enjoy:

Have fun!

Facebook, Effect of the Web on Journalism

Couple of stories around the web:

The Best of Visualization Tools

Here is a nice article titled “The Best Tools for Visualization

Visualization is a technique to graphically represent sets of data. When data is large or abstract, visualization can help make the data easier to read or understand. There are visualization tools for search, music, networks, online communities, and almost anything else you can think of. Whether you want a desktop application or a web-based tool, there are many specific tools are available on the web that let you visualize all kinds of data. Here are some of the best:….

Read on..

Classical Computer Science Texts

This page here titled “Classical Computer Science Texts” lists some of the best texts in classical computer science.

Have Fun!