I remember reading a statement somewhere, saying that “Ipohnites are known wise-spenders, in politically correct term. In other words, kiam-sap lot.” Being a Ipohnites myself, I bet to differ. Okay, I have to agree that he was 1/2 correct. His statement does apply on dad-mom’s generation. My dad told me he went to Antap Cafe and had a coffee that costed him RM7. Of cos, for the elderly, RM7 for [ Read More ]
A week to go before reaching 24. Feeling old, I suddenly came out with a silly idea. I texted one of my best pal “Jan, I have a birthday wish. Can we wear school uniform when we go out this Sat?” He replied, “Yes, that would be fun!” Okay, to be a student after leaving it for 6-7 years is not an easy job. There are a few props I [ Read More ]
import java.util.*; import java.io.*; public class DiskStorage { //declare the default calculation – byte conversion private static final long KILOBYTE = 1024; private static final long MEGABYTE = 1024 * 1024; private static final long GIGABYTE = 1024 * 1024 * 1024; public static long getFreeSpace(String path) throws Exception { if (System.getProperty(“os.name”).startsWith(“Windows”)) { return getFreeSpaceOnWindows(path); } if (System.getProperty(“os.name”).startsWith(“Linux”)) { return getFreeSpaceOnLinux(path); } throw new UnsupportedOperationException (“The method has not been [ Read More ]
Error : Exception in thread “main” java.lang.UnsupportedClassVersionError: HelloWorld (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Reason : Trying to run a class compiled with newer version of JDK. For example, you have compiled the class with [ Read More ]
Wonder how you can get the names of each files in a directory (folder), get the size and accumulate the sizes? Here’s how… import java.io.*; public class Directory { public static void main(String[] args) throws IOException { String directoryName; File directory; long allSize = 0; directoryName= “C:\\Documents and Settings\\user\\Desktop\\calculation”; directory = new File(directoryName); if (directory.isDirectory() == false) { if (directory.exists() == false) System.out.println(“There is no such directory!”); else System.out.println(“That file [ Read More ]
I’ll be turning 24 this coming August, and yes, this is a reminder for my frens out there to prepare presents for me. Hehe, I was just joking. In a blink of eye, I’ll be 24. I can’t belief that. Because of my over-matured (old) look, many of my frens thought I’m already 34. Stop being mean okay? I still feel like I’m young though. Things that happened during my [ Read More ]
My frens are finally back from Australia. I miss them so much, I cant wait to spend times with them. Anyway, haven’t realli got to chance to meet with them. Jan sent me an MMS and told me he brought me something from Australia. This is what he sent to me….. I have no idea when or where I should where it (in malaysia). But I love it. THANX…. HEHE
I’ve been very tired lately, insomnia for days. Blame it on the weather but that is not exactly the main reason why I’m encountering this. Turning 24 this coming August, I’ve been thinking quite alot. Yes, I guess the older you’re getting, the more burden and responsibilities you have to carry. Unlike during young, we can act stupid and childish, but still being treated as “cute”. Children nowadays are so [ Read More ]