Wednesday, January 16, 2008

Déjà-vu

After a long time, the writing bug hits me again!

Due to the known vagaries of life (obviously something called work proved to be the first and the only influencing factor), I was not able to write much in the last month. That was the technical part of me saying that. The logical part of me says, “You probably did not have any good idea or thought to write about!”

Now that I finished my 6 months in the professional world today, I feel I have added another view to my decision making process. We all err and we all retract back. And to retract we must know that we have erred (which is usually not the case). Even if we do come to know we have erred but the time to change has become improbable (rather than impossible), retracting back is not an option at all. Saying this, it’s very hard to imagine a situation where some ideas which were very fascinating initially can turn out to be a farce as it is not up to your expectations. One can say, we got know that it’s not good for us early, so do something about it. Others say everything happens for a reason and it was already in writing that we’d probably have taken that step anyway (remember it was one’s own decision initially!). So continue with it or just admit that we are incompetent losers.

This begs for a question: Do we always set goals in life with a rider that if certain short-term goals are not satisfied or the path its taking is not conforming to the goals we set before, we’ll annul the step we first took in achieving that goal and look for other alternatives? The other choices are: changing your goals altogether (so that the path we are moving now is in line with the goal), continuing with that path (whatever it may be) and seeing what happens or doing a bit of both. The first option is the least heartening of the choices. It’s not easy to take a decision like that and this kind of decision is usually a forced decision by many other factors (family, financial matters etc) rather than the one factor we are speaking of now. The second choice is a choice for the “Easy come easy go” kind. They follow the path with the phrase “Let’s see what happens”. The third option is a mixture of both. This is usually influenced by the fact that some cannot adhere to the first step fully as their mental make-up does not suit this kind of decision making and hence jump to the second step.

In my personal opinion, I would stop as soon as I found out I was not heading in the direction I initially set out for and find alternatives to go in that direction. In this thinking process, if I have to modify my goal so that it’s more achievable realistically speaking (after this folly has been committed), YES by all means. The changes which are effected will always be in the short-term goals and not on the long-term goals. This is what i intend to do if i do face this dilemma. Saying this, I have to say that it brings out a strong sense of déjà-vu whenever I touch upon this topic. Come to think of it, everyone will feel the same as soon as they dig deep into their thoughts.

Until next time,
Cheers and ciao

Wednesday, December 12, 2007

LFC - You'll never walk alone


Hail Liverpool!!!

"You'll never walk alone" This possibly would have been what the Liverpool team, which set foot on the Stade Velodrome in a Do or Die match against Marseille, told its coach after the 4-0 drubbing of the opponents. In the wake of the recent developments and controversies which have marred our Manager Rafa Benitez, this is the least the team could do for him.
What a win against the french power house Olympique de Marseille at the Stade Velodrome!!!

I am surprised that i watched the whole match. The surprising aspect being that the match was scheduled at 1:15 AM my time. After i started working, working late hours is normal but for a match, this was a first. After the unexpected loss against Reading, there were some apprehensions about this game. But the rebound penalty kick from Gerrard just 4 minutes into the game removed all doubts. A friend of mine, Sughosh, who is a outright Arsenal and Arsene Wenger fan and a keen follower of football,(he follows the game to the hilt) had said that in pressure matches, the team scoring the first goal would of all probabilities win the match. Thats exactly what happened. I, being a Liverpool fan, would like to thank Givet(What a bad tackle! He could have hurt Gerrard real bad with that tackle) for giving us the opportunity to score the first goal. The Second goal was a Torres masterpiece. Kewell passed the ball to Torres. Torres, like the wind, moved with grace and speed, dodging 3 defenders on the way and slotting in the second. This came at the 12th minute. This sealed the game in my opinion.

The third was from the hardworking Dirk Kuyt who deserved it. Here again Kewell played a pivotal role. He's a great asset to the team but his fitness might still be his greatest enemy(if he could just stay fit for longer periods). The fourth was by Babel(to rub salt in the wound). There could have been a 5th but Gerrard hit the ball high.

