Cache – Explained

6 02 2009

This term, as most heard by web-bies, is temporary data storage mechanism. Well, most people are concerned about cleaning it though; after doing a lot of junk browsing etc.

The files you automatically request by looking at a Web page are stored on your hard disk in a cache sub directory under the directory for your browser (for example, Firefox). When you return to a page you’ve recently looked at, the browser can get it from the cache rather than the original server, saving you time and the network the burden of some additional traffic. You can usually vary the size of your cache, depending on your particular browser.

Internal-Mechanism:

Well, there are a couple of basic terminologies here. ‘Hit’ and ‘Miss’. When we request a URL to the browser, then the client looks for the file if preserved in cache, if it is available, it fetched the file from cache. This is a hit. Miss is the opposite of it. The efficiency/usage of the cache is evaluated by the hit ratio.

How is it maintained?

Now, the question arises, how we manage cache data. The important point is that cache uses very limited storage memory of the hard-drive/memory. So data has to be managed i.e, delete some and add some frequently. This is all done by ‘Cache-Algorithms’. One famous one is least recently used (LRU) which replaces the least recently used with the most recently used. There are several algorithms followed though, I would blog about it sometime later.

General Usage:

Computers include caches at several levels of operation, including cache memory and a disk cache. Caching can also be implemented for Internet content by distributing it to multiple servers that are periodically refreshed. (The use of the term in this context is closely related to the general concept of a distributed information base.)

Altogether, we are aware of these types of caches:

• International, national, regional, organizational and other “macro” caches to which highly popular information can be distributed and periodically updated and from which most users would obtain information.
• Local server caches (for example, corporate LAN servers or access provider servers that cache frequently accessed files). This is similar to the previous idea, except that the decision of what data to cache may be entirely local.
• Your Web browser’s cache, which contains the most recent Web files that you have downloaded and which is phyically located on your hard disk (and possibly some of the following caches at any moment in time)
• A disk cache (either a reserved area of RAM or a special hard disk cache) where a copy of the most recently accessed data and adjacent (most likely to be accessed) data is stored for fast access.
• RAM itself, which can be viewed as a cache for data that is initially loaded in from the hard disk (or other I/O storage systems).
• L2 cache memory, which is on a separate chip from the microprocessor but faster to access than regular RAM.
• L1 cache memory on the same chip as the microprocessor.





Namasthe, PS3

2 02 2009

Gamers, get yourself geared up. PS3 has arrived in India. This time, Sony is trying to give a surprise (!!!). The package would have a 80GB console and also bundled copy of Resistance 2 with Dual Shock 3 controller. The entire package of 80GB PS3, Resistance 2 and Dual Shock 3 controller is priced at Rs. 25,990.

This new bundle will help you save some quick bucks, as Resistance 2 copy sells for Rs. 3499 and Dual Shock 3 controller is priced at Rs. 2,990. Sony does not bundle any of this with their 40GB PS 3 version.





Colors of January

25 01 2009

Colors of January





Simulated JUnit tests for Web Applications using HTTPUnit

23 01 2009

HttpUnit is a suite of Java classes to test Web applications over HTTP. Coupled with JUnit, HttpUnit is a powerful tool for creating test suites to ensure the end-to-end functionality of your Web applications.

While JUnit itself can test server-side Java code by writing test harnesses for individual classes, HttpUnit extends JUnit to test the integration over the Web by emulating the way a Web browser works and working through a Web server. This article will explain how you can take advantage of HttpUnit.

One great aspect of HttpUnit is that it can test entire Web applications, not just single pages. Because it honors form information and cookies, you can write tests to cover a whole session. For example, if your Web application includes a shopping cart, you could write a test to try logging in, selecting an item, placing it the shopping cart, and checking out. Since the tests are written in Java, there’s no limit to how in-depth your tests can be. Let’s get started by looking at a simple HttpUnit test.

