Archive for October, 2008

New Apple laptops

Wednesday, October 15th, 2008

Apple released yesterday new models of all of its laptop lines. This is quite important for me since I own one older model and as I’m not quite satisfied with it, I would buy a new model next year. The importance of this step is to show a new direction in the laptops line, and to show customers where did they improved and where they did not. I will write few notes of the pro model as this is the one I’m interested in.


My specs

The first thing that the refresh brings is a new look which unifies the whole laptop line to be the same. The look is also unified with the other Apple’s devices like iPhone or Cinema displays. But this is not a big deal, just a nice thing for your eyes. What is more important change is inside the laptops. The Pro line spots new Nvidia chipset with integrated graphics chip on the chipset, and dedicated more powerful GPU outside. This is a great move since the laptop would normally use the integrated chip, and under some circumstances, it can turn on the external GPU to get more horse power. This apparently saves a lot of energy. So the Pro line sees also a new batteries which should bring up to 5 hours of battery life.
The additions are apparently great, but there are also some weaknesses, even with the things I wrote above.

Memory

The first one, and according to me the biggest problem, is no shift in memory limits. To new Pro laptops, you can still fit only 4GB. This is apparently some ceiling introduced by Apple since to the Nvidia chipset, you can fit one 4GB memory module, and as there are two, you should be able to fit 8. And indeed, in this case, Apple is far, far behind standard PCs. Sorry to say that, but this made me really angry. Putting artificial gaps is not fair, and nobody will get any advantage of it. Normal PC laptops can fit more memory than 4GB for a while, and they do it even thought people are still using old 32bit Windows. 32bit OS X can use more. This limitation is really crucial for me as I need to run VmWare with Windows on my laptop. As I run some big IBM’s software, I need to give 2GB specially to VmWare, and as you know OS X, it doesn’t have any memory to anything else. So I’m limited to run just VmWare, and text editor. Nothing else fits, unless OS X will swap like crazy. Sad, but true.
With the memory, I forgot to mention that when you use the integrated graphics chip, it will take memory from your RAM. So you would end up with less memory than in the current line. Another reason why to allow more RAM.

eSATA

The another problem is lack of eSATA (external SATA) port which is a new standard for modern external hard drives. Perhaps Apple is still pushing its own Firewire solution, which doesn’t have of much use for me anymore. The problem is that all new harddrives you can buy have the eSATA and USB connections. And guess what. USB is sloooooooooow. And eSATA is soooo fast. Maybe FW800 can compete a little, but it’s a problem to find some FW800 external disk. You can find some 3.5″, but if you want smaller, you can’t. I have seen just FW400 which is out. And this solution just looked wrong. A FW400 case with an old PATA disk. Just for your information, there is a link to the test of disks at ExtremeTech.

Glossy screen

Yet another problem is glossy screen. I am strongly against these. They bring a little nice picture, but when just a little of sun rays fells to the screen, you are done. Like a mirror. The glossiness might be a good option for normal monitors, but not for laptops as I use laptop at many different places. I just found that 17″ model spots the antiglare display, but this option doesn’t exist at 15″ models.

Prices

The almost last complaint is about prices. Why are they the same for the last 5 years? The whole industry goes steeply down, but Apple. Apple makes whole lot more laptops than ever, and no change. I thought that you can make money either on quantity or on quality, but Apple is doing the first, but charges for the second. They increased quantity of sold laptops, but are slowly dropping the quality. And also my notorious complaint about the price difference between the US and the EU. It seems we are entering a little better times as prices for the higher 15″ Pro model in Germany is $2583 excluding VAT, and in the US $2499. I think this is positive sign, although there is still a slight difference. But for example Adobe should get an example out of this.

Also I still haven’t seen prices here in Prague, and I can only guess how much we will need to pay. I reckon way more than in Germany, maybe 10%, maybe 20% more as it is a “good” custom of the authorised reseller here.

Batteries

The last complaint will be about the batteries. They tell us up to 5 hours, but haven’t we heard this last year as well? So no improvement here although they bringed a few innovations in this area.

Possitive side - no trackpad buttons

Now to a little brighter side of the things. No button at trackpad! What a great idea. I didn’t like the button anyway. I will try to disable the trackpad as well, and will see what happens. Also as I have seen the pictures, the trackpad is huge, much bigger than the current one. Good job.

Finally ability to replace hard drive

The another great thing that shifts the laptops forward a lot is the way how they did it serviceable. Finally you can change the hard drive also in Pro the same way as in older MacBooks. Nice. An overview how to do this can be found at Arstechnica.

Conclusion

To be honest, I was expecting from Apple more, and they still haven’t showed us what can they do, and no doubt about that they can do whole lot more.

Creating own JNDI DataSource

Monday, October 6th, 2008

Yesterday, I was having lot of troubles loading DataSource via JNDI in my tests. At first I tried to load just the InitialContext, and bind something. I used MysqlDataSource provided directly by the MySQL ConnectorJ library. There is the code:

MysqlDataSource ds = new MysqlDataSource();
ds.setUrl(url);
ds.setUser(user);
ds.setPassword(password);
ds.setUseUnicode(true);
ds.setCharacterSetResults("UTF-8");

ic.bind("java:/comp/env/ds/test", ds);

This apparently didn’t work. This is a very typical access when some programmer tries to get things working via some API, but doesn’t have any clue about what is he doing. Very typical. [-; So I had to do some research (read programmer’s research which is basically looking for some code or tutorial to get things working). So I found that for every path in JNDI I want to bind some object, I will need to create this path. Hm, ok. So there is the code for creating a new path (= subcontext).

InitialContext ic = new InitialContext();
ic.createSubcontext("java:");
ic.createSubcontext("java:/comp");
ic.createSubcontext("java:/comp/env");
ic.createSubcontext("java:/comp/env/test");

Hm, still nothing. At the second line in the previous code, JNDI code threw NoInitialContextException exception. I didn’t have any context factory defined. Where should I get it?! At first I thought I will need to use some Spring or some similar beast which I was scared of, but as I turned out, it was much simpler. I just needed to rip Apache Tomcat and use their own provider.

System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");
System.setProperty(Context.URL_PKG_PREFIXES, "org.apache.naming");

Also don’t forget to add two jars to the test classpath. These jars are available at tomcat/bin/tomcat-juli.jar and tomcat/lib/catalina.jar. And that’s it. So the final code follows:

System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory");
System.setProperty(Context.URL_PKG_PREFIXES, "org.apache.naming");
InitialContext ic = new InitialContext();
ic.createSubcontext("java:");
ic.createSubcontext("java:/comp");
ic.createSubcontext("java:/comp/env");
ic.createSubcontext("java:/comp/env/test");

MysqlDataSource ds = new MysqlDataSource();
ds.setUrl(url);ds.setUser(user);
ds.setPassword(password);
ds.setUseUnicode(true);
ds.setCharacterSetResults("UTF-8");
ic.bind("java:/comp/env/ds/cms", ds);

Also last note. Never forget to use useUnicode and characterSetResults set to UTF-8 properties of Mysql driver with unicode tables, or your data will be crippled.