To me, the most heartening aspect of the win was, the opponents, did not have one proper shot on our goal. The defence was water tight. Even Kewell and Bennayoun came forward(figure of speech) when their services was required in defending. It almost looked like a 6 man mid field with a 6 man defence. This, again a positive to ponder over, in no way hampered our fowards in scoring goals(see the score line and you'll remove this thought from your mind).

Rafa's persistence with 4-1-2-3 field in the game against Reading was, according to me the single most factor responsible for the defeat. Thankfully, the Marseille game saw a 4-4-2 and some times 4-3-3. We play the best passing football in EPL and arguably we may be bettered by only by Arsenal. This virtue cannot be harnessed with a 4-1-2-3 field. We need players who play wide and the above mentioned field does not allow that.

Moving on the derby match against Manchester United at Anfield, all i would like to say is, "Beware!". The confidence we got from this victory is enough for us to go out on an all offensive against Man Utd. I just hope Rafa does not play too much with the team composition ahead of this derby. (Just an after-thought)

Hail Gerrard, Hail Torres, Hail the team and most importantly, hail the Great mentor and Coach Rafa!!

Tuesday, December 11, 2007

One of the best Games ever - Age Of Empires(AOE)

Hi all,
First of all, i am a devout fan of AOE. I sincerely feel this was, is and will be one of the best strategic games ever made. Although I started playing single player games like when i was in 9th Standard, I developed real interest only when started playing Multiplayer games with friends during my graduation years.

Whenever i played single player games during my school, the usual situation was i would easily win when the difficulty level was set at normal or medium and i would lose very badly when it was set at hard.(Ignoring Very hard which was one of the levels) This became very common and my interest waned because of this. I should also say this was not the only factor. I was more interested in playing(and watching) cricket and running(athletics). I spent most of my free time playing(and watching) cricket then. It was my favorite past time. During my graduation years, chances of playing cricket were very rare as most of my friends with whom i used to play, were either busy when i was free or had already started working. I had to find other avenues to venting my frustration which which used to pile up alarmingly because of the thorough bombardment of boring lectures which were thrown at us by our lecturers. That was when i started playing AOE again(That required some forcing from Slasher(Charan). Shyam and Slasher were always speaking of the game and strategizing which acted as a catalyst).

AOE is very similar to Chess. I found this similarity when i started playing AOE. Although its a different thing altogether that i stopped playing it, the desire to play well and win in Hard and Very hard was always there and the game's similarity to chess acted as a catalyst. During my graduation, Slasher(Charan) rekindled my interest. He's really good in this game. I can safely say he's the best among us.(when i say 'us', it means, yours truly, Shyam(Srinidhi), RK(Vinay), Aht(Ahtesham), DragonKnight(Sudheesh) and Shivu). The position of the Second in the list will be closely fought by Aht and Shyam. The list goes like that. One would be surprised when they hear Shyam never had actually heard of AOE(possible never played any computer game) before Slasher introduced the game to him. Then, he became a addict of the game. Slasher then forced me to play the game. I did not stop after that. We played 2 times a week atleast and we would have played more if some of the guys had more download limit. We would play even during our semester exams.( For those guys who did not believe my last sentence, just see my 6th 7th and 8th semester marks(thats when i started playing))

Coming to the similarity between AOE and Chess, this would be pretty obvious when one plays the game. Playing a random map, with a human opponent who is competent and winning will be one of the most satisfying things and believe me, you'll get one of the best sleeps of your life that night. Just like chess, its a mind game. One has to out think his opposition. Strategical planning is given utmost importance. Brute force of the most powerful army will be brought to dust if not planned properly. The basic nuances of the game is really thought of very well. Say for example, the most powerful soldier in the game, the Egyptian War elephant (damn costly though), is very weak against the weakest soldier in the game, the pikeman(the cheapest unit). If one thinks he's invincible because he's attacking with a horde of most powerful unit in the game, he's in for trouble. Not just this, take Cavalry against infantry or archery against infantry, many things even out. In a multi player scenari0, where the players have teamed up, the game will be very enjoyable. The players can strategize and attack. Numbers matter but having variety in the army and knowing how many units of one type to attack with(which one can learn only by playing more of this wonderful game), usually is the deciding factor in a evenly contested match. Selection of civilization too plays an equally important role. Many people complain that strategic games are time consuming and boring. Actually one can finish a 8 player game in say 3 hours(believe me after some practice, one can finish single player V/s computer game with hard difficulty level under an hour) and its very far from being boring. If and when well contested, it'll be one of the most thrilling, fascinating games one would have ever played.

Coming to specifics, I usually played with Britons initially. The long bowmen rock!!! But the interest to learn playing with another civilization made me change to Japanese. The Samurai is cool too. As of now i have the civilizations i have played with and competitively at that are Brits, Japs, Aztecs and Spanish. Currently i am playing with Spanish and i am simply not able to let them go as their cavalry is really good. One of the other reasons might be "More GOLD"(Typical working class mentality eh?).

Cheerio.

Monday, December 10, 2007

Cricket and Beyond contd....

Hi all,

Hope all of you guys had a happy weekend. A weekend of superb cricket. The happy thought of being able to see the test match for 2 days without any hazzles, alone made me happy. To add to it, there was the Sri Lanka and the England Test series and EPL to boot.

For all you ladies and gentlemen who don't know, I am a ardent Liverpool fan. I also closely follow the other matches of good teams like Arsenal and Man Utd, but i try really hard to see LFC's matches Live. More on the club i support in my next blog.

Be ready Aussies! Here we come!!!
That will be what our batsmen will be telling. Honestly, we expect Dravid to perform well when India's winning in tests. But in this scenario, even without Dravid's contribution, we're in a position to win the series against Pakistan. That i guess is a bad sign for Aussies. There are 3 reasons for it. The first reason being, all our batsmen coming to form prior to a 4 test series down-under. The second being, Dravid's bad form. Dravid is a fighter. He'll make his inclusion count one way or another. He's never been out of form for a long time and that too in tests, not more than a series. I am talking of the law of averages here. He's failed in the Pakistan series by his standards and surely he'll be a hit in Australia. The third being the unavailability of Mcgrath and Warne. The Aussie bowling line-up was too hot to handle for the Sri Lankans but they will be in for some spanking when India tours Australia. The Indian middle order is too good for the Aussie bowling line-up. Without the experience of the two greats, the aussie bowlers, donot have depth and experience. Here again, Mcgrath's loss will be more critcal than Warne's. Brett Lee is good but not really good enough to take on the Indian middle order. The rest of the bowling is really very new. The news that Mcgill may not play, may be a boon to them. They will now probably play Hogg in his place. And Mr Hogg, from what i have seen, is the only Aussie spinner of my time to have troubled India atleast for a significant amount of time.

Again to even things out, there are many factors which nullify this superiority.
The Aussie fielding - The Aussies can nullify the positives the Indian batsmen bring to the table by their own batting and surpass them by their fielding. Bad fielding and catching has been the bane of India since time immemorial. The Aussie team will save say 40 runs per innings and Indian team will concede say 30 runs per innings. The deficit here itself is around 70 runs per innings. Adding dropped catches to it will surely tilt the equation towards Australia. Indian batsmen, however good they are, are not good enough to nullify this difference.
Aussie batting- The formidable Aussie batting will be something to reckon with. Most of this responsibility will have to be shouldered by the Captain Kumble and Bhajji. The pitches in Australia will not break down as fast as Indian pitches and they stay true till tea on 4th day or the whole match sometimes. So some part of the load must be taken by the new ball bowlers. Bhajji may not play in some tests if the pitch suits pace bowling and playing 3 fast bowlers is inevitable. The pace battery needs the service of a fit Zaheer and Sreesanth. Zaheer might get fit for the series, but i worry for Sreesanth. I hope he gets well and starts on the boxing day test. He's one of the best test opening bowlers i have seen in recent times. Except for his 'Actions', after picking up wickets, which are embarrassing, he's a really talented bowler. Everybody have their own idiosyncrasies and we have to respect his and move on. Come to think of it, one can feel, why doesn't he do that himself and respect others. Who know, he may turn out to be good and respectful later in his career.Back to Cricket, he's a must if India's to win a test in Australia. Zaheer, the other vital new ball bowler also needs to be at his best against the Aussies. In case Bhajji doesn't play, the third seamer might be, Pathan, Munaf or RP. Preferably RP or Pathan. On the field, Munaf looks like he's gonna die any moment and bowling deliveries at medium speeds of 130Km/H is sucking the blood right out of him. He did not look fit in the Pakistan series. His fitness worries have been continuing. Pathan brings with him the all-rounder tag. RP brings the genuine pace and lift with him. Let the better player for the situation play.

Hmmm now the present match at hand, India lost momentum and drew the match in Kolkota. They should not do that here in B-lore. The same pair of Misbah and Kamran are playing now. Hope they get out and the team collapses. Preferably, they should get all out by 450. India should play out the day score some 200 quickly. Declare half an hour or an hour before stumps on 4th day. The we should hope, our spinners can take the 10 Pakistani wickets. On a fifth day pitch in Bangalore, i hope it won't be tough. All the best India........

Ciao

Friday, December 7, 2007

Cricket and Beyond

Hi all,

I have mentioned in my profile that Cricket is one of my passions. That actually is an understatement. I am (all the extreme adjectives can be used: on the pro of-course) intense fan of cricket and Indian cricket in particular. As i am forced to go to work by the vagaries of life, i am not able to follow the game completely. But i still am keeping track of the matches going on.

The ongoing series with Pakistan is not up to my liking. As a matter of fact, even the series previous to it. Although the results were different in both, (for the ignorant lot, We lost to Australia and won against our so called bitter rivals Pakistan) the aggression and the intensity was just missing. Even if it was, it was not there for the entire match or innings.

I feel India performs well when they are like the underdogs. This time though, it was not the case. There were two reasons to it. One, India came home with a World Cup to boot (50 or 20 over, who cares) and they could now not be considered underdogs to the 50 over World Champs Australia. Two, the Australian team which toured India, was not at all a World beating side. It was the Australian team minus Hussey(one of they batting mainstays), McGrath(one of the best line and lenght bowlers of all time) and Warne(one of the best leg spinners of all time). Although the depth in the Australian bench saw to it that the national team did not suffer because of this, one could see the aura of invincibility of the mighty Australian team wearing off. Warne was possibly the one guy whom the Australian team would not have missed as he has dismal record in India and Indians in general. So these factors made the Australian team more humane and average.(Compare this team to the previous Aus teams which toured India). As i had mentioned before, India were not the underdogs this time and hence, we lost the series. There were many more factors involved in the loss to Australia as a matter of fact but this was the psychological part.

Coming to the Pakistan series, our captain Dhoni, 'matured' after a maiden series against Aussies at home, inspired the team to win the series against Pakistan. I would like to mention this- Although the previous captain Dravid(One of my ALL TIME FAVORITE cricketer) played many a blinder of innings during his captaincy, he never was successful in inspiring the team. So internal duels in the team did not help then. Personally, Dravid will always be the best buddy of a captain and never the captain himself. He simply is not made for it. He has played unbelievable innings for India under Azhar and Ganguly and i expect him to do so under Dhoni too. Come to think of it, our most successful captain Ganguly, was helped in many a way by Dravid to build his tally.(Imagine, dravid in his peak- Century after century and catch after catch). But this is not true for Dhoni. Its very heartening that he's finding runs with bat and his keeping has improved by leaps and bounds(thanks to Dinesh for keeping Dhoni on toes) after he's become captain. More importantly, he's put the internal struggles behind and helping the team focus fully on the cricket. Some super partnerships between Yuvraj and Dhoni and the brilliance of Sachin took us through. Yuvi is in unbelievable form since the England series. I don't need to say anything about Sachin. He's beyond words.

Personally, i am fan of attacking cricket. You would be wondering how come i would be a fan of Dravid if i like attacking cricket. Let me tell you a scenario. The battery of world's fastest bowlers are bowling at a batsman. Say the average velocity of the delivery is around 150 Km/H.

As soon as i tell you this scenario one'll think this bombardment will go on for say 20 overs max. If a batsman like Dravid is defending the deliveries like it should not travel 2 metres from the crease, think of the pain it causes to the bowlers. He'll try to do something different and go for runs. His temperament is unquestionable. So he'll defend all the 20 overs if he's given the opportunity. On the bowler's side, think of bowling at a wall for 20 overs(with no result of-course)!

Will say more on my next post.
Cheerio

Wednesday, December 5, 2007

Setting permissions in State Machine Workflow(WF)

Hi,
This is my first Blog :)

