Sunday, July 19, 2009

Finished with first idiots painting :)


I am done with Sudhirs painting, its like just 2D effect as I was not able to give it the touch to be consider it as 3D, still to learn a lot. For the portraits I need to learn the color effects to bring the image as 3D, here I failed to do so, as such you can see that the face with no light is just as some what black, but actually should have been of dark brown (not exactly), anyways I will be working on the kid, mmm thinking of my sis to paint next, this one is not for any one but for me to learn.

Sunday, July 12, 2009

Knife painting


Just completed painting with knife, tried to get depthness but not upto the mark.

Sunday, June 28, 2009

mid-way through painting of 1 of the idiots


I started off with my life's first portrait, its of Sudhirs and I am almost there, a sort of mid-way. Took me nearly whole day to come up to there, but still I lack in giving it as a real picture, but yeah I know for sure I have learned things with this one and will be on to the next one, it will be of Nandu's, but his portrait will be in just blue, black and white shades.

Thursday, June 25, 2009

My Unfinished Painting



I started of with this paintings on 23Dec08, yeah they are not yet finished and are in the same state as of I left it then. I am not sure when it will be finished and as I am not a real artist like professionals, I do painting only when I get interest and so not sure when they will be finished :), mmmmm lets wait an see if I can finish with this one or not.

Recollecting my past painting which I used to do with water color, I have done birla temple painting in the past but then it was way back, I don't even remember to whom I have given the painting then, if its still there.

2 Idiots portraits


I have been given task by two idiots (off-course Sudhir and Nandu) to have there portraits been done. I have started off with Sudhir as I have a good pic of him, but Nandus mmmm still waiting for his good pic, I am not an portrait artist but trying out this will be a great experience. I have done the outline with pencil on 15" X 22" inch of Sudhirs. Will be starting on Nandu's when he will provide me with a good pic :)

Will be starting on giving it color, just thinking on how to give it!, I mean should I give it as usual skin color or should I go with a sort of creativity to give it a single color...it all depends on my mode when I start on it, until then...wait and see :)

Thursday, June 18, 2009

DOS/MAC to Liunx/Unix text file converter

This is a common problem if you work on linux/unix flavors and when you check out you find an shell script which is just an ascii file is not working, when you try to run it says "bash: ./mk.sh: /bin/sh^M: bad interpreter: No such file or directory"

Simple solution is to convert the text file (shell script) which is in DOS/MAC into LINUX/UNIX text format using "dos2unix" command. Need to run as "dos2unix "

Tuesday, June 16, 2009

Learning steps with "Jack Kolber"

Just completed with "Jack Kolber" tutorial, I am still learning things told by Jack and need to do a lot of work, thanks to him once again.

Monday, June 15, 2009

Learning steps with "Jack Kolber"

I was searching youtube for learning the technique used by the professional painters, who are real artists, I found one video at Oil Painting Lesson with Jack Kolber - Summer At The Lake its by "Jack Kolber".

I have started on it, its not yet complete and you can see the preview of my first layer of the painting.

This painting is dedicated to "Jack Kolber", Thanks Jack.

Tuesday, March 03, 2009

Printing "Hello World" with three different threads

Written a Java program which prints "Hello World" with three different threads ie first thread should print "Hello", second one " " (a space) and the third one should print "World". This three threads can start at any point but our program makes sure that the output is constant.

import java.util.ArrayList;
import java.util.List;

