David Cumps
#region .Net Blog
-
NSurvey
For one of the projects I had to do, I had to create an online survey application, which would be used to gather feedback from Microsoft events. Up until then, feedback was collected by handing out a form and entering the data manually.
As I was given free choice on how to solve this problem I suggested using an existing open-source framework and extending it to meet the requirements. This suggestion was quickly approved because on one side it meant commitment from Microsoft towards open-source and on the other hand it prevented re-inventing the wheel. The project used for this solution is called NSurvey. This provides a survey framework, making it very easy to setup surveys, add questions, add users, do mailings, implement security on a survey-based level, perform statistical operations on the answers and add new functionality by extending on existing classes.
NSurvey is an ASP.NET application, written in C#, which uses a SQL Server back-end, using stored procedures, and various other layers. The installation of NSurvey went very smoothly because of an msi file, placing all files in their correct location.
I started by testing the application and learning the big structure of how it worked. During this small test round, I began thinking on how the final solution would look. -
Reflector
One of the tools I had in my toolbox was Reflector. This tool is written by Lutz Roeder and allows you to examine a .NET assembly. Through the use of reflection it can display all namespaces, classes, methods, properties, events and fields in the dll.
It is possible to view the code in IL, C#, VB.NET and Delphi. Some of the useful features are the Call and Callee Graph.
The Call Graph shows you which items are used by a given method, while the Callee Graph displays all the methods that call a given method.
Forgot something for blog readers, the url where to get it: http://www.aisto.com/roeder/dotnet/ -
Boxing/Unboxing
This post moved to http://blog.cumps.be/boxing-unboxing-in-net/ with some additional information about generics.
-
Imagine Cup
Important note (to not get confused):
The text below (and the future ones) is written in the past tense, because they are text that have to go into a book for school, which you have to write after your internship, giving info about what you did. But I'm writing it piece by piece, because otherwise it will be too much to remember, and a lot less detailed :)
For the second year in row, Microsoft organized the Imagine Cup. This is an international contest with various categories. As a part of my internship, I had to compete in the Visual Gaming and the Information Technology category.
The IT category was about diving into solving real life IT problems. With questions about networks, databases and various servers the content was really diversified.
You get 30 minutes to solve 30 questions, scoring 3 for each correct answer, 0 for a blank answer and -1 for a wrong answer. The first 5 people of a country advanced to the next category, which was the first goal of my internship.
After having spent half an hour taking the quiz, I had to wait a day to get the results, to prevent abuse. My score ended up being a 66/90, placing me at a shared first place in the Belgian competition. My first goal was reached.
The Visual Gaming competition was a coding challenge. In this competition you were given an SDK, which included a 2D-viewer, 3D-viewer, documentation and the required assemblies.
In the VG competition you had to write code for robots in a small game, their brains, or also called, AI. The main things I learned thanks to this competition were algorithm-knowledge, performance issues and logic thinking.
Algorithm knowledge was useful to find optimal actions for the robots, for example, the A* algorithm explained above, helped to find the shortest path. Other algorithms such as Traveling Salesman Problem also had to be solved and implemented to gain a strategic advantage in this game.
Performance was a very important aspect in the VG competition. Because your code had a limited time-window it could run in, it had to be very fast, making sure it stayed inside that window. This was the reason why I implemented a binary heap in the pathfinder, and why I made a lot of performance optimizations, such as preventing boxing and unboxing, storing certain 2-dimensional arrays in a 1-dimensional and cutting back on object initializations.
But knowing how the algorithms work and how to tweak for performance alone didn’t do the trick. The difficulty lies in making it all work together and operating as a big unit, working its way to a victory. That’s where logic thinking came in, to determine what tactics to use, and which algorithms to use.
After having played with this an afternoon I managed to get 1325 points, which was enough to get to Round 2, and to achieve another internship goal. My personal next goal was to try to score as good as possible in the second round.
(Which I will talk about when the second rounds is on its way :p) -
Binary Heaps
-
A* Algorithm
-
Day One
-
Internship at Microsoft
As some of you might now, I'll be doing my internship at Microsoft.
One of the things I'm supposed to do, is blog about my time there.
So, because of this, there is now an MS Internship category on my blog.
Ofcourse not everything I do will be posted, but I'm sure there will be enough :)
I'm really looking forward working there! -
DevDays 2005 Belgium - Day 1 - Full Report
Allright, currently it's a very busy time, but some people asked for more info about the previous DevDays 2005, so here is my attempt :)
First of all, I haven't taken any pictures this time, because I had to give my bag away at the start, and the camera was in there.
The first presentation after Bill Gates' keynote was by Philippe Destoop about Closing The Gap Between Development And Operations: A Developer's Perspective.
The main problem lies withing a lack of communication between developers and operations. Depending on the size of a company Operations has either little power or unlimited power. In either case, not talking to Operations can lead to your company suffering loss when your application crashes, or when Ops have a lot of power, prevent your app from being deployed.
The solution to this is to work together with Ops during development and to make them like your app ;)
You do this by communication a lot and by implementing monitoring and control functionality into your app, to be used by Ops later on.
The good thing is, a lot of the code needed to do this already exists, in the form of the Enterprise Library. More particulary, the Logging and Instrumentation Application Block.
Using this block you can raise events and timed events to about anything you want. Making it possible for Ops to receive these events in their monitoring programs and do something with it.
You can view some examples of code in the presentation.
Next presentation was IT Fortress: Developing On A Secured Infrastructure by Raf Cox.
He talked about security, first examine what you want to protect and why, then choose a technology to protect it with, and don't be shy of using built-in technology of the OS, it's better then re-inventing it.
In a secure environment you have to be aware as a developer that your application isn't as "free" as it might be in your development environment. It can be run as a normal user, not fully trusted, with limited network access.
You always have to think about possible security bugs, if you don't, they will be there and hackers will know them.
After this he explained the possible authentication choices in Windows, how Basic Authentication, SSL and Kerberos works.
You can use Windows for authorization as well. By using the Authorization Manager it is possible to define common roles in your organisation with common used operations and define their permissions in the manager in a central place. After this applications all can use this information.
Last part of the presentation was about using least privilege. You can read all about it in the presentation.
Third presentation of the day was by Clemens Vasters about Interop & Integration: Best Practices For SOA With Today's Technologies.
During this presentation everything that has been shown is readily available, no future products were used, which is a nice thing for a presentation! :)
The presentation was based on a demonstration example to explain how service-oriented architecture works.
Basicly every functionality in the example is a service, when you take a look at the big overview it looks like a very modular system where each service has one well-defined task and works together with other services.
Some properties of these services are autonomy, where each service control and hide their state, services also are never hard linked to each other and are platform independant, so no returning DataSets.
Services also contain "edge code", which is code specifically written for the borders, and do nothing but forward to the real code that handles the logic, which are basic classes.
This was a very energy-rich session, with a lot of new information, which is still being processed by my brain :)
You can view all the diagrams in the presentation.
Next presentation was Best Practices For Windows Forms Development by Marc Ghys and Bart Debeuckelaere.
The first issue was to improve performance for Smart Clients. This can be done by using a lot of caching, compress the SOAP messages, and possibly use ngen.exe to precompile your assemblies. Also when you have to do something intensive, do it when the user expects it, for example, make a web-service call when a user clicks a submit button while showing a loading msg, and not when he leaves a textbox for example.
Next was how to secure webservices, by using the integrated authentication mechanisms in Windows and by using WSE.
Other things during this presentation were creating your own controls to provide a consistent look and feel in your application, using code generation to save time and to have consistent code. Then some info was given about ClickOnce, but the demo failed and then the time was up. But you can view the presentation for more info.
At the end of the day there was a community block left. These were the Lightning Talks where I talked about Alternate Data Streams. And these are the only photos I have of the day, taken by Tom Mertens, tnx!
This concludes day 1, tommorow I'll try to do the same for day 2, I also ran out of time now ;) -
DevDays 2005 Day 2 - Exams & Internship
The Developer & IT Pro Days 2005 are over, as well are my exams.
During day 2 we saw what is going to come with the next .NET version (partial files, generics, ClickOnce, ...) and what mistakes an admin can make in his IT setup and how to fix them.
The last one was really funny, but sadly enough those mistakes are often made, running SQL Server as SYSTEM, SQL Injection, simple passwords, no defense in depth, logging on as domain admin, ...
My exams are also over now, the last one of my current education, coming up next is a 3-month internship at Microsoft.
And just like Tom's doing, here is a picture of the Channel 9 guy, sitting together with the Azlan mascotte on the tower of stuff I had to learn these last 3 weeks for my exams :)