Search This Blog

Saturday, September 20, 2008

Installing JDK 1.5.0_15 on Damn Small Linux - Not

This actually is a no brainer, any one can do it, but still i thought i would right it down, may be a reference for me, to remember what i did. It was pretty much same as how you do it in rest of the linux distros, no exceptions.

First i went to sun's website and downloaded the .bin installation file. (not the rpm one). since i wanted to install in a place from where i can access it for all users. i became root. then i copied the .bin file to /usr/local, then enabled executable permissions to it and then executed the file. that is it. it got installed into /usr/local/jdk1.5.0_15.. I will list the exact steps which i had done.

$su
$cp /home/dsl/jdk-1_5_0_15-linux-i586.bin /usr/local/
$cd /usr/local
$chmod a+x jdk-1_5_0_15-linux-i586.bin
$./jdk-1_5_0_15-linux-i586.bin

after this, i logged in to another terminal and edited the .bashrc file to set the java_home and path variables, so as to access the commands directly in command prompt.

in terminal enter
$cd
$vi .bashrc
(or)
$vi .bash_profile

then at the end of the file add the following lines.

export JAVA_HOME=/usr/local/jdk1.5.0_15
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/lib

save the file and exit, and do a machine restart(it should work if you open another terminal and check, but all failed and only a reboot worked in my case).....

Thursday, September 18, 2008

Damn Small Linux on VmWare

I have known DSL for a long time (say since mid 2005 ..).  But i had never thought of it as anything more than a os on a cd to be used when my system hiccups.

I am in delhi, and am void of access to any system sparing my office pc here.  and that to i can't install anything on it.  So now me being far away from linux was sort of taking a toll on me.  so i decided to install linux on vmware as it was already there in my machine.

Initially i had tried to install it, though everything went smoothly, but it did not work or to be precise it did not boot into the newly installed system.  Then on further digging around i found it did not handle scsi disks so i had to set it to IDE.  I forgot where i had found the info, you will get it with a simple google.  i am too lazy to go around.  but it was inthe dsl forums.  That much i remember.

i will say what i had done.

First i had created a virtual IDE disk for 3 GB.
then after booting into the ISO, i went into terminal and became root.
now i ran cfdisk, and created two partitions 1 gb swap and rest as ext3 bootable.
then i started the installation with the command dsl-hdinstall.  and went ahead with the default at everyplace.

after 10 mins it was there.  i was asked to reboot and it went right into the hd boot.  now things were working fine.  Now i am planning to install jdk (which should not be a problem), mysql and then dimension, and take it for a test run...

Monday, September 08, 2008

A Hard Decision

i don't know weather i am doing it correct by writing this post. But, as the saying goes, when in doubt....

It is not everyday that some one who is up the ladder at the near top of the organization would call you for a chat.

It is not everyday that, that one person at the top of the organization, would offer a dream chance to join his elite team.

And it is not everyday that you would reject the offer and live the rest of the life as though nothing had happened.

There were not so many reasons why i said no to his offer... only a few,
  • His thinking of only his solution is correct.
  • Being asked to stay in Delhi.
  • The rest of office's attitude.
If he can work around the first 2 points, i can work something out of the 3 point. But i can't do anything. and the verdict had been spilled out of my mouth.

As i have heard, it was difficult to say No. But somehow, i did......

Transfering data from one database to another

Hmm, Most of what i am going to say in this here, will be childish, but still....

DimensioN is built on top of JBOSS. It has some inbuilt functionality to export data from one database to another, with some rules associated with it. and that is great, But what it lacks is you cannot pick and choose which records you want to transfer. That was a problem.

There is a way to atttain the solution for this problem in DimensioN, but the application architecture which we had decided upon did not permit, or to be correct will make it too complex, for the future DimensioN developer to understand and tackle any problems if they should arise. this would invove the logic as follows,

rModify --> DbImport --> rModify....

And as you can see rModify is a bit of a highlevel feature, and many still dread to use it. so the only thing which i could think off was using some thing else which is out of DimensioN but still could be used with it, like Ant target or something.

