21 November 2008

Picasa + Snapfish: finally printing is easy and fast in NZ too!

Google has released version 3 of the excellent Picasa, a free photo management tool
Google Photos Blog: A closer look at Picasa 3 (beta!)

But even better news is that Digitalmax has teamed up with HP's SnapFish and since Picasa can upload photos directly onto SnapFish, finally printing has become so easy and affordable!

I've used Digitalmax in the past, when they had specials for big prints in digital aspect ratio.
It's an excellent service but the potential savings wouldn't justify the hassle of using their antiquated tool for uploading pictures.
Recently they had revamped their website but they hadn't come up yet with a decent client software to facilitate the uploading process.

Well done Digitalmax, we're certainly going to use your services much more often in the future.
By the way, thank you very much for the 50 free prints that are given away as a welcome bonus!

22 October 2008

Efficient use of resources in Android

Now that Android is out, people will start looking into that great (and big) code produced by Google engineers.

One thing they have always claimed is that the Dalvik VM is safe, with each instance running in a separate process, while still efficient with resource sharing among instances.
I didn't know how that could be possibile since processes in Linux (on MMU-ful processors) have got dinstinct address spaces.

But now I've gone back to a presentation I hadn't listened to carefully enough at the time.
http://sites.google.com/site/io/dalvik-vm-internals

Basically, a Dalvik VM process is created at the beginning. Each new instance of the VM is a 'fork' of the original one (that is called, ironically, Zygote).
What I did not know is that the 'fork' action in Unix is highly efficient and makes a copy of the memory pages just when they get modified, which you wouldn't expect for most code.

http://en.wikipedia.org/wiki/Fork(operatingsystem)

09 October 2008

Something to be said...

Embedded Systems Design - Embedded.com: "Software developers are a breed apart from the standard consumer. Writing a software program requires logic, a good and detailed memory, and a certain comfort with exactitude and creativity. Consequently, the people who write software programs tend to be smart, literal minded, logical people with good memories and organized thoughts--sometimes to an extreme.

Developers are typically very intelligent, good with numbers and abstract concepts, and have an eye for detail. They tend to live in and care about the programming life, and these highly analytical people are often passionate about chosen technologies with an almost religious fervor for or against a vendor or a vendor's technology. Developers can be extremely literal minded, sometimes to a fault. Because code logic is the process of following precise instructions, solving problems often requires exhaustive technical detail as well as a broad overview of the context in which a product is used."

Machine Translation and Speech Recognition at Google

Great research being done at Google

Machine Translation and Speech Recognition at Google

30 September 2008

Templates and Exceptions in C++

It's quite funny to read about Templates and Exceptions in C++, after having used them extensively in Java and never in C++ (well, call the first ones generics).
They were so advanced, for the time, but in the case of exceptions, a bit limited: in C++ you can just catch integers, while in Java you catch objects of type Exception.
I've heard people saying that C++ templates are far more powerful than Java generics. I don't know exactly why but the fact is that Java generics are a mess so people stay away from them, or use them as little as they can.

23 September 2008

ActiveObjects: An Easier Java ORM

In my little experience with Hibernate, I had to port code from C# to Java.
While doing so I got rid of dreadful data sets and introduced the use of Hibernate.
Having to import an existing database scherma, I used the Hibernate Tools for Eclipse to generate the required XML configuration files.

In my view choosing Hibernate over data sets has improved a lot the existing code by getting rid of tons of SQL that was scattered all over the place.
Plus it has inforced good decoupling of business and data access logic so that it is now trivial to switch over to a different database vendor.

