Random Thoughts And Coding
Posts tagged development
Visual Studio snippet for a view model property, using the SetProperty() method
Sep 16th
I spent my 3 months summer internship coding a Windows 8 application, and even though there now is a basic implementation of the INotifyPropertyChanged interface provided by Microsoft (BindableBase), I can tell you creating a view model for each view you need is very time consuming and boring, and not nearly as quick as I would like it to be.
How to find all implementations of IEnumerable not implementing ICollection
Aug 12th
Following my last post on benchmarking madness, here is a short one about finding .net classes or interfaces based on given criteria.
While writing my last post, I found myself having a hard time searching for classes implementing IEnumerable<T> without also implementing ICollection<T>.
Indeed, beside String, there is not so many…
More >
Benchmarking madness: IEnumerable
Aug 12th
What is the best way to know if an IEnumerable<T> contains at least one element?
I mean, what is the most optimized way to know this information?
Maybe the first thing that came to my mind was to do some .Count() > 0 check, but if you think of it, the Count() extension method would have to enumerate the entire collection to know its length. This seems a little overkill.
More >
How to dynamically add properties to an existing object – dynamic keyword trick
May 28th
Les développeurs sont fainéants, c’est l’une de leurs nombreuses qualités… More >
Firefox tip of the day: open twitter profile with the Awesome Bar
Mar 16th
Introduction
Problème : je veux accéder au profil d’un utilisateur twitter le plus rapidement possible depuis mon navigateur, en utilisant la notation courante @pseudo.
J’ai cherché quelque temps une solution existante sans succès, et trouvant que cela faisait une bonne idée de projet, j’ai décidé de créer la mienne.
NegativeScreen
Sep 7th
NegativeScreen est une application permettant d’inverser les couleurs de votre écran, afin par exemple, de ne pas se faire éblouir dans la pénombre.
Ce programme a été conçu pour faire son travail tout en gardant une fluidité d’animation maximale.
Les performances de l’ordinateur ne sont que très peu affectées.
Différents mode d’inversion sont proposés, dont des modes “intelligents”, permettant d’inverser le noir et le blanc tout en conservant des couleurs (presque) identiques.
Utilisation
Dès le lancement, l’inversion des couleurs s’active.
NegativeScreen ne possède qu’une interface graphique minimale sous la forme d’une icône associée à un menu contextuel, dans la zone de notification.
Le simple click active ou désactive l’inversion, tandis qu’un click droit fait apparaitre un menu contenant plus d’options.
En plus de ces commandes, NegativeScreen est aussi controlable uniquement en utilisant des touches de raccourcis.
Raccourcis par défaut
- Win+Alt+H Termine l’application (Halt, en anglais)
- Win+Alt+N Contrôle l’activation/désactivation du mode Nuit
- Win+Alt+F1-à-F11: change le mode d’inversion:
- F1: inversion standard
- F2: inversion intelligente 1 – transformation optimale en théorie (mais couleurs pures désaturées)
- F3: inversion intelligente 2 – haute saturation, couleurs pures bonnes
- F4: inversion intelligente 3 – ensemble désaturé, jaunes et bleus mauvais, en fait plutot relaxant et assez agréable
- F5: inversion intelligente 4 – haute saturation, jaunes et bleus mauvais, assez lisible
- F6: inversion intelligente 5 – pas tellement lisible, bonne couleurs. (couleurs CMJ un peu désaturées, toujours plus saturées que la normale)
- F7: sepia negatif
- F8: noir et blanc negatif
- F9: rouge negatif
- F10: rouge
- F11: noir et blanc
Configuration
La version 2.0 introduit un fichier de configuration, permettant de configurer pratiquement toutes les fonctions de NegativeScreen.
Il est par exemple possible de choisir des raccourcis claviers personnalisés, ou même d’ajouter de nouveaux effets en plus de l’inversion de couleur !
Notez que cela nécessite des connaissances sur les matrices de couleurs (color matrices)…
Il est possible que j’ajoute un moyen d’en générer plus facilement dans une version future…
Si le fichier de configuration est manquant (negativescreen.conf), vous pouvez utiliser le menu “Edit Configuration” qui régénérera automatiquement la configuration par défaut.
Si quelque chose tourne mal après avoir édité le fichier (un mauvais raccourci clavier faisant crasher le programme…) vous pouvez simplement supprimer le fichier de configuration, la configuration interne par défaut sera utilisée.
Version pour Windows XP
Malheureusement, l’API Magnification utilisé par cette application n’existe pas sur Windows XP.
J’ai donc le regret d’annoncer qu’il n’y aura pas de version compatible Windows XP de NegativeScreen.
Téléchargements
NegativeScreen est distribué gratuitement, ainsi que son code source, sous licence GPL.
- Dernière version binaire (directement utilisable)
- Ancienne version (non configurable, mais marche avec Windows Vista)
ChangeLog
Version 2.2, 2013-02-17 ------------------------ - [fixed] avoid crash if a hot key cannot be registered - [added] new ActiveOnStartup configuration option Version 2.1, 2012-12-22 ------------------------ - [fixed] crash on Windows 8 due to inter-threads calls (this was not a problem on Windows 7) - [added] new MainLoopRefreshTime configuration option Version 2.0, 2012-12-14 ------------------------ Major update: - reworked entirely - better performances - smooth transitions - graphic interface (minimal) - configuration file: - fine grained configuration - custom hotkeys - custom color effects Version 1.12, 2012-12-14 ------------------------ - [fixed] crash on Windows 8 Version 1.11, 2012-06-26 ------------------------ - [added] new red and negative red filters bound on F9 and F10 Version 1.10, 2012-05-15 ------------------------ - [fixed] infinite flickering on Vista (introduced in 1.8) Version 1.9, 2012-04-16 ------------------------ - [fixed] stupid bug if the Windows taskbar is vertical Version 1.8, 2012-03-22 ------------------------ - [fixed] execution is no longer prevented if aero is disabled (previous bug corrected) however, the performances will still be horrible Version 1.7, 2012-03-21 ------------------------ - [fixed] works as expected when using custom DPI settings Version 1.6, 2012-02-27 ------------------------ - [fixed] crash on X86 on launch - [fixed] prevent execution if aero is disabled (prevent undesirable behaviours: black screens, 100% CPU usage...) Version 1.5, 2012-02-16 ------------------------ - [fixed] (internal) ColorMatrix implementation - [added] new feature: choice between 9 inversion modes (smart mode, etc... see readme for details) Version 1.4, 2012-02-09 ------------------------ - [fixed] does not crash anymore on Windows Vista Version 1.3, 2012-02-01 ------------------------ - [fixed] multi-screen should finally work! after a lot of tests and coding, I re-thought completely the architecture - [knownbug] in some screen configurations, if the primary screen if smaller than the other screen, the second larger screen has a black border at its bottom. It could be a bug in the Windows API... Version 1.2, 2011-09-18 ------------------------ - [fixed] multi-screen support (again) : bug with main screen on the right Version 1.1, 2011-09-13 ------------------------ - [fixed] multi-screen support - [fixed] when halted while paused, the application never stopped Version 1.0, 2011-09-06 ------------------------ - Initial release
Vous pouvez retrouver ici l’article technique sur la réalisation de ce projet.
NegativeScreen
Sep 6th
Version Française ici
NegativeScreen is a Windows application allowing you to invert your screen colors.
Appart from accessibility matters, this software is especially useful when you are surfing on the internet in a dark room, and the screen is dazzling you.
NegativeScreen was designed to work without impacting the performances and fluidity of your computer.
Unlike the Windows Magnifier, which is also capable of such color inversion, it was specifically designed to be easy and convenient to use.
Different inversion modes are provided, including “smart” modes, allowing blacks and whites inversion, while keeping colors (about) the sames.
Usage
The color inversion takes effect immediately after starting the program.
NegativeScreen comes with a minimal graphic interface in the form of a system tray icon with a context menu.
You can toggle the inversion by clicking the tray icon, and access more features by right clicking it.
Along with these commands, you can also control NegativeScreen only by using hot keys. Read on…
Default hot keys
- Win+Alt+H: Halt immediately the program
- Win+Alt+N: switch between normal mode and colors inversion mode (Night vision
)
- Win+Alt+F1-to-F11: change inversion mode:
- F1: standard inversion
- F2: smart inversion 1 – theoretical optimal transfomation (but ugly desaturated pure colors)
- F3: smart inversion 2 – high saturation, good pure colors
- F4: smart inversion 3 – overall desaturated, yellows and blues plain bad, actually relaxing and very usable
- F5: smart inversion 4 – high saturation, yellows and blues plain bad, actually quite readable
- F6: smart inversion 5 – not so readable, good colors. (CMY colors a bit desaturated, still more saturated than normal)
- F7: negative sepia
- F8: negative gray scale
- F9: negative red
- F10: red
- F11: grayscale
Keep in mind you can always change these defaults by editing the configuration file.
Configuration
The version 2.0 introduces a configuration file allowing to tweak almost everything in NegativeScreen.
You can now choose your own hot keys if you don’t like the defaults, and you can even add you own color effects!
This requires some knowledge in color matrices though.
I may add an easy way to build some in a future version…
If the configuration file (negativescreen.conf) is missing, you can use the “Edit Configuration” menu to regenerate the default one.
Should something go wrong after edition (bad hot key…), you can simply delete the configuration file, the internal default configuration will be used.
Windows XP Version
Unfortunately, the Windows Magnification API this application uses, is not available on Windows XP.
Therefore, I’m sorry to tell, there will be no XP compatible version of NegativeScreen.
Downloads
NegativeScreen is freely available, along with its source code, under GPL license.
- Last binary version (if you don’t know what to download, take this one)
- Legacy binary version (no configuration, but works under Windows Vista)
ChangeLog
Version 2.2, 2013-02-17 ------------------------ - [fixed] avoid crash if a hot key cannot be registered - [added] new ActiveOnStartup configuration option Version 2.1, 2012-12-22 ------------------------ - [fixed] crash on Windows 8 due to inter-threads calls (this was not a problem on Windows 7) - [added] new MainLoopRefreshTime configuration option Version 2.0, 2012-12-14 ------------------------ Major update: - reworked entirely - better performances - smooth transitions - graphic interface (minimal) - configuration file: - fine grained configuration - custom hotkeys - custom color effects Version 1.12, 2012-12-14 ------------------------ - [fixed] crash on Windows 8 Version 1.11, 2012-06-26 ------------------------ - [added] new red and negative red filters bound on F9 and F10 Version 1.10, 2012-05-15 ------------------------ - [fixed] infinite flickering on Vista (introduced in 1.8) Version 1.9, 2012-04-16 ------------------------ - [fixed] stupid bug if the Windows taskbar is vertical Version 1.8, 2012-03-22 ------------------------ - [fixed] execution is no longer prevented if aero is disabled (previous bug corrected) however, the performances will still be horrible Version 1.7, 2012-03-21 ------------------------ - [fixed] works as expected when using custom DPI settings Version 1.6, 2012-02-27 ------------------------ - [fixed] crash on X86 on launch - [fixed] prevent execution if aero is disabled (prevent undesirable behaviours: black screens, 100% CPU usage...) Version 1.5, 2012-02-16 ------------------------ - [fixed] (internal) ColorMatrix implementation - [added] new feature: choice between 9 inversion modes (smart mode, etc... see readme for details) Version 1.4, 2012-02-09 ------------------------ - [fixed] does not crash anymore on Windows Vista Version 1.3, 2012-02-01 ------------------------ - [fixed] multi-screen should finally work! after a lot of tests and coding, I re-thought completely the architecture - [knownbug] in some screen configurations, if the primary screen if smaller than the other screen, the second larger screen has a black border at its bottom. It could be a bug in the Windows API... Version 1.2, 2011-09-18 ------------------------ - [fixed] multi-screen support (again) : bug with main screen on the right Version 1.1, 2011-09-13 ------------------------ - [fixed] multi-screen support - [fixed] when halted while paused, the application never stopped Version 1.0, 2011-09-06 ------------------------ - Initial release
If you are interested in technical details, you can read the following post, recounting the development of this project (in French).
When comes the night : screen colors inversion
Sep 5th
Rien de tel qu’un écran affichant une page blanche ou claire, pour s’éclater les yeux lors de l’utilisation de son ordinateur dans la pénombre.
Sans parler des insectes attirés à 100 mètres lorsque vous essayez d’aérer les 28.5°C de votre chambre…
Pour atténuer un peu le problème, il existe une solution très simple en théorie : inverser les couleurs affichées ! (écran en négatif)
Sous GNU/Linux ou Mac, c’est effectivement simple (Ctrl+Option+Cmd+8 sur Mac, un poil plus compliqué sur Linux)
Mais sur Windows, c’est une autre histoire.
More >
Entity Framework 4.1 : Un template qui prend en charge la documentation xml
Jul 26th
Cela fait quelques semaines que je découvre Entity Framework, Le système d’ORM de Microsoft, et je l’apprécie de plus en plus
Ce framework d’ORM a beau être jeune et manquer encore de pas mal de fonctions (qui à dit enumérations ?), il simplifie beaucoup la vie, et c’est un vrai plaisir de travailler avec. (tant qu’on a pas besoin d’une fonctionnalité non supportée ^^)
Je ne m’étais jamais intéressé à cette techno plutôt orientée entreprises dans mes projets perso, et je débute donc avec un train de retard, directement avec la version 4.1.
Cette dernière version change et simplifie pas mal de choses lors d’un développement Model First, avec l’ajout de l’API DbContext qui remplace l’ancien ObjectContext.
Reinventing the wheel : C++ Linked List
Jul 3rd
Hasard du web ou magie des mots clés, j’ai l’impression en ce moment de ne lire que des posts ou les auteurs se demandent si les programmeurs de nos jours ne sont pas incompétents et paresseux comparés à leurs prédécesseurs…
La question du lien précédent a généré un nombre impressionnant de réponses en une demi journée.
Il y a aussi cet article de Joel Spolsky, co-fondateur de Stack Overflow, qui critique la simplification des cours d’IT : selon lui, en enseignant le Java plutôt que le C, et en évitant les vrais problèmes : pointeurs et récursion, la sélection ne se fait plus, et les programmeurs formés sont mauvais.