Making a request
Since HttpUnit can emulate an entire session and not just a single request, the system uses a class, called WebConversation, to manage the requests, handle the cookies, and resolve relative URLs. As you write more complicated tests, the WebConversation class will become more important. Usually, the class simply creates a request to the URL base_url. The response from this request is stored, and the JUnit method assertEquals() tests whether the response was 200, which is the HTTP response for a successful request.

Parsing a response
Once you’ve made a successful request to a Web server, it’s time to parse the result of the request. HttpUnit makes use of the JTidy package, which is included in the HttpUnit distribution, to parse the resulting HTML into a Document Object Model (DOM) tree. For those who aren’t familiar with DOM trees, they offer a uniform way to manipulate a document in a hierarchical data structure. JTidy provides a standardized way to manipulate the HTML result.

You should note, however, that the DOM tree that JTidy builds represents the structure that a document should have, not necessarily what it does have. That means that JTidy may add structural elements to the document tree that aren’t in the HTML source but should be. That includes head and body markers, paragraph marks, font tags, and more. Iterating through a DOM tree and visualizing the output, can be helpful.

Shortcuts through the DOM
Navigating through the DOM can be difficult and time-consuming. Fortunately, HttpUnit includes tools to make quick work of dealing with some HTML elements.

Navigating links
HttpUnit offers much more than just parsing the result of a single connection. The real power comes from being able to make multiple requests through the WebConnection object. The easiest way to make multiple requests is by following HTML links.





Chandni Chowk 2 China Hello Tune Codes

4 01 2009

doregama-00-chandni-chowk-to-china-inlet051





Symbian S60, What is it?

22 12 2008

Since its introduction in 2001, the S60 platform has been the world’s most popular smartphone platform. By early 2007, more than 100 million S60 devices had been shipped by six platform licensees. The first S60 device, the Nokia 7650 smartphone, introduced a comprehensive range of features, including personal information management (PIM), browsing, imaging, and music. Since then, S60 devices have become increasingly sophisticated, with high-resolution cameras, full Web browsing, stereo music, mapping, and voice over IP
(VoIP), to name just a few of the features now available. The range of S60 devices has also evolved, offering distinct collections of device models for consumers, enterprises, and other specific market niches.

One key factor in the success of the S60 platform is that it enables users to add features to their devices by installing third-party applications and content. At first, the platform supported third-party applications written in the Java and native Symbian C++ programming
languages. As the platform has evolved, an increasing number of development options have become available. Application developers can now choose from Symbian C++, Open C, Java platform, Micro Edition (Java ME), Python, Flash Lite from Adobe, Web Run-Time, and
Scalable Vector Graphics Tiny (SVGT) technologies. At the same time, Web content developers have been provided with support for standard Web technologies — such as HTML, Cascading Style Sheets (CSS), JavaScript,Asynchronous JavaScript and XML (Ajax), Flash Lite, and
SVGT — to enable S60 devices to browse their websites





Modern Technology – Owes Ecology – An Apology

21 12 2008

Interesting quote, right? I think its true! We all should do something to save the ecology.

Anyways, i spotted it in Bryan Adams’ music video ‘Oxygen’ today. Just wanted to share with you guys!

Definitely, we, the modern technology users/developers, owe ecology and apology.





Critical IE Bug! Patch it immediately!

18 12 2008

This is a new critical security exploit in IE7 using mshtml.dll redirect disclosure. Ensure you quickly apply patch or use alternate browsers like Firefox or Chrome.

To patch your machines:
http://www.microsoft.com/technet/security/bulletin/ms08-078.mspx

News:
http://news.cnet.com/8301-1009_3-10124702-83.html





December Notebooks! Which one to buy?

15 12 2008

I ordered for a Dell XPS M1530 today morning, expecting it at home by this weekend. Will review it along with pictures later this weekend, but before that i would like to share my experience on R&D to convince my confused mind about which one to buy!

