- Diplomacy is the art of saying "nice doggy" ... until you can find a rock.
- It's not a bug, it's a feature. >> Support
- As far as I can tell, calling something philosophical is like greasing a pig to make it hard to catch.
- It’s always known that one horse can run faster than another. But which one?
- Some people will believe anything if you whisper it to them.
- If you want to make peace, you don’t talk to your friends. You talk to your enemies.
- We could never learn to be brave and patient If there were only joy in the world.
- War does not determine who is right - only who is left.
- Gratitude is expensive. Revenge is profitable.
- A synonym is a word you use when you can’t spell the word you first thought of.
- The greatest weariness comes from work not done.
- It may be that your whole purpose in life is simply to serve as a warning to others.
- Anything is possible, but only a few things actually happen.
- No matter how big or soft or warm your bed is, you still have to get out of it.
- I went on a diet, swore off drinking and heavy eating, and in fourteen days I lost two weeks.
- We make a living by what we get, we make a life by what we give.
- I slept, and dreamed that life was beauty;I woke, and found that life was duty.
Some Popular, Interesting, Impressing, Funny...... Quotes
Java Image - read image and separate RGB array values
public class TestImagesss {
public static void main(String[] args) {
int value[][]=getRGB(getImage("test.jpg"));
int valueR[][]=getR(getImage("test.jpg"));
}
//.... code below :
maven - pom.xml define properties constants
<properties>
<my_Constant_String>com.gt.App</my_Constant_String>
</properties>
Use : <some_property_tag>${my_Constant_String}</some_property_tag>
screen logger - capture screen periodically and save to folder - java
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class ScreenLogger {
private static final String saveLocation = "c:\\logs\\";
private static final int timeInterval = 1000 * 30;
private static Rectangle rect;
private static Robot robot;
public static void main(String[] args) throws Exception {
init();
new Thread(new CaptureThread()).start();
}
J2ME Bluetooth discover connect send read message
This working java source code was used in our project BlueChess- two player chess game over bluetooth adhoc connection
Code:
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;
import javax.bluetooth.ServiceRecord;
import javax.bluetooth.UUID;
import javax.microedition.io.Connector;
import javax.microedition.io.StreamConnection;
import javax.microedition.io.StreamConnectionNotifier;
public class BtCommunication {
private StreamConnectionNotifier scn=null;
private DiscoveryAgent mDiscoveryAgent=null;
private StreamConnection conn = null;
private InputStream inputStream=null;
Java:opening a folder in windows explorer
String cmd = "cmd.exe /c start ";
String file = "c:\\";
Runtime.getRuntime().exec(cmd + file);
In this quick tip, I’m going to show you how to pop open Windows Explorer directly from your Java application. The snippet above constructs a command that tells cmd.exe to run the built‑in start utility. When start receives a folder path, Windows opens Explorer instead of a console window—exactly what we want.
How it works step by step:
- The
cmd.exe /cprefix runs a command and then terminates the command prompt. startlaunches a new process in a separate window; for directories, this means Explorer.Runtime.getRuntime().exec(…)hands the assembled string to the operating system.
One thing to keep in mind: if the directory path contains spaces, you must wrap it in escaped quotes. For example:
String file = "\"C:\\Program Files\"";
Runtime.getRuntime().exec("cmd.exe /c start " + file);
Alternatives: Starting with Java 6 you can use the Desktop API:
Desktop.getDesktop().open(new File("C:\\"));
That approach is more portable, but it may fail on headless systems or if the file isn’t a directory. For Windows‑specific utilities the start trick is reliable and gives you full control.
If you need to capture output or handle errors more gracefully, switch to ProcessBuilder. As an example:
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", "start", "C:\\");
pb.start();
Testing…
Creating DSL / PPPOE Connection in UBUNTU
Creating DSL connection in Ubuntu is extremely easy.
Create, configure maven project in eclipse - example tutorial
- Download and Install maven in windows:
- Add M2_REPO classpath variable in eclipse
- Generate Java/Web Project with maven and import in eclipse
- Add another dependency from web repository
- Add custom or 3rd party library manually into repository:
- Benefits of using MAVEN :
Reading contents of unix ext partitions from windows
Do you ever want to copy files from your unix ext partition from windows?
Ext2Explore is solution.
It supports ext2, ext3, ext4 partitions. and easy to use as it provides GUI like an file explorer.
This software is compatible with windows XP SP3 and higher.
Download it from SourceForge.net
You need to run this program as an Administer option.
Most Popular English Movies
They are definitely good : inspiring and entertaining.
- A beautiful mind
- The Pursuit of Happiness
- Atonement
- The Notebook
- Casablanca
- Hill has eyes
- Stuck
- 8 belows
- Alive
- Awakenings
- Basketball diaries
- The Motorcycle Diaries (2004)
- Before Sunrise (1995)
- Before Sunset (2004)