CAT | Software
27
My GetService Pattern
In .Net the Interface System.IServiceProvider is a simple and elegant method to query services from other objects without having – or even wanting – to know how the class structure behind it looks like. Is the interface at that class implemented or at another? No matter, you query IServiceProvider and you get an instance of what you asked for.
That’s the theory. In reality the developer may have forgotten to add the new interface to the list after he implemented it. Or he forgot the IServiceProvider altogether.
That’s why I have this method to get what I want through several fallback strategies:
Categories: Misc, Software
Tags: .NET · C# · System.IServiceProvider
Comments: No comments
12
My XmlSerializer Pattern
The idea behind the .NET System.Xml.Serialization.XmlSerializer class is that you can easily serialize an XML file into a class tree and vice versa.
If you’re using XML Schema files, the xsd.exe tool can create that class tree for you.
But for simple applications you don’t even need a schema. You simply create a class that has public properties of simple types or complex types that in turn contain simple types.
Then you can throw this object into the XmlSerializer and you’re done.
Here’s my personal XmlSerializer coding pattern for a simple list of settings:
Categories: Misc, Software
Tags: .NET · C# · Serialization
Comments: No comments
29
Poker Chips Spreader
My buddies and I are playing Texas Hold’em cash games every once in a while.
As a start stack you get 5,000 in chips.
Since it is a varying degree of players every evening (from 4 up to 8 so far) I wrote a little app that would determine what kind of chips the start stack for everyone would consists of.
We agreed that the stack shouldn’t contain more that 20 chips of one value (so you wouldn’t get too many low-value chips).
I used to have a classic PDA (with Windows Mobile) on which it ran. Now it’s unfortunately broken.
Thus, I adapted the app so it would run on a normal Windows as well.
If you’re having a Poker night, feel free to use it to build equal stacks for everyone: PokerChipsForWindows.zip
Categories: Misc, Software
Tags: No tags
Comments: No comments
Windows 8 was written primarily for touch devices such as tablets and touch screen monitors.
If you’re a classic mouse and keyboard user there will be some challenges.
For example, did you know that if you want to close one of the new Metro apps, you have to push your mouse to the top of the screen until it turns into a hand and then you have to drag the app all the way down to the bottom of the screen until it disappears?
Also, the new Windows 8 is designed to have a special function in every corner of the screen. To open the Start screen you have to move your mouse into the lower left corner until a small Start screen popup appears and then click.
But what if you have two monitors and the right one is your primary monitor just like in my case? Try to quickly hit the small area on the bottom left of the right screen when the mouse cursor has a whole other screen to wander into…
That’s why I’m glad that I grew up during DR DOS and MS-DOS and still know how to use keyboard commands and shortcuts.
For example, I have not opened an MS Office program via icon in years. Not in Windows XP, not in Windows 7 and I won’t do it in Windows 8. You open the Run window via Windows key plus R (Win+R) and type “winword” or “excel” or “powerpnt” and off you go… For the Calculator “calc”, the Character Map “charmap”, the Paint program (e.g. for quick screenshots) “mspaint”, …
Luckily for me, Windows 8 brings some new shortcuts with it which can be used to open the most important functions. The keys used are not always intuitive but my guess is that the alphabet has only so many letters and many are already in use.
But nevertheless, why the function “Find Apps” has the shortcut Win+Q instead of Win+A and “Find Settings” has Win+W instead of Win+S I do not know.
So, here’s a list of shortcuts new and old that might come in handy for the usage of Windows 8:
Windows key (Win) – Formerly opened the Start menu, now opens the Start screen (no need to find the lower left corner of the screen). Press Win again and the Start screen closes.
Before Windows 8 I found this to be pointless unless you were unlucky enough to have a computer without a mouse. Now it actually becomes useful.
Win+Q - Opens the search for applications in the former start menu.
Win+W – Opens the search for settings.
Win+F – Opens the search for files.
Win+E – Opens a new instance of Windows Explorer.
Win+R – Opens the Run window.
Win+I – Opens the Settings sidebar.
Win+P – Opens the multi-screen options (e.g. to use a projector in a meeting).
Win+D – Shows the Desktop. Another press of Win+D returns all programs to their previous state (important difference to Win+M).
Win+L – Lock computer.
Win+X – Show a list of shortcuts to various system functions.
Win+C – Show the right side bar (no need to find the lower/upper right corner of the screen).
Win+M – Minimize all windows and thus show Desktop.
Categories: Misc, Software
Tags: key strokes · keyboard · shortcuts · Windows 8
Comments: No comments
20
C# CodeDom Inline Compiling
I was a bit bored just now and since the WYSIWYG editor of Wordpress 2.9.2 doesn’t work as optimal as I had hoped, I decided to write my own program that translates forum posts with BB code into HTML.
Of course I could have put all these replace functions into the code but then I would have to adapt the code every time I find a new tag.
So I thought this might be a good time to toy with the Inline Compiler of C#. And if done right, it is relatively easy.
Here’s my first Inline Compiling Code Snippet (it doesn’t contain any error handling and some such, but you get the idea how it works):
Categories: Misc, Software
Tags: .NET · C# · Inline Compiling · Microsoft.CSharp.CSharpCodeProvider · Serialization · System.Xml.Serialization.XmlSerializer
Comments: No comments
9
Windows 7
For no reason at all I kicked my XP Friday evening and installed Windows 7 Ultimate (“Never change a running system” my ass
).
Once upon a time I installed Vista, but the UOPs were annoying and my XAMPP didn’t run properly and I didn’t like it at all. So I switched back to XP.
Friday I downloaded the RTM (Release to Manufacturers) from MSDN and installed the 64bit Ultimate edition.
And I have to say, it looks and feels really good. OK, some things need getting used to. But overall it feels like a modern OS and all my programs (DVD Profiler, Visual Studio 2008, TortoiseSVN, XAMPP, Firefox, Thunderbird, … -> x64 when available) are running just fine.
Categories: Misc, Software
Tags: DVD Profiler
Comments: No comments
Now, after I’ve finished Crew Edit 2 which rips the crew data from IMDb and makes them available to DVD Profiler, I’ve decided to combine it with the well established program Cast Edit 2.
And here it is: Cast/Crew Edit 2 and Cast/Crew Edit 2 For TV Shows.
Categories: Misc, Software, Web
Tags: Cast/Crew Edit 2 · DVD Profiler
Comments: No comments
28
Crew Edit 2 for DVD Profiler
Here’s version 0.3.1.0 of Crew Edit 2:
http://doena-soft.de/dvdprofiler/3.5.1/CrewEdit2.zip
It helps you to rip IMDb crew data and insert it into DVD Profiler.
What needs to be done now is to transform/map IMDb crew roles into the ones from DVD Profiler.
For example: Fanboys.
The credit there is “Writing credits” -> “screenplay” which has to be mapped to “Writing” -> “Screenwriter”
For this you use the “EditIMDbToDVDProfilerCrewRoleTransformation.exe”.
PS: And remember: IMDb data must not (!) be contributed to the Online Database.
PPS: Cast Edit 2 and other software can be found here: http://doena-journal.net/en/dvd-profiler-tools
Categories: Misc, Software, Web
Tags: Cast/Crew Edit 2 · DVD Profiler · Fanboys
Comments: 1 Comment
8
Downgrade to Wordpress 2.3.3
At some point I got the glorious idea to update from Wordpress 2.3.2 to version 2.6.5. I was punished instantly because the WYSIWYG editor didn’t work anymore.
Luckily a few days later version 2.7 came out and I updated again. Looked nice but was terribly slow. And suddenly I got a mail from my provider that my scripts would drive the server insane and that I had to do something. So I checked all my projects and did some optimizations and whatnot because I thought the error would be somewhere in my “bricolage code”
.
But then he said: It’s your Wordpress. So I deacticated all my plugins but it didn’t help. So what did I do, I exported all my posts, killed Wordpress 2.7, did a clean install of 2.3.3 and here we are again.
And what have we learned again what we’ve never should have forgotten? Never change a running system!
Categories: Misc, Software, Web
Tags: No tags
Comments: No comments
18
Firefox 3 has been released!
Since yesterday evening the newest version of the Mozilla Firefox browser, Firefox 3, is available for download. I’ve been using the Release Candidate since it has been released and it works marvelous. Additionally the page loading times have vastly improved.
What CNN says about Firefox 3.
What The New York Times says about Firefox 3.
Categories: Misc, Software, Web
Tags: No tags
Comments: No comments
