Simon on the (dot)Net

L'homme qui codait en do dièse

  Home :: Contact :: Syndication  :: Login
  29 Posts :: 0 Stories :: 0 Comments :: 0 Trackbacks

News

Archives

Image Galleries

dimanche 22 juillet 2007 #

Bonjour à tous,

N'étant maintenant plus à Supinfo, je déménage mon blog.

Vous pourrez trouver mainenant de mes nouvelles sur : http://www.simonferquel.net/blog/Default.aspx. Mettez à jour vos lecteurs RSS!

posted @ 22:06 | Feedback (28)

lundi 25 juin 2007 #

The installation package of Script# contains both Script# librairies and compilers, and Visual Studio project and item templates. The problem is that the installer has been created to install these templates in Visual Studio 2005, so they do not appear in Orcas. But there is a workaround.

Using a fabulous little tool (Universal Extractor), you can unpack the MSI. Then, you can copy the templates to your Orcas Template repository: (in this example we use the user template repository, which is very usefull when you are not an administrator)

  • [MSI folder]\VSCSharpProjTemplateFolder\Script# -> %USERPROFILE%\Documents\Visual Studio Codename Orcas\Templates\ProjectTemplates\Visual C#\Script#
  • [MSI folder]\VSCSharpItemTemplateFolder\Script# -> %USERPROFILE%\Documents\Visual Studio Codename Orcas\Templates\ItemTemplates\Visual C#\Script#

I do not use the other templates, but you should be able to find where to put them easily if needed.

posted @ 09:43 | Feedback (105)

vendredi 8 juin 2007 #

I just made a video presenting Script# with ASP.NET AJAX and my Visual Studio Add-in for Web Service support.

You can see it here: http://blogs.labo-dotnet.com/simon/videos/DemoSSWS_fr.wmv

It is in french, and I don't know I will have time to make an english traduction... So if you are intersted in doing this, please contact me.

You can download the base solution (without Ajax), and the end solution. In both cases you will need the Northwind DataBase (SQL Server or Access version), and you will have to modify the connection string (and provider name if you use Access version) in the web.config file.

posted @ 12:50 | Feedback (13)

jeudi 31 mai 2007 #

As you can see with my previous article, I am a Script# enthusiast. But there are some limitations in the actual version. One of the most important examples is the lack of support for ASP.NET Ajax proxies for WEB Services.

Indeed, ASP.NET Ajax generates JavaScript proxy classes allowing browser-side code to call ASP.NET WEB Services methods marked as [ScriptService] and [ScriptMethod].

As Script# does not allow to write code calling classes and methods that it does not know, we have to build Script# assemblies that contain stubs of the proxy classes generated by ASP.NET Ajax. In order to do that, we need to look at the JS code generated by ASP.NET Ajax and rewrite the declarations in C#. It is a very time-expensive process, so I decided to create a Visual Studio plug-in that do that automatically.

It works using reflection on your WEB Application assembly, looking for [ScriptService]-marked WEB Services and [ScriptMethod]-marked methods, generating C# code and compiling it with Script#.

You can download this add-in here, and its source code here.

To use it, build your WEB Application project, right click on it in Solution Explorer and click “Generate Script# stubs for Web Services…” Chose a path to store the generated assembly, click OK, and that is done.

PS: this add-in only works with WEB Application project template (not with Web site templates).

[updated]:

I have just made a video presenting this: http://blogs.labo-dotnet.com/simon/archive/2007/06/08/17379.aspx

posted @ 11:27 | Feedback (47)

mardi 29 mai 2007 #

Hi there,

I have not been posting for a long time, and sorry for every MyExposé users, I am not releasing a new version of it (as I am very busy at this moment, and I will be also the next few months).

Nikhil Kothari has recently published a new version of Script# (a tool that works like GWT that generates JavaScript client-scripts from C# code). The greatest new feature is the support of ASP.NET AJAX. So I wrote a tutorial to discover Script# by creating ASP.NET AJAX components. In this article you will create an IP v4 calculator that can compute Network IPs from an host IP and a subnet mask. All the behavior will be executed client-side and will be generated by Script# from C# code (you will enjoy IntelliSense, refactoring, class diagrams etc. in your client code).

Here is the english version (thanks to Mauricio for the help on translation): ScriptSharp and ASP.Net Ajax[en].pdf

