Monday, August 4, 2008

Ants marching into my MacBook ;-D

Yesterday my new Mac Book got attacked by red ant. Its funny ;-)

See these pictures...

Thursday, July 3, 2008

Want 1440 X 900 on Intel VGA?

I have been facing problem with setting my PC screen resolution with 1440 X 900 since I don't have it in my Display settings. After lot of research and google search I found the fix.

It seems Intel do not configure their driver to natively allow a resolution of 1440×900 (as well as other resolutions between 800×600 and the maximum supported resolution of 1680×1050). It seems this has also been a problem with other chipsets that Intel manufactures (from their 915 series upwards).

An inspection of the zip version of the driver (Intel provide 2 drivers, one in the form of a self extracting .exe and the other is a .zip file containing all the driver files) for my graphics controller
revealed that a file within the driver- igxp32.inf (a setup information file) would allow me to specify extra resolutions that could be used by the computer after the driver was installed. Opening this file in notepad, one section immediately caught my attention:

[NonEDIDMode_AddSwSettings]

Within this section of igxp32.inf it appeared I could enable up to 5 extra resolutions for use within Windows display properties. The next line of the file has been commented by Intel:

HKR,, TotalDTDCount, %REG_DWORD%, 0 ; This shows number of DTDs to be used. ; 0–>Disable the feature.

Well I wanted to enable all the resolutions I could, so I changed the 0 to a 5 like so:

HKR,, TotalDTDCount, %REG_DWORD%, 5 ; This shows number of DTDs to be used. ; 0–>Disable the feature.

The next 5 lines within the file seemed to be the settings for the extra resolutions that would be added after this driver is installed. The first 4 had been set already to offer 1920×1080@60, 1920×1080@50, 1280×720@60 and 1280×720@50 resolutions. The last, 5th line had no
hexadecimal values, and the comment on the end of the setting was blank, so here is where I edited and added the resolution for the screen I was trying to get working. A quick Google of 1440×900@60 revealed the hex values for that resolution to be:

HKR,, DTD_5,%REG_BINARY%, 97,29,A0,D0,51,84,20,30,50,98,13,00,00,00,00,00,00,1C,37,01 ;1440×900@60

So I edited the 5th line to look like that above and saved the file. Upon un-installation of the old driver and installation of the newly modified driver, a quick delve into the settings in display properties revealed all 5 new resolutions selectable. I could now apply the 1440×900 resolution I wanted.

I believe that other Intel graphics drivers may have the setup information file named differently from igxp32.inf, but that they can all be modified in the same way.

Sunday, June 29, 2008

Difference between setTimeout() or setInterval() - JavaScript

The functions setTimeout and setInterval
at first glance appear to be very similar. In fact many
people writing Javascript seem to be unaware of the
existance of one or the other of these two functions
because they write code that uses one function where
the other would have been far more appropriate. The
problem is that many of the descriptions of what these
two functions do don't highlight the difference
between them. The definitions appear identical in many
cases.

These two similar looking functions perform very differently. The setTimeout function delays for a specified time period and then triggers execution of a specified function. Once the function is triggered the setTimeout has finished. You can of course terminate the execution of the setTimeout before it triggers the function by using the clearTimeout function.

Often you will see setTimeout used at the end of a function to trigger another execution of the same function perhaps passing it different parameters. Where this is done the time from the first triggering of the function until te next will be the specified delay time plus the time taken to execute the function. Here is an example:


moreSnow();

function moreSnow() {

// content of moreSnow function

setTimeout("moreSnow()", speed);

}

The setInterval function also delays for a specified time before triggering the execution of a specific function. Where it differs is that after triggering that function the command doesn't complete. Instead it waits for the specified time again and then triggers the function again and continues to repeat this process of triggering the function at the specified intervals until either the web page is unloaded or the clearInterval function is called.

The above code using setTimeout could have been written using setInterval instead and would have looped slightly faster since the loop would not have waited for the content of the function to be processed before triggering the repetition. Here is the above code rewritten to us setInterval:

moreSnow();
setInterval("moreSnow()", speed);
function moreSnow() {

// content of moreSnow function

}

Which of the two functions that you use depends on what you are trying to achieve. If different parameters need
to be passed to the function on each call or the content of the function decides whether or not to call itself again then setTimeout is the one to use. Where the function just needs triggering at regular intervals then the setInterval function may produce simpler code within the function particularly if it has multiple exit points.

Tuesday, June 24, 2008

The struggle to open up Java completely is finally coming to an end.

Following the announcement of Sun's plans to make Java free and open under the General Public License (GPL) at JavaOne 2006, there have been a few struggles on the path to open source. At the time of the OpenJDK release in May last year, around five percent of the code — the portion not owned by Sun — was still closed.

Simon Phipps, chief open-source officer at Sun, said: "We released under the GPL everything we had the rights to release under the GPL, and that was last summer. There were a couple of holdouts there. One was the area to do with raster graphics and 2D graphics. That turned out to be owned by a company that didn't want us to release that code as open source. We negotiated with them and because they've said: 'Yes, you can open source the code', I can tell you they're Codec..."

"The only element that's left now is actually a sound-related component within Java. We finally decided that the vendor that's involved there just isn't going to play ball and we're rewriting the code from scratch. That's going to be done within the next couple of months," said Phipps.

Phipps said Java is expected to be completely free within the coming few months.

"I'm expecting that — certainly by the end of this year and hopefully sooner — we'll have all of the source code for Java under the GPL", he said.

Red Hat also introduced its IcedTea project in June 2007, with the aim of making OpenJDK a part of Fedora, as well as other Linux distributions, without constraints.

The IcedTea project reached a breakthrough last week when the latest OpenJDK binary included in Fedora 9 passed the Java Test Compatibility Kit, a set of tools designed to verify whether a particular implementation is consistent with the Java specification.

OpenJDK, now a part of Fedora 9, contains all the necessary Java APIs (application programming interfaces) of a Java Standard Edition 6 implementation. The plan is to now make OpenJDK a part of the next Red Hat Enterprise Linux edition: 5.3.

Friday, June 20, 2008

Bye Bye MVC, Hello RIA+ SOA: Next Generation Web Development

The world of web development is moving away from MVC-based web architectures and towards a client/server model that is probably best described as RIA + SOA, where RIA represents the rich user interface and SOA represents the services that it consumes.

There has been a lot of buzz around rich Web 2.0 applications, but they will not become mainstream until the next generation of web platforms emerge - fully integrated platforms that enable RIA + SOA.

For more information visit http://java.sys-con.com/read/513263.htm

Thursday, June 12, 2008

ZFS in Apple's forthcoming Snow Leopard Mac OS

Apple will support Sun's ZFS file system in Mac OS X v10.6, called 'Snow Leopard, due out in 12 months time.

Apple's Snow Leopard web page states 'For business-critical server deployments, Snow Leopard Server adds read and write support for the high-performance, 128-bit ZFS file system, which includes advanced features such as storage pooling, data redundancy, automatic error correction, dynamic volume expansion, and snapshots."

The general direction of the Snow Leopard release is to provide better support for multi-core processors through Grand Central technology, improve Mac OS X' performance, upgrade the collaboration facilities, and greatly improve interoperability with Microsoft's Windows Exchange product. Support for 64-bit kernel technology enables main memory to scale to 16TB.

Snow Leopard is also supposed to reduce the amount of hard drive storage space needed for its own files, presumably by not storing PPC code on Intel Macs and vice versa.

In March Sun CEO Jonathan Schwartz said Apple would support ZFS in Mac OS X but didn't get much public support from Apple. ZFS support in Snow Leopard vindicates Schwartz's stance. Nothing is written in stone though and things could change between now and Snow Leopard shipping.

With NetApp and Sun locked in law suits over Sun's open sourcing of ZFS there may be some form of indeminity arrangement bwetween Apple and Sun.