Apart from some intricacies with native and composite keys, my experience with Hibernate has been pleasant,
The only issue I have with the ORM is its slow startup and the fact that it relies on a ton of external Jars (the same reason why it's quite hard to package Hibernate as an OSGi bundle).

For a future project of the same (small) size, I will definitely look at a new, smaller ORM.
Here are some links:

ActiveObjects: An Easier Java ORM
https://activeobjects.dev.java.net/

16 August 2008

a language can be successful so long as it resists the temptation to innovate

An interview with Neil Gafter on Java 7 features

One of the comments was that a language can be successful so long as it resists the temptation to innovate. What are your thoughts on that?
Well… Let me put it this way: when Java was first released upon the world, most of the people who looked at it seriously were C and some C++ programmers. And it was seen as a huge innovation, and I don't necessarily mean that in a positive sense. People were saying: "Are you serious that you expect me to use garbage collection in a production context? And a VM instead of a compiler?" There were a lot of things that were tried-and-true in the sense of having been around for a long time and proven themselves from a software engineering perspective, but simply were not widely deployed, things that have been in the universities, but not out in the production world. In retrospect we can say that the things that Java added to C were not new, were not inventions, were not brand-new ideas that hadn't been around before. They were ideas that had proven themselves already but had not been widely deployed. There are a lot of ideas that have proven themselves but have not been widely deployed, that are not in Java, in fact there are ideas that have proven themselves and been widely deployed and yet are not in Java. We're probably more likely to be successful adding things that are not being added to a language for the first time. So I would largely agree with his comment.

18 July 2008

What the lack of a 'classpath exception' for JavaME means for developers

I've been wondering why Sun ships some open source project with the 'linking' or 'classpath' exception and some other without.
JavaSE and other cool projects, like open-DMK, all ship with the exception and that means you can use them in commercial projects without having to release the source code.
Unfortunately PhoneME advanced doesn't fall into that category.
And that's a shame because it's really tempting to get hands in that project: it's so well structured and documented.
No idea how much royalties would be.

Anyway, there's another JVM, open MIKA, that is available under BSD. Here's what they have to say about Sun's licenses

/k/ Embedded Java Solutions: "So if you develop applets, midlets, whatever that will be downloaded onto a GPL version of Sun's VM, no problem. No problem either if you want to create an all-open-source device. But if you want to ship your device with pre-installed software which you do not want to place under a GPL-compatible licence (or you cannot do so, because the software is licensed-in), you need to do one of two things:

* Get a commercial licence from Sun, just as before, or
* Use a different, 'non-infectious' VM.

/K/'s Mika is non-infectious, because it comes with a BSD-style licence. Kaffe is under GPL just like Sun's open Java, but key developer Dalibor Topic apparently believes that this does not affect the applications which run on Kaffe, even if they are distributed together with the VM; to him this is just 'mere aggregation'. So with Kaffe you are probably OK (although you may have difficulty convincing a company lawyer of this). Other non-GPL VMs include ikvm, which runs on top of Mono; for GPL'd VMs it is best to contact the authors to see what arrangements can be made."


UPDATE a JavaPosse interview with a Sun JavaME leader clarifies this topic

08 July 2008

Innaworks Talk at Wellington JUG, Next Week

Mobile ecosystem, and mobile application development using Java

Wed Jul 16 5pm – Wed Jul 16 6:30pm

map
Equinox, Level 5, Equinox House, 111 The Terrace (or 222 Lambton Quay through Amazon), Wellington

5pm for 5:15pm start

Please register for this event at http://www.eventbrite.com/event/136502282
- it's FREE.

Topic: Mobile ecosystem, and mobile application development using Java
Speaker: Stephen Cheng, CEO Innaworks


Mobile computing is becoming mainstream. Mobile computing can add
great value to internal business processes, as well as offering ISVs
plenty of opportunities.


However due to the complexity of the mobile eco-system as a result of
diversity of technology platforms and a complex value chain, a mobile
software developer faces many technical choices and commercial
hurdles. This talk provides an overview of the mobile ecosystem from a
commercial and technical perspective, and details some of key
technological and commercial issues. Java does play a particular
important in this story due to its current dominance as a mobile
software platform.


We will also demonstrate alcheMo Java to native platform porting
solution which solves the platform fragmentation issue. Incorporating
an advanced Java to C++ translator and an optimized run-time library,
alcheMo extends Sun's "Write Once, Run Anywhere" philosophy to native
platforms without access to a Java Virtual Machine. alcheMo makes it
possible to maintain a single code base in J2ME while developing for
the key native platforms (such as BREW, iPhone, Windows Mobile).


Bio:

Stephen Cheng is the founder and CEO of Innaworks since 2002.

Stephen is a frequent speaker at industry conference including Game
Developer Conference Mobile, JavaOne and BREW Conference.


Don't forget to register, since we want to ensure the venue can fit
everyone.

13 June 2008

Enum types - Nice Trick!

Effective Java Reloaded (Google I/O Session Videos and Slides)

public enum Ensemble {
SOLO(1), DUET(2), TRIO(3), QUARTET(4), QUINTET(5),
SEXTET(6), SEPTET(7), OCTET(8), DOUBLE_QUARTET(8),
NONET(9), DECTET(10), TRIPLE_QUARTET(12);
private final int numberOfMusicians;
Ensemble(int size) {
numberOfMusicians = size;
}
public int numberOfMusicians() {
return numberOfMusicians;
}
}

30 May 2008

Having fun with the Google Web Toolkit

I'm finally having a chance to experiment Java to Javascript with Google Web Toolit 1.5
It's great fun!
I'm curious to see what will happen when closures are added to Java.
The marriage between statically typed and dynamic languages will be even stronger, maybe they'll be merged!

14 April 2008

JUnit 4.4 - Wellington JUG meeting

JUnit 4.4 - Wellington JUG meeting

Wednesday 16 April 2008 5:00 for 5:15 - 6:30 pm

The venue is to be:
Equinox
Level 5
Equinox House
111 The Terrace (or 222 Lambton Quay through Amazon)
Wellington

Topic: JUnit 4.4
Speaker: John Smart

JUnit is the de facto standard for unit testing in Java. JUnit 4.4
introduces many innovative new features that can make unit testing
easier and more productive. In this talk, we will examine how to write
good unit tests in JUnit 4, and look at a few of these techniques,
including parameterized tests, the new Hamcrest asserts and JUnit Theories.

John Smart is currently an independent consultant working in Wellington
who provides consultancy and training services in the Java/J2EE field.
His specialities include providing training and mentoring in Java
web development, optimising the software development lifecycle and
helping clients improve their development process with industry best
practices such as Continuous Integration and automated testing and code
quality audits. He also helps clients introduce more agile development
processes into their projects.

He has worked on many large-scale J2EE projects for government and
business involving international and offshore teams. In Wellington,
John has also worked for Equinox on a number of projects for various New
Zealand government services. John also writes articles for many Java
web sites such as JavaWorld, Java.net, ONJava and DevX. He has just
finished a book called "Java Power Tools", which he wrote mostly during
his time working at, and with help from, Equinox.

03 April 2008

A Java bytecode processor

I love that



aJile Systems, Inc. - aJ-100: Real-Time Low-Power Direct Execution Microprocessor for the Java

Features:

  • 32-bit Direct Execution Java Processor Core
    • Native JVM bytecode execution
    • Extended bytecodes for memory mapped peripheral access
    • IEEE-754 floating-point arithmetic
    • Writeable control store supports custom application specific instructions
  • Native Java language Threading Support
    • Hard real-time, multi-threading kernel in hardware
    • Atomic threading operations
    • Built-in deterministic scheduling queues
    • Directly supports the Real Time Specification for Java (RTSJ)
    • Thread to thread yield in less than 1╬╝sec
    • Eliminates traditional RTOS software layer
  • Multiple JVM Manager (MJM™)
    • Supports multiple independent JVM’s
    • Brick wall time and space protection
    • External memory protection support
    ...

07 February 2008

23 January 2008

Serial Port and flow control with javax.comm

Sun doesn't provide a javax.comm implementation for Windows and they suggest to use a freely available implementation of their API called RxTx.

But I was having trouble getting the RTS/CTS hardware flow control going, like someone else.
It seems like some CTS events are missed.

At the end I succeeded by adding a wait loop for the CTS to go high before writing each character:

import gnu.io.*;
private SerialPort sPort;

private void osWrite( int val ) throws IOException
{
while( !sPort.isCTS() );

os.write( val );
os.flush();
}


One would expect this to happen in the background, but it doesn't with this particular implementation of javax.comm.

See also: http://en.wikibooks.org/wiki/Serial_Programming:Serial_Java#JavaComm

12 January 2008

Tait split-off breaks ownership model

Tait split-off breaks ownership model


Mimomax Wireless will work in high spectral efficiency radio, a technology which Tait has been working on for three years. It allows large quantities of data to be sent at high speed over wireless networks.

The company will initially target utility companies wanting real-time monitoring of resources and distribution networks.