My first choice was to use Ant target, coz i have done database manipulation with it for an other project, previously. As i can use it as a template and proceed off, and that would save time too. But, i ran into trouble with it, First i had to make javascript to work from inside Ant and then after i had succeded, when i had tried to do the database manipulation, it was creating a exception saying Illegal Access Exception, some AntClassLoader came in and some bullshit which i was not able to understand. and i had waited for 3 days for OS support, but when i came to know that help might not arrive on time, i wanted to put in something to get things going till the support arrived.

Another two days and that jsp expert had not finished the job yet, and they were pressing me for an answer, as though i was a part of that project. ( i had moved to another one even b4 the problem started). Well then, i had to sit back and write the code again for the jsp. (i hate to code. but this was as usual Reverse Engineering, as i would put it,coz i know the basics to do anything, i just did not have the time to proceed to write things from scratch.) I had set a deadline of 4 hours for me to finish. and i sat down to write the code. it took me 3 hours and a half to do it. and it was pretty much good, without any problems, and is working fine.

I know there are still 2 potential pit falls..... (1) I haven't used a try catch block, so if any exceptions are thrown the page will be a error. which i will have to correct in the future... (2) I haven't used parameterized prepare statement, so if the data is going to have any problems like a single quote, or anything that would hamper a insert statement on syntax, yet again the page will break with an error.

So with these details, i give you the code. it might be helpful to someone.
-----------------------------------------------------------------------

<%@ page import="java.sql.*" %>
<%@ page language="java" session="true" %>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="org.apache.commons.fileupload.disk.*"%>
<%@ page import="org.apache.commons.fileupload.servlet.*"%>
<%@ page import="org.springframework.jdbc.core .*"%>
<%
////////////////////////////////////////////////////////////////////////////////////////////////////////
// ExporttoErp.jsp //
// //
// File Created on September 5th 2008 at 1807 hrs. //
// Last Modified on September 5th 2008 at 2030 hrs. //
// Modified By Anbarasan //
// //
// This page exports data from dimension database to navision database. //
// We get the record identifier from the url. //
// Then we proceed to retrive data from dimension and then push it into navision. //
/////////////////////////////////////////////////////////////////////////////////////////////////////////
%>
<html>
<head>
<title>
DbExport utility to export Single Record of choice to ERP.
</title>
</head>
<body>
<%
String id=request.getParameter("docid");
////////////////////////////////////////////////////////////////////////////////////////////////
// Enable the following line to see the primary key id that is being passed. //
///////////////////////////////////////////////////////////////////////////////////////////////
// out.println(id);
////////////////////////////////////////////////////////
// Connection to Dimension's Database //
////////////////////////////////////////////////////////
DataSource dimds = (DataSource)com.orangescape.hce.server.services.CsServiceLocator.getInstance().fetchObject("java:dimension");
Connection dimconn = null;
dimconn = dimds.getConnection();
//////////////////////////////////////////////////
// Connection to Navision's Database //
//////////////////////////////////////////////////
DataSource navds = (DataSource)com.orangescape.hce.server.services.CsServiceLocator.getInstance().fetchObject("java:erp");
Connection navconn = null;
navconn = navds.getConnection();

String dimparentqry="select [Amount],[Bill-to Customer No_],[Chain Name],[Created On Date],[Customer_PO_date],[External Document No_],[Location Code],[Octroi Amount],[Octroi Applicable],[Order Type],[Order Value],[Project Date],[project No_ updation],[Promised Delivery Date],[Req_ delivery Date],[Sales Cordinator Code],[Sales Cordinator Name],[Salesperson Code],[Sell-to Customer No_],[Shortcut Dimension 1 Code],[Shortcut Dimension 12 Code],[DocID] from [xxxxxxxx Pvt_ Ltd_$temp sales header] where docid = '"+id+"'";
String dimchildqry="select [Approx_ Cost],[Line No_],[No_],[puchase order no_line],[Quantity],[SODetailsId],[Unit of Measure],[Unit Price],[Variant Code] from [xxxxxxxxx Pvt_ Ltd_$temp sales line] where SODetailsId='"+id+"'";

//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Enable the following line to see what the data retrival query from dimension database is..... //
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// out.println("<b>ParentQuery</b><br>"+dimparentqry);
// out.println("<br><br><br>");
// out.println("<b>ChildQuery</b><br>"+dimchildqry);
// out.println("<br><br><br>");
//////////////////////////////////////////////////////////////////////////////////////////////////////////
Statement dimst=dimconn.createStatement();
ResultSet dimrs=dimst.executeQuery(dimparentqry);

