Posts

Kill a Process

Unix > ps -ef | grep java > kill -9 PID Windows > netstat -ano | findstr 8100 TCP    0.0.0.0:8100           0.0.0.0:0              LISTENING       8732 TCP    [::]:8100              [::]:0                 LISTENING       8732 > taskkill /PID 8732 /F  SUCCESS: The process with PID 8732 has been terminated.

Search only Folders in Windows 7

Image
GUI search : To restrict by file type Use Example ------------------------ --- ------- Folders folders kind:folders Folder name foldername foldername:mydocs Command line search: dir java /ad /s /b

Message driven beans(MDB) and transaction attributes

"Message-driven beans may declare only the NOT_SUPPORTED or REQUIRED transaction attribute. The other transaction attributes don't make sense in message-driven beans because they apply to client-initiated transactions." Why ? MDB are called asynchronously. Therefore NEVER, SUPPORTS, REQUIRES_NEW transaction attributes are not make sense, because there isn't pre-existing transaction context for MDB. NEVER throws Exception if there is pre-existing transaction context, but that don't ever occur. If there is pre-existing transaction context, SUPPORTS will run in that transaction context. (But, there is NO such in MDB!) REQUIRES_NEW always run in new transaction context, but this behavior is always the same to REQUIRED. REQUIRED Vs. REQUIRES_NEW why are we allowed to use a REQUIRED , but not a REQUIRES_NEW? When we specify theh RequiresNew, it comes with an implicit understanding that if the client has a transaction, it needs to be suspended. i.e. the existence of a cl...

What is serialVersionUID?

If a class implements Serializable interface, your IDE worn you to add serialVersionUID or it add automatically. This variable holds a private static final long and IDE automatically declared it to 1L. class SerializeMe implements Serializable { private static final long serialVersionUID = 1L; private String data; public SerializeMe (String data) { this.data = data; } public String getData() { return data; } } Field data represents some information stored in the class. Note that serialVersionUID is a static value, then it should not have been serialized. But why is this so impotent? public class SerialVersionUIDTester { public static void main(String [] args) throws Exception { File file = new File("out.ser"); FileOutputStream fos = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(fos); SerializeMe serializeMe = new SerializeMe("serialVersionUID is 1L"); ...

-- Start Telnet feature in Vista --

-> Open the Start Bar and search Telnet. -> If it does not show anything in Programs do the following. -> Open Control Panel. -> Click on Programs. -> Click on Programs and Features. -> Under that click "Turn Windows features on or off" (left side of the window). -> Click Continue on the Pop-Up. -> A Dialog box will show up and it might take a while to populate the list. -> Go down in Dialog box and look under Tablet PC Optional Components. -> It will say Telnet Client. -> Check the box -> then OK. It may take a while. -> check the telnet in command prompt.

-- Are you a Android Developer? --

If you going to develop an application using Android (specially hardware dependent application, just like new protocol for WI-FI or new network application), curren- tly you must have a mobile phone which is fully support Android OS. There was a Nokia phone and one Motorola phone which is support to Android partially. Because some Android features doesn't work will on those phones. That implies only T-Mobile G1 is the solution to such development. Android announce that they are going to issue a phone, for Android developments and they are call it as a Android Dev Phone 1 . Android Dev Phone 1 is a SIM-unlocked and hardware-unlocked device that is designed for advanced developers. The device ships with a system image that is fully compatible with Android 1.0, so you can rely on it when developing your applications. We can use any SIM in the device and can flash custom Android builds that will work with the unlocked bootloader. The device currently costs $399 (USD) (including free sh...

-- Google Android --

What is Android? Android is a software stack + Operating system and middle-ware, for mobile devices. Its provides a SDK for develop a applications on Android using Java language. Now it has a Eclipse plug-in for Android application development. Why is this so cool Android is a full open-source platform for mobile devices. It has a full access to hardware level and free to develop software. Features * Application framework enabling reuse and replacement of components * Dalvik virtual machine optimized for mobile devices * Integrated browser based on the open source WebKit engine * Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) * SQLite for structured data storage * Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) * GSM Telephony (hardware dependent) * Bluetooth, EDGE, 3G, and WiFi (hardware dependent...