Reality is a perception. Perceptions are not always based on facts, and are strongly influenced by illusions. Inquisitiveness is hence indispensable

Thursday, October 30, 2008

HTML - Buttons as Links

UI designers pursue their job with the idea of getting a clean and pleasing finish. That is their job, however this single focus causes them to ignore the periphery. Accessability and Technical realisation take a back seat. A really good designer would provide a solution that is solvable and not some thing which is impossible.

What is an impossible design? Think of cramping a list of names into a horizontal row without any due consideration for 'screen estate', now if anyone does a Ctrl++ to increase the font size what would happen? It is impossible to support all resolutions, but most often the min and max constraints can be frozen, not having them defined causes even more confusion.

What is a solvable problem then! The unfortunate truth about web-dev is lack of standard environment. The browsers, CSS, java script all tend to vary. Removing backward compatibility is a sin, but that is the burden these age old browsers have to carry. The new kids on the block (Chrome), Good luck!.

Nuf of cribbing and coming to point, one of our teams was given this task of submitting forms using links. Now HTML supports form submissions on buttons and images alone! So what did they do, went ahead and used images. Not bad unless you think of resizing text. Like most puzzles which we face, I happened to run into this conversation and started twiddling with the source. Look where we are Maa.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
/* Works on Firefox2+ but not on IE6 :(*/
.link a>input{
background:none;
border:0;
border-bottom:1px blue solid;
padding:0;
height:1.2em;
cursor:pointer;
}

.link a>input:hover{
background:none;
border:0;
border-bottom:1px red solid;
padding:0;
height:1.2em;
cursor:pointer;
font-weight:600;
}


</style>
</head>

<body>
<div class="link"> <a> <input type="button" value="submit"/> </a> </div>
<div class="link"> <a> <input type="button" value="crap"/> </a> </div>
</body>
</html>

Wednesday, October 22, 2008

Stack Overflow

StackOveflow: A new preoccupation and time killer! Explains a slump in my blogging activities.

Nuf said, the real reason why I fell in love with SO cannot be explained, it has to be experienced. Have a look at this post (warning java script knowledge is mandatory)

Sunday, September 28, 2008

Religion for me 2

Now when I read about, people fighting eachother for their beliefs, I was surprised. Infact I was depressed. I feared some of my friends and neighbours would be hurt. So I started paying more attention to the differences. The differences were those I never cared for. They were the most superficial ones. I don't know why and how they became so important, so as usual started asking others. The answer, it was told so in the books.

As a student of logic, I found religion unexplicable. The most difficult thing to comprehend was the irrepressible quest to force ones own ideals on others. Then I found that the books actually force certains aspects on individuals. For me, Religion was no longer a way of life, it was a totalitarian structure with helped individuals intrepret things in many ways. It became a abhorence, more like a power structure or political structure. My knowledge of history didn't help here.

My angst was targeted towards the religious symbols. I started to interpret things in a different fashion. Religion was set out as a means of bringing social order to a society. When these isolated societies started to come in contact, they had to fend themselves and religion became a voice and power. God had nothing to do with it. God, wouldn't even care if people worshipped him or not. Religion says that God is the most powerful one and he saves the people. They don't give out compelling reasons why God would do so, what binds God to carry out the obligation and the consequences of not doing so. God wouldn't be hurt by things I do or don't do. Individuals are incapable of causing any harm, are do they? All they are capable of doing is hurt others.

Does God exists? I don't know, frankly I don't even care. I even wonder, what would the believers of respective religions do, if God himself tells them that they need to change their beliefs, they may call it a bluff/fraud and attack. So what do I want to do, I find some aspects of life appealing, like enjoying a nice laugh/conversation. Showing appreciation towards others and caring for others in my own capacity. I wouldnt' want this silly religion thing to interfere in any of these.

Religion for me

I grew up in a family which observed reverence to GOD. I remember the early days when my mom and dad used to take me to holy shrines and asked me to pray, they infact used to prompt me to ask for blessings!! My normal prayer was 'God, give me good conscience, help me with my studies, I will behave myself'. I am not going to spell out the religious order which my family belongs for it defies the purpose of this blog. When I grew up, I used to see people who never had any consideration to the ideals promoted by my family, I also saw people who went throught the strict regimen. As a kid, I once bychance went into a neighbour's house, they belonged to a different religious order, I saw the people over there uttering their prayers and I followed them with my own words - quoted above. I could see the lady of the house smiling in agreement.

