Skip to content

Best Geek Quotes

26-Jun-09

feeling geeky? here are a few t-shirt quotes for you

talk is cheap
SHOW
me ur
CODE

browse me..
||
free the WEB

copy and paste doesn’t create bad code.
Bad programmers create bad code.

I would love to change the world, but they won’t give me the source code

If it’s not on the net, it’s not on Earth.

Who is General Failure and why is he reading my disk?

I don’t write comments.
If it’s hard to write, it must be hard to understand !

Passwords are like underwear. You shouldn’t leave them out where people can see them. You should change them regularly. And you shouldn’t loan them out to strangers.

On the keyboard of life, always keep one finger on the escape button.


My quotes:

गूगल मेहरबान तो गधा पहवान

when god left bugs in me, how can my software be perfect


Notation:
<front> || <back>

Google अनुवाद

25-Jun-09

Read this:
जेना एक अर्थ वेब रूपरेखा जावा में लागू है. यह आप की दुकान करने के लिए / क्वेरी / अनुमान RDF / RDSF / उल्लू triples की अनुमति देता है. जेना एक triples RDF () में से सेट में मॉडल कहा जाता है या मॉडल वस्तु के भीतर जमा. डिफ़ॉल्ट द्वारा जेना में पैदा-स्मृति मॉडल है, लेकिन इस पर कार्रवाई करने के लिए उपयुक्त triples की अगर आपके पास बहुत बड़ी सेट नहीं है. यहाँ sdb आप को बचाने के लिए आता है. यह जेना की है कि आप MySQL, MSSQL, PostgreSQL, Oracle, आदि जैसे संबंधपरक डेटाबेस में इन मॉडलों को स्टोर करने की अनुमति देता है एक घटक है, जबकि Ubuntu पर sdb स्थापित इस पोस्ट में मेरे अनुभव का वर्णन करता है.

Now read original one:
Jena is a semantic web framework implemented in Java. It allows you to store/query/inference RDF/RDSF/OWL triples. In Jena a set of triples (in RDF) are called Model or stored within Model object. By default Jena creates in-memory models, but this is not suitable if you have pretty large set of triples to process. Here comes SDB to rescue you. It’s a component of Jena that allows you to store these models in relational databases like MySQL, MSSQL, PostgreSQL, Oracle, etc; This post describes my experience while setting up SDB on Ubuntu.

and what’s the title of my blog?
तु मेरी जिंदगी है!

lol…

Where did this come from?
Google अनुवाद

Well, it’s not that bad. For Hindi translation simply converting words and reordering subject/verb/object is not enough. Where does the semantic/context go?

Setting up SDB for MySQL

21-Jun-09

Jena is a semantic web framework implemented in Java. It allows you to store/query/inference RDF/RDSF/OWL triples. In Jena a set of triples (in RDF) are called Model or stored within Model object. By default Jena creates in-memory models, but this is not suitable if you have pretty large set of triples to process. Here comes SDB to rescue you. It’s a component of Jena that allows you to store these models in relational databases like MySQL, MSSQL, PostgreSQL, Oracle, etc; This post describes my experience while setting up SDB on Ubuntu.

  1. Download SDB. Extract it into some folder.
  2. SDB works with SUN Java only. Ubuntu has GNU Java installed by default. You need to install SUN Java and set it as default.
  3. Create a database for SDB in MySQL. I did using phpMyAdmin. Let’s call this database SDB2.
  4. Prepare a store description file. It serves as config for SDB and contains information like where to connect. You will find one such example file in the SDB directory. Here is an example for the description file I have used:
    @prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
    # MySQL - InnoDB
    <#store> rdf:type sdb:Store ;
    sdb:layout "layout2" ;
    sdb:connection <#conn> ;
    sdb:engine "InnoDB" ; # MySQL specific
    .
    <#conn> rdf:type sdb:SDBConnection ;
    sdb:sdbType "MySQL" ; # Needed for JDBC URL
    sdb:sdbHost "localhost" ; # or the IP address of the database server
    sdb:sdbName "SDB2" ; # MySQL database name
    sdb:sdbUser "username";
    sdb:sdbPassword "password";
    sdb:driver "com.mysql.jdbc.Driver" ;
    .
  5. Set environment variables:

    SDB installation directory –
    export SDBROOT="/home/ankit/tmp/SDB"

    Path to MySQL JDBC commector jar which contains com.mysql.jdbc.Driver class.
    export SDB_JDBC="/home/ankit/tmp/SDB/mysql-connector-java-5.1.7-bin.jar"

  6. Required tables must be created in database before we can use it. Run following to initialize SDB2 database. This creates 4 tables inside SDB2.
    bin/sdbconfig --sdb=sdb.ttl --create
    If this fails, somthing went wrong with settings. Check them again.
  7. Next you can run test suit to ensure everything is working fine.
    bin/sdbtest --sdb=sdb.ttl testing/manifest-sdb.ttl

    In my case one testcase failed stating -

    Failure: Unicode-5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): Results sets not the same

