Mix08

  • nederlands
1 02 2008

It has been some time ago that I have seen the inside of Windows Live Writer. I have been terribly busy with a project for the Silverlight Challenge en currently still am. This is why I haven’t blogged as much is I usually do. Also the previously promised report about the Envision-Event trip will have to wait.

Why this blog post then, U ask? I would like to share with you the joy of having registered for the Mix08 in Vegas. An event you should not miss this year.

With the release of  Silverlight 2.0 (beta) and subjects as IE8, ASP.NET MVC, IIS7, WPF 3.5, Dynamic Data Controls and.NET 3.5, I’m very much looking forward to it.

And the fact that it is in Las Vegas is not bad either. I haven’t settled yet on the flying schedule, and the hotel.

Who else is going? and if you are, how did you arrange your flight schedule and your hotel, any tips that can help me? The Venetian is a bit to pricey for my taste.

Going to dive back into my Silverlight 1.1 Alpha project. The longer I work with it the more I’m looking forward to the 2.0 beta release.

Hope to see you in Vegas!

Robertjan Tuit



.NET Source Code Released

  • nederlands
17 01 2008

Microsoft released the .NET source code today, available from withing Visual Studio 2008.

Many of us have been longing for this moment, and many others have pointed out that it is very unwise to use it in the light of patents and copyright.

Especially that copyright discussion has kept us busy for a while but i’m convinced that here in Europe we have nothing to fear. You should keep in mind that if you have plans on brining your software to the states it is a whole other ballgame.