while(dimrs.next()){
String navparentqry="insert into [xxxxxxxx Pvt_ Ltd_$temp sales header] ([Amount],[Bill-to Customer No_],[Chain Name],[Created On Date],[Customer_PO_date],[External Document No_],[Location Code],[Octroi Amount],[Octroi Applicable],[Order Type],[Order Value],[Project Date],[Project No_],[Promised Delivery Date],[Req_ delivery Date],[Sales Cordinator Code],[Sales Cordinator Name],[Salesperson Code],[Sell-to Customer No_],[Shortcut Dimension 1 Code],[Shortcut Dimension 12 Code],[SO Document ID],[SO No_ Of SCM]) values (";
navparentqry = navparentqry + dimrs.getString("Amount") + ", ";
navparentqry = navparentqry + "'" + dimrs.getString("Bill-to Customer No_") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Chain Name") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Created On Date") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Customer_PO_date") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("External Document No_") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Location Code") + "', ";
navparentqry = navparentqry + dimrs.getString("Octroi Amount") + ", ";
navparentqry = navparentqry + dimrs.getString("Octroi Applicable") + ", ";
navparentqry = navparentqry + "'" + dimrs.getString("Order Type") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Order Value") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Project Date") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("project No_ updation") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Promised Delivery Date") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Req_ delivery Date") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Sales Cordinator Code") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Sales Cordinator Name") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Salesperson Code") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Sell-to Customer No_") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Shortcut Dimension 1 Code") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("Shortcut Dimension 12 Code") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("DocID") + "', ";
navparentqry = navparentqry + "'" + dimrs.getString("DocID") + "')";

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Enable the following line to see what the data posting query to erpdatabase is..... //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// out.println(navparentqry);

PreparedStatement navst=navconn.prepareStatement(navparentqry);
navst.executeUpdate();

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// i don't know what is wrong with this method, but it throws com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set. //
// ResultSet navrs=navst.executeQuery(navparentqry); //
// navst.executeQuery(navparentqry); //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

dimrs=null;
dimst=dimconn.createStatement();
dimrs=dimst.executeQuery(dimchildqry);

while(dimrs.next()){
String navchildqry ="insert into [xxxxxxxx Pvt_ Ltd_$temp sales line] ([Approx_ Cost],[Line No_],[No_],[po no update],[Quantity],[SO No_ Of SCM],[Unit of Measure],[Unit Price],[Variant Code]) values (";
navchildqry = navchildqry + dimrs.getString("Approx_ Cost") +", ";
navchildqry = navchildqry + dimrs.getString("Line No_") +", ";
navchildqry = navchildqry + "'" + dimrs.getString("No_") +"', ";
navchildqry = navchildqry + "'" + dimrs.getString("puchase order no_line") +"', ";
navchildqry = navchildqry + dimrs.getString("Quantity") +", ";
navchildqry = navchildqry + "'" + dimrs.getString("SODetailsId") +"', ";
navchildqry = navchildqry + "'" + dimrs.getString("Unit of Measure") +"', ";
navchildqry = navchildqry + dimrs.getString("Unit Price") +", ";
navchildqry = navchildqry + "'" + dimrs.getString("Variant Code") +"') ";

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Enable the following line to see what the data posting query to erp database is..... //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// out.println(navchildqry);

PreparedStatement navst=navconn.prepareStatement(navchildqry);
navst.executeUpdate();
}

navconn.close();
dimconn.close();

//////////////////////////////////////////////////////////////////////////////////////////
// A display message to indicate the end of the posting of data process..... //
//////////////////////////////////////////////////////////////////////////////////////////
out.println("<center><h1>Data Transferred to erp with SO Number : "+id+"</h1></center>");
%>
</body>
</html>

Monday, August 25, 2008

An Evening Walk in Delhi,

I had a really bad headache in the morning today. I just could not think of anything, so i decided to skip office today. I lay in bed, as all my room mates here in the guest house left for work. I just reminded A with what is where, and what has been done and what has to be done and things like that, then again dozed off. i woke up at around 12:30 or something, check my other official mail, then my phone rang, it was the new J, She was asking about some MSSQL stuff (as usual) and was invoking my frustration at having missed the OOTY trip which was they had added to the bala marriage visit trip. She was saying how i missed it and what fun they had and stuff, anyway i think i gave her a solution and went off to sleep again as the headache was still there slightly. She seems to have called me around 2 but i was fast asleep.