And here is the french version: ScriptSharp et ASP.Net Ajax[fr].pdf

Update:

There was a mistake in the presentation of Script# (I wrote that Script# was inspired from GWT, and that is not true). This has been repaired.

I released a Visual Add-in allowing to use Script# to call Web Services.

posted @ 10:31 | Feedback (50)

mardi 27 février 2007 #

As Patrice tagged me, it is at me now to say 5 “unknown” things about me. I think that will not be very difficult as I do not say anything about me on this tech’blog. So… let’s go!

  • First of all, I am from Orleans, a little-medium sized town 120 km south to Paris where I lived until I have been 17 (and until I have had my “baccalauréat”). I came in Paris and have been a student at Supinfo since this time (for the curious ones, I am 22 now, less than most of my current students ^^).
  • I am a musician (a fucking artist as would say my friends of Supinfo .Net Lab…), I play the guitar and the clarinet (at least, I played the clarinet, since I did not play it for about 6 months).
  • I am a “Supinfo certified trainer” since September 2005. That means that I specialized myself in Microsoft .Net technologies and WEB development, and for my two last years at school, I teach to other students stuff like C#, ASP.NET, Windows Forms, ADO.NET, Remoting and non Microsoft subjects like XHTML/CSS, JavaScript, PHP… That means too that when I am not teaching, I am training myself on recent or upcoming technologies such as .Net 3.0, C# 3, ADO.NET vNext, ASP.Net Ajax extensions (Soon on this blog, a forum engine based on ASP.NET and Ajax extensions which is my “project of the moment”. I promise something pretty cool).
  • I am in my last year at Supinfo… so I am looking for a job. I will be free from September 2007. Feel free to download source codes on this blog to have an overview of my technical skills and maybe send an email to “Simon dot ferquel [nospam] at supinfo dot com” for more details on my profile.
  • I have a big default: I am a World of Warcraft player. A few months ago, I was really addicted, I have even been a raid leader, I played every nights… This game is very cool, but also very life-intrusive… So I reduced my game-time and replaced it (in part...) with “at-home development” time. MyExposé is born during this “World of Warcraft cure”!

