Repeater Control – Tips

28 08 2008

My recent project had a requirement to change the class for every fifth element in the repeater. Though I wasnt able to find it widely on the net, the coding turned to be easier than  I had ever imagined. Here’s the snippet that i used in the ItemDataBound event of the Repeater control to set the class for every fifth element:

private void rptCollections_ItemDataBound( object sender, RepeaterItemEventArgs
e ) {
   if ( ( e.Item.ItemType == ListItemType.Item  e.Item.ItemType ==
ListItemType.AlternatingItem )
      && ( 1 + e.Item.ItemIndex ) % 5 == 0 ) {
      HtmlGenericControl divAddressItem = e.Item.FindControl( “divAddressItem” ) as
      divAddressItem.Attributes.Remove( “class” );
      divAddressItem.Attributes.Add( “class”, “lastItemCollectionItem” );

Nicotine-alcohol combination affects learning abilities

23 08 2008

The ill effects of both nicotine and alcohol are well documented. But a new study says that in combination they are even more harmful.

The two most abused drugs can, taken together, affect a person’s ability to learn, according to the study by a team of Temple University researchers.

The findings of the study were presented Tuesday at the annual meeting of the society for Neuroscience in San Diego.

Thomas J. Gould, co-author of the study, said that it aimed to understand the interactive effects of the two drugs and how they alter behaviour and produce neural changes.

This, he said, would place us “in a better position to develop treatments for drug addiction”.

Using an animal model, Gould and co-author Danielle Gulick examined the effects of alcohol and nicotine on learning to determine what happens as the drugs are combined at different doses.

“Think of a situation in which somebody is drinking and having cognitive difficulties,” said Gould. “Smoking may take the edge off of it at first, so they begin smoking and they smoke more and more until tolerance develops and they lose that edge.

“Now they are drinking and smoking and they are addicted to both. But if they try to quit smoking, they go into nicotine withdrawal, which results in a learning deficit. Maybe a drink will actually help them out initially, but then they consume more and they develop even worse learning deficits, so now they begin smoking again and they end up relapsing.”

Dasavatharam – Kamal’s ten roles revealed

20 08 2008

Postproduction and CG (computer graphics) work on Kamal Haasan’s mag num opus Dasavadharam, which is directed by K. S. Ravikumar is taking place at a brisk pace in a closely guarded environment at a studio in Chennai under the able guidance of Hollywood experts.

DC managed to get a sneak peek of the 10 avatars being donned by Kamal in the film as well as the opening song of the film from a close source involved in the postproduction. Kamal’s ten roles include that of an ordinary man, a traditional 12th century Vaishnavite called Rangaraja Nambi, a scientist, a 90-year old Brahmin lady who happens to be a dwarf, an eight foot tall giant, the U. S president George Bush, a sardarji (who is paired with Jayapradha), a dark skinned man from Thirunelveli, a Chinese martial arts expert and a white man who is a villain.

For the first time, Asin plays a dual role in this film. In one avatar, she plays an Iyengar lady draped in a traditional nine-yard saree opposite Kamal’s Nambi character.Towards the end of the film, she appears as a modern girl paired opposite Kamal’s character of the ordinary man.

Insiders, who got a glimpse of the song sequences of Kallai Mattum Paarthal Kadavul Theriyadhu, sung by Hariharan and set to music by Himesh Reshammiya could not stop rav ing about Kamal’s dedication and the huge amount hard work that went into the film. The thematic song was picturised near the Ennore port and Utthandi on ECR in Chennai. An awe-inspiring set resembling a Vishnu temple was erected on the beach at the cost of Rs 3.5 crore.

According to the scene, in the 12th century, king Kulothunga Cholan of Cholamandalam (played by Napoleon) orders his men to throw into the sea, a deity of Lord Ranganathar and Rangaraja Nambi who is an ardent devotee of Vishnu, holds on to the idol.

Preparing for a shot, which appears before Kamal’s immersion into the sea, the actor was reportedly hanging from a rooftop for around 15 days from 9 am to 6 pm.

“We felt speechless seeing the actor’s energy levels and involvement,” commented a unit hand present on location.

About 8,000 junior artistes dressed in costumes belonging to the period were used for this song, which was shot over 45 days.

Though producer Oscar Ravi was tightlipped about the entire proceedings, he said, “After the movie is released, Kamal Haasan’s name will be etched in the history of world cinema for the next 100 years.”

Performance Testing

15 08 2008

Hmm… you ever been into performance testing wherein, the application (you are testing) is dreadfully slow, padded with heavy processes and complex scenarios that cannot be efficiently automated? Well..i ve been and there is this one nice way of making it interesting.
Get your app loaded on the screen and along by, load the ever famous Helicopter (flash) game in a conveniently sized window. Now all you need to do is to fill up whatever test data that needs to be filled and get your app going. As you wait for the next screen to load, switch on to the other window and get the helicopter flying till the screen’s done loading in the background. Assuming the skill of flying the helicopter without crashing it till the next page loads to be congenital for a software engineer (in case not, guess it’s never too late to rear it, is it?), one can arrive at how slow the application has been based on how far the helicopter traveled.

Me’s sure that there are other ways too. Do share. 😉

Another day in cubicle paradise.

10 08 2008

Thats the title of a Dilbert book i purchased recently. Nothing mirrors our lives so perfectly as Dilbert does. The boredom, the monotony and the various other “small details” about office life Scott Adams has so beautifully portrayed through dilbert. The best one I like is the one where Dilbert gets his mum to his cubicle. And the first thing she asks him on seeing his cubicle is, “You did attend college right???”

There was a show coming on Travel and Living last night. Something called Faking it. and yesterday they had picked an IT guy just like all of us. He describes his day thus, sitting in one place for 8 hours, starting at the screen and his only exercise being the walks to the restroom and other such small breaks!

Boom!!! I can see myself doing that day in and day out! Get here, check mail, call the dudes at onsite, get work for the day, do the work for the day, send status and go home. Cycle continues day after day.

Its been almost two years for me in that cycle!! The mood to work is gone, motivation is at an all time low, the drive is non existant and i can go on and on about this!!


Was reading Trainspotting and a quote from the movie came to my mind…

Choose Life. Choose a job. Choose a career. Choose a family. Choose a ****ing big television, choose washing machines, cars, compact disc players and electrical tin openers. Choose good health, low cholesterol, and dental insurance. Choose fixed interest mortage repayments. Choose a starter home. Choose your friends. Choose leisurewear and matching luggage. Choose a three-piece suite on hire purchase in a range of ****ing fabrics. Choose DIY and wondering who the **** you are on a Sunday morning. Choose sitting on that couch watching mind-numbing, spirit-crushing game shows, stuffing ****ing junk food into your mouth. Choose rotting away at the end of it all, pishing your last in a miserable home, nothing more than an embarrassment to the selfish, ****ed up brats you spawned to replace yourself.

Choose your future.

Choose life.

Foundations of Ajax – book review

2 08 2008

I’ve recently completed reading “Foundations of Ajax” by Ryan Asleson and
Nathaniel T Schutta. This was the first book published, that I was able to
discern, on the subject of Ajax. I found the book to be very complete and
helpful and recommend it to those wanting to fully understand how to utilize
Ajax in their web apps.