The evening was boring, I re read the Prisoner of Birth for the 3rd time, and then thout atleast lemme go for a walk for some fresh air and lemme check out the new book store which these guys found yesterday, so i wore the newly bought jeans and the I'M FUN tee and hit the road. It was too hot, the slight drizzle in the evening must be a reason for this, i took the inner roads instead of taking the main road, reacching the ring road and gooing to the destination, i walked slowly reach the subway crossed the road and moved into the mall searching for the shop which they had gone yesterday. and atlast i found it, but to my disappointment it was Closed,

I but then, i was caught in two minds weather should i go to the next one some distance down the road, or shall i return home. But the heat was too much for me, so i decided to walk back to the guest house.

It was strange to walk the streets here in south Ex, the people do not care what happens, They just walk by, they are like a archipelago, a group of islands. i don't know weather the next house people will know if some thing happens in one of the neighbour's houses. I doubt it. It is too silent, disturbingly silent. I hate this place....

The guys are still not back. i think i will talk another walk, and then go to sleep...

Saturday, August 23, 2008

Drinks Party!!!

It was last week friday or so. i don't exactly remember. My R had bought something new so there was a party thrown in the cafeteria of the office. I have heard about drinks party more from my friends, it will be like this like that and so, This was the first time me attending one.

Once J had said that it would be loud and fun to be there in the party. But this one wasn't so. It was loud in the first 5 minutes but then it was normal after that, it was too boring that i went back to my place to work after half an hour. It wasn't that great though, but i got the much needed break from work that day. We did take some pics there, will be uploading them soon.

btw, I don't drink.

Friday, August 15, 2008

India Strikes Gold on the 4th day of the Beijing Olympics 2008

BCCI Rs.25 lakhs

Haryana Rs.25 Lakh

Karnataka Rs.10 Lakh

Punjab Rs.1 crore

Chandigarh Rs.5 lakh

Madhya Pradesh Rs.5 lakh

Free travel in Spice Jet

Free Travel pass in First Class Compartment

This aint a wish list. This is what Abinav bindra gets for winning the gold medal in Olympics, not to mention to his favourite dishes from his sister for this raksha bandhan...


Well I am not saying no body should reward him for winning the olympic gold medal.. he has made india proud. But the very point which all these government bodies miss out is what makes me angry...


Lets list the facts first.

  • Abinav never used any government facilities.
  • Abinav never went to the academy to practice.
  • all other shooters failed to qualify, baring a few who went to the first round..

when these idiotic governments can shell out so much money on to this winner, then why not shell some thing like this for a academy where the people can practice and can get us more medals, that this only lone some till date, while china has already raked 32 (and counting) gold medals....

And for the whole day, (also for the following next 2 days) they were telecasting and talking and wishing to only abinav bindra, everything else took a back seat... They talked about nothing. All these tv channels which carry many a sting operations to uncover so many things, why not they do a investigation on why so many athletes failed to qualify. Why don't they raise this question everytime they are hailing some one. This time, indians struck gold on the 4th day itself, now they will not worry, even if nobody else is going towin a medal in the rest of the days in this tournanemt. why worry, we already got a medal and that too gold.. FUCK off

This makes a point like this, tat only those with money can sharpen their talents and go about and try to win the gold. The previous versions silver winner Rajavardhan Rathore was supported by the Army and not by the government in any means... and now he is getting all the money back. again. and what the rest of the people who relied on the government systems, there futures will be in doubt, they might be let off for some days, then everything will be forgotten and they will be doing the same things again...

what the hell is this government there for, what is the sports ministry doing. Why the hell am i writing about this?!!

Independence Day in the Capital....

I have been here for quite a time without any quality work. or should i say work. Well, then i can always invent some on my own. and that is what i did. I did create some ant build scripts for some of my taks, to make my job easy. but still it is too boring, the scrpts did not even give me a little challenge.

Am just getting bored in Delhi... I don't know what i will do the next two days. The capital is closed for the day, all borders have been sealed since yesterday night, Trafic was worse yesterday, very less number of buses and autos. It was a contest to catch a auto last night, which i was enjoying in the rain. it took us nearly half hour to get a auto. Coming back, to day is the independence day of my country, and the capital has been locked down. The day the country got freedom, we are in a house arrests (kinda). it is boring

