Showing posts with label Netbeans. Show all posts
Showing posts with label Netbeans. Show all posts

Mar 3, 2011

Kademlia based file sharing tool

What is Kademlia?
Kademlia[1] is a UDP-based peer-to-peer communications protocol, a variation on the DHT (distributed hash table). It is distinguished by its use of XOR as a metric [2].

Why Kademlia?
Some key features of Kademlia can be found in here[3].

What else!
What's the big fuss about Kademlia? Well, I wrote a simple file sharing application for demonstration. Actually, I wrote the file sharing application, the core Kademlia part is borrowed from Dr. Thomas Ambus's "Peer-to-Peer Routing for Persistent Storage"[4].


Simple implementation of Kademlia based file sharing
You can download the whole project file from here. If you only want to test just use the jar in the dist folder. else you can directly import it to netbeans as a project. (write "java -jar KademliaApplication.jar" in a text file and save it as "run.bat" :) and double click on the bat file)

You can start a network by your own, by pressing the Start Network button. You can join a network if you know the port and the IP of another machine where this application is running. local node's port is randomly generated.

If you want to upload a content, you should first start the server and then upload the file using Upload button.

using Search Content button, you can search a file(hmm.. you have to write the exact name of the file that you search). Then if the content is available, it will show up as a green text under the Search Content button.  Then download and have fun.


References:
[1]http://jkadx.googlecode.com/files/nps6DF.pdf
[2]http://xlattice.sourceforge.net/components/protocol/kademlia/index.html
[3]http://code.google.com/p/jkadx/wiki/KademliaWhitePaper
[4]http://www.ambus.dk/plan-x/routing/

Dec 16, 2010

Configuring Fortran77 in Windows7

I followed the article to integrate Fortran to NetBeans. In order to do so, the following procedure should be followed.

  1. install cygwin (linux like environment for windows)
  2. install the Fortran compiler and related tools
  3. integrate to Fortran to Netbeans.
I will describe the first two only, since the above linked article has nicely described "How to integrate Fortran to Netbeans". 

Install Cygwin
  1. download the setup.exe from cygwin.com from the location pointed out in the figure below.









2. Once you run the setup.exe it will prompt you three options. My preference is the second one. download without installing- as shown in the following figure.

3. Then you can click "Next" for the coming options, since there's no need to deviate from default options until you are asked to select the packages as shown below.
5. Select the c, c++, f77 compiler packages( within the devel category) and gnu make utility package. These packages may depend on other packages, those must be downloaded. You will be prompted to do download them by the installation wizard.

Yeah yeah, it takes some time to download!

6.Once you finish the downloading, run the setup.exe file again and use the "Install from local directory". You will be asked to show the directory where you have downloaded it. (this folders name is odd. something like "ftp%3a%2f%2fcygwin.mirrors.pair.com%2f")

7. Then you should go next and next until it is finished!! You could see the start Cygwin by double clicking the icon on the desktop.

8. "g++ --version" would show you the gcc version installed. likewise check other installations you mentioned in the package selection (number 5).



9. Enjoy what you have done :)