I have worked a little on State Machine workflows in the project i am working on. The solution is specific to WF and .NET 3.0 project which uses MOSS .

I had faced a problem of assigning permissions. You might be wondering, What permissions! I will go a little deep into delving the information. When a task is created for some user say, user A in a typical State of a approval state machine workflow, the permissions are not automatically set to that user alone :( . Any person i e B C or D can click on the task and execute the task. To get to a solution, i tried giving specific permissions to the Tasks list. But what i was actually doing was just delaying the imminent problem, which was the inherrent problem in the workflow itself. I searched through the net and found 2 alternative solutions which were much better and error proof.

One is in the Create Task properties, where we can set Special permissions for Groups or users, wherein the initial permissions will be over-ridden. And the other is to set Roles in the OnTaskChanged event handler properties. These roles which will used to validate against any incoming events.

I was successful in finding a solution using the first method. I was unable to do so using the second method. The second method needs a Class which inherits from the parent class SPRoleType and this class must be used using the System.Workflow.Activities.WorkflowRoleCollection class. I was not able to do it. (In case you gets to know how to use this method, please reply.)

Coming to the part which i successfully completed, all that is to be done is, create a System.Collections.Specialized.HybridDictionary task1Permissions type for the task mentioned.

i.e
public System.Collections.Specialized.HybridDictionary task1Permissions = new System.Collections.Specialized.HybridDictionary(); //Define this as variable

In the create task event handler write this piece of code.
this.task1Permissions["Reviewer"] = SPRoleType.Contributor;
this.task1Permissions["Approver"] = SPRoleType.Contributor;
this.task1Permissions["Group Members"] = SPRoleType.Reader;
this.task1Permissions["Group Visitors"] = SPRoleType.Reader; // all the groups in the sharepoint site must be assigned permissions.(over-ridden)
This did the trick for me.
Hope it helps.

Using SPEmailReceiver event handler (MOSS)

I had a requirement that i wanted email be configured for a document library. On the arrival of the email, the email body was to be parsed and the subject of the mail, some important info from the body had to be updated into a list.I found some options which i could make use of, like

1. SPEmailReceiver - I had major problems with this. Some of them were,
a. As soon as i activated this feature(i installed this event handler as a feature(obvious)), the email which was obediently coming into the document library, stopped coming. I worked on it for a significant amount of time but to no avail.
b. The event handler never fired. I tried many times. I searched for a solution for a very long time but to no avail. Then i decided to move on. The solution was workflow.
2. Write a workflow which activates on Item Update. Configure the document library to receive email and check the box which says, save content. In the workflow, write the required logic to parse the data. - I found some glitches here. The email was always stored as .eml file. I did not know how to parse a .eml file.
3. When i was pondering as to how i could parse a .eml file,my team came up with a suggestion that i could use Timer service instead of a workflow and parse the .eml file(workflow would anyway be a poor choice as it was a single course of action). I tried using this and it worked perfectly.(by this time, i knew how to parse .eml file)

As you can see with the 3 choices, the first choice was the most natural one. But i was forced to use the third choice. But i really wanted to use the SPEmailReceiver event handler. I finally came up with the solution. The problem was not with the event handler(I had done that properly). But it was the process i was associating with.
While debugging, this event handler must be attached to not only the w3wp processes but also the owstimer service process. There were cacheing problems with this owstimer service too. So if you do face problem in executing the code, just kill the owstimer process, deactivate feature, uninstall feature, install feature, activate feature and do an IISRESET. This should do the trick.This will get the debug working and the flow will go into event handler. If the code present there is proper, it'll work with out any glitches. If you have a better method, do reply.
Cheerio