Well, firstly, my basic need for a notebook was to have a heavy HDD so that i can have multiple OS and data, superb RAM (4GB, say 2DDRs) and a high performance processor with atleast 3MB cache. Using this i would maintain a server may be, for my R&D on Java Enterprise apps, play HD games, movies, HD audio, most importantly a lot of multi-tasking. And i would prefer it to be easy-to-carry.

As i am a born techie, i do have a good idea about which one does what, so narrowed down my list to Dell, Vaio and HP. Considering high performance, HP sucks (Well, thats my opinion) though it is a numero uno seller and perfect just for multimedia. Moreover comparing HP with Dell and Vaio is like comparing Maruti with Honda and Audi. So i’ve deleted it from the List. My hunt started with several models in sony vaio and dell. After visiting stores, internet reviews, speaking to friends who’ve got ‘em, i’ve narrowed down my list to these:
1.Sony Vaio CR353
2.Sony Vaio CS17
3.Sony Vaio CS14
4.Dell XPS M1530
5.Dell XPS M1330
6.Dell Studio 15

Frankly, Vaio has got amazing looks. Its build quality is excellent. But considering my life-time philosophy “never bother about looks, just worry about the insider performance” i had to go to XPS M1530 ultimately; i’ll tell you why.

Considering a budget of 60K, i could get the above mentioned models of Sony Vaio. But i had to go for lot of compromises, i would never get a 4Gb ram in vaio, no 320Gb for my budget, moreover i could never get an NVIDIA GT (i could get a GS ofcourse but a 128MB). But still sony’s got the best reviews about its cache management and clock speed utility. The best advantage of sony is its audio cards, the default HD audio card is equipped with dolby room/home/theater and believe me, no other notebook has such a good audio. The system performance during heavy multitasking is very soft and quiet.
PROS:
1.Excellent Build Quality
2.Good Cache managemenr and clock speed utility
3.Good HD audio
CONS:
1.Compromise on memory & graphics
2.Sensitive to carry
3.Low end configs for 60K

Here comes my all-time favorite, DELL. Trendy looks, amazing performance, cheaper deals, good quality, worth for price. Internet reviews and people reviews give an outright 10/10 on its performance. Moreover, it comes in my budget and has the highest config in the world currently for a personal notebook. I could do all that i wanted in the first paragraph.
PROS:
1.Excellent configs
2.Proved performance
3.Affordable price
CONS:
1.Not so stylish looks like vaio

I was in a paradigm of comparing between a high-end Honda and low-end Audi. I thought its better always to be a high-performer, so decided to go for DELL.

Now Studio vs XPS, which one to go! I called one of ma buddies who works for Texas Instruments, he is a chip designer out there and asked him about the difference between the processor configs and graphic memories of studio vs XPS asking him about their dependencies in different environments. Then read few reviews about Core 2 Duo T5800 vs T8100 and understood that there are several issues which a normal user would never notice on the UI. Ultimately XPS is the winner. I felt 1330 was very smaller and had lastly reached at 1530.

Guys, this is just my personal opinion which i’ve arrived after a little research. Nothing offensive!!!





Vista SP2 Beta is out

4 12 2008

Microsoft is continuing to broaden the pool of Windows Vista Service Pack 2 (SP2) testers beyond the fairly small, select group who’ve been working with test builds for the past few months.

On December 2, Microsoft made the latest beta build of SP2 available for download by any TechNet and Microsoft Developer Network (MSDN) subscribers.

The highlights of the Service Pack includes native Blu-ray burning, VIA 64bit security support, Hyper-V hypervisor, WMP upgrade DRM issues fixed, feature pack for WiFi, event logging support in SPC, reduced resource hogging by sidebar gadgets and improved power settings for Windows Server 2008. Along with these, Microsoft also promises to include support for proprietary file systems used in Flash memory like exFAT/FAT64.

As per sources on the web, SP2 beta download size will vary from 302MB to 390MB for 32-bit version supporting five or 36 languages. Download size of Vista SP2 64-bit version will vary from 508MB to 644MB including support for five or 36 languages.