New Apple laptops

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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Creating own JNDI DataSource

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.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Xcode and 64 bit apps on Leopard? A small step still remains…

September 26th, 2008

Although Xcode is the only real world 64-bit application on Leopard, it is not yet fully dedicated to support the 64-bit applications on 100%. It has still major defects using debugger at 64-bit applications. I tried to make one my application 64-bit, but the debugger stopped me from doing it so, and I switched back to 32-bits during the development. However, I plan to get back to 64-bits later, I’m not giving up though… [-;


This is how debugging should look like

At first, I started wandering where did my objective-c variables go. I thought I hadn’t have switched on some build variable, so I was looking for some magic check box, but without any luck. After some searching, and experimenting, I found that when the application was running at 32-bit mode, everything was just fine, but when I switched back to 64-bit mode, all the variables went away. At the same time, I also found that gdb doesn’t allow me to execute any objective-c methods. This might be the reason why no variables were shown. This also sucks, since I call obj-c variables quite often as I need to display value of some object, or test something.


And this is how it is in 64-bits.

I don’t know what is the cause of this. It is apparently some change in the obj-c runtime system that broke the things. I don’t even know whether this worked at previous Xcode version (I used 3.1 now), so it might be just a bug, but quite annoying.

Leopard is a good start on the 64-bits way, but Apple has still long way to go if they want us to use and develop 64-bits as the main job. I hope that Snow Leopard will continue the current effort in computing to bring the real 64-bit environment.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Forms Validator is hosted at Google code

September 24th, 2008

I want to put here a short note that I put the JavaScript forms validator at Google code. I decided to keep the project’s home page here, although I’m thinking about moving it over there as well… The rest like source control, and the bug reporter will be at the google code. I will work on the code some more later this week since I found some deficiencies. No bugs, but situations that can’t be handled like for example when the description is inside the edit control. And for sure, there will be some more…

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Releasing NSWindowController properly

September 20th, 2008

Yesterday I found that one my application doesn’t release NSWindowController. The problem was that I was not using NSDocument architecture, and releasing NSWindowController is a little different without NSDocument than with NSDocument.

By default, when closing a window with the red button on the top, you will not release the window controller object. If you want to do so, you must implement the windowWillClose notification in your window controller, and autorelease self. Yes, autorelease self, because this will release window controller later after the code that handles the click on the red button handles to the close event, and hides the window. During all this work, the window controller must be ready to react. Later, when your window controller gets disposed, it also automatically decreases retain count in the window, and thus the window object will be released as well. So you should use code such as this in your NSWindowController subclass:

@implementation MyWindowController
-(void) windowWillClose:(NSNotification *)notification
{
   [self autorelease];
}

Also don’t forget that your window cannot have two properties that automatically release some objects. Both must be set to FALSE. The first property releases the document on close of window (your application would crash if set to TRUE - there is not document - hm, Apple might check this as well, and not to crash the application). The second property is that the window itself will be released on close (your application would also crash since the window will release itself, and your controller will do the same later, so the release count will be 0 at the time of the second release). This second property is often set in Interface Builder application. So, consider calling these two functions when creating a new window.

[[myWinController window] setReleasedWhenClosed:FALSE];
[myWinController setShouldCloseDocument:FALSE];
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

HTML forms validation

September 16th, 2008

HTML forms validation is always a pain. You must process the validation both server and client-side. The server-side part is obviously a problem of your server framework, but the client side is a problem that must be solved by JavaScript. I always used some custom scripts, for every project the same thing that was rewritten every time. Almost same code was used in different projects. So I told myself that I should do something about it, and decided to write a small JavaScript library to support client side forms validation. My goal was to have a JavaScript framework that will allow me to check the form with minimal use of coding. I wanted something like configuration driven validation. Another goal was to provide a consistent error reporting, so the user is always informed in a standard way, and the user will always know what is the problem. The error reporting also consists of translatable error messages. Yet another goal was to provide a consistent set of validation rules that can be applied on a wide range of the controls, and further extended.

Defining the validation

To define validation, I decided to use css classes to set the constraints. That means that you don’t need to call any code at all, but just include some javascript files, add some css classes to html tags, and the library will take care about it itself. Of course, you would be able to call all the things by coding, but this was not the point. The full automation is the biggest deal here.

Validation rules are defined as css classes. So some general information about its structure: validation rules always start with “val_”. For example rule for required field is “val_required”, so you will write:

<input type="text" class="val_required your_class">

Some rules can have parameters. These parameters are passed to the rule code automatically. For example if you want to define a rule for minimal length of 2 letters, you will use this code:

<input type="text" class="val_minlen-2">

Some rules can be applied to multiple types of components, but most not. The work on my todo list is an automatic checking of the validity of the control type.

Validation rules

There are included several validation rules that match the most of the needs. Of course, you can always add your own validation rules.The list of rules follows.

  • required - presence of text or presence of
  • minlen - minimal length of text or minimal number of selected items in select html element
  • maxlen - maximal length of text or maximal number of selected items in select html element
  • minvalue - minimal value
  • maxvalue - maximal value
  • int - value must be a number
  • float - value must be a floating point number
  • email - valid email address

Reporting errors

Error reporting is the final step towards the user. Displaying an alert is not enough anymore. Much more convenient towards the user would be to add the error message behind (on the right side of) the form field, and remove the error when it is not necessary.

The error is reported with the name of the field that is taken from the associated label. If no label can be found, the generic error text is used.

As it was said, it is possible to use localisation. Currently, the only supported localisation are generic English (so one for England, Australia, South Africa, and the US) and Czech. This part obviously needs a lot of attention in the future. If you want to change the localisation, you must explicitly state it as a class in your form. The class name is “val_lang-cz”.

Simple usage

So now it is a time to show some simple usage of the validation. Just a simple usage follows. Its purpose is to illustrate how to use it. The following input text has to contain at least 3 and at most 10 characters.

<input type=”text” name=”username” class=”val_required val_minlen-3 val_maxlen-10″ />

Future directions

The future directions would be to make sure that the validation works in any browser. Further adding more validators, adding an immediate error reporting after the control looses the focus, some more work at internationalisation is also needed. Further some more work at checking various types of controls is needed. Documentation needs to be updated, but to be honest, there is never enough documentation. Maybe I will add some more advanced AJAX validation of more complex situation that need communication with the server.

So that’s all. Hope you will enjoy it. I promise, since I will use it from today, I will update the code regularly, patch bugs, and release new features. This version is just a preview of what it might contain, so comments here, bugs to martin at kronos-software.eu.

DOWNLOAD

Documentation


Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Macs and quality -> getting worse, part 2

August 31st, 2008

Apple’s quality problems in the recent time don’t affect only hardware, but also software. It is still not like in the Windows world, but it’s getting close. I still like Apple’s products, and I wouldn’t change for Windows or Linux desktop, but the sad truth is that it’s on it’s way down…

I think Apple tried to add as many new features as they could, but this, of course, affected the quality. Quite well engineered, but poorly built.

Couple of years ago when I bought my first Mac, I had OS X Panther. This version was still quite early release in the development, but you know, it was a slow and sometimes painful transformation from the OS 9 -> OS X, so many things were not in the state as we would like to see them. At that time OS X had maybe 4 years of life, and so it had some features that crippled user experience (I would maybe say bugs). As I remember, the worst was file manager. I mean the system component, since when some process created some file, the running applications were not able to refresh open dialogue panels to show the new file. Quite stupid, right? But I think this was one of very few remaining problems from the old OS 9, and it was fixed in Tiger.

Tiger was the best release so far. No problems at all. Really great!

At the time Loepard was supposed to be released, I was looking forward to see super cool, stable OS without any problems. Bah, big mistake. I was hoping that since Apple postponed Leopard, so I thought they will make it a really good system. But as it turned out, they just wanted to shuffle developers there and back to iPhone without worrying about the new release quality. Just to get the f* iPhone out.

The problems with Leopard started at the beginning, and are not fixed yet. The first problem is that Leopard cannot keep WEP2 wireless connection. I see all the time connection dropping. Leopard almost every hour or half hour disconnects from the network without any reason.

Besides the connection dropping, there are more problems with network. Why is it so hard to remember networks that I have used, and to which I have password in my keychain, and why is it so hard to connect them as Tiger was doing? I just don’t get this. Why should I click on some stupid dialogue to choose a network I want to connect? I use just ONE network at home in Prague, ONE network at my parent’s house in Olomouc and ONE network at school, and that’s all! I don’t use any more networks. And Leopard is not able to remember it.

Couple of days ago I have encountered another glitch (read as fatal flaw) in my Macbook Pro. Freezing. FREEZING. Complete freezing after switching from Automatic network settings to some other. This happened three times so far. It is random and happens after couple of seconds. You cannot move mouse, press any key, screen doesn’t display any change. Nothing. Reboot.

I mean that these problems are probably not unusual in PC world, but for me, it’s been quite disappointing.

I think Apple is currently more interested in their iPhone business than in the good old computers business. They probably moved a lot of quality assurance control to iPhone, and QA for Macs is not what it used to be. Hopefully they have noticed that, and Apple announced the Snow Leopard which should be evolved Leopard with focus on stability and quality than on new features…

Even though I am quite angry on the current state of Macs. So at the end I can say only one thing: Apple, do something about this mess!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Macs and quality -> getting worse

August 26th, 2008

When Apple switched to Intel processors I was sad that Power architecture was gone. On the other side, I was really happy in new possibilities that were opened. One of the greatest ones was that i am finally able to run Windows under VMware, that Java finally got fast enough, and some others. But since I bought a new Macbook Pro (MBP), I sometimes really feel that Apple jumped to the world of Microsoft. The quality is not what it used to be anymore, and Apple’s world is sadly closing to the standard Microsoft have - read as NO or very LOW standards.

You can see that in many ways. Hardware is really bad. I mean it is probably still better than any other PC brand, but when I compare internals of MBP with my old Powerbook, the MBP is not as great as the old machine. I mean two factors are here - the fabrication and the quality. MBP doesn’t look like that solid as the old one. The old machine looked like from the different world, nothing I have seen before. Well build, everything fit together, not plastics. Just a solid piece of hardware. And the new one is not better. I have to say I don’t understand these things much, and so my point of view is just a amateur’s one, but I say how did I feel it.

Now to the quality. This is what disappoints me the most. The hardware has constantly some problems. Within the first week, I had to get replaced my keyboard. There were problems with pressing keys. Sometimes, you just missed the key (= read as very, very often), so I couldn’t write without typos. You just didn’t feel when the key was really pressed and when not. Even after replacement it is still not quite 100% feeling, and I miss some keys sometimes. When I compare the MBP keyboard with Powerbook which had the best keyboard I have ever seen, the MBP clearly fails. A lot. Keyboard is a basic part which you use the most. This is like when steering wheel is not accurate. You would also have many problems.

What more - my brother who bought the same laptop with me has problems as well. His DVD reader doesn’t work. He burns a DVD on his MBP, and then he cannot read it! How come? We have tried the burned DVDs on our dad’s PC with several years old DVD reader, and it didn’t have any problem. What more, we are scared to get it replaced because of poor Mac service quality here.

All these HW problems are even more irritating when you think about the level of quality of Apple support in Czech Republic - nothing that can be compared with Dell or HP. And it’s not even close. And it is not closing. I hear just worse and worse things. When there is something wrong with the laptop, you have to wait like an idiot three weeks until they get some part from Germany or where do they get it from, so you are basically out of your work. You might be able to talk to repairman to get the laptop, and bring it back, but since my brother doesn’t live in Prague, but in Olomouc or in Brno (when he is at school), it means three hours in the train to Prague (=just 4 to 5 hours from our home in Olomouc to the service building), wait till some guy looks at it (= 1 day if you are lucky, normally 2 days), and then get back to Olomouc. This is when you want it back immediately. Or it can be stuck there three weeks. Or you can send it to the service and back, but for this you would pay about €20 for each shipping. So this is how fast it is here. Just only because they don’t care about you.

You cannot even get service on site. We bought MBPs with an international English keyboards and English OSX. Czech keyboards are unusable for programmers. They are to type, not to program. With such MBPs, there is NO way how to get an on-site service plan. And what more - for MBPs with Czech keyboards, it is available just in Prague, and close surroundings. This is nothing near the quality of service of Dell or HP (I mean the premium one). And what more - this on-site service is again pricier than in the EU, and is not a standard Apple service plan - no abroad repairs, etc.

When you add 10 to 20% higher prices than in other EU countries (and more significant number like 40% than in the US) then there is just one conclusion. Screwed from all sides - Apple, local shops, local servicing companies. The next time I will buy it in Germany. It would be cheaper.

The next post will be about software which got down as well…

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Gentoo Linux 2008 VMware image x86_64

August 7th, 2008

I just made this image as a base for myself, but I want to share them as well. Fell free to download them, and use them as you want. By downloading, you agree that the use is at your own risk, and I am not responsible for any mistakes and damages.

 The kernel is 64-bit Linux 2.6.24 Gentoo patch 8 with SMP enabled. The image has been made on VmWare Fusion 2.0 beta2, and contains its VmWare Tools. Almost nothing has been installed - just the basic stuff like sshd, mc, so the rest is up to you.

Memory allocated: 532MB
CPUs used: 2
Virtual machine files size: 4.21GB
Disk: 10GB mounted as / 
Compressed size: 765MB in 5 files

So now the important stuff - how to get into:

user: root
password: password

The files are split up to 5 parts, and you can download them from rapidshare:

part 1 (190 MB)
part 2 (190 MB)
part 3 (190 MB)
part 4 (190 MB)
part 5 (2.5 MB)

You can decompress files using RAR which can be downloaded at www.rarlabs.com. Decompress command would be (in the directory of the download, extracts files into separate directory):

unrar x gentoo-2008-x86_64.part01.rar

 

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati

Mono? Thank you, not anytime soon…

July 24th, 2008

Today, I was playing a little with .NET implementation Mono on OS X. Respectively, I was playing with Monodevelop IDE because as I do now something in Visual Basic.net at work, I was curious how can this compare to the real Visual Basic 2005. I was hoping at least to get running some parts that interact just with command line. And, well, my expectations were way too high. I didn’t do anything. I was not even able to open the files properly. The editor was not apparently able to accept the windows line encoding. Compiler threw some strange errors on things that even didn’t look they are in our code. What else to say? Do not waste people’s time with releasing software that is your toy, and actually doesn’t work. It’s not worth. You waste time of the others, and your name doesn’t gain anything.


The Visual Basic editor when I tried to open a normal VB file

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati