Thursday, February 25, 2010

The Bloom box - green energy



My sixth sense tells me that this company is ready for prime time ... period.

Tuesday, February 23, 2010

My best budget SSD

Super Talent UltraDrive ME 128GB $308
Sequential Read Rate: 260 MB/s (max)
Sequential Write Rate: 195 MB/s (max)
NAND Flash: MLC
64MB DRAM cache
Access Time: 0.1 ms
Firmware upgradeable: Yes

OCZ Vertex Turbo 120GB SSD $365
Maximum sequential read speed up to 270 MB/s
Maximum sequential write speed up to 200 MB/s
Indilinx Barefoot controller and Samsung MLC NAND flash for maximum performance
64MB 180MHz DRAM cache for ramp up stutter-free performance
Seek Time less than 0.1 ms
Firmware upgradeable: No

NetBeans 6.9 new feature



It's nice to know that Netbeans will support OSGI in the next release (6.9), more detail can be found here ...

Monday, February 22, 2010

How to copy a file

How to copy a file

In Java 5 and 6:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
....
String orig ="file.xml";
String dest = "file.xml.bak";
InputStream in = new FileInputStream(orig);
OutputStream out = new FileOutputStream(dest);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();

In Java 7:
import java.file.io;
import org.apache.commons.io.FileUtils;
....
String orig ="file.xml";
String dest = "file.xml.bak";
File fOrig = new File(orig);
File fDest = new File(dest);
FileUtils.copyFile(fOrig, fDest);

In Groovy:
new File("/tmp/otherFile") << new File("/tmp/someFile").text
( new AntBuilder ( ) ).copy ( file : 'blah' , tofile : 'fobar' )

Reference

Sunday, February 21, 2010

Groovy tips

How to use 'split' on each line of a file:
new File("simple.tab").withReader{r->
line = r.readLine();
println "first line: $line"
r.splitEachLine("\t"){fields->
println "fields on line: $fields"
}
}

linefeed = "\n" //or "\r\n" if the user chose so
lines = new File('pathtofile').text.split("${linefeed}")

Tuesday, February 16, 2010

Test how to upload an image ..

It's fun to do image ... :-)

Sunday, February 14, 2010

Another way to make good use of your webcam

Just bookmarked this link for future experiment.

Highlight cam is a free software you can register online and start monitoring immediately and make your PC a security system and act as a silent security guard for your office, Home or any other space

Features:
* Motion alert notifications sent via Email
* Off-site backup in case the intruder takes the computer

Tagging for your blog

Finally found how I can add Tag to my blog and here is the link ... the 3D tag provided by Blogger works fine on Google Chrome and FireFox but Microsoft IE.

Code formatting test

By using this formatting tool (or this) I'm able to display code snippets properly in my blog.

<target name="build"
depends="copydata,copyresources">
<echo message="Building ${bundle_name} in ${component_name}..." />
<mkdir dir="${build_root}/build/${bundle_name}/bin" />
<mkdir dir="${build_root}/output" />
<copy todir="${build_root}/${bundle_name}/bin/">
<fileset
dir="${build_root}/build/${bundle_name}/src/">
<include name="${bundle_name}.xml" />
<include name="**/*.png" />
<include name="**/*.gif" />
</fileset>
</copy>
<antcall target="compile_with_javac" inheritrefs="true" />
<antcall target="compile_with_iajc" inheritrefs="true" />
<antcall target="renameoutput" />
</target>

Sunday, February 7, 2010

groovy++ looks cool

Groovy++ make Groovy run a lot faster by trimming dynamism and flexibility that you don't need.
And after I looked at the performance of groovy++ here I feel more confident to say that Groovy will be gaining ground fast ... sooner or later :)