Friday, December 01, 2006

Sun Java Application Server - MySQL : Connection Pooling HOWTO

Once in a while I come up with some tech howto. The last one being "HOWTO set XMMS current song as you IM status".

This time it is...


MySQL Connection Pooling Step-by-Step HOWTO

  • Make sure U have the mysql.jar file with U. It contains the mysql driver.
  • Your Sun Java Application Server (SJAS) folder looks like this

drive:\Sun\AppServer\ i will refer to this location as J2EE_HOME

  • Now copy the mysql.jar to J2EE_HOME\ant\lib directory
  • Start the server
  • Open the admin consolehttp://localhost:4848/
  • Login using the default uname/passwd

uname: admin

passwd: adminadmin

  • Click on : Application Server => JVM Settings tab => Path Settings tab
  • Now paste the following line: ${com.sun.aas.antLib}/mysql.jar in the textarea labeled as "Classpath Suffix"
  • Click on Save. Close the admin console.
  • Restart the server.
  • Open the admin console (http://localhost:4848/) again.
  • Expand the Resources node
  • Expand the JDBC sub-node
  • Click on Connection Pools
  • Click on New
  • Fill up the fields as follows:

Name: mysqlpool

Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Resource Type: javax.sql.DataSource

Do not modify rest of the fields.

  • Now add following properties by clicking on "Add Property" at the bottom of the form:

DatabaseName : OnlineBankingSystem

User : admin (your mysql username)

Password : admin (your mysql password)

  • Click on save. You will see "New values successfully saved"
  • Now, Click on Ping. If you get a "Ping succeeded." then be happy :D
  • Now is the last step. click on the JDBC Resources node.
  • Click on New.
  • Fill up the fields as follows:

JNDI Name: mysql

Pool Name: mysqlpool

  • Click on Save. Thats it! We r done ! :D
  • Your mysql connection pool is now ready to accept requests to the database. It is referred to as just "mysql" from within the EJB and JSP (its JNDI Name remember, :-? ).
  • And of course, I wish U all the Best ! :D
    Lemme know soon wat happened and if it helped. :D

Sunday, September 03, 2006

What does a CD mean to a cow?


Passing thought: Imagine two people conversing using their Nokias. The information is ferried between them through space in form of light waves. Would it be possible to monitor the physical properties of the space and infer the information being exchanged? One may point out that the cell phone data is garbled for obvious reasons. But would it be possible to determine atleast this garbled data by performing a suitable measurement on the space, somehow?

Eavesdropping on people's conversations is not really the topic. It is rather about the nature of information.

Is there a theoretical limit to how much information a given volume of space may possibly
contain irrespective of the method used for storing/encoding this information? There can be two possibilies:

  1. Yes, there is a limit.
  2. No, there isn't a limit.
If it turns out that the first case is true, then it would imply that there must be something in the fabric of this universe - some key ingredient which serves as a universal currency of information. This would mean that a general purpose instrument which can quantitate information contained in the given object space should be achievable.
But if it happens that the second case is true then information would turn out to be indeed something very personal - so that each individual can have the freedom of interpreting this information the way way he pleases. That there wont be such thing as a universally true information or a universally false information for a given obeject space under scrutiny. In such a case it would not be possible to develop a generic tool or quantitating the information content Which is :-( So, clearly in this case infomation exchange is possible only if the two parties agree on the information content.

Passing thought: Your Win-Zip program which you use to compress data does its thing like this[2]. A CD contains data stored along the tracks. In each track there are two possible features - a small pit and no pit corressponding 0 and 1 or otherwise. A 700Mb of such a CD would contain an entire DivX of The Da vinci Code. One would be able to watch it if one has a CD-ROM to decode the engraved data. But what if one does not have such a specific device? Does the information contained in this CD affect the properties of the physical space it occupies so that a suitable measurement on this space would reveal the movie data indirectly?

Casual Mention: "Biology is the domain of the complex. It takes 3 * 10.pow(9) bases = 6 * 10.pow(9) bits of information to specify the DNA that determines a human being".[1]

But what is in it for the biologist? Well, putting it rather (very) bluntly,
If the information is found to be universal as opposed to personal then a given space, say a space which contains only a single DNA fragment, can be analysed by using some tool to come up with the absolute information content of the space; DNA sequence in this case. Outrageous. I know.

Theres more actually, but by now I have either forgotten to mention those things/ too lazy to type anymore/ its lunch time :P
Maybe some other day. . .

Interesting reads:

  1. http://www.cs.auckland.ac.nz/CDMTCS/chaitin/***
  2. http://en.wikipedia.org/wiki/Data_compression
  3. http://www.faqs.org/faqs/compression-faq/part2/section-4.html

*** = Must read.

Wednesday, June 07, 2006

T.I.F.R. BioChem Labs


Plush, clean, efficient publishing machines, silent except for the ho-humming of speed-vac rotors or gel-shakers amidst over-crowded chemical shelves with a graffiti of TODO post-its whereas the room corners are claimed by the latest and greatest fat gizmos spitting out raw data only to be handed over to the computing room to make sense of all that alphabet soup while the show is run by smart biochemical ensembles of CHONSP.

ΔG = ?

Tuesday, January 17, 2006

Million Dollar Meccano



Some Basics
Everybody knows the central dogma of molecular biology - DNA=>RNA=>Protein. There is another lesser know dogma - protein primary sequence=>protein 3D structure=>protein function. The real challenge now is to actually be able to predict a protein's function given its amino acid sequence.
Proteins come in mind boggling range of shapes and functions. Yet all of these exotic stuctures derive their blueprints from a modest (boring), 1D stretch of information encoded in a mRNA fragment. Hence, essentially, manufacturing a protein is simply (!) the folding up of a linear polymer of amino acids onto itself through twists and turns and coils assuming a complex 3D structure which can do useful things.
There is considerable evidence suggesting that the protein's primary structure contains sufficient information to direct the folding of the polypeptide backbone to give a correctly folded 3D sturcture.

Show Me My Millions
Biology never had it so good. We now seem to know much of the basics, we seem to have the suitable technology and most importantly we also have brains working towards this massive goal. It is just a matter of who claims the top cherry. Biology is therefore going to be an increasingly interesting area even for the VCs. The X Pize Foundation of the first-private-spaceship-contest fame is now planning to offer a new prize '$5 million to $20 million for anyone who can decode the DNA of 100 or more people in a matter of weeks'. This gives one an idea of how important the once academic questions of biology have become relevant to the general masses. What would the next prize be . . . protein folding?
These are not the millions I was talkin about. These are just the tip of an ice-berg. By putting together 20 amino acids together biology has produced a plethora of protein structures and this was pretty much to be expected given the diversity that surrouds us. But even these different proteins are made of a large but limited number of motifs. Once all these motifs are charaterised one would truly have the nuts and bolts out of which actual functional proteins - molecular machines could be made. This would open up an entire industry of protein engineering. A good part of which may focus on chemically tweaking the existing proteins and a maybe a smaller group may focus on inventing entirely novel proteins. The possibilities seem to be endless. People are already using biological macromolecules in household products - e.g. Subtilisin a proteolytic enzyme is used in these.

I can go on and on . . . got the point ?

Wednesday, January 11, 2006

IM Gaim

Of men and women and there IMs...









Why am I rambling about some such topic? Is it really unlike of me to jabber on non-tech topics... :-? ewwwwwwwww lets explore the not-so-tech side...of people's IM-habits, IM-eccentricities, IM-egos, IM-hyphenated things.....

Lets start with a Sunday morning newspaper MCQ
Quantitating ur IQ: IM Quotient

1. Buddies Count?
a. Who counts...c'mmon
b. ummmmm
c. The messenger length/breadth is higly distorted (lengthwise)

2. Buddy Online/Offline ratio?
a. very very less than 1
b. approx 1
c. much greater than 1

3. Who's the 'initiator'?
a. me...i am a very good guy/gal ya know
b. depends
c. how do u do that? every time I login IM screens mysteriously pop up everywhere

4. Ur IM input/output ratio:
a. I am gr8 at typing ya know...my im windows are splattered with my say
b. Neva thot bout that really
c. **shrugs**

5. Away message
a. Who's away? me ...r u kiddin me
b. Sorry, I ran out for a bit! (classic Gaim)
c. i did'nt know ya miss mi so mach laddie

Ok lets see how U scored:
Mostly As: Its CyberSpace in case u did'nt notice...u can do without being urself..."Wake Up"
Mostly Bs: Well U r managing it well fella.
Mostly Cs: Ok...you dont have to be truthful evertime

After that taxonomy of IM creatures lets chk out something more about the IM-culture.

Dogs and bitches...
Hyenas, spiders, bees, dogs and other of those NAT GEO creatures. All these species have one common characteristic - the male must make the first move. Humans stick to their animal instincts in the IM land too. When a female collegue/ friend/ UFOD (undefined-female-object-of-desire)/...sorts... come online it is the moral responsibility of the male to 'initiate'. Female initiations are kinda rare cosmological events and need careful investigation.
Cant we just leave behind all our inhibitions when we are atleast IMing?

Should I/ Shouldn't I moments...
Okay so u login to ur account. U see this list of online buddies. U r not exactly in a mood to chit-chat. Okay with some of them, but not others. It is considered to be rude if you r online and donot IM with other 'available' onlines. So wat u end up doin is waste some bandwidth with some non-sense for 2 mins. Hang up with regular 'tc's and 'bbye's and ...the sorts. Why do all that? If u wanna chat plz initiate, if they want let them do it.

Bloated Egos...
Giving out ur IM id to ur boss is a very BAD idea. Bosses expect u to initiate, to do most of the chattering, entertain them...Besides the bosses, some other people around you who are'nt exactly ur bosses but create such an impression are like pseudo-bosses. These are the domineering sorta people. They have a kind of air to themselves. They will reply least frequently, with minimalist use of words, with huge latencies.

The END Problem...
Okay...this is not the end problem of molecular biology (d-uhh DNA replication)....this is a classic IM end problem. Let me put it straight - "How does one end an IM conversation?" People have this habit of trying to end the convo by these one liners:
tc
gnite
bbye
cya
ciao
chao
c u around
lets part
over n out
. . .
But no matter what u type...the person on the other side has to come up with some reply so that he-may-have-the-last-say.
The Solution: Well...it seems the problem has been solved by biology. When u wanna end a convo just type UGA (or UAA or UAG). WHY? Well go n revise ur high school biology. UAA, UGA n UAG are stop codons. What bout the non-science people U ask? In case U did'nt notice this is basically a tech blog and the intended audience is obviously other techies/nerds/geeks. What bout non-bio-science-people U ask? Well... if U r a non-bio-science-fella ; I hate to be the 1 to break it to ya fella but "U dont fit into the l33t group, aadeos" UGA.

more, comming soon...