Pradeep's Blog

Google

Sunday, October 23, 2005

Had Time for Fantastic Four

I watched fantastic four this week. After watching I was left confused as to if DNA can change in a humans in their life time? My perception was that DNA never changes. I came to this conclusion because I DNA is used to convict people. If DNA changes in a human being how could it be used to convict criminals? I also thought that DNA would be altered only if you are exposed to drastic environmental changes (as in the movie or a nuclear exposure) and this change too would be visible only in the off springs.
But after thinking for a while all that seemed to be wrong and what was shown in the movie seems to be correct. DNA does change naturally, but in very very small proportions. Therefore it can still be used to convict crime. It also makes logic that if an atom bomb can change DNA (causing effects like cancer etc), why can’t some other effect change our DNA for good. There also seems to be research going on in this field, i.e. to change the DNA in a controlled way. This would benefit lots of people as the bad part in their DNA can be removed to avoid decease.

Saturday, October 22, 2005

Enterprise Systems & Failure...


Melbourne’s harbour implemented an Enterprise System, and that failed drastically. The reason for an Enterprise implementation to fail could be attributed to lot of things. Though most people immediately blame the Enterprise system provider, I believe that attributing the failure to them is very unfair.
The most important reason for failure seems to be that most organizations do not know what exactly they want the Enterprise System to do for them. If they themselves are not clear, how could the provider be clear? Most Enterprise System implementations fail because of the clash of the system with the way things were done earlier or clash with the organizations strategy. The business have some kind of pull to the Enterprise system and are so excited about the system. But they must remember that the enterprise that’s important not the system. Companies that have provided more emphasis to the working of the organization rather than to the system itself seem to have a very high rate of success in implementing an enterprise system. Businesses have to understand that though Enterprise system can deliver great rewards they also have inherent equally great risks associated with them.

Sunday, October 16, 2005

Easy way to find Cyclomatic complexity…


My project required me to find the cyclomatic complexity of a given method (in a java class file). I used a java class file manipulation tool named ASM Using ASM I was able to get the total number of jump instruction in a method. I will explain this with an example. Consider the methods 1 & 2 .
Method 1:

Public void check(int c) {
if (c>0){ //if block } //other instructions.
}

Method 2:
Public void check(int c) {
for (int i=0;i<5>

Both methods have a cyclomatic complexity of 2 (just 2 possible paths of execution). But if I was to use the Instruction count method 1 has just has One JumpInstruction but method two has 2 JumpInstruction (one for comparing the if(i<5))>

Friday, October 14, 2005

I Bet you cannot create a folder named 'CON'

Try creating a folder named con. It's not possible in windows. I was at first told about this as a glitch in windows by my friend. But i later found out that this was not a glitch, but just the way windows was intented to work.
The technical reason behind this is that, there are certain names that are reserved for device and these names cannot be used as the name of a file (remember that directories are also considered as files in windows). Some of these reserved names include: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Microsoft also recommends to not use these names as file names too (ie with extension like, LPT9.txt). Mystery Solved!!

Tuesday, October 11, 2005

Sun and Google Team UP!

Sun and Google have last week agreed to work together on a multiyear contract. Though the exact details of the contracts have not yet been out, I guess that it’s Google that would benefit more from the contract. For a start Sun has agreed to distribute Google’s toolbar with JDK with a month. With thousands of downloads of JDK made each day, this would benefit Google for which it seems to compensate Sun with direct monetary benefits.
While both Sun and Google seem to be exited about the contract, not everyone is. By this move Google and Sun have sort of combined to stand up against Microsoft. For example while Sun’s JDK and their operating systems (Solaris) are a direct competitor to Microsoft’s .net architecture and Windows respectively. Now google’s toolbar adds on as a reply of msn messenger.
With this contract between Sun and Google I am not sure what would happen to the contract between Microsoft and Sun early last year…..

Friday, October 07, 2005

Tips to avoid your email ids from getting into the hands of spammers

Having had a taste (with some research) as to how & where spammers look for email addresses, I now have a clear idea of how to protect your email addresses from being used by spammers. Though you cannot do much unless you are a mail server admin here are few tips that I think if followed will provide much more security for your mail addresses.

A) Mailing habits:
a. Don’t ever reply to a spam. By doing so you may confirm that your email is valid and also verify that it’s an active account. Also don’t be tempted by messages that say "mail here to unsubscribe", they never work.
b. When mailing to large use group always use Bcc. If you are using cc your friend’s addresses are visible to everyone else. This method is very efficient for spammers because of the density of the email addresses.
c. Make sure that you remove extraneous email addresses from forwarded mail. Again this is has a high density of email addresses.

B) Web pages, chats and groups habits:

a. Never publish your emails online. Even if it’s an absolute necessary, mask you email address. The mail character that spammer’s bots look for in a web page is “@”. There are lots of ways by which you could mask your email address. Some of the masking techniques that are already being used are
i. Use an image to display your email address on web pages. Therefore the bots are sure to miss them.
ii. Or, you could use an image just for the @ character.
iii. You could use java script in your pages to inserts email addresses on the fly.
iv. Or you could represent your email address in hex as shown below. Again masking the @ character.
v. Instead of displaying your mail address in your site you may opt for a form which allows visitors to contact you using backend scripting.

b. Never participate in an online discussion list or forum if they post your email address to their site.
c. Never type your true email address into a web form & never use the "Mail this Document to a Friend" web forms. Some of the websites sell your email addresses to spammers. You could instead use a temporary mail address.
d. You can redirect the spammer’s bots to a "dead-end" page on your site, because some email address harvesting tools don't bother to mask their identities (i.e. they don’t pretend to be a browser so you could know they are something else).
e. Never use your original email id to chat in chat rooms. Most of these chats rooms have automated robots to extract user names (which are valid email addresses in that domain).

Monday, October 03, 2005

What’s ASM?

ASM is a byte code manipulation framework. It can be used to write a class file from scratch, read the contents of them, or change them dynamically at runtime. There are other tools (BCEL & SERP) that offer the same functionality, but these tools are bulky and very slow compared to ASM. The advantages of ASM over the other tools are given in detail here.
The design of ASM is also been very well thought of. For example, ASM is divided into many packages. This allows its users to use on the package they need. Some of the main packages in ASM are,
Core: Package provides an API to read, write, and transform Java byte code.
Tree: Provides in-memory representation of Java byte code.
XML: Provides an adapter to convert byte code structures to and from XML
Util: Contains several helper classes and simple byte code verifiers that can help in development or testing.
Analysis: Provides basic data-flow analyses and type-checking algorithms
In my subsequent blog I will explain how to use ASM to read a class file.