/**
* Program which prints "Hello World", "Hello", " ", and "World" are printed by different threads
* but should be in sequence of "Hello World"
*
* @author mpujari
*/
public class ThreadHelloWorld {

private static final int COUNT = 1000;

private static final String[] STRING_OUT = new String[] { "Hello", " ", "World" };

private static final List stringOutList = new ArrayList(COUNT);

private static class SimpleCountLock {
private int count;

SimpleCountLock(int count) {
this.count = count;
}

public int getCount() {
return count;
}

public void setCount(int count) {
this.count = count;
}

public void incrementCount() {
count++;
}
}

private static class PrinterThread implements Runnable {

private String msg;
private int priority;
private SimpleCountLock lockObj;

public PrinterThread(String msg, int priority, SimpleCountLock lockObj) {
this.msg = msg;
this.priority = priority;
this.lockObj = lockObj;
}

public void run() {
synchronized (lockObj) {
while (true) {
if (this.priority == lockObj.getCount()) {
// System.out.print(msg);
stringOutList.add(msg);

lockObj.incrementCount();
lockObj.notifyAll();
return;
}
try {
lockObj.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}

public void doTest() {
SimpleCountLock lock = new SimpleCountLock(1);
for (int i = 0; i < COUNT; i++) {
lock.setCount(1);
Thread hello = new Thread(new PrinterThread(STRING_OUT[0], 1, lock));
Thread space = new Thread(new PrinterThread(STRING_OUT[1], 2, lock));
Thread world = new Thread(new PrinterThread(STRING_OUT[2], 3, lock));
Thread[] threads = new Thread[] { space, hello, world};
for (Thread thread : threads) {
thread.start();
}
for (Thread thread : threads) {
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}

public static void main(String[] args) {
ThreadHelloWorld helloWorld = new ThreadHelloWorld();
helloWorld.doTest();
// test the output
int count = 0;
for (String out : stringOutList) {
int mod = count++ % 3;
if (!STRING_OUT[mod].equals(out)) {
System.out.println("STRING_OUT[mod]:" + STRING_OUT[mod] + ", " + out);
throw new RuntimeException("Test failed");
}
}

System.out.println("Test was successfull");
}

}



Monday, February 23, 2009

Final touches to Boat in the dark

After 3 months of doing my "Boat in the dark" painting, yesterday I have given it a final touches ie I had varnished it :), looks great with a new layer of shine....
Need to varnish "The lazy puppy" and the "Sunshine".

Thursday, January 01, 2009

Another year starts

We are in to new year & hope this year brings happiness to all of us (hopefully). for me things are going on well work as well as hobby wise, right now 3 paintings r in progress from that one is hyderabad's birla temple (one of the icons of hyderabad) . Will be posting soon once completed :)

Wednesday, December 17, 2008

My new path


At last I started on my own path, still need to learn and do a lot. The first one a puppy is for Kaushik (As I told him, he would get my first painting) :) and its like the first painting as I had no exp in oil paint...anyways lots of complaints from him for that but a promise is a promise so I will not be correcting that painting even if I know its not tht much good...




The second one is for my wife...yeah my life I started realizing about oil painting...yeah its not that easy, this painting is copy right of a guy (I don't remember this id to be given over here) so I tried to do it as he has done but yeah he is a professional one n mine seems just a child started one, mmmm thats k for me....I have learned lots of details from this person's painting (thanks to him, sorry realy I haven't saved from where I have taken this painting).








The third is for Sudhir...my lungoti yaar....yeah he seems very impressed but frm my heart I know its just eye illussion if this painting is seen by any real artist he will defentliy kick me..for the mistakes I have done, but yeah I will b improving on that.

Thursday, October 30, 2008

ORA-01005: null password given; logon denied

I was doing a simple POC of JDBC.
My system configuration is

Operating System : Windows XP
OS Architecture : x86
OS Version : 5.1
Database Version : Oracle Database 10g Express Edition Release 10.2.0.1.0 - Beta
Java Version : 1.5.0_16
JDBC Jar File : OJDBC5.jar

When I tried to run the program I was getting "null password given; logon denied", yeah I know the reason :) I cross checked that I have missed giving password but NO wait...I have given it correctly, but still I was getting "null password given; logon denied".

I searched net for any issues related to it, and found one blog where it says change the language settings, I tried it but had no success. So I went and saw was I using correct ojdbc5.jar file, looked like I was using correct jar and that too with correct version of JAVA but still I got the error. after struggling for 3 days I just thought to use the jar provided by ORACLE XE in %ORACLE_HOME%/lib, it contained ojdbc1.4.jar and ojdbc1_g.jar it says to use this jar with JDK1.4 but I was using 1.5 but still wanted to test it. so I went ahead and used 1.4 drivers instead of 5.jar, it just worked out...... :) but still have to figure out why I was getting "null password given; logon denied" when I was using ojdbc5.jar which should be used with JAVA 1.5.

Tuesday, September 30, 2008

Back reference in Hibernate

I was working on a bug (enhancement) in my project, where in I had to enhance one functionality which is purely written in JSF (some JS) to use the projects metadata framework. First I want to tell what this framework looks like (at high level).

Metadata framework (MTDFRM) its some thing like replicating or showing in UI form to the user for doing addition/editing/deletion of an row in DB (database).

Coming to the problem where it all started, below is the hibernate mapping of a table which I had move it to MTDFRM from conventional JSF:

<hibernate-mapping>
<class lazy="true" update="true" insert="true" table="HOLDER" name="Holder">
.......
.......
<set lazy="true" cascade="all" name="ParamsValues">
<key column="PARAMS_VALUES_SEQNO" null="true">
<one-to-many class="ParamsValue">
</one-to-many>
</key>
</set>
.......
</hbm>

There were 10 properties (including collections) but when I was running the project JSF was complaining about a property not found which was named as _paramsValuesBackref ("_" and "Backref" where appended to paramsValues, as I am like a new bee to the project I spent around 6hours finding which code modified the properties of the table mapping but I never serached in hibernate code, my mistake :(, but some how at last I was able to trace to a file which was appending one extra property to the metadata, it was org.hibernate.cfg.HbmBinder.

As per comments in the file of HbmBinder it says "for non-inverse one-to-many, with a not-null fk, add a backref!", which was perfect fit for the above properties which I had in my mapping file, so I had to add inverse="true" which made the backref no more to be added as extra properties in the metadata, as we know it also helps in telling hibernate that we should not propagate chances made at this collection end ie at ParamsValues end.

This blog doesn't say much about the usage of BackRef by hibernate, as I need to investigate the usage as how hibernate uses this property. Will be posting the finding (need to google or debug) in the next blog to come....

Sunday, September 21, 2008

The mistakes I do & repeat it even if I know :)

I am a human :) (wow at last I think I am a human) in my job I do one big mistake, which I know about, I may be doing even more mistakes but I need to hunt them down someday.
So about this mistake, I don't know what technical word is given to this habit, its like this say I am working on a problem (off-course its about my job) and as usual I don't know anything about it, I try to hunt it down as soon as possible but when I am stuck the usual thing normal people do is take help from a person who already knows about it but me me....I don't do this but instead I hunt around and this goes like a circle, few problems yeah I do get solutions, its not gr8 because already ppl know about this and me just discovered, but my inner feeling is like "wow I did some thing gr8" this feeling is a evil in disguises to me as for other problems I hunt and I can't get the solution on time but to get this gr8 feeling I try and try but at the end it like, the problem which can be solved by a person how knows things better can do it in say some 16hour I spent the whole week :( ie 8hours * 5 (40 hours) but still I am now where.......
This is my biggest mistake, I do all over then I release but then latter when I am into problems I forget or negelate my mistake and I am allover again doing the same old mistake :)
The other mistake I do is like, when I am looking for solution for problem 'A' I hunt it down, but during this period if I see other things like 'B', 'C'.....I get involved in tooking into it for getting knowledge about them and I just get deviated from problem 'A'.
I need to over come this things, hope I do and soon as I am getting nearer to 4years of work exp I need to be more smart and more control on my self taking in to account of any problem (technically).

Thursday, August 21, 2008

Dos and Don'ts

This is much for myself & if it helps others its good :
  1. Code to interface, mmmm still need to get habituated with this.
  2. Write test cases.
  3. Never mutate the object passed by the parameter ie when we get list as an method parameter do not alter the list in that method , and when we need too then just make a local copy of it and work on the locally created object.
  4. When wrapping up the exception do wrap with cause ie try {} catch (SomeException e) { throw new WrapException(e.getMessage()) {}...never do this, we are eating up the actual cause but instead do "throw new WrapException(e)" in the catch.
  5. Avoid String splitting for business logic flow. like String str1 = getSomeText(); if("Target".equals(choice.split("-")[0].trim()) { //do this....} else {// do that...}

Some other things I want to remember and I forget all the time
  1. Apache Tomcat is servlet container, it implements java servlet & jsp spec and provides pure java HTTP web servlet environment.
  2. 'Apache Web Server' is C-Lang based HTTP web server.

Thursday, June 26, 2008

technical blog by my collegues

My colleagues blog at http://pitfalls.wordpress.com which is a good stuff to go through...this ppl r technical gurus... :) gr8 to have thm as my colleagues...

Sunday, June 15, 2008

sw architecture links

Nowadays I am going through Hibernate, JSF, Springs and functional requirements of my current project. Going through this stuff all at a time is not good....this I got to know after doing it :)

Today I got a good links on Software Architecture, this link is of an google group http://groups.google.com/group/codingthearchitecture?lnk=srg and this one by Markus Voelter http://voelterblog.blogspot.com/

Thursday, May 29, 2008

Good article in to JVM internals

This link provides good information about JVM internals.

http://www.artima.com/java/

Monday, May 12, 2008

Books to read:
  • Extreme Programming explained by Emrace Change
  • Effective Java by Joshua Bloch
  • Design Patterns by the Gang of Four
  • Concurrent Programming in Java by Doug Lea
  • The Pragmatic Programmer: From Journeyman to Master
  • Better, Faster, Lighter Java by Brue A. Tate & Justin Gehtland
  • Java Threads by Scott Oaks, Henry Wong
and still to come.....