Showing posts from January, 2012

find all columns in oracle named as district_id

I had a problem today. it was about changing all district_id in a whole database. so I need to find who used district_id as column name in tables in oracle.

here is how I find it.
Select COLUMN_NAME,table_name from user_tab_columns where table_name in ( select object_name from user_objects where object_type='TABLE' ) and COLUMN_NAME ='DISTRICT_ID' and I changed all values from found tables.

test your disks in linux

I have a linux server which has 2 disks on it. one of them is SSD and other is SATA disk. I wondered how fast is ssd is here is the output :) ~ # hdparm -t /dev/sdc /dev/sdc: Timing buffered disk reads: 598 MB in 3.00 seconds = 199.03 MB/sec ~ # hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 266 MB in 3.00 seconds = 88.55 MB/sec I should say this test done when server has load on it. pretty nice


one of my dead project which was about endoscopic data capture and saving in mp4 format. which was using blackmagic card to capture all data and it was working in linux with power of QT and ffmpeg.

I was thinking I may publish in google code svn repo. but there is no development plan on it so no need to have any repo. people who need to capture data from blackmagic capture card and save it in video file may find this as helpfull example.

strange java hibernate story from today

today I was developing a new request from customer. its not a big issue just adding a new Boolean field will cover the request and will work happly ever after. I added my new "isActive" field into hbm xml then pojo. and started the app in windows with tomcat maven plugin. there was nothing wrong hibernate started up smoothly and update the table and added my new field into the persistent level. I like hibernate more, everyday :) its just like a dog. best friend of men. which helps for everything and expects only our love :D anyway I decided to deploy our new class to server which runs weblogic 11g. I went to ssh and run "svn up" then "mvn install" then went back to weblogic console for updating our big webapp. then I gave the path of war and said update then started the app. then started waiting log to come and make me smile :) and it said there is no getisactive function in the class. I just added and run in my laptop it was working fine. how the hell …

publishing and reading from jms

simple java class for reading and writing to weblogic jms. import; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueReceiver; import javax.jms.QueueSession; import javax.jms.Session; import javax.jms.TextMessage; import javax.naming.Context; import javax.naming.InitialContext; import org.apache.axis.AxisFault; public class ReadFromRemoteJms{ public static void main(String args[]) { try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); env.put(Context.SECURITY_PRINCIPAL, "weblogicusername"); env.put(Context.SECURITY_CREDENTIALS, "…

swt and maven example

Swt does not come from maven repo with the latest version. but you can use this pom to use latest swt version  from nexus testing repo.

<project xmlns:xsi="" xmlns="" xsi:schemalocation=""> <modelversion>4.0.0</modelversion> <groupid>mascix</groupid> <artifactid>MavenSwt</artifactid> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupid>org.eclipse.swt</groupid> <artifactid>org.eclipse.swt.win32.win32.x86_64</artifactid> <version>3.6.2</version> </dependency> </dependencies> <repositories> <repository> <id>nexus-testing</id> <layout>default</layout> <url>…