So I have to tag other blogs to propagate the chain… The winners are: Yann Lautrédou (my team manager), Thomas Lebrun (another SCT actually in internship at Microsoft France), and Mitsuru Furuta (Microsoft France evangelist, C# addicted and leader of the MathFX project).

posted @ 11:54 | Feedback (396)

mardi 13 février 2007 #

Hi everyone.

I received many encouragements for my work on MyExposé, and I thank you very much for all of that.

As you can see, MyExposé has not been updated since Windows VISTA RTM is out for enterprises. There are multiple reasons for that, much work at Supinfo, many other projects (you will see some of these in the upcoming weeks / months on this blog), but the main reason is that I had no Windows VISTA license (except a Business N version from my school that I am boycotting) to continue developping MyExposé on RTM.

I installed Vista Ultimate two days ago on my laptop. So development will restart very soon. In a couple of weeks, I will release a new version with several improvements :

  • Code robustness
  • Improved security (currently, plugins are loaded in the same AppDomain as the core of MyExposé, with privileges of the current user... Evil developpers can easily write keylogger plugins for MyExposé, that will not be possible anymore in next version).
  • Improved performances
  • Bug fixes with the taskbar mini-app
  • Improved performances on multi-core platforms
  • Settings to enable / disable background transparency
  • Settings to set transparency of the thumbnails
  • Improved installer

Lastly, I am looking for a developper who have a Windows Vista 64 bits capable computer to maintain my code for this platform (or a hardware manufacturer to "lend" me such a computer ^^).

Contact me at : simon dot ferquel [nospam] at supinfo dot com

posted @ 09:58 | Feedback (307)

mardi 5 décembre 2006 #

As I have used Expression Interactive Designer a lot in precedent projects, I was curious about new stuff in Expression Blend (the final name of Interactive Designer, aka Sparkle Designer).

So there are some very good stuff… and some not so good at all !

I will summarize my impressions with a good / bad list by theme.

Layout

Good

  • The new toolbar (but not its placement, at the left of the screen)
  • Grouping of the toolboxes by themes (Interaction, Project, Properties, Resources, Results)

Bad

  • Lack of interface customizations (we cannot dock the toolboxes where we want)
  • Timeline placement: It is in a vertical toolbox, and fit in the half of the toolbox width!!!
  • No "auto-hide" functionality for the toolboxes (like Visual Studio toolboxes)

Features

Good

  • Event triggers and property triggers support (the best new feature of this version)
  • Style / template editor (much better)
  • Asset library
  • Syntax highlighting of Xaml code...

Bad

  • ... but no IntelliSense!
  • Lack of style editing / affectation options using controls contextual menus (whereas templates are present). Workaround:  Menu bar -> Object -> Edit Style
  • Integration with Visual Studio: No intellisense because the project is not loaded when you double-click on a .cs file

General design

Good

  • Hmm Hmm...
  • Icons of toolbar buttons and controls are not so bad...

Bad (here is the dark side of Expression Blend ^^)

  • Layout problems (see the layout part of this post)
  • The Dark theme (default theme of Blend) is awful: it is dark, not user friendly, unreadable, and it does not respect color preferences of the user (and it does not integrate well in the user environment, definitely)
  • It is even worst for short sighted people (low contrast, text written in gray over dark gray, default police size...)
  • Menus design make me think of old dos text editors (squared, gray... ugly)
  • The worst is for disabled elements (disabled menu items, for example, are printed in dark gray over darker gray)
  • Light theme is even worst (uglier, really awful)
posted @ 17:22 | Feedback (20)

mercredi 8 novembre 2006 #

Today is a release date for My Exposé.

Many improvements in this version:

  • More natural thumbnails placement (no more grid)
  • Tray icon with configuration dialog
  • No more configuration file in ProgramFiles folder
  • New object model for triggers (better resource freeing, new trigger methods, informations about the state of "MyExpose"...)
  • Support for non-96 dpi screen settings
  • Support of Windows Speech Recognition (open the configuration dialog, add a trigger, choose VoiceTrigger and configure it)
  • Beautyful icons from Mauricio Diaz (thanks a lot Mauricio ^^)
  • ...

You can download binaries or source code.

[Update]

If you have problems running MyExposé, try to install the following package :
http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en

If you have have already installed an old version of My Exposé, please uninstall it before trying to install this version.

For developers who are interested in developping their own triggers, see the code of the VoiceTrigger project.

kick it on DotNetKicks.com Digg!

posted @ 16:12 | Feedback (200)

vendredi 6 octobre 2006 #

A new version is available here:

http://blogs.labo-dotnet.com/simon/archive/2006/11/08/11485.aspx

 

 

Here is the original message:

Even if it was written in French, my last post seems to have been read by many people from all around the world. Thanks a lot to all my refferrers. So I am pleased to annouce a new version of MyExposé (sorry it is not yet on Codeplex...), and this time, in english !

What's new in this version ?

  • More robust code: Detection of resolution changes, desktop composition disabling...
  • "Sensitive screen corners": Exposé can be triggered by the mouse
  • Configuration file: Possibility to change settings like trigger keys/corners without restarting MyExposé
  • Extensibility: Third party developpers can develop their own triggers
  • Incomplete support of multi-screen configurations: Multi-screen configurations may encounter some visual bugs but should work as expected.
  • Performance: Better performances on multicore configurations (thanks to OpenMP)

You can download either Source code (you should have to configure projects to target your windows SDK folder) or binaries.

 

posted @ 13:58 | Feedback (138)

mardi 12 septembre 2006 #

Update: new version here.

Le week end dernier, j'ai eu une idée lumineuse... J'ai réfléchi à ce qu'apportait Mac OS X en terme d'expérience utilisateur et qui n'éxistait pas sur Windows Vista. La première idée qui m'est venue est "Exposé".

Bref rappel sur cette feature à la fois toute bète et super bien pensée :

En tant que développeur (et aussi en tant que Geek d'ailleurs), il m'arrive souvent d'avoir beaucoup (énormément) de fenêtres ouvertes. Pour m'y retrouver, c'est bien souvent la galère, et je perds beaucoup (énormément) de temps à essayer de trouver LA fenêtre dont j'ai besoin (cela se termine bien souvent par l'ouverture d'une nouvelle fenêtre au bout de 30 secondes de recherche ^^). Exposé permet par la pression d'une simple touche du clavier (F9 sur Mac) de voir l'intégralité des fenêtres sous forme de miniatures dispersées sur tout l'écran, ce qui permet de localiser immédiatement la fenêtre qui nous intéresse et la faire passer en premier plan.

Bien sûr Windows Vista possède quelques fonctionnalités similaires, mais dont l'ergonomie n'est pas aussi efficace (Flip3D ne permet pas de visualiser toutes les fenetres en même temps, et en plus elles sont de travers :p, et le nouveau alt+tab affiche des miniatures trop petites).

Et bien ma chère Martine, votre serviteur vous apporte l'ébauche d'un remède à cet abominable manquement. Ca se trouve ici, c'est absoluement pas supporté, ca tourne sous Windows Vista RC1, il n'y a aucune gestion d'erreurs/exceptions, ca ne fonctionne que si Aero est activé et c'est codé en C++ mixte (CLI + code natif pour limiter le nombre de P/Invoke). Ce sera bientôt sur Codeplex, et vous pouvez bien sûr faire n'importe quoi avec les sources...

(Cliquez sur l'image pour télécharger les sources / éxécutables)

Au fait, je n'ai pas tout à fait copié Apple : F9 c'était trop chiant comme trigger pour le debugage (ca avait tendance à me rajouter des breakpoints ^^), alors j'ai choisi F12 :).

posted @ 19:20 | Feedback (106)

mercredi 23 août 2006 #

Bonjour à tous.

J'ai profité de la réinstallation de ma machine pour installer la CTP de juillet de WinFX du Framework .Net 3.0, les outils de la gamme Expression et tout le tintouin, afin de jouer un peu avec WPF et WCF.

Voilà donc un petit programme permettant d'intéroger la base de donnée d'images Flickr dans une interface créée grâce à Windows Presentation Foundation.

Bien sûr, pour pouvoir lancer la version compilée, il vous faudra le Framework .Net 3.0 Runtime July 2006 CTP.

Pour les aventuriers qui voudraient explorer et compiler le code source, il faudra également le Windows SDK July 2006 CTP.

A noter que le développement de cette application a été l'occasion de la découverte d'un bug intéressant (mais qui pour l'instant n'a pas l'air d'intéresser les principaux intéressés...).

Un grand merci à Mauricio Diaz Orlich qui a fait les visuels (logo du labo, icône du bouton Full Screen et dessin de base de l'écran de chargement) sous Expression Graphic Designer.

A savoir que cette application qui n'a l'air de rien, aborde une bonne partie des nouveautés de WPF (Multithreading, animations, templates, styles, triggers, binding, DependencyObjects/DependencyProperties, ressources...).

Pour finir un petit screenshot :)

PS : après avoir sélectionné une photo dans la liste des résultats, vous pouvez cliquer sur l'image pour accéder à la page flickr correspondant à la photo (pour laisser un commentaire ou autre), ou cliquer sur le bouton "Full Screen" pour avoir droit à une jolie animation (qui rame un peu, d'accord, mais jolie quand meme :p)

posted @ 16:52 | Feedback (247)

mardi 8 août 2006 #

Thomas Lebrun vient de publier un article très intéressant sur les nouveautés de C# 3. Il couvre à peu prêt tout ce que l’on sait (et que l’on peut tester) pour l’instant sur la nouvelle version du langage ainsi que des technologies qui lui sont associées.

Seulement en parcourant l’article j’ai un peu buté sur un paragraphe à propos des expressions Lambda. En effet, d’après certaines tournures de phrase, on pourrait croire que les expressions Lambda ne sont que des méthodes anonymes dont on aurait raccourci la syntaxe… Ce qui est vrai dans certains cas (pour Linq for Objects par exemple), mais qui est loin d’être une généralité.

En effet le principal apport des expressions Lambda est justement la notion d’"expression". Une expression diffère d’une instruction par le fait qu’elle peut être évaluée et interprétée par le code. On parle alors d’évaluation d’arbre d’expressions.

Une expression Lambda sera donc suivant les cas compilée en tant que méthode anonyme (quand la méthode dans laquelle elle est utilisée attend un délégué), ou comme une "expression" lorsque la méthode attend une expression.

Pour illustrer ceci, voici un petit exemple de code :

DataContext1 dc = new DataContext1();
var allresults = from p in dc.MyPersistentTypes
select p;

Console.WriteLine("Copy all entities from database to a list");
 
List<MyPersistentType> allEntitiesInAList = new List<MyPersistentType>(allresults);

Console.WriteLine("Query from table :");

var queryFromTable = from p in dc.MyPersistentTypes
                     where p.Id > 2
                     select p;
 
 
Console.WriteLine("Query from a list :");
var queryFromList = from p in allEntitiesInAList
                    where p.Id > 2
                    select p;

A noter ici que j’utilise la syntaxe Linq plutôt qu’une expression Lambda, ce qui revient exactement au même.

Voyons maintenant le résultat de la décompilation du code généré grâce à l’outil Reflector :


DataContext1 context1 = new DataContext1();
Table<MyPersistentType> table1 = context1.MyPersistentTypes;
 
Console.WriteLine("Copy all entities from database to a list");
 
List<MyPersistentType> list1 = new List<MyPersistentType>(table1);
 
Console.WriteLine("Query from table :");
 
ParameterExpression expression1 = Expression.Parameter(typeof(MyPersistentType), "p");
IQueryable<MyPersistentType> queryable1 = 
     Queryable.Where<MyPersistentType>(context1.MyPersistentTypes,
           Expression.Lambda<Func<MyPersistentType,bool>>(
                Expression.GT(Expression.Property(expression1,
                      (MethodInfo) methodof(MyPersistentType.get_Id)),
                       Expression.Constant(2, typeof(int))),
                new ParameterExpression[] { expression1 }));
 
Console.WriteLine("Query from a list :");

if (Program.<>9__CachedAnonymousMethodDelegate5 == null)
{
   Program.<>9__CachedAnonymousMethodDelegate5 = new Func<MyPersistentType, bool>(Program.

b__3);
}
IEnumerable
<MyPersistentType> enumerable1 = Sequence.Where<MyPersistentType>(list1, Program.<>9__CachedAnonymousMethodDelegate5);

On voit bien ici que la même expression lambda est compilée de façon différente selon le cas dans lequel elle est utilisée. Pour le type Table, on a droit à quelque chose relativement compliqué en apparence (il s’agit en fait d’un arbre d’expression), alors que pour le type List, on utilise un délégué généré (de la même facon qu’une méthode anonyme).

En fait, le compilateur a détecté que le type Table implémente IQueryable (et plus précisément IQueryable<MyPersistantType>), et a donc décidé de créer un arbre d’expressions qui sera évalué par le provider utilisé (définit au niveau du DataContext dans notre cas), afin d’obtenir le résultat escompté (dans notre cas, ceci éxécutera une requete SQL du genre « SELECT * from MyTable where ID > 2 » et nous la renverra sous la forme d’une énumération de MyPersistentType). A noté que l’arbre d’expression n’est pas évalué dans notre cas, car nous n’avons pas utilisé le résultat de la requête dans notre code. En effet, l’éxécution de la requête ne se fait qu’au moment où queryFromTable est utilisé.

Je ne détaillerai pas l’arbre d’expression généré ici, dans les grande lignes, on peut voir que l’on passe à la méthode Where une lambda expression (Expression.Lambda), constituée d’une comparaison "Greater than" (Expression.GT) s’éxercant sur une propriété d’un parametre de l’expression (Expression.Property) et une constante (Expression.Constant).

posted @ 12:51 | Feedback (27)

jeudi 29 juin 2006 #

Suite à mon dernier post, voici une application de mon "moteur d'animation" : un moteur de Drag and Drop animé (c'est à dire que les éléments déplacables ne se téléportent pas, mais glissent élégament vers leur nouvelle position). Vous pouvez en voir un aperçu ici, et télécharger les sources par là. Tout commentaire est le bienvenu :).

Sinon, si quelqu'un sait comment éviter les sélections de texte intempestives lors du déplacement de mes parts, ca me serait bien utile...

posted @ 14:13 | Feedback (26)

lundi 19 juin 2006 #

Pendant que mes élèves sont en TP noté, j'occupe mon temps en faisant un peu de Javascript. Je suis en train de développer un moteur d'animation (permettant d'animer un peu tout et n'importe quoi et surtout des attributs css). C'est en Javascript, c'est orienté objet, il y'a même un peu d'héritage... Bref, tout retour est le bienvenu ! http://blogs.labo-dotnet.com/simon/developments/JSAnimationEngine.zip

posted @ 09:44 | Feedback (20)