Creating A Local Maven repo from 3Rd party JARs

Sometimes you might need to package 3rd party JAR files in a way that allows you to incorporate them into a maven project easily.  To do so, you need to put the JARs in a local repository to so that the can be picked up by Apache maven. You can  achieve this by using the maven-install-plugin by running the following command:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

To illustrate this with an example, let us assume that we want to add the  Algorithms Book library to your local repository. You need download first the algs4.jar to your machine (i.e. ~/Downloads). Once you have done so, you can run the following command to add this file to your local repository.

mvn install:install-file -Dfile=~/Downloads/algs4.jar -DgroupId=edu.princeton.cs \
-DartifactId=algs4 -Dversion=1.0 -Dpackaging=jar

Once you added the jar file to the local repository. You can use the following XML in your project’s pom.xml.


Happy Coding.


To 9/11 victims: You country is as Responsible as Saudi Arabia

The US Senate and House of Representatives recently approved a bill allowing the victims of 9/11 to sue Saudi Arabia for being backing the terrorists who were responsible for 9/11.

At the surface this might seems a noble cause, however, they forget that their own country is as responsible as Saudi Arabia. They seem to forget that their successive governments have long supported directorships in the Middle East and Islamic World. Dictatorship regeimes in countries like Egypt, Saudi Arabia, Jordan, and Pakistan have long enjoyed the support of the USA which has condoned the oppressions of such regimes. Such oppressions resulted in the rebellion of certain individuals like Osama Bin Laden who ended up establishing an Al Qaeda The victims of 9/11 also seems to forget that their own country has funded Al Qaeda and helped in establishing it during the Afghanistan war against the Soviet Union.

It is a bit ironic that the victims of country whose government is responsible the biggest atrocities in the 21st centenary. The USA government repeatedly lied to make the case for invading Iraq in 2003 which has results in the destruction of Iraq. Not only this, but they let the country to be taken extremist groups like Al Qaeda and later on Daesh.

Somehow the Americans think that they have the moral high ground when it comes to the war on terror. Yet, their government is stained with the blood of innocent victims who died because of the wars that of the USA in the Middle East.

If you really want to seek justice, you should then start at your own backyard and sue your own government.

Opening Up a port on RedHat

By default RedHat comes with strict configuration for protecting you from hackers. If you want to open up certain ports for network traffic you will need to use iptables command.  Here is how you might open tcp port 3030 for network traffic

$ sudo iptables -I INPUT -p tcp -m tcp --dport 3030 -j ACCEPT
$ sudo service iptables save # saves rules to /etc/sysconfig/iptables

Alternatively you can use  firewall tui tool

$ sudo system-config-firewall-tui

Replacing URIs with labels in RDF object fields using sparql

Here is how it is done with an example from Linked Movie Database

prefix movie: <>
prefix rdfs: <>

select ?s ?p ?o
       <> ?p ?o1 .
       optional {?o1 rdfs:label ?o.}
       BIND (<> as ?s)
       <> ?p ?o .
       optional {?o rdfs:label ?label.}
       BIND (<> as ?s)
order by ?p
limit 25

Females in DBPedia

Here is a simple SPARQL query to list all females in DBPedia

SELECT ?property ?hasValue ?isValueOf
  { <> ?property ?hasValue }
       ?isValueOf ?property <> .
       ?isValueOf <> ?gender .
       FILTER regex(?gender, "female", "i")

Algorithms, Part I — Social Network Connectivity (With Union-Find)

Nice blog post about “Social network connectivity” problem that appears in Coursera Algorithms I (

Steel Wings

Q: Given a social network containing N members and a log file containing M timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time at which all members are connected (i.e., every member is a friend of a friend of a friend … of a friend). Assume that the log file is sorted by timestamp and that friendship is an equivalence relation. The running time of your algorithm should be MlogN or better and use extra space proportional to N.

(Java Code on github at the bottom of the post. )

My thoughts and solutions:

When solving dynamic connectivity problems (like whether there is a path between two nodes but we don’t care what the exact path is), we can try using the Union-Find algorithm. And this is a typical application of union-find in social network.

This question asks if we can determine the earliest time at which all…

View original post 391 more words


growth of the network seems to show that connectivity is its 
own reward, and is more valuable than any individual application 
such as mail or the World-Wide Web. [1]