Fiddled with suse here from morning and made the Internet working, I still don;t know what the problem is, the internet was not working for the past 2 weeks and the fucking windows went down during the installation of SUSE, saying hal.dll missing or corrupt. and the very next day the internet stopped working in SUSE. we were just baffled. we were not having the correct settings to connect to internet. so we decided to take the settings from the windows installation which was not working. to do this we need to repair windows. it took us the whole week to get a windows installation disk.

But before we could lay our hands on the windows installation disk, the CTO who lives with us in the guest house, locked down the modem and the bios preventing us from booting thru d. Now with this idiot, i had to striggle thru this week till i made internet connectivity this morning....

The CTO talkes big things about linux, but he is against installing linux in the guest house machine (we just tried dual boot) and moreove, he was also not interested in getting the system into proper shape. he was preventing us from correcting the system, and also he was also not making any efforts to make it work properly, or not even calling the service guy to do his job, This sucks. He is holding on to many a information and is not open to others suggestions, and he says he is a follower of open source. These guys suck. i do not want to be among these people. but god forbid, i am here working in here, along with these people. This just sucks....

Any way aprt from the rantings, we did go our to cetain places in the capital. and as usual i have some pictures to share. they have been uploaded to picasa. you can find the links in the side bar, a little down.

Independence day when we got freedom in 1947, and that makes the people to be home of the fear of some thing like a bomb blast and stiff in this age.. and this sucks...

Anyway. Enjoy and have a nice day...

Tuesday, August 05, 2008

Skelta

Skelta, the name somehow reminds me of Zelda games. But Skelta is not a game, nor anything related to it. It a tool, a work flow tool. It's web site screams about itself as The World's 1st embedable .net BPM and work flow engine using Microsoft .net framework..
Now what am i doing talking abt some microsoft technology... well i was forced to sit through the demo of skelta. which i should say was quiet interesting product, considering, i too work with a tool, which is similar to this in the work flow design market, but that is of JAVA technology. ok, coming to Skelta, it had a nice good looking UI, and also the demo was impressive, and the Skelta guys have promised to give us a eval version which we can use it and see.

First things though i was impressed with skelta, i couldn't stop noting the one requirement which Skelta had. which was not so nice. It requires Either Mssql 2005 or above or Oracle 10g and above for it to run, and the other applicatios which are there already may run on any database which it has. now why should i go to installl another database server just for skelta when i am already using something which is being used by numerous other applications. I don't know why they stuck with only these tow databases for skelta's internal db use. This is one place where the tool i work with has a advantange, it can connect to any database with a JDBC driver, which is nearly every other database that exists, which is nearly everything. (ok there might be exceptions but then, Skelta too could not connect there either).

Though it has a nearly good looking ui, it looks too much like my Mail client's inbox, which looks boring after some time. This is again where there is a hands up with the my tool. But clearly there are places where D*******N will skore against Skelta, but there are, again places where Skelta will score. Now which i will be using in the near future, that i cannot tell, if my bosses say use Skelta, then i will have to use it. But then that doesn;t mean i will put my D*******N skillls to rest. I'll put them to good use somewhere...........

Like the same challenge that i had with this one porting to linux, this time i might have a greater challenge, coz this one will not work in Linux, as this is a microsoft technology. But again there is always a alternative when comming to linux, and there is MONO in this case. I might be tempted to try to port it to MONO but i won;t have the kind of support that i had for the present tool. Coz i won;t have access to the code base. But still there is no harm in trying. Lets wait with crossed fingers, for what the future holds only future knows..............

Delhi..............

Delhi, am back in delhi for a month or two. on an official tour. It is still the same since how it was two years ago, the same traffic jams, the heat, the unexpected rains, everything is still the same. Except for me, last time i was here for working in my favourite field, as instrumentation engineer in the CNG field. But now as a software developer and support engineer for D*******N.

It was just plain old memories, for the first two days, then back to the reality, the new office here, though the HO of the company that i work in, doesn't look so. There was no name board, it just looks like a big house entrance located in the wrong area... i couldn't get a pic. may be i;ll to get one later b4 i leave delhi.....

Got some pictures, and some nice funny ones too, will post em soon,......