Skip to main content

Posts

20 very useful Java code snippets for Java Developers

Following are few very useful Java code snippets for Java developers. Few of them are written by me and few are taken from other code reference. Feel free to comment about the code and also add your code snippet. 1. Converting Strings to int and int to String String a = String.valueOf( 2 );   //integer to numeric string int i = Integer.parseInt(a); //numeric string to an int 2. Append text to file in Java Updated: Thanks Simone for pointing to exception. I have changed the code. BufferedWriter out = null ; try {      out = new BufferedWriter( new FileWriter(”filename”, true ));      out.write(”aString”); } catch (IOException e) {      // error processing code } finally {      if (out != null ) {          out.close();      } } 3. Get name of current method in Java Stri...

Android is not Google and Google is not Android anymore?

I like Android a lot. It’s Linux’s biggest end-user success story. Android has great applications. Moreover, Android’s smartphone market-share is growing fast. Eventually Android will become the number one smartphone operating system in the world. If, that is, everything goes right. Android’s biggest worry is not the iPhone, the Blackberry, or Windows Phone 7; it is that it will fragment into multiple incompatible, brand-specific versions. With a large number of custom versions of the Android platform emerging, the concern is that interoperability will be weakened because of the potential for applications built specifically for one variant or device not being able to work with others. You see, all the original equipment manufacturers (OEMs), like Motorola and HTC put their own software, Sense UI and Motoblur respectively, on top of Android. Then, all the carriers add their own special-sauce of applications. It can get messy. If the makers of the number one mobile game in the worl...

Tablet Buying Guide for 2012

So you’re looking to buy a tablet. The good news is that this is the most exciting time yet for the form factor, with exciting and competitive products available or coming soon from Google, Amazon, Microsoft, and Apple. The bad news, of course, is that all this choice makes buying decisions that much harder. Let’s take a closer look at each of the major players. Here’s our tablet buying guide for summer 2012. iPad No need to describe this one for you. For the time being, the iPad still dominate the tablet field. It commands the most apps and, in its newest generation, an absurdly high-resolution display. Bluetooth and software like Pages, GarageBand, and iMovie make it a device for both creation and consumption (though it’s still a bit awkward to pair with a keyboard). If you know someone with a tablet, it’s probably an iPad. Here are the three most important questions, then: Do you enjoy or prefer iOS? Are you willing to pay at least $400? And do you want a 10-inch ta...

How to hack a computer with IP address

There are plenty of papers out there that go into how to obtain an IP Address from the preferred mark of your choice. So I’m not going to go into that subject. Alright so say we got the targets IP Address finally. What do we do with this IP Address. Well first ping the IP Address to make sure that its alive. In other words online. Now at the bottom of this document I have included some links where you can obtain some key tools that may help on your journey through the electronic jungle. So we need to find places to get inside of the computer so we can start trying to find a way to “hack” the box. Port Scanners are used to identify the open ports on a machine that’s running on a network, whether its a router, or a desktop computer, they will all have ports. Protocols use these ports to communicate with other services and resources on the network. 1) Blues Port Scanner   This program will scan the IP address that you chose and identify open ports that are on the target box. ...