I decided to write this as the SDB wiki does now contains clear step to follow. Hope your semantic (web) application ROCKS !

- ankit

Setting Default JVM on Ubuntu

21-Jun-09

Heard of ‘update-alternatives’ on Linux? It’s a smart utility to find various versions of one software and set default.

For example, you may have GNU Java as well as Sun Java. (frankly saying, I hate GNU Java, aka gcj)

sudo update-alternatives --config java

[ Where can I see all installed JVM?
On Ubuntu, Java Virtual Machines are installed in /usr/lib/jvm. You can see java-gcj here which comes by default with Ubuntu.
]
- ankit

Ankit on Google Maps

28-May-09

a search for Ahmedabad in Google Mapsailla I’m in the top-contributors list !

ankit-google-map

[ What is Google Maps?
Google Maps is a web mapping service application and technology provided by Google. It offers street maps, a route planner for traveling by foot, bicycle, car, or public transport and an urban business locator for numerous countries around the world. It also can help find the location of businesses.

I want to be there, but how?
All you need is to contribute via Google Mapmaker. Start tagging places/buildings for the areas you know or lived. And one day you will be listed on Google Maps :) . It took me a week for ~100 edits.
]

- ankit

Lucene StopWords

27-May-09

Lucene is a open-source high performance full-text search engine and has libraries for almost all well known languages (Java, C#, PHP, Python, C). This post is about describing StopWords for a full-text search engine (Lucene).

( Lucene can also be used to index database table rows. The advantage for having Lucene search instead of (database software’s) in-build full-text search engine is Lucene ranks search results based on their relevancy. For example assume you have a product table with <title , description> fields and you want to give higher rank to ‘title’ over ‘description’. )

A stopword is a language-word that has no significance meaning in a keyword based search system (e.g. Google). Lucene also has a set of such words for English language and these are simply ignored while analyzing/tokenizing text. You can find them inside org/apache/lucene/analysis/StopAnalyzer.java file declared as StopAnalyzer.ENGLISH_STOP_WORDS constant.

public static final String[] ENGLISH_STOP_WORDS = {
"a", "an", "and", "are", "as", "at", "be", "but", "by",
"for", "if", "in", "into", "is", "it",
"no", "not", "of", "on", "or", "such",
"that", "the", "their", "then", "there", "these",
"they", "this", "to", "was", "will", "with"
};

You can also specify your own stopwords while indexing text. Use StandardAnalyzer’s constructor and pass a set of words as agrument. These will be ignored while indexing.

- ankit

Gmail Bug with attachent !

14-May-09

Seems like following is a bug in Gmail system. I was investigating over PHP.Backdrop.Trojan and wanted to show malicious installed.php file to my friend. Here is what I did -

1. Created a reply mail (in Gmail).
2. Attached two files. One of them was malicious ‘installed.php’. The attachment was successful.
3. Saved draft.
4. Clicked ‘Send‘ button, and got confirmation about successful send.
5. Now when I clicked ‘Your message have been sent. View message.‘, voila! nothing happen and it didn’t even showed me my mail.
6. Later after few hour I realized that mail has not been sent and still there as draft!

That’s why they call it beta!

[ Note: Ideally a message with viruses should not circulated. My concern in this post is the invalid message/alert displayed to user! ]

- ankit

Finally, a domain for ‘ankitjain’

21-Apr-09

 

 

www.ankitja.in

purchased a new home
www.ankitja.in
(currently redirects back to this blog)

I always dreamt to have ankitjain.com or ankit.com,
but this one is much cleaner and better.

 

 

Proposal for WordPress Summer of Code

02-Apr-09

Requirements: Create a suite of plug-ins for event planning, tie it into WordPress MU/BuddyPress/bbPress, and create a community organizing platform for open source release. Using WordCamp.org as the test case, the resulting site would include functionality for registration, calendaring, additional roles/permissions, extended profiles, directories (vendors, participants, etc), discussion and messaging, coordination around things like carpooling and planning meetings, event media, etc. Source WordPress GSoC2009. This proposal generalizes it further.

Personal Details

  • Name: Ankit Jain
  • Email: ankitasdeveloper | gmail + com
  • GTalk: ankitasdeveloper | gmail + com

More…

For Geeks: Watch YouTube on TV !

01-Apr-09

Have you ever wanted to feel so comfortable to watch YouTube videos on TV using a remote control?
Here is how!
More…