Monday, January 26, 2009

Jan quizzes in Chennai

The long weekend of the 24th, 25th and 26th Jan had three quizzes in Chennai. I attended two of those. The Mylapore Quiz which was a part of the Mylapore festival on the 25th and the IQL India Unplugged on the 26th of Jan. Both of them where conducted at the same venue. Hotel Karpagam Hall in Mylapore. Read on to know my views on how it went
The Mylapore quiz was a part of the Mylapore Festival that is fast becoming one of the famous neighborhood events in the city. The quiz master for the afternoon was Ashwin Prabhu. There was a prelims of 20 questions followed by the finals which was 6rounds.
The questions were very well framed and the enthusiasm of the participantsand their love for Mylapore was quite evident. The team of V.V. Ramanan and Ram Shankar walked away with the laurels. Overall the quiz was a very good experience. For somebody who is trying to get back to quizzing regularly, it was very enjoyable. Thanks to Ashwin and Srinivas for putting together a set of intriguing questions.
The second quiz was the India Unplugged conducted by the India Quizzing League. Personally, I thought the quiz would have had better participation if it was slotted in the evening. The quiz was scheduled at 09.30 AM in the morning. Karthik Narayanan started off the quiz with a fun question on JK Rithish. The prelims was a set of 30 questions. Again 6 teams got into the finals. This is where the quiz started to falter I thought. The questions for the finals could have been thought out better. Infact, the quiz seemed to get very long and the third round was a bit dry. I couldn’t stay till the end but kudos to the IQL Team for putting up this quiz. Jan 26th Is usually the date for the Odyssey Quiz but that didn’t happen this year. The IQL Team came forward and filled the void. This can only get better.

Tuesday, September 16, 2008

ADO.NET Data Services - Part - III


To work with ADO.NET Data Services, you should ensure that you have .NET 3.5 Framework SP1 installed. Apart from ADO.NET Data Services SP1 brings to the table a lot of new features. For a list of new features in SP1 refer to this link (VS 2008 and .NET 3.5 SP1 Features).


 


Once you have the SP1 installed, open VS 2008 and open a new web application. Right click on the solution and add a new ADO.NET Data Entity model. The extension of the file will be edmx. A wizard will guide you through the process of creating an entity model based on a selected database. I will not get into the details of the wizard for the sake of brevity. The wizard is quite self-explanatory. The only thing worth mentioning is to set support for MARS resultsets in your advanced window when you click new connection.



 


 


Once you have run through the wizard, depending on the tables you have selected you will see a data model like the one shown in the picture.


 


You can also create an entity model only for the tables you want, by selecting the appropriate tables in the wizard. We will now go on to add the ADO.NET Data Service. You can do this by opening  the add new item dialog box and selecting ADO.NET Data Service from it.


 


Once you have added the svc, you will see the code behind. Lets take a look at the only method that exists.


 


The method InitializeService is the first method that will be called when your service is invoked.  Any code that you write in this method is applicable to all the data models that you expose through your web service. One of the key things that you will do here is taking care of security. Though .NET gives us some built-in methods to set rights, more often than not we will be writing our code to monitor these accesses. The InitializeService gives us a single place where we can write code for access privileges for the whole service.


 


Coming back to the code behind, there are a couple of things you have to change in here to get it up and working. You will have to include the name of the datasource class in your servce name declaration. Replace the “/* TODO: put your data source class name here */ with the name of your entity class. You can find out the name of the entity class by looking the class name from the designer.cs file.


 


Build and run the solution. You will get a response like the one shown in the picture. This is because currently you have not set the rights. To view or access the exposed services, you should give rights explicitly.



 



 


Open your code editor. In your InitializeMethod uncomment the two statements


 


config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);


config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);


 


Replace the “MyEntitySet” with the name of the Entity and “MyServiceOPeration” with the name of the operation or the methods that you write. To provide access to all the entities and the operations use “*”. In my code for testing, this is what I have done.


 


             config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);


             config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);


 


That’s it!! Your service is now ready to be accessed. Build and run the solution again. You will see something like below. Look at how the results have changed just by including those two lines in the InitializeService method.



 



 


One thing I would like you to note is the format of the data. In the above example, data is being returned as ATOM feeds.


 


Now that we have built a service, we next have to build a client to access this service. More of that in the next part. Happy Coding!!!

Saturday, September 13, 2008

This is Anfield!!!!


How long does it take to travel from Cloud nine to Earth? If you ask Sir Alex this question, his answer would be 90 minutes. Because that’s exactly what Man Utd. Went through on their trip to Liverpool. Rafa had a day to savour as he won his first victory against Manchester United 2-1.


 


The start was anything but uneventful. The starting line-ups were pre-cursors to what was to follow. No Gerrard; No Torres for Liverpool and Ferguson sent out a statement of “intent” by playing Berbatov in the starting line-up. For the first 20 minutes everything seemed to go United’s way. Berbatov was involved in the build up on the right hand side to what would eventually be a Carlos Tevez goal. Tevez had another chance when he had to net in a cross with Just Reina to beat but he couldn’t keep it down. Tevez and United eventually paid heavily for that miss because as it turned out Liverpool just arrived into the game late. When they did, they swept away the “Red Devils”. For the next 70 minutes only one team played.


 


There were the likes of Rooney, Tevez, Berbatov, Kuyt and Keane on the pitch but the irony was all the three goals were scored due to big defensive lapses. Javier Masceranho was the first culprit for not tracking Tevez’s run into the middle.Unmarked Tevez netted Berbatov’s cross in the 3rd minute to give United the lead. Most of Liverpool’s attacking was from the right, with Arbeloa and debutant Riera being impressive. In the 26th minute, Van Der Saar messed up a Liverpool cross to fumble the ball to Wes Brown’s feet resulting in an own goal. Liverpool were level. As hard as United tried, it wasn’t just their day. Carrick was making his comeback from an injury but that didn’t last long. He injured himself on a sliding tackle trying to win the ball back. A substitution was apparent and Liverpool were getting on top.


 


Second half continued to be more embarrassment for the visitors. Ryan Giggs came in for Carrick. It seemed as if the substitution would work when his long distance drive was on target making Reina stretch to keep it out. As it turned out that wouldn’t be Giggs most significant moment in the game. Liverpool were keeping up the pressure at the other end. Rafa brought in Gerrard and Babel to induce some pace into the Liverpool attack. In the 75th minute, Giggs, riding the baseline, instead of kicking the ball over for a corner, tried to keep it in play only for Liverpool to take possession. Kuyt’s cross met Babel’s legs resulting in the winner for Liverpool. But the trauma for United was far from over. A minute before full time, Vidic made an error in judgement hustling for a ball he was never in contention for. He was given a second yellow and a red. He will now miss his game against Chelsea.


 


The victory now leaves Liverpool top of the table but Chelsea can catch them when they play Manchester City later in the day. As for United, 4 points from the first 3 games is hardly the start they would have liked. They are not strangers to having slow starts and catching up during the latter half of the season, so don’t write them off just yet. But for their striker trio, I don’t think we will see Berbatov, Rooney and Tevez starting again for some time.