Saturday, August 28, 2010

Java 5 and Java 6 not so popular features set

Many know about generics, collections enhancements and auto-boxing, varargs, annotations ,but there are some less popular features added to java in Java5 and Java6. I'm going to point the lights on them, because they are little treasures:

Java 5:


- Formatter class - easy to use class for proper formatting of numbers, date-time, currency etc

- Scanner class - slower but comfortable to use to read text from streams

-    java.util.concurrency.* package - atomic classes introduced. You are going to use them if you are in a concurrent environment... Also locks and some thread-safe collections

- JMX was added to J2SE --- instrumentation, management for your applications, MBeans - you name it

- Arrays.fill() -- fills an array with a value you give it. Very useful instead of writing a loop and doing it manually.

- Arrays.deepToString(); --- another great static method -- instead of writing a recursion method to print the toString method of the elements in a multi-dimensional array, you just use this method !

- JTable printing - it looks more natural to have a native printing method



Java 6:

-  Deque --double-ended queue was added as an interface in the collections package

- int[] newArray = Arrays.copyOf(anotherArray, newLength);  --- faster and cooler than System.arraycopy(..)

- drag'n'drop improved --- they made it more usable, but how exactly - I haven't tried it to tell you

- JTable sorting and filtering added

- Console class added

- new methods in File - getTotalSpace(), getFreeSpace(), getUsableSpace() --- why create a file and fill it with some data when you can first check if there is enough space in the drive to create the file in the first place?

- java.util.zip.DeflaterInputStream: Data read from this stream is compressed.
  java.util.zip.InflaterOutputStream: Data written to this stream is decompressed.

Or in normal human language - something like a Zip Streams where data is compressed . Nice! I am sure to use it next time!

- JMX was greatly fixed and update so my suggestion is to use it on this JRE6 version.

- JSR 223: Scripting for the Java™ Platform API -- This is a framework by which Java Applications can "host" script engines


So Java guys, out there, don't miss out these features and have in mind the enhancements :)

L.K.

Wednesday, August 25, 2010

Dell Inspiron 1520 bugs

First of all I want to say that I'm very happy with my 2-year-old Dell laptop and his performance. This little piece of hardware (3 kg isn't that small...) has been very useful for me, writing some homeworks for the university, studying, chatting, even flirting, and of course preparing some projects connected with  Java, CPP and Python.

Anyway, but there are some flaws and I'll comment on a few of them

- strange noise

From time to the laptop starts beeping in a disturbing way... as if there is a flake of dirt in the CPU and the CPU's reading heads are registering it and the fast movement produces the squeaking sound ! Of course, that's not it, because CPU's units don't have moving parts... May be it's something in the HDD ... I hope not because I don't want lost bytes/files/hard-drives problem. It was a frightening sound the first few times, but I got used it .... because it happens quite often. May be once a month. And I'm using my notebook everyday...

- blue/black screen of death

I suppose this is due to my Windows 7 (and before was XP), but the message I got is always for a hardware malfunction and a memory dump is created. This has happened 4-5 times for these 2 years. Not good. But there was the moment I played Starcraft and it got it quite often... so may be it's a software glitch... Nevertheless it's not a
pleasant experience.

- I use Hibernate
I'm not using restart very often. I'm always hibernating and I can justify that this feature is GREAT! What hibernate does is save the state of all programs on your HDD (requires some free HDD space) and shuts down completely very quickly.
+ no power consumption compared to sleep
+ faster shut down compared to restart/shut down
+ faster start compared to restart/ shut down + start
+ all programs are already loaded and waiting for you!

People, use hibernate! Saves time and it's very nice.

A few more tricks help reduce the performance degradation:
- use programs like CCleaner to uninstall unused programs; clean registry; turn off start-up applications
- use defragmenters - your HDD becomes so unordered (fragmented) that a simple song play with Winamp makes your HDD heads travel looong distances and degrade performance. Of course all the small and constantly created/deleted files that a browser makes are "helping" for the situation. 

- DVD malfunction

In today's epoch of very fast Internet connection people need less and less CDs or DVDs storages, so basically I have almost never used my DVD and it's all in dust now. Well I tried to clean it, being careful with the lenses etc but the read speed is very low. But again may be it's a common problem when not using a device.

 - light up/down the Laptop screen on Windows 7

 When using FN+up and FN+down the display sometimes doesn't dim itself on all possible levels (8 levels of gray may be). For example 4-5 levels are active and the screen stays dark... Then you have to find the "Adjust brightness" option in Windows and using the software slider to move it and then it seems it resets which level how much darkness must set and then it manages to be from full dark to full light again...
Again this could be just a driver issue.
Later I found this to be connected with the Power plan chosen and with the cable of my AC adapter charger. When I unplug it and then plug it again, it fixes.

- Home button next to Power button

OK what's good is this button to me when I don't have Home Media Station or what was its name (a Dell software) because my laptop had not a single bit set when I bought it - completely empty (as I wanted it) and now it seems I cannot adjust what the button should do - for example open an Opera browser would be great... I'm very disappointed because I used some forum discussions solutions to setup my PC but... I failed...
Actually that was on my Win XP and now I'm going to try on Win7. Wish me luck!

//edit
I managed to set my Home Media Station button to Winamp :) Finally, I can use all buttons on my notebook.
I used this forum discussion to manage and configure the button :  link 

Leni Kirilov