Sunday, June 28, 2009

Thoughts on Keyboard Design

From the ages of personal/business computing machine and Notebook/laptop designs, I guess keyboard is one of the most neglected part. Not sure how many manufacturers ever really given any thought on that.

At least customized laptops can be provided with options of keyboards. You have lots of choices on other aspects of laptop, then why not we have to bear with same-old fashined keyboard alone?

If the designer really run out of any changes....here my two pennies..

* CAPS LOCK - Its carried from typewriter design. How many people require ALL CAPS typing on a laptop?? We have sophisticated word processors these days which can easily do the job. Why the hell we still need this?

* NUM LOCK - I really forget when either me or my friends [ppl with computers for 20 hrs a day] last time use this key?

* Functional Keys - Albeit key board savvvy techies like keyboard navigations..but lots of functions can be programmed without functional keys.. can we save that space for other keys?

Lets hope, these matters for those who matter on laptop designs.

Monday, June 22, 2009

நம் பணி!

அறிவியலின் மகளாய் பிறந்து, அமெரிக்காவில் வளர்ந்து இன்று நம் பட்டி தொட்டி எங்கும் நீக்கமற நிறைந்திருந்து, மன பலத்தையும் , அறிவையும், உழைப்பையும் மட்டும் நம்பியிருந்த பலகோடி இளம் நம்பி நங்கைகளுக்கு, தொழிலாய் அமைந்து பொன்னான வாழ்வளித்திருக்கும் கணினிக்கு நமது வாழ்நாள் நன்றி!

கணினியை என்னை போன்று தொழிலுக்காகவோ, அல்லது பொது-சுய உதவிக்காகவோ பயன்படுத்தும் எல்லா கைகளுக்கும் வணக்கம்.

ஒருநாள் ஆய்வகங்களிலும், பணம் புரளும் அலுவகங்களிலும் மட்டுமே ஆராதிக்கப்பட்டவள், இன்று நம்மூர் மருந்து கடை தொட்டு, பீடி சிகரட் கடை வரை வலை விரித்திருப்பது நிதர்சனம்.

இவ்வளவு அரிய வளர்ச்சியை சீரமைக்க, மேம்படுத்த, கண்காணிக்க, பரவலாக்க, எத்துணையோ கைகள் உழைக்கின்றன.

கணினி தொழிலும், கட்டிட வேலை போன்று பரவலானதலும், ஆங்கில அறிவை பெற்ற ஒரு சிலரே செய்ய முடியும் என்கிற ஆணவத்தாலும், இத் துறையை நாடும் பல போலிகள் பெருகிவிட்டன.

எதோ ஒரு, டுடோரியல் சென்டெரில் ஆறு மாதம் படித்துவிட்டு, ஒன்றோ இரண்டோ சான்றிதழ்களை பெற்று கொண்டு , தானும் ஒரு Sofware Engineer என்று சொல்லிக்கொண்டு எத்துணையோ வேடதாரிகள் பிழைத்துக்கொண்டு இருக்கிறார்கள்.

இத்துறையின் பொறுப்பு, நான்கு வரி code, கூகிள்-இருந்து சுட்டு, copy paste செய்துவிட்டு QA வை கையில் போட்டுகொண்டு - Defects free Delivery - செய்வதோடு மட்டும் முடிந்துவிடுவதில்லை.

இதையும் தாண்டி, இதன் அடிப்படையை புரிந்து, இவள் அழகை, பெருமையை உண்மையாய் ரசித்து, இன்னும் ஒரு படி மேல் கொண்டு செல்ல துடிக்கும் ஒரு சில நெஞ்சங்களும் இருக்கத்தான் செய்கின்றன.

இத்துறையின் பொறுப்பு ஒரு நல்லாசிரியரை போன்றது. ஒரு ஆசானின் தவறால் எப்படி ஒரு இளம் சமுதாயமே பாதிக்கபடுகிறதோ, அங்ஙனம் பெருகிவரும் சாப்ட்வேர் கருப்பு ஆடுகளால், கணினியின் நலன் மட்டுமின்றி, நம் நாட்டின் நாளைய வளர்ச்சியும் கூட பாதிக்கபடலாம்.

ஆகையால், ஒவ்வொரு கணினி வல்லுனரும் - குறிப்பாக இந்திய கணினி வல்லுனர்கள்-
தமது பொறுப்புணர்ந்து, எவ்வழியில் இத்துறையில் நுழைந்திருந்தாலும், இனிமேலாவது ,இதன் அருமை உணர்ந்து, செம்மையான வளர்ச்சிக்கான வழிகளை சிந்தித்து செயல் ஆற்றுவோமாக.

இப் பொறுப்பே இப்பதிவை தொடங்குவதற்கான உந்து சக்தி. பின்வரும் நோக்கங்களுக்கான நமது சிந்தனைகளை இங்கே பகிர்வோமாக.

* கலையாக பயிலுதல் & பயிற்றுவித்தல்
* நுணுக்கங்கள்
* திட்ட மேலாண்மை & செய்முறை
* நம்ம ஊர் பயன்படிற்கான கருவிகள்

இப்பதிவு, கணினியையும் அதன் பயன்பாட்டையும், அதன் வளர்ச்சியையும் ஆராதிப்பவர்களுக்கு காணிக்கை.

Sunday, June 21, 2009

Dependency Injection with Guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5 and above, brought to you by Google.

It uses power of Java 5 Annotations to replace new with @Inject.

Before delving into the new framework, lets recapture "Dependency Injection"

Before starting a surgery, the surgeon makes sure, whatever required to complete the surgery procedure are readily available.

The surgery assistant does the prep work and manages everything available before calling the surgeon to start. Imagine how horrible it would be for a surgeon to do the prep work during the surgery itself. It would leave enormous amount of risk on critical operation.

Similarly for a TransactionMananger to act on a transaction,it may depend on - Source Account, Receiver Account, Transaction modes etc.

If the transaction manager works on gathering the dependencies during the transaction, it will not only affect the transaction time , but can also impact on quality which can lead to errors.

If an assistant makes sure, TransactionManager gets everything it requires before starting the transaction, the TM can just focus and ensure smoother transaction. If at all there is any error, it will be very easy to find out as responsibilities are way clear off.

This is what called as "Dependency Injection". In other words "Dont call me. I will call you".

public class TransactionManager{

Account sourceAccount;
Account receiverAccount;
Double amount;

void transfer(){
this.sourceAccount.debit(this.amount) ;
this.receiverAccount.credit(this.amount);
}

}

public class Account{

long accountNo;
String name;

void debit(int a){
}

void credit(int a){

}

}

The dependencies of TransactionManager are sourceAccount and receiverAccount. All these dependencies are injected by an assistant - called - Inversion of Control Engine. [IoC Engine]

The IoC engine just requires following configuration to perform this.

< bean name="transactionManager" class="TransactionManager" >
< property name="sourceAccount" ref="sourceAccount"/>
< property name="receiverAccount" ref="receiverAccount"/>
< property name="amount" value="100"/>
</bean >

< bean name="sourceAccount" class="Account" >
< property name="accountNo" value="123" />
< property name="accountName" value="first last" />
</ bean >

< bean name="receiverAccount" class="Account" >
< property name="accountNo" value="89234" />
< property name="accountName" value="xyz man" />
</ bean >



Without dependency injection the transfer() would have been like this

void transfer(){
Account sourceAccount=new Account();
sourceAccount.setAccountNo(123);
sourceAccount.setName("first last");

Account receiverAccount=new Account();
receiverAccount.setAccountNo("89234");
receiverAccount.setName("xyz man");

sourceAccount.debit(100);
receiverAccount.credit(100);

}


Instead of tying the dependencies too tightly and mixing with core functionality, the assistant [IoC - Inversion of Control or Dependency Injection Engine] makes sure all the dependencies are readily available when required.

This not only makes the surgeon [TransactionManager] job easier, but also ensures testability and maintenance. If the amount or Account implementation changes in future, its very easy to update the code. Just change the configuration and you all done. The IOC will keep you updated and will deliver you all dependencies at required time


Refer for more info.
http://code.google.com/p/google-guice/

Wednesday, April 1, 2009

Comet - Reverse Ajax - Server Push

We see many attempts to bring Rich User experience - more of a- app like features to the modern browser users.

Numerous frameworks developed based on Java scripts handling browser DOM model to achieve Rich UI. These frameworks are currently leveraging the Asynchronous Requests to the server- AJAX. These requests are made from browser to server, however little research or development explored on the other way around - server pushing data to active browser sessions which would result in more of applet like applications on browser still proving better performance.

Comet - a new word - used to describe web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it

There are many methods currently employed for this technique.

Example applications:

Google chat , Meboo






Monday, March 30, 2009

Javascript : Anything can convert to Boolean!

Most powerful languages are very simple to program and very complex to master. and no doubt Javascript is one among them!

As Javascript as minimal data types, and in times anything can be potentially converted to boolean value, and the reason is few values [0, false, '',undefined, null] are equate themselves to boolean FALSE.

So, here is an example to convert any data type to equate to a boolean value.

var val=5;
val=!!val;
alert('Numeric Value:'+val); //true

val=0;
val=!!val;
alert('Zero Numeric Value:'+val); //false

val = '';
val =!!val;
alert('Empty space value:'+val); //false

val = undefined;
val = !!val;
alert('undefined value:'+val); //false

val = new Array();
val=!!val;
alert('Array Object value:'+val); //true

val= {};
val=!!val;
alert('Empty Object value:'+val); //true

val=false;
val=!!val;
alert('Boolean value:'+val);  //false

val= null;
val=!!val;
alert('Null value:'+val); //false




Albeit this power can mislead to type safety, it certainly adds great value when used wisely.

Hope you do so :-)

Monday, March 23, 2009

eRights - Unified Access & Concurrency Control for IT Products

We might have used Lightweight Directory Access Protocol [LDAP] used to control user authentication and entitlements for enterprise applications. 

Albeit open source ldap can fulfill extensive access control mechanism complex entiltments for enterprises, it potentially lacks concurrency enforcement for which many of us, would have employed other custom solutions [like tracking session id/access id with respect to application usage etc]

eMeta attempts to bridge the gap between access & concurrency controls through its unified approach via its eRights suite.

The product description goes as below.....

"eRights is an enterprise-information commerce software package for the online 
information industry. It provides authentication, access control, concurrency control. 
It helps IT product enterprises to  implement sophisticated personalized licenses 
and allow organizations to extract products from large databases of information.

eRights directly addresses the problems of selling and distributing information 
online by recognizing that information products are built from elements of 
content and application services that can be packaged in different ways to 
address different markets. eRights optimizes the many paths and usage terms and 
makes user, access, and product information available to other components of 
content distribution systems, such as personalization and content management 
software, content protection technologies, and payment systems."


Lets analyze a custom implementation on eRights :-

Resource 

The bottom of hierarchy starts with resource - that can have id and name. This is atomic unit of access control that can be devised. 

Product

The set of resources are grouped together and called a product - this can be real world business entity. 

User

This represents individual user / role that can access the product. Apart from regular name, id, password,  details it can also store as much customer info as possible.

Group

The set of users - called as Group that represents a team/organiztion unit/ a department etc.

Other than individual user access - group login/password also can be configured. 

License

The users and/or groups are assigned a product or set of products with set of rules governing validity time period, trial/preferred access, concurrent usage, number of logins etc which is called Licensing.

Concurrency Maintenance:

When a user logs in, an eRights session can be tied with the user record which can keep track of concurrency. 

Programming interfaces:

eRights offers application programming interfaces for many standard programming languages [Java, .Net, Perl etc] which enables application developers seamlessly integrate eRights into their application suite.

Conclusion

Concurrency control is certainly a step ahead on product marketing and its worth to consider unified solutions like eRights.


More info: 
http://www.emeta.com



Thursday, March 5, 2009

Composite Configuration

This Configuration class allows you to add multiple different types of
Configuration to this CompositeConfiguration. If you add Configuration1, and
then Configuration2, any properties shared will mean that Configuration1 will be
returned. You can add multiple different types or the same type of properties
file. If Configuration1 doesn't have the property, then Configuration2 will be
checked.




























Here, if you want to override any of the configurations mentioned by default, simply define them in APP_1