Check the following links for more information:

  • The blog post from Scott Guthry
  • How to setup browsing from visual studio 2008
  • Phil Haacked : Perception vs Reality on the patents
  • Don’t look at the sourcecode of .NET licensed under the ‘Reference license’

    Robertjan Tuit



  • WiiMote Mania

    • nederlands
    5 01 2008

    After seeing the briljant wiimote implementations of Johny Chung Lee I had no doubt whatever that a lot of other projects would follow. And indeed everyone has started cooking with the WiiMote and the Coding4Fun .Net libraries.

    Recepy 1: Tumbling horse

    • 40kg wiimote_20070620-1Spring horse
    • 1 WiiMote
    • 1kg Need 4 Speed

    http://wiimotehorse.tumblr.com/

    Recepy 2: Project Maestro

    • 1 WiiMote
    • 100kg WPF
    • 20kg LCD Scherm
    • 2 WiiNority Gloves

    http://labs.cynergysystems.com/Silverlight.html

    Recepy 3: Lasergame

    • 2 Wireless sensor bars or candles !?!
    • 2 Wiimotes
    • 1 room with places to hide

    http://www.wiili.org/forum/wiimote-laser-tag-t1196-s7.html

      Recepy 4: XNA Studio
    • 360kg XNA Studio
    • 1 BallRace

    http://www.youtube.com/watch?v=nQ8raY6RwtU

    Conclusion

    I think these are not the last “out of the box” implementations that we will see. The next few months will tell, and i’m realy looking forward to it.

    Enjoy the rest if your weekend!

    Robertjan Tuit

    update 5-1-2008 13:36: Cynergy Labs: Project Maestro



    Silverlight CustomControls and Blend 2

    • nederlands
    26 12 2007

    Most of you would have probably stopped developing in silverlight 1.1 2.0 after seeing how custom controls worked in blend 2 (they do nothing). But for those of you who persevered some tips to help you on your way.

    Xaml

    The current control model is absolutely unfinished. One of the firts thins you have to do is change the way a CustomControl is loaded, and map the controls in your xaml to your code.

    System.IO.Stream s =
      this.GetType().Assembly.GetManifestResourceStream(“UserControl1.xaml”);
    FrameworkElement _actualControl = this.InitializeFromXaml(
      new System.IO.StreamReader(s).ReadToEnd()
    );
    _actualControl.FindName(“Button”);Namespaces

    Blend 2 doesn’t understand it when you put namespaces in your customcontrol xaml, it does work in the xmlns decleration but not in the actual xaml control.

    Wrong:
    <CustomControls: Buttons.RoundButton …..=“” /> and
    <CustomControls.Buttons: RoundButton …..=“” />

    Right:
    <CustomControls:RoundButton …..=“” />

    Visual Containers

    Because custom controls do not show in blend 2, making layouts is a very dificult story. One solution is to create rectangles for every custom control and name them the same except for a temp_ prefix.

    Then in the onloaded event of your page, cycle trough your object tree and place the custom controls over the rectangles and remove them.

    More to come.

    Robertjan Tuit



    Wiinority Report

    • nederlands
    22 12 2007

    Sometimes i am so inspired by things i read, see or hear, that i am not quite sure how to act on them. But i’m glad that have my Blog these days to at least share it with you all.

    That we can connect our wiimote to our pc is not new, but what this guy is doing with it is realy refreshing and inspiring.

    The principle behind a wiimote is a camera inside the wiimote that registers the 2 light sources inside you sensor bar on top of your tv. Bu what if you swap them: You place the wiimote on top or at the bottom of you tv and you move the light sources around, the applications are very endless. For example when you use a pair of glasses with 2 lights on eather side.

    Especially his 3D viewport implementation is inspiring and the other makes the input devices from Minority Report science fact instead of function!

    Everything is available as c# source code, i can’t wait to get them to work on my own laptop!

    Link : http://www.cs.cmu.edu/~johnny/projects/wii/

    Video’s :



    Moq (Mock-You)

    • nederlands
    21 12 2007

    One of the most important tools for a modern developer is a good mocking framework.

    At the moment there are 2 relatively equal frameworks : RhinoMock en TypeMock. Both have good compile time debugging, reflection, refactoring and have proven themselves in numerous projects.

    Moq - Mocking YouBut as could be expected after the release of the new c# 3.0 language features, there is a “newcomer in mocking town” and it’s named Moq, pronounced as “Mock-You”.

    Using the new “Linq” language features this is a project to watch. Especially because it is available as full open-source at Google code.

    QuickStart : http://code.google.com/p/moq/wiki/QuickStart
    Home : http://code.google.com/p/moq/
    Download : http://code.google.com/p/moq/downloads/list



    Silverlight 1.1 en ASP.NET WebService

    18 12 2007

    Al een paar weken ben ik in de avond uurtjes een applicatie aan het maken die  gebruik maakt van silverlight 1.1 alpha , asp.net, webservices en Linq2Sql. Daarbij ben ik een paar heikele puntjes tegengekomen die ik met jullie wil delen. Ze zullen zeer waarschijnlijk allemaal opgelost zijn in de komende 2.0 beta. Maar als je, zoals ik, voor die tijd ermee aan de slag wilt dan kan je de volgende zaken tegenkomen:

    A circular reference was detected while serializing an object of typeDbMl properties

    Als je een linq2sql object model maakt dan zitten daar naar alle waarschijnlijkheid circular references in. Hier kan de serialization van de webservice niet mee omgaan.

    Dit kan je, als je WCF gebruikt, oplossen door Serialization  Mode van de DataContext op UniDirectional te zetten.

    Als je zoals ik gebruik maakt van een “ouderwetse” webservice, omdat ik WCF, Silverlight 1.1 alpha en de silverlight proxy generator van Visual Studio 2008 maar niet goed aan de praat krijg. Dan kun je dat op 1 manieren oplossen.

    Een simpele oplossing is om de association weg te halen, maar dit is in veel gevallen niet wenselijk.

    Je kan ook een van de 2 referenties op “internal” zetten in plaats van “public”. Deze Access property is er voor de Child property en Parent Property van de Association. Vaak is de child property niet nodig in je model. Let alleen wel op, deze is dus nu ook niet meer beschikbaar in Linq Queries.

    JSON_cannotconvertobjecttotype

    In eerste instantie gebeurde er gewoon helemaal niets, ik probeerde een webservice aan te roepen en toen hield hij er gewoon mee op. Na wat verdere inspectie kwam ik bij de fout JSON_cannotconvertobjecttotype.

    Na wat zoekwerk op google,  bleek deze fout te ontstaat als je een Guid binnen een class hebt. De fout zit ergens in de alpha code van Silverlight. En dan heb je dus een probleem want de Guid is gegenereerde code uit je database.

    Je kan je datamodel aanpassen en gaan werken met incremental id’s. Maar wil je gebruik maken van de aspnet_user tabel (standaard in asp.net 2.0) dan zul je toch echt iets moeten gaan doen met de Guid.

    Een andere oplossing is om zelf objects (dto’s) te maken met Guid als string en deze objecten te vullen met de gegevens van de Linq objects. Dit voelde alleen als een heleboel dubbel en repetitief handmatig werk en als echte ontwikkelaar heb ik daar een hekel aan (grijns).

    De oplossing die ik uiteindelijk gekozen heb is om via een SearchAndReplace command-line utility in de gegenereerde proxy class alle System.Guid te vervangen door System.String na elke successvolle build.

    Hierdoor word de Guid in silverlight dus een string, waar ik mee kan leven. De SearchAndReplace utility is eigen fabricaat dus als iemand interesse heeft kan ik de source op mijn blog plaatsen.

    Update 18 Dec 2007 16:08: Dezelfde fout treed op met System.Nullable<> types.

    Robertjan Tuit



    ASP.NET 3.5 Extensions

    10 12 2007

    Het lange wachten is over, we kunnen eindelijk aan de slag met het MVC Framework. Gebundeld met de onderdelen die tot nu toe in de asp.net futures release zaten heeft het asp.net team vandaag een preview van MVC framework uitgebracht in de ASP.NET 3.5 Extensions. Je kunt ze “gewoon” naast de huidige assemblies blijven draaien, dus ASP.NET MVC Object Viewerinstalleren en spelen maar!

    De extensions download bevat:

    Je krijgt er dus gratis en voor niets ook nog is het Entity Framework bij, ik kan niet wachten tot ik er vanavond lekker mee kan gaan spelen!

    Direct downloaden :

    En nog een klein overzichtje van wat informatieve blog posts, walktroughs en screencasts:

    Veel plezier!

    Robertjan Tuit

    Bronnen: ScottGu, Nikhilk & Phil HAACKED.



    Volta, Web Development 2.0

    7 12 2007

    Inderdaad: Web Development 2.0 en niet Web 2.0.

    Ik ben echt ontzettend enthousiast over wat er vandaag uit de Microsoft Labs is geslopen, dus neem alsjeblieft de tijd om deze lange post door te lezen. Ik ga proberen uit te leggen wat Volta nu precies is, om daarmee ook volta_thumbnail aan te geven waarom ik het zo geweldig vind.

    Voor de mensen die mijn blog al wat langer lezen, Volta is Script# in het kwadraat. Volta werkt alleen niet met source code maar met MSIL (Intermediate language). Deze MSIL kan hij dan weer converteren (hercompileren) naar javascript dat draait in elke willekeurige browser en elk willekeurig platform (in deze ctp alleen nog IE en FF). Het genereren van cross browser javascript kan je vele uren ontwikkel en debug tijd schelen.

    Je kan dus “gewoon” C# (en o.a ook VB, Python en Ruby) code schijven tegen je html pagina aan. Dus als je in html een element met id=”Text1″ hebt, dan kun je in C#  Text1.InnerHtml = “Nieuwe tekst”; intikken, waarbij het bij het hercompileren door Volta, vertaald zal worden naar javascript en uitgevoerd in de browser.

    Tot aan hier, nog niets nieuws. Want dit konden we al met Script#. Hoewel deze implementatie je wel behoorlijk veel meer vrijheid geeft. De echte kracht van Volta zit hem wat mij betreft in het feit dat je binnen een project zowel server als client code kan schrijven.

    image001

    Deze laag splitsende technologie (zie ook plaatje hierboven) werkt door middel van attributen (o.a. [RunAtOrigin]) die bepaalde classes op de server en andere classes op de client laten draaien. Deze classes kunnen dan, zonder dat je daar zelf code voor hoeft te schrijven, elkaar aanroepen alsof ze zich op dezelfde laag bevinden. Volta genereert alle code die nodig is voor de communicatie tussen de browser en de server.

    Daarbovenop levert volta een wijde reach van tools en functionaliteit (o.a. controls en javascript interop). Daarme tilt Volta het ontwikkelen van webapplicaties naar een nieuw niveau.

    Wel moet op dit moment worden aangetekend dat het wel te maken hebben met een CTP preview release waarvan de functionaliteit nog lang niet vast staat en de code nog lang niet productie klaar is, maar een kijkje in de keuken van de toekomst is natuurlijk nooit verkeerd.

    Dus als je net zoals ik gegrepen bent door het Volta Virus, kun je de volgende links volgen om meer informatie te krijgen en er zelf mee aan de slag te gaan en ik hoor net dat Christiaan van Bergen na het weekend met een paar mooie code voorbeelden komt om je verder te helpen.

    Robertjan Tuit

    p.s. Waar zouden ze toch dat logo vandaan hebben ?



    Microsoft MVC and Ajax

    26 11 2007

    Nikhilk is weer eens lekker aan het prototypen geweest en je vraagt je soms af waar hij zijn tijd vandaan haalt, geeft mij ook wat van die tijd!.

    Maar goed, het betreft hier een eerste Prototype voor Ajax met het MVC Framework. Uiteindelijk zal het standaard in het MVC Framework zitten, dus je moet dit zien als een eerste expiriment, waarbij je zelf nog een behoorlijk hoeveelheid sturing kan geven via feedback.

    Het voorbeeld laat zien hoe de partiele pagina rendering van AJAX in MVC past.

    Het is daarbij ook gelijk weer een mooie showcase van wat voor een gebruiksgemak het MVC Framework ons gaat bieden, waarbij ook de zeer belangrijke unit tests aan bod komen.

    Source code : sample code, sample app and tests

    Link : http://www.nikhilk.net/Entry.aspx?id=181

    Robertjan Tuit