Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java:
String camelCase = "StructuralDesignPattern";
StringBuffer label = new StringBuffer(camelCase + 10);
java.util.regex.Pattern p = java.util.regex.Pattern.compile("[A-Z][a-z]+");
java.util.regex.Matcher m = p.matcher(camelCase);
while ( m.find() )
{
label.append( m.group() + " ");
}
System.out.println(camelCase + " >> " + label.toString());
[ Note: this does not work for all test cases. You may also want to try regexp as "[A-Z][a-z]+”, for matching any continues uppercase letters too (e.g. AnkitJainFROMIndia >> Ankit Jain FROMIndia) ]
ankit.tk – free
ankitja.in – paid
ankitJain.tk – free
ankitJain.info – paid
YeMeriLifeHai.com – paid planning to drop this one
AnkitAsDeveloper.tk – free
POLAROID-EFFECT.TK – free
Get your own FREE .tk domain name << and you can have unlimited !!
(the only catch in this offer is you need at least 25 hits in 90 days, I think that you can manage by your own )
[ This post is about software's disability to meet users' expectations. I know you have developed lots of software/applications over your career! Have you ever evaluated them on disability index? No, then read on. "You" = refers to our typical "software engineer" ]
Ever heard someone saying “this software sucks”… I love such moments. It makes me laugh, not for the user, but for the poor developer! Users are innocent, they are not concerned about technical details. A software is there to make life simpler and hide complications of a task. It’s your responsibility to make it intuitive and meet users expectation on first impression, rather showing unnecessary (modal) alert boxes or irrelevant (technical) details. You don’t need to be a Usability Engineer. Just,
stand on users’ shoe and think what is annoying
don’t take negative feedback as an attack on you and your beliefs.
Rather it’s a feedback on your understanding about how much you understand your users. In short never reject/resist on feedback.
Nobody hates software more than software developers and nobody distrust software more than software developers. Scott Berkun has written a good post about why software sucks. ( I have heard software engineers saying that they don’t trust online money transactions. Heck !! Do you need President to meet you and ensure? )
Here is what I think you should target as first step:
Any tasks that you think user should perform by reading Help/Documentation, MUST be automated.
Even an single unnecessary alert box annoys. Features should be available with less no of clicks. Still this is very subjective matter to discuss. A simple guidelines is – only system errors or exceptions should raise alert-box, tiny information should be modal-less dialogs (or like balloon pop-up).
users never read entire screen. Default values chosen or default selection of check-boxes makes big difference in a long run.
E.g. while filling an online form a default selection of check-box “subscribe me for spam mails”. Who does read entire form before clicking submit? None. But it affects your reputation in long run.
Never hesitate in picking a useful (cool, awesome, sexy, astonishing, amazing! ) feature from competitive software. Ask a simple question – Does it add value to your product? You won’t like this argument, but this is truth. The success of Web is a tiny ‘view source’ feature. Well, this is a fast moving industry where we learn from other, we improve over time. You never blame the world for borrowing tabbed browsing from Opera (originally by NetCaptor). It’s a matter of accessibility, and understanding what your users like and what they dislike is a key to success.
Larry Ellison, CEO of Oracle Corporation, describes all the fuzz around cloud computing in a short introduction. He touches very reasonable concern –
“computing industry is the only industry more fashion driven than woman’s fashion“
Of course, this is true. Think about the last 10 years, how many new languages introduced, how many new versions of existing languages, new frameworks are released everyday, etc; But what about the compatibility with old? Isn’t today we (as a system owner, who actually pays for software development) want to have a stable, low cost, maintenance free software. I want to install it once and be assured for rest of 5-10 years. New versions/frameworks comes with new bugs. Do you have a stable CRM/ERP that can help me in 5-10 years run?
In Java, unreachable code is treated as compilation error. What do you think? Isn’t making it warning would have made developers’ life simpler?
Of course you can write –
if( true )
return;
What if you could simply write return. This helps in testing a function quickly. As a good programming practice we always remove all warnings from code, and such unconditional return statements can be rectified later.
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.
There is no place like 127.0.0.1
You know it’s love when you memorize her IP number to skip DNS overhead
Girls are like Internet Domain names, the ones I like are already taken
It’s not bogus, it’s an IBM standard.
- Esther Filderman
“computing industry is the only industry more fashion driven than woman’s fashion”
- Larry Ellison
you are looking at GEEK GOD
My quotes:
गूगल मेहरबान तो गधा पहलवान
when god left bugs in me, how can my software be perfect
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?
तु मेरी जिंदगी है!
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?
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.
SDB works with SUN Java only. Ubuntu has GNU Java installed by default. You need to install SUN Java and set it as default. [Note: you know why this point is important? I wasted 1 hr when I did same setup second time. Later I realized I was using GNU libgcj (gij/gcj). For god's sake, someone please kill gcj...
Create a database for SDB in MySQL. I did using phpMyAdmin. Let’s call this database SDB2.
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" ;
.
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"
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.
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 steps to follow. Hope your semantic (web) application ROCKS !
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