One another time, I happened to step into the prayer room of a different neighbours. I used to enjoy the stories told by the elders and asked them if I could have the book of stories. They told me I couldn't and I wouldn't' understand the writing as well. I asked why? They told me it was the holy book and even they wouldn't touch it normally. I didn't feel bad as I remember my mom warning me with the books in our house. (Technically speaking, those were scriptures, but for a 11 year old they are all books!). The best part of all the religions was the festivals we used to have. We could jump of school and enjoy the sweets. My mother never objected! I even used to help our neighbours with the preperations. The same was the case in our school. I used to observe that some of our teachers/students used to take a special eatery. Once I joined the line just to try that. Later my friends asked me when we converted! I said no!! I just wanted to eat what you guys are having.

For me all the stories had the same moral, all my friends and their parents taught the same. Later when I found what others saw as reigion, I was in for a shock. Will continue rest in my next posting...

Thursday, September 25, 2008

Global Singletons, Good and Bad

I am just quoting my opinion someone elses article. The actual article can be found at:
singletons-are-pathological-liars


Why is global bad? Yeah, I know what your are thinking, and no, I am not joking. There are certain languages like JS which are quite powerful and yet have limited ability to comeup with walls (modularity).

Global is bad because:
a. It causes namespace conflict
b. It exposes the state in a unwarranted fashion

When it comes to Singletons
a. The explicit OO way of calling them, prevents the conflicts, so point a. is not an issue
b. Singletons without state are (like factories) are not a problem. Singletons with state can again fall in two categories, those which are immutable or write once and read many (config/property files). These are not bad. Mutable Singletons, which are kind of reference holders are the ones which you are speaking of.

Now if they are designed to act as application cache, you may see a lack of adequate cohesion. So what do we do! Using the pathelogical lies analogy, hide the unpleasant details, in private methods or in interfacing Adaptors (IOC). Make sure that these kinds of singletons are restricted to above sections of code and for the rest of application they become person-nongrata. Finally when you test the application, you won’t see the singletons. Not fool proof, but just makes it a wee bit difficult to accidentally modify things.

If we are exposing state of instance to Singletons in any other way, it is a bad OO design.

Quoting Dalai Lama, “Know your rules well, so that you can break them”.

Appreciation and Irony

Today my mail box is bombarded with mails, all showering appreciation for some work I did last week. Am I happy? yes I am guilable. On the other hand, I am still trying to maintain the vulcanistic composure, I have quite a few good reasons too. After the toil of working for 5 years, this is the first time I am put in limelight! The unfortunate part is that, I did quite a few things in the past which would exceed the current 'achievement', if it is the right word. Most often, my peers and superiors would show their admiration, verbally and sincerely. Today it is different. Lets see how.

I am working for a client, who happens to be contractor who manages third party contractor. I am with one of the third party suppliers. There was an issue, which would affect the whole design framework. I wouldn't spell out the issue in the current post, thats not the point anyway. The proposal for that solved the problem without causing any major design changes. So our client and the actual authority were really impressed. This caused a cascade of mails. When you prepare a recipe, or shoot a nice picture, you would like knowledgable people to acknowledge it. People without the intimate understanding of nuances just follow the crowd. When you see someone buying a camera or tv, they go with the brand. These would seldom try new things, no matter how good they are and this has nothing to do with being acquainted with the product.

The cascade caused the senior management of our company, just jumped the bandwagon. Now, I know some really good tasks carried out by some of our team, I personally did some stuff which overshawdows the current task. The chance of not being able to give a solution was alway lurking around. The difference was, in the exposure I recieved this time. Thinking of all those old times, I just wonder at the ways persistance pays, when you least expect it. This political embargo I am carrying with me probably will get some mileage during my review meetings, but the baggage of my team members staring at me like they used to do when you top your class or play that crucial shot in a field game, is unwarranted.

I just get a feeling that things are overdone in real world, and have to remind myself that even olympians are forgotten

Friday, September 12, 2008

Lost world

Typical applications of ANTLR would be in parsing domain. My first interaction with ANTLR was for a data generation application. We had this system which consume huge xml streams. The schema types were defined via xsi and testing the code for all conditions was inhumane! Even coming up with data for functional flows was painful. So the solution was to comeup with a template of the xml (using schema) and another template for possible datatypes. Parse the template, create a inmemory tree and walk the tree several times (using custom java code). We picked up a random domain value for substitution for each walk and ended up having a comprehensive data sets. There were certain correlation problems though and it was a different story.

I am writing this as I became a bit nostalgic seeing http://blog.centuryminds.com/2008/09/antlr-tutorial-dependency-injection-language/. Err when was the last time I learned something new!?

Popular Posts

Labels

About Me

Well for a start, I dont' want to!. Yes I am reclusive, no I am not secretive; Candid? Yes; Aspergers? No :). My friends call me an enthusiast, my boss calls me purist, I call myself an explorer, to summarise; just an inquisitive child who didnt'learn to take things for granted. For the sake of living, I work as a S/W engineer. If you dont' know what it means, turn back right now.