Archives
-
Merry Christmas - Happy Newyear
It's been a while ago since I posted something, it has been very busy over here, and now exams are coming up.
But after that I promise to post something usefull again :) Maybe sooner...
But for now, I wish you all a Merry Christmas and a Happy Newyear. -
Different Actions - Same Result
This post has moved to http://blog.cumps.be/different-actions-same-result/ trying to spark some feedback with additional question.
-
BENUG Test Driven Development Session - TestDriven.NET
Today I went to a BENUG session about test driven development, and I finally got NUnitAddin to work ;)
A small recap of today:- Get TestDriven.NET-0.9.615d.msi, this includes MbUnit along with NUnitAddin already setup to work with MbUnit. No more need to edit that config file yourself. The future testing tool is TestDriven.NET ;)
- Reference Core, Framework and TestFu in your project.
- Add [TestFixture] as attribute to your class.
- Add [Test] as attribute to a method.
- Right click somewhere in the class and Run Tests, to run them all, or right click in one method to only run that one.
- Watch the Output window display success or failed, and display the report url at the end.
- CTRL+Click the url to see a detailed report (view example).
Note:
If you have installed csUnit, leave it installed! Do NOT uninstall it unless you are good enough informed about the uninstall possibly fucking up your VS.NET installation. I uninstalled it today, and poof, adding classes and everything else trough VS.NET was broken, solution, Repair VS.NET :( -
Add IE Features - New keywords (yeah, the ones Firefox users are so proud of)
Right, someone trying to convince me why Firefox is so much better than IE brought up the issue of being able to type "google searchterm" into his Adress bar and immediately being taken to the site.
Well, here's some news: IE can do that to, along with imdb, whois, vandale, php and everything else that uses parameters as query terms.
How? Look at this registry key and see the light:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\google]
@="http://www.google.com/search?q=%s"
" "="+"
"%"="%25"
"&"="%26"
"+"="%2B"
%s is where your search term comes, and the name of the key is the prefix.
Another example to get the hang of it:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\imdb]
@="http://us.imdb.com/Find?%s"
" "="+"
"%"="%25"
"&"="%26"
"+"="%2B"
Got it? Sweet, enjoy your new IE power! ;)
I have uploaded a .reg file which contains altavista, astalavista, cd, download, google, googlenl, imdb, php, sub, vandale, vcd, whois and lucky as search terms. Feel free to invent more :)
Update: Google feeling lucky keyword.
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\lucky]
@="http://www.google.com/search?q=%s&btnI=I%27m+Feeling+Lucky"
" "="+"
"%"="%25"
"&"="%26"
"+"="%2B" -
The Invisible Administrator
Today something very weird happened and I doubt something this weird will ever happen again.
I was working on a site at school when I browsed to a file-server to check some paths, and to my surprise I could suddenly access ALL shares, not only the ones for students, but all of them...
When I tried creating files they got made under BUILTIN\Administrators! But I was logged on with my own student account. So, being nice and all, I reported it...
Then we spent almost entire afternoon trying to determine why I was suddenly an admin.
And this is when the weird stuff started to happen:
On PC1 I was an admin on the server, but when I logged in to PC2 I couldn't access it.
We tried different student accounts on PC1 but they also couldn't access the shares.
Then we removed all groups from my account except Domain Users, and I still could get in.
We cleared the profiles from PC1 and 2 and also deleted my roaming profile.
Nothing changed...
First conclusion: It's tied to username X and PC1, examine PC1 later.
Then we go to another room and try it on different computers. And there it starts all over again.
PC3: I'm an admin, PC4: I'm not.
In the end we checked all groups I belonged to, and their membership, deleted my profile, checked all NTFS permissions (which I could change as well..), and nowhere there was a trace of me or any groups I belonged to. Nothing had admin rights.
We forced replication to make sure I was group-less but it still worked!
Conclusion: User X has the rights of an Admin, but does NOT show up in any group, NTFS permissions or anything else...
Solution: We disabled the account and created a new account.. (Which means I have to recreate my entire profile again...)
Has anyone else every encountered this, and found out why this was happening? -
Six Invites to the Most-Hyped-Mail-Service-Of-The-Year, aka GMail
Ah, well, 11 blog posts on a day is fine as well :p
With all those people giving away GMail accounts, I got 6 as well.
I got one someday, never used GMail, but hey, I can give them away.
There's too much hype around it, and I'm really not into webbased mail when I just can read it from Outlook.
But anyway, if you want one, it seems I have to supply a First and Last name and an email adress, so, the first 6 people who supply them in the comments get an invite.
Update: I just got 5 more invites, will update post when they're all given out...
Update2: All gone, closing comments -
Fix Outlook Contacts Phone Number "+32" with C#
I own a Sony Ericsson T630 and manage my contacts with Outlook trough Bluetooth.
This has the side side-effect that I finally started adding everyone I might need to contact to my Contacts, before that I just picked an email and used the Reply-To ;)
But there is one thing that bothers me, I store my numbers in international format (eg: +32 50 .....), but Outlook always removes the + in front of it, and I can't find how to change that. And my phone needs the +!
So I wrote a C# tool that would let me fix my contacts.
You can download it here and read the full article here. -
Fix Outlook Contacts Phone Number "+32" with C#
I own a Sony Ericsson T630 and manage my contacts with Outlook trough Bluetooth.
This has the side side-effect that I finally started adding everyone I might need to contact to my Contacts, before that I just picked an email and used the Reply-To ;)
But there is one thing that bothers me, I store my numbers in international format (eg: +32 50 .....), but Outlook always removes the + in front of it, and I can't find how to change that. And my phone needs the +!
So, let's write a tool to fix this.
First we need a reference to Outlook. So add a reference to 'Microsoft Outlook 11.0 Object Library' (or 10.0, if you use 10.0 leave a comment if this source worked for you!)
When you did this you'll have two new reference, just remove the Office Core... so that you have something like this:
Our application has a very simple logic, where the Main controls it all.1using System;
First we get the folder where our Contacts are stored.
2using System.Text.RegularExpressions;
3using System.Collections;
4using System.IO;
5using System.Diagnostics;
6using Outlook = Microsoft.Office.Interop.Outlook;
7
8namespace FixContacts {
9 class FixContacts {
10 static void Main(string[] args) {
11 // TODO
12 }
13 } /* FixContacts */
14} /* FixContacts */1 //string contactFolder = @"Cumps David\Contacts";
Then we open Outlook and get the folder.
2 Console.Write("Contact Folder: ");
3 string contactFolder = Console.ReadLine();1 Outlook._Application appOutlook = new Outlook.Application();
When we have the contact items, we loop over everyone of them, checking if there is a number to be fixed.
2
3 Outlook.NameSpace olNS = appOutlook.GetNamespace("MAPI");
4 olNS.Logon("", null, null, null);
5
6 Console.WriteLine("Searching Folder...");
7 Outlook.MAPIFolder olContactFolder = GetFolder(contactFolder);
8 Outlook.Items olContactItems = olContactFolder.Items;1 Console.WriteLine("Fixing Phone Numbers...");
Finally, we clean everything up.
2 foreach(Outlook.ContactItem olContact in olContactItems) {
3 CheckNumbersToReplace(olContact);
4 }1 olNS.Logoff();
First the GetFolder method. This will get us our folder we specified with a path.
2
3 olContactItems = null;
4 olContactFolder = null;
5 olNS = null;
6 appOutlook = null;
7 Console.WriteLine("Done");
8 Console.ReadLine();
Again we open Outlook. Then we split the path into the corresponding folders and we look for the root folder.1Outlook._Application appOutlook = new Outlook.Application();
When we have found our root folder, we will look for our first folder and when we find it, we replace our parent object by that folder and go looking for the next folder.
2Outlook.NameSpace olNS = appOutlook.GetNamespace("MAPI");
3olNS.Logon("", null, null, null);
4
5Outlook.MAPIFolder olFolder = null;
6folderPath.Replace("/", @"\");
7string[] arrFolders = folderPath.Split('\\');
8
9foreach (Outlook.MAPIFolder olTmpFolder in olNS.Folders) {
10 if (olTmpFolder.Name == arrFolders[0]) {
11 olFolder = olTmpFolder;
12 break;
13 }
14}1if (olFolder != null) {
And in the end we return our found folder after cleaning up.
2 for (int i = 1; i < arrFolders.Length; i++) {
3 Outlook.Folders olFolders = olFolder.Folders;
4 olFolder = null;
5
6 foreach (Outlook.MAPIFolder olTmpFolder in olFolders) {
7 if (olTmpFolder.Name == arrFolders[i]) {
8 olFolder = olTmpFolder;
9 break;
10 }
11 }
12 olFolders = null;
13 }
14}1arrFolders = null;
Now the CheckNumbersToReplace method, this is a simple one.
2olNS = null;
3appOutlook = null;
4return olFolder;
We create an ArrayList where we will add every phone number in the contact that starts with our contry prefix.1 private static void CheckNumbersToReplace(Outlook.ContactItem vContact) {
Next we check every phone entry if it contains the prefix. (I only show one of them now)
2 ArrayList phoneNumbers = new ArrayList();
3 string countryPrefix = "32";1 if (vContact.HomeTelephoneNumber != null) {
When we looked over all phonenumbers, we will build a new vCard with the correct information in it, that is, our numbers prefixed with a +.
2 string phoneNumber = vContact.HomeTelephoneNumber;
3 if (phoneNumber.Substring(0, 2) == countryPrefix) { phoneNumbers.Add(phoneNumber); }
4 }1 if (phoneNumbers.Count > 0) {
As you can see, we create a temporary vcard for this, and then launch it, you only have to press Save on it, and it's saved. As this is just a personal tool I didn't have the time or requirement to look into automatically saving it. In the end we delete the temporary file.
2 string vCardLocation = "";
3 Outlook.MailItem vCardMail = vContact.ForwardAsVcard();
4 Outlook.Attachments vCardArray = vCardMail.Attachments;
5 foreach (Outlook.Attachment vCard in vCardArray) {
6 vCardLocation = Environment.CurrentDirectory + @"\" + vCard.FileName;
7 vCard.SaveAsFile(vCardLocation);
8 foreach (string phoneNumber in phoneNumbers) {
9 FixNumber(vCardLocation, phoneNumber);
10 }
11 }
12 vContact.Delete();
13 Process launchvCard = new Process();
14 launchvCard.StartInfo = new ProcessStartInfo(vCardLocation);
15 launchvCard.Start();
16 launchvCard.WaitForExit();
17 File.Delete(vCardLocation);
18 }
The FixNumber method is a simple search and replace in the vCard file.1 private static void FixNumber(string vCardPath, string phoneNumber) {
And that is our FixContacts utility. It opens the contact dir, scans the contacts, check for phone numbers and fixes them if necessary and pops them up with the correct information, after which you only have to press Save.
2 if (File.Exists(vCardPath)) {
3 StreamReader readvCard = File.OpenText(vCardPath);
4
5 string vCard = readvCard.ReadToEnd();
6 readvCard.Close();
7 vCard = vCard.Replace(phoneNumber, "+" + phoneNumber);
8
9 StreamWriter writevCard = File.CreateText(vCardPath);
10 writevCard.WriteLine(vCard);
11 writevCard.Close();
12 }
13 } /* FixNumber */
Good enough for me, me phone and Outlook playing nicely together with this.
Full sources and executable are uploaded again. Enjoy. -
Blog-post record - Using ndiswrapper
Wow, apparently I made 8 blog-posts today (9 now), that's a record ;) Well I've been away for a while as well, so..
Busy holiday, little time for computer, and plenty of new projects, a new laptop, airport express, all the toys ;)
I guess it'll be a bit more quiet the coming days, as I said everything today ;)
But to give this post some information, here's how to set up a Dell truemobile 1450 under linux. (I got it working under Fedora Core 2)
Get ndiswrapper and the .exe file that came with your card.
Extract the exe to a location on your disk
Install ndiswrapper (make install)
Install the driver (ndiswrapper -i bcmw15a.inf)
Check if it worked (ndiswrapper -l)
If it worked, check iwconfig to see wlan0
Now set up your wlan
iwconfig wlan0 mode managed
iwconfig wlan0 key open 12345..6 (your hex WEP key)
iwconfig wlan0 channel 11 (your channel)
iwconfig wlan0 essid HEAVEN (your essid, without quotes)
You can test with iwlink wlan0 scan (I believe) if it finds your AP.
I found that when you are unable to set your essid, it is because your WEP key is invalid. I don't know WiFi tech enough, but it seems that you only need a valid WEP key and it'll find your wlan.
If it's associated, bring it up with ifup wlan0 and it'll get an ip trough dhcp.
It took me a while, especially the essid part. Also sometimes it can bark at you when trying to set your key, then you have to do:
iwconfig wlan0 key open
iwconfig wlan0 key open 12345..6 (your hex WEP key)
Don't know why, but that solved it. -
Open Java and .NET Programmer functions
Ulysses Consulting recently contacted me asking if I didn't knew anyone for the following positions:
- Java Programmer
- .NET Programmer
If you want to apply contact me and put Ulysses in the subject. Include your contact details and which function you're going for and I'll forward the info. -
New site for Dutch teachers - Lerarenforum.be
In case there are some Dutch teachers reading this, I just finished a forum site exclusively for teachers...
It's a project of Kurt Meuleman, a teacher himself, who wanted to have a forum for the entire Dutch-speaking teacher-community, and today it's officially open.
Basically it's phpBB with a self-created theme and some mods. I'm convinced that with his motivation it could become something, should be on Radio 1 soon normally ;)
The address? http://www.lerarenforum.be -
Stream Music over WiFi - JustePort - .mp3 support needed
Right, about 2 weeks ago Jon Lech Johansen released Justeport, a tool to stream your Apple music files to your Airport Express.
His site went down almostly as soon as the big news sites picked it up, and the source of Justeport couldn't be downloaded.
I also didn't see much blogging about this, which is strange, because his tool is written in C#!
A few days ago I got an Airport Express and now I'm streaming .mp3 to it from iTunes (on Windows) but I have to use iTunes, and that's not something I like, making me go away from Winamp...
But JustePort can not stream .mp3 files to it, but the source is available (and here is a mirror), so maybe there is someone with a better understanding of handling music files in C# who could write something to stream .mp3 to it.
Hopefully there will be a Winamp plugin someday to do this.
It's a great piece of technology, a very small WiFi AP which you can plug in to an electric outlet and to your stereo and stream music to it through the air.
I guess if someone has too much time on his hands and wants a challenge, this is one, writing an mp3 player that can stream to the Airport Express (with volume control, play, pauze, prev, next and playlist support ofcourse ;))
If someone is up to it, and needs someone testing it with an Airport Express, contact me and I'm willing to help you. -
Random Wallpaper through Scheduled Tasks
With my new laptop I got a screen with a 1920x1200 resolution, so I went out looking for wallpapers for the resolution, because my existing ones degraded in quality with that size.
My search led to Deaddreamer from which I have my current wallpaper as well.
But nowadays he got so many good ones, so I picked up 5 1600x1200 wallpapers. And now I want a random wallpaper each time I logon.
Having some spare time (very rare) I created something small myself, I'm sure there are tools out there to do all that.
Originally I wanted to use PHP to get a random number and set the wallpaper, and then call the php script with a bat file and set it as a scheduled task. But that kept popping up a dos prompt each time it set it, and my wallpaper disappeared after boot (some bad registry settings).
So I used KiXtart to set the wallpaper and then link it with a shortcut which would run minimized.
That worked for one paper, but when I tried the RAND function in KiXtart, it didn't go well.. But I had the php script and bat still there so I let that make a random number and then kill the KiX script with that number as argument.
Result:
Shortcut to wall.bat, which calls wall.php, which makes a random number and calls wallpaper.kix with the number, after which my wallpaper is set, and saved in registry.
I have to shortcut Run as minimized and on logon and every hour, and now I got a nice random wallpaper implementation.
Overly complicated? Maybe, If you have php installed, it's a small solution, otherwise you need a 1.3Mb dll and 24k php.exe in the same dir, which isn't really something bad.
I have zipped everything and written the steps to install it out in a Readme.txt for everyone wanting it as well. I also included the php.exe and dll.
Download it here: RandomWall.zip (706Kb).
And now I have sweeeet super-detailed wallpapers auto-changing without any special timer programs running, but just the Scheduled Tasks :)
Here are my wallpapers:
ddr_0075_vertical_theory_pure.jpg
ddr_0075_vertical_theory_decay.jpg
ddr_0088_v1r2a_1600x1200.jpg
ddr_0091_bioforge_1600x1200.jpg
ddr_0086_21st_century_kaos_1600x1200.jpg
(convert them to .bmp first, not sure if it's required, but whatever, bmp is nicer, no need for desktop to go in Web mode) -
Hacking Uxtheme.dll - Watercolor Theme
One thing I immediately do on a new pc is get it personalized. This includes changing icons and wallpapers, but also resource hacking the run box and hacking the uxtheme.dll to support custom themes.
Today I'll talk about implementing the Watercolor theme I have been using for a year now, and got a lot of mails on where and how to get it.
First you have to modify UXTheme. This used to be somthing "difficult" but now it's easy. Get the UXTheme Multi-Patcher and run it.
As always, and on the left side of the blog, I'm not responsible if something goes wrong, everything you do is your responsability.
Normally, according to the page I just linked, this doesn't work on XP SP2 final, but I ran it anyway and it worked. Just make sure you wait for the Windows File Protection box to come up.
Next you get the Watercolor theme, unzip it and run WatercolorLitev211.exe, it'll install the theme and you can select it from the Desktop Configuration control panel. It packs with several colors, I either have it set to Blue or Ergonomic.
Enjoy your sweet new theme :p
A screenshot from a previous posting demonstrating the theme: -
New Student Site - Interview with Jan Tielens, Wouter Sergeyssels, Patrick Verbruggen, Tom Mertens and Gerd De Bruycker
During the holidays I recreated our internal school site, and reformed it to a place for students.
And one nice thing for everyone is: it's public from now on!
Well, actually, let me explain. The informational part is public, with the interviews, news, pictures, etc...
The (new) community is also publically viewable, but not registerable.
And students of our school get extra features, like accessing their homedir from home, reading plenty of internal school stuff (like, when not to waste time coming to school when somebody is sick :p), along with the ability to join the community.
One small disadvantage for a lot of readers... It's only available in Dutch.
If that isn't a problem for you: visit Studnet!
What does this has to do with IT (besides the creation)?
Well, it has an interview section on it, for which I did 5 of them already, and they are about IT. Here are the links:
Jan Tielens - About the tasks of a .NET architect.
Wouter Sergeyssels - A look inside a hosting company, Nucleus.
Patrick Verbruggen - Processes and the future of programming in the Western world.
Tom Mertens - Installers and the future of passwords.
Gerd De Bruycker - Microsoft Communication Channels (MSDN, TechNet, several magazines, user groups, MVPs, ...) and how it is to work for Microsoft.
If there are other Dutch-speaking people reading this and who believe they would add value to the site with an interview, please contact me. The target group is students, preffered interview channel is MSN/ICQ. -
Windows XP Pro and IIS5 - Multiple Sites
I recently got a new laptop (Dell Inspiron 8600) and installed Windows XP Pro on it (with SP2 installed already, yes :p).
One thing I hate about this, is that it includes IIS5 and you can't install IIS6 on it (not that I know of).
Why is this bad? Because you can only have one site... Which is something I got way to much used to running Windows 2003.
Luckily enough, Davy Belmans thought the same, so he developed IIS Admin.
It's a very nice tool, very small, and sits in the tray bar, allowing you to easily add new sites, and switch between them.
Yes, switch, because even with multiple sites configured, you can only run 1 at the same time apparently.
If you run Windows XP, and you don't have a way to get multiple sites working, get this tool, otherwise, comment and tell me how ;) -
BENUG Hands-on workshop on TDD - Location Info
On 9 September 2004 there is a Hands-on Workshop on TDD organized by BENUG.
The location info only indicates directions for cars though.
I just called Compuware to get some info for train- and bus info. So, everyone coming by train, this is what I got:
Get the train to 'Leuven'.
Overthere is a bus with number 358, every 20 minutes.
Take that bus and it should stop right at a Q8 station, right after it passed a firemen-building.
It should stop right in front of Compuware.
I'm going there by train ;) Hopefully I'll find it easily. -
Nothing compares to you...
int you = new int(), nothing = new int();
-
Bad IT people
First of all, sorry for not posting much lately. It's a very busy time, I just finished working for a month, gonna buy a new laptop, a Dell.
Didn't have that much time (and energy) to do much computer related things, and if I did something it wasn't worth blogging about it (and yes, I usually set my standards pretty high :p)
But here is a little teaser, a small list I gathered some years ago, all based on true events:
Bad IT people:
- Can not press CTRL-ALT-DEL properly
- Lose their command prompt
- Can not configure their e-mail client
- Do not understand <form>
- Can not put RAM in the right memory banks
- Do not understand https://
- Can not install & configure IIS
- Deny that Google is the best search engine
- Can not use command line 'ftp'
- Do not understand what dual-boot means
- Can not open a .pdf file
- Forget to check the power supply on failure
- Can not use MS Excel
- Believe that MSN is the only IM
- Do not know the difference between their LAN IP and external IP
- Are scared when their cpu load is at 100%
- Do not know what extensions are
- Put their pencil in a pc cooler
- Believe that Hotmail is a program
- Can not see extensions
- Destroy their mobo and CPU by installing a printer
- Do not know what their source code is
- Can not open unknown files
- Burn 1.8Mb on a 700MB CDR
- Do not known what a proxy is
-
Microsoft Link Resources
I just started collecting various links about Microsoft that might be usefull to someone.
You can find the current collection at http://microsoft.zoekinfo.be.
If you have a link you find usefull and believe it would fit on that page, please leave it behind in the comments!
Thanks -
Tweaking the Run Box (Windows Resource Hacking)
Time for a new article, but not about C# this time.
This time it's about Resource Hacking, more particulary, we'll customize the Windows Run box so it will look something like this:
If you're interested, take a look at the article: Custom Run Box (Resource Hacking). -
Custom Run Box (Resource Hacking)
It's time for a new article, but not about C# this time. I'll tell you how to modify Windows, we'll change the Run box and make it look like this:
We'll begin by copying shell32.dll to a safe place.
First of all the disclaimer: This article is purely informational, you don't have to do anything because I tell so, everything you do is on your own risk and I am not responssible when anything goes wrong.
With that out of the way, grab the tools if you don't have them yet:
Copy it two times, one which we'll be editing, and one which is a backup.
Open it in ResHacker and you'll see a list on the left side showing all available resources.
Now select the 'Dialog' resource, and look at 1003. You'll notice it's the Run box.
We'll start by adding a bitmap to place on our Run box. Go to 'Bitmap' and select 'Action', 'Add a new Resource'.
Here you select a bmp file and give it the name RUNGFX. You can get the bmp I used here: Runbox.bmp.
Press 'Add Resource' and now you can see it's added.
Now we'll go back to the 'Dialog' 1003, 1033 and replace the existing script with this one:
1003 DIALOGEX 0, 0, 188, 83
STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION ":: run ::"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS SHELL DLG"
{
CONTROL "", 12298, COMBOBOX, CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 3, 53, 181, 198
CONTROL "R", 12306, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 21, 90, 1, 1
CONTROL "Run", 1, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 3, 67, 59, 14 , 0x00020000
CONTROL "Cancel", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 63, 67, 59, 14 , 0x00020000
CONTROL "Find", 12288, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 124, 67, 59, 14 , 0x00020000
CONTROL "RUNGFX", 0, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 3, 181, 48
}
To make your life easier, and to be sure you don't make a mistake due to your browser word wrapping the script, copy paste it from this text file: runscript.txt.
When you have replaced it you press 'Compile Script'.
And now you'll see the preview has changed to our new runbox!
Press CTRL+S to save the modified dll.
The last thing we need to do is to use Replacer to replace our existing shell32.dll in SYSTEM32 with our new file. You can't just copy it in there because Windows File Protection would replace it with a backup. Therefore we use Replacer, just follow the instructions Replacer shows and you'll be fine. Replacer also prompts you to make a backup, make sure you make one, you never know what can go wrong.
When the file is replaced (Replacer replaces the file itself along with the one in dllcache) you have to reboot and when everything went fine, you now have a new Run box! A really good looking one, different from everyone else.
Some notes:
If you move the controls around, make sure to not place any above or behind the bitmap, it could give problems. Also don't include a bitmap bigger then your box. Make sure you leave a bit of spaces from the edges, when you put the bitmap against the border, it won't show up. -
Microsoft Products & Games
If anyone needs a link to a Microsoft product or game, check these out:
- http://microsoft-producten.zoekinfo.be/
- http://microsoft-games.zoekinfo.be/
Had some spare time left :) -
Drivers License Progress
Today I took the theoretical drivers license exam. And I passed it! With 0 mistakes! :)
The only thing that's left now is the practical exam. But that's still a couple of months away. -
New Religion
This post has moved to http://blog.cumps.be/the-bits-bytes-religion/ with additional info and pictures.
-
ConvertToProperties Macro
For everyone who received .NET Magazine #5, there's an article in there at page 53 about cleaning up your code.
Jan Tielens mentions a ConvertToProperties macro, which is really sweet!
But there has been a printing error or something, the link went missing on page 55 in the bottom box. (http://xxx/...)
So, here is it: Create Property Macro for C#.
The version on the site doesn't correspond to the screenshots, it doesn't use mVariable (any more?), but replaces it with _variable (which I prefer).
Be sure to get this macro! It saves you a lot off time ;) -
Passed another year!
Exams are over and I got my results. I passed with 'Highest Distinction', you can only guess how happy I am :p
Dutch details at: www.cumps.be
Now only a half year of school left, and then it's time to do an interim at a company :) -
Passing bitwise OR enum values
Everyone who has ever used a Regex knows this form of parameter:
1Regex r = new Regex("", RegexOptions.Singleline | RegexOptions.IgnoreCase);
I often wondered how to do that as well and because nobody ever taught me that at school, I had to figure it out myself. And today I did, and I'm sharing :)
This is very usefull if you have a class that takes a lot of options and you don't want to add a bool for each possible option.
First you need to create an enum with the possible options, and number them binary. (eg: 1, 2, 4, 8, 16, ...)1 public enum Pars {
Next you need to have a method which takes this enum as a parameter, after which you can extract each of the possible options from it with a bitwise AND:
2 One = 1,
3 Two = 2,
4 Three = 4,
5 Four = 8,
6 Five = 16,
7 Six = 32,
8 Seven = 64
9 } /* Pars */1 private static void TestPars(Pars options) {
When all this is done, you call the method, passing the options you want with a bitwise OR between them, like this:
2 if ((options & Pars.One) == Pars.One) { Console.WriteLine("One"); }
3 if ((options & Pars.Two) == Pars.Two) { Console.WriteLine("Two"); }
4 if ((options & Pars.Three) == Pars.Three) { Console.WriteLine("Three"); }
5 if ((options & Pars.Four) == Pars.Four) { Console.WriteLine("Four"); }
6 if ((options & Pars.Five) == Pars.Five) { Console.WriteLine("Five"); }
7 if ((options & Pars.Six) == Pars.Six) { Console.WriteLine("Six"); }
8 if ((options & Pars.Seven) == Pars.Seven) { Console.WriteLine("Seven"); }
9 } /* TestPars */1 static void Main(string[] args) {
This example will print Three, Five and Seven.
2 TestPars(Pars.Three | Pars.Five | Pars.Seven);
3 }
How does it work internally?
Here are the rules for the bitwise operators:
Bitwise OR:
0101 (expression1)
1100 (expression2)
----
1101 (result)
Bitwise AND:
0101 (expression1)
1100 (expression2)
----
0100 (result)
Now, our enum has the following binary values:
1 - 0001
2 - 0010
3 - 0100
4 - 1000
...
If for example we pass the options One and Two along, we combine them with the bitwise OR, creating 0011.
And if we want to check if Four was passed along, in our if we check if the options combined bitwise with Four result in Four.
0011
0100
----
0000
Four was not passed.
If we check with Two we get the following:
0011
0010
----
0010
And 0010 = Two, our if = true, and Two was passed along.
A lot of you will say "well duh, that's basics". Could be true, but I never learnt it at school, and never ever had the need for it, but now I wanted to know, and I guess there are more people out there who haven't learnt it either. -
Personalizing Outlook Today
This post has been moved to http://blog.cumps.be/personalizing-outlook-today/ and updated with Outlook 2007 information and additional Outlook Today configuration options.
-
Troubleshooting DotNetNuke 2.1.2 Installation
I had a lot off trouble installing DotNetNuke. This popular portal application kept me busy for an entire afternoon and night.
First I got ASP.NET errors about columns missing in tables, then about stored procedures. When those were gone, the application itself managed to hang IE.
So, for everyone else who might be suffering from this, or will give it a try and encounters the same, here's my installation guide for 2.1.2:
The SQL errors occured when using SQL Server as Data Provider, the IE errors always occur.
This step is for everyone using SQL Server:
- Download DotNetNuke_2.0.4.zip.
- Extract this, follow the normal installation procedure, this version doesn't give any problems.
- Open the site so that it creates the tables and stored procedures.
- Download DotNetNuke_2.1.2.zip.
- Delete all files from 2.0.4 but keep your SQL Server tables.
- Extract 2.1.2 in the same location.
- Open the site, now you got passed the missing columns errors!
- Download DotNetNuke_2.1.1.zip.
- Extract this to a temporary location and get the file spmenu.js from controls\SolpartMenu.
- Copy this file to 2.1.2 overwriting it.
- You now fixed the IE errors!
Let's hope future versions don't require so much hasstle. -
Won at the DigiKids 2004 Awards!
I'm happy! A site I created for someone has won a price at the DigiKids 2004 Awards.
I heard there were 120 submissions, and the one I created ended up with the 10 best sites! This is a very nice extra as a student, now I can tell something I coded lasted between 120 others! :)
The results are in Dutch, but if anyone is interested: Prijs van de Minister van Onderwijs - Communicatorprijs.
Some extra info about the site: Connectedly -
Unable to launch notepad from 'Run' or view HTML source
Today I experienced something weird.
Normally I run a lot of files just from 'Run' (Win+R), but today I did 'Run', 'notepad', and nothing happened...
This was weird.. As I could still open .txt files with Notepad.
I could not run notepad from 'Run'! I was amazed, I mean,.. what could break notepad? :)
First I checked if the file was still there (ofcourse, how could I still view files otherwise..), and if my PATH variable still included Windows. Everything seemed ok.
But then I found it, it only seemed as I could not run notepad.
What happened was the following: There was a notepad.com file in the system32 dir all of the sudden (spyware, virus, don't know). And Windows decided to run that one instead of notepad.exe
So it seems Windows prefers .com over .exe when trying to run a file without an extension.
Why does this happen?
There's another environment variable, called PATHEXT, with the following data:
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
Now you can clearly see the order of the files. I tried the same thing with a .bat and .exe file, and changing the env var, and it worked.
I'm not sure if the .COM has to be the first in line for normal system operations?
One side-effect of this was that when I wanted to View Source of a HTML page, it would also launch the notepad.com which did nothing, and thus not showing any source! I remember a lot of people complaining about not being able to view the source of their pages, this could be what's causing it!
Hopefully I'm telling something 'new' here, that's usefull ;) I never knew that order of extensions. -
It's just an act of God, nothing special...
Sometimes you wonder if there is someone who reads the End User License Agreement...
If found this on the McAfee Security website:
YOU HEREBY ACKNOWLEDGE THAT THE SOFTWARE MAY NOT BE AVAILABLE OR BECOME UNAVAILABLE DUE TO ANY NUMBER OF FACTORS INCLUDING, WITHOUT LIMITATION, PERIODIC SYSTEM MAINTENANCE, SCHEDULED OR UNSCHEDULED, ACTS OF GOD, TECHNICAL FAILURE OF THE SOFTWARE, TELECOMMUNICATIONS INFRASTRUCTURE, OR DELAY OR DISRUPTION ATTRIBUTABLE TO VIRUSES, DENIAL OF SERVICE ATTACKS, INCREASED OR FLUCTUATING DEMAND, ACTIONS AND OMISSIONS OF THIRD PARTIES, OR ANY OTHER CAUSE REASONABLY BEYOND THE CONTROL OF THE COMPANY.
Since when do we include acts of God in an End User License Agreement? -
Gatekeeper 2004 is over!
The Gatekeeper Test 2004 is over! EricM is the winner with 4680 points!
It was a nice contest, too bad I wasn't on time each day to catch the bonus points, but I did learn some new things :)
In the end, I'm quite happy! I finished on position 102 with 3950 points.
Can't wait for the next Gatekeeper, hope to do it even better in 2005 ;) -
Accessibility Guide on Webdevelopment
I discovered a very usefull Accessibility Guide on websites today.
It describes the actions we, as developers, have to take to make our sites more accessible to blind people, people without javascript, console browsers and slow modem users.
I found it very usefull, and in the future I sure will try to follow most of those guidelines. -
New site launch! PC Guru!
Today I launched a new site, called PC Guru.
It's a Dutch-only website about hardware. Oriented to beginners, but it contains usefull information for advanced users as well.
You could see it as a complement to Partrick Verbruggen's XP Guru, which deals with Windows XP problems.
We both use dasBlog to power the site, they're both oriented to the Dutch-talking community, and use a similar structure.
Be sure to check it out once, and give it to your friends when they have a problem :) -
.NET Magazine - Edition #5
I just received mail that a new edition of .NET magazine will be available soon. Edition number 5.
It's a Dutch-only magazine, freely available to everyone in The Netherlands and Belgium.
So if you're not registered yet, go check it out!
Edition #5 is going to talk about Whidbey, Indigo , XP SP2 and lots more. I've received the other magazines as well, and it's good! -
Abit motherboard killed RAM (Abit IT7-MAX2)
I don't like Abit anymore. There you go, I said it. Why? My motherboard killed a RAM module. (My motherboard is an Abit IT7-MAX2)
A bug in the BIOS, or a hardware problem, I got lost in the possible causes. In the end it did kill my memory.
The motherboard set the memory bus at 178Mhz, while it supports PC2100 memory, but PC2100 memory can't handle that speed, PC2700 even has problems with it.
I had 2x 512MB PC2700, and then, one died. So far for the auto-detect options of the motherboard.
Cold boot was impossible, I had this issue once before and then they advised me to replace my PSU, that worked last time, although it must have been coincidence because it was a memory issue.
The motherbord displays an A7 and AF error on it's led when it stops booting, and this is offcourse undocumented by Abit, only forums help. There I learnt it was a hardware issue, allong with all the details.
Solution? Go into the bios and remove the auto detect options and set everything manually.
H/W Strap should be set to Low 1:1, PCI to Fixed 33Mhz, and your multiplier and FSB to whatever is needed for your CPU.
One problem though, if I can't boot, I can't change anything in my BIOS. :(
So, off to the store it was, bought myself 2 x 512MB PC3200 and everything is working again. The old memory module is dead.
So far the worst part, motherboards killing memory. Now more of the undocumented stuff.
I had one module of 512MB still here, so I tought, 1.5GB of ram, nice!
I insert 3 x 512MB, and what does the BIOS see? 1GB...
I switched modules around, inserted them one by one to make sure none were damaged, but my motherboard refused to see all three of them.
The website states it supports up to 2GB of ram, and it has 3 memory banks.
But now for the undocumented part: the motherboard only supports 4 sides, so you can have 2 dual-sided memory, or 1 dual-sided and 2 single-sided. But you can't have 3 dual-sided modules. But guess what, almost all ram is dual-sided. Solution? You have to buy 2 x 1GB, which is expensive.
It seems Abit likes to sell, but when it comes to helping they believe their products are flawless, while they are not.
My advise: Don't but an Abit motherboard, I sure won't but them anymore. Take an Asus or something.
Here is a 11-page thread about this problem, that show the true nature of Abit. -
Controlling a Usercontrol from another Usercontrol
Today I received a question on how to make a usercontrol visible from another usercontrol. You could also see this as: "How could a usercontrol control everything from another usercontrol?"
Normally you wouldn't do this kind of stuff (at least not in my opinion). Usercontrols are to ASP.NET what modules were for VB6, and just like another class, they should function without knowing what's outside their borders, like small functional containers.
Let's take a look at this. First I created a normal page, Default.aspx, and I also made two usercontrols, Control1.ascx and Control2.ascx.
Control2.ascx only has a label, and Default.aspx contains the two usercontrols (named UControl1 and UControl2). Control1.ascx has a button on it, called cmdMakeVis.
First I tried making UControl2 as a public property in Default.aspx, and accessing it from UControl2 through there, unfortunately that gave me an object reference not set error.
My second attempt turned out fine though:
I took the Default.aspx page out of the Context.Handler and searched for UControl2 on it. If I would find it, I could control it. Good thing it worked ;)
Here's the code the button contains:1private void cmdMakeVis_Click(object sender, System.EventArgs e) {
I also uploaded this small test project as an illustration.
2 TestSite.DefaultPage Default = (DefaultPage)Context.Handler;
3 TestSite.Control2 UserControl2 = (Control2)Default.FindControl("UControl2");
4 if (UserControl2 != null) {
5 UserControl2.Visible = true;
6 }
7} /* cmdMakeVis_Click * -
UPX - the Ultimate Packer for eXecutables
A tool I used a lot on my .exe's when creating VB6 applications is UPX (which stands for the Ultimate Packer for eXecutables).
This is a very valuable .exe that you can just drag-drop your .exe's on and it'll compact them (and make it a bit harder for newbies to decompile your program).
Ofcourse there are Unpackers for the people who really want to decompile your application, but you can at least enjoy the compression that UPX does. I used it on my last project file and it went from 208KB to 77KB.
I used the upx 1.24 windows console version. -
VBDOX - Documentation Generator for VB6
A long time ago I talked about how great NDoc is.
Quick reminder:
NDoc generates class library documentation from .NET assemblies and the XML documentation files generated by the C# compiler (or with an add-on tool for VB.NET).
I love the tool, I use it for all my documentation in .NET projects.
A few days ago, I had to make a Visual Basic 6 project. And one of the requirements was a documentation. Knowing about NDoc, I went looking for something similar for VB6. There are a lot off tools out there, commercial and free.
But VBDOX is the best in my opinion. It generates the same MSDN style documentation, as HTML with the possibilty to compile it into a Windows Help file.
It can use an XML style of commenting, and quickly parses it and generates the documentation.
This resulted in a very nice documentation for my project. -
Writing Secure ASP.NET Session - Dutch
It has been a long time since I posted something, but here I am again. It's a very busy time right now, some exams, loads of school tasks, some websites, etc..
And also, a talk I had to prepare for class. One that I'm going to share with you.
I'll have to dissapoint non-Dutch readers though, the slides are writting in Dutch, as it was a local session. You could always look at the code though.
The subject was 'Writing Secure ASP.NET'. Covering :- Cross-site Scripting
- SQL Injection
- Hashing passwords
- IOPermissions by default
- Unsafe DSN (DSN with password included)
You can find all files here: SecureASPNET.ppt (227k) and Demo.zip (205k).
-
Codezone Magazine
I just received the 01/2004 edition of the Codezone magazine.
If you aren't subscribed yet, go get it now! (yes, it's free)
It's written in English. And I believe it comes from Microsoft Germany (at least, that was where it came from on the enveloppe). -
Using NUnit - Error Reporting To The EventLog
I started working with NUnit a couple of days ago and here is my first attempt at creating something in this new style:
Error Reporting To The EventLog - NUnit.
It's very weird to switch to Test Driven Development, still have to get the hang of it.
If anybody has any comments on what I created so far, if it's good or bad, please say so, I'd like to know if that's the way others use NUnit. -
Error Reporting To The EventLog - NUnit
For this article, we're going to write a class to write to the EventLog. To allow us for easy error logging.
I'm going to use NUnit as well to test our class. You can get NUnint at http://www.nunit.org/. Install it.
Start by creating a new project called 'EventLogTests', this is a class library. Add a reference to nunit.framework.dll located in the NUnit bin directory.
Throw out the constructor and add the attribute TestFixture to the class. This will tell NUnit about a new set of tests.1namespace EventLogTests {
Now we'll add a method called Initialise, which we mark with the SetUp attribute. This method will be run at the beginning of each test. In here we will create our EventLogger object (which doesn't exist yet).
2 using System;
3 using NUnit.Framework;
4 using CumpsD.Tools;
5 using System.Diagnostics;
6
7 [TestFixture()]
8 public class EventLogTests {
9
10 } /* EventLogTests */
11} /* EventLogTests */1private EventLogger _ErrorLog;
Next thing is setting up NUnit. You can find Visual Studio add-ins vor NUnit, but as I'm having some problems with getting them to work properly I'm using an alternate method. Go to the project properties, configuration properties, debugging. And set Debug Mode to Program, and Start Application to nunit-gui.exe, each time we'll press F5 NUnit will now launch.
2
3[SetUp]
4public void Initialise() {
5 this._ErrorLog = new EventLogger("MyCatastrophicError");
6}
The way of test driven development is to first write a test that fails and then add some code to make the test pass. We have already written a failing SetUp, because the EventLogger class doesn't exist yet, this counts as a failed test as well. So, let's make it pass.
Create a new class library called EventLogger and create the constructor.1namespace CumpsD.Tools {
Let's create our first test. We want to read an EventLog.
2 using System;
3 using System.Diagnostics;
4 using System.Runtime.Serialization;
5 using System.Runtime.Serialization.Formatters.Binary;
6 using System.Security;
7 using System.Security.Permissions;
8 using System.Globalization;
9
10 public class EventLogger {
11 private string _ApplicationName;
12 private EventLog _Log;
13
14 public string ApplicationName {
15 get { return this._ApplicationName; }
16 } /* ApplicationName */
17
18 private EventLog Log {
19 get { return this._Log; }
20 } /* Log */
21
22 public EventLogger(string applicationName) {
23 this._ApplicationName = applicationName;
24 this._Log = new EventLog();
25 this.Log.Source = this.ApplicationName;
26 } /* EventLogger */
27 } /* EventLogger */
28} /* CumpsD.Tools */1[Test]
We mark our method with the Test attribute, along with the ExcpectedException, because this._BadLog contains a non-existant logfile, and we want our class to throw an exception when trying that.
2[ExpectedException(typeof(InvalidEventLogException))]
3public void ReadLog1() {
4 EventLogEntry[] EventLogs = this._ErrorLog.ReadLog(this._BadLog);
5}
This test fails, because the ReadLog method doesn't exist yet. Let's create it, this requires some more coding, we'll have some private helper methods. SetLog to specify the EventLog we want to read from, and IsLog to check if the EventLog actually exists.1private bool IsLog(string logName) {
This code on it's own will still fail, because there is no InvalidEventLogException! Let's add a class in the same file defining the Exception.
2 return EventLog.Exists(logName);
3} /* IsLog */
4
5private void SetLog(string logName) {
6 if (this.IsLog(logName)) {
7 this._Log.Log = logName;
8 } else {
9 throw new InvalidEventLogException("Invalid Logfile.");
10 }
11} /* SetLog */
12
13public EventLogEntry[] ReadLog(string logName) {
14 this.SetLog(logName);
15 EventLogEntry[] EventLogs = new EventLogEntry[this.Log.Entries.Count];
16 this.Log.Entries.CopyTo(EventLogs, 0);
17 return EventLogs;
18} /* ReadLog */1[Serializable()]
When we run our test now, the EventLogger will throw an Exception and our test will pass, because we were expecting an exception.
2public class InvalidEventLogException: Exception, ISerializable {
3 public InvalidEventLogException(): base() { }
4
5 public InvalidEventLogException(string message): base(message) { }
6
7 public InvalidEventLogException(string message, Exception innerException): base (message, innerException) { }
8
9 protected InvalidEventLogException(SerializationInfo info, StreamingContext context): base(info, context) { }
10
11 [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)]
12 public new void GetObjectData(SerializationInfo info, StreamingContext context) {
13 base.GetObjectData(info, context);
14 }
15} /* InvalidEventLogException */
Write a test with a valid EventLog name as well, and make it pass, the code shown above will work.
We also want a WriteLog method, to actually log our errors, so let's make a test for that.1[Test]
The WriteLog1 method is similar to the ReadLog1 method, it tries to write to an invalid EventLog and will fail. The WriteLog2 method however tries to write to a valid EventLog , and checks if the error is actually written afterwards.
2[ExpectedException(typeof(InvalidEventLogException))]
3public void WriteLog1() {
4 this._ErrorLog.WriteLog(this._BadLog, "This is a test entry");
5}
6
7[Test]
8public void WriteLog2() {
9 string ErrorMessage = this._ErrorLog.WriteLog(this._GoodLog, "I have encountered a catastrophic error!");
10 EventLogEntry[] EventLogs = this._ErrorLog.ReadLog(this._GoodLog);
11 Assert.AreEqual(ErrorMessage, EventLogs[EventLogs.Length-1].Message, "Wrong Error.");
12}
Both tests will fail, because we'll write the methods now.
I have created an enum for the three types of EventLogEntries, Information , Warning and Error. Along with an overload for WriteLog so it would write an Error by default.1public enum ErrorType { Information, Warning, Error }
Our real WriteLog method will check for a valid EventLog and then write the Entry to the EventLog and return the error message it has written, so we can compare in our test.
2
3public string WriteLog(string logName, string errorMessage) {
4 return this.WriteLog(logName, errorMessage, ErrorType.Error);
5} /* WriteLog */1public string WriteLog(string logName, string errorMessage, ErrorType errorType) {
If we run our tests now, we'll see they succeed. I have added some more tests to check if the Entry type was written correctly.
2 this.SetLog(logName);
3 EventLogEntryType LogType;
4 switch (errorType) {
5 case ErrorType.Information: LogType = EventLogEntryType.Information; break;
6 case ErrorType.Warning: LogType = EventLogEntryType.Warning; break;
7 case ErrorType.Error: LogType = EventLogEntryType.Error; break;
8 default: LogType = EventLogEntryType.Error; break;
9 }
10 this.Log.WriteEntry(String.Format(CultureInfo.InvariantCulture, "{0} caused the following error:\n{1}", this.ApplicationName, errorMessage), LogType);
11 return String.Format(CultureInfo.InvariantCulture, "{0} caused the following error:\n{1}", this.ApplicationName, errorMessage);
12} /* WriteLog */
At the end you should have something like this:
And when you check eventvwr.msc you will see something like:
As always, I've uploaded the sources so you can check them on your own. -
Explorer Bug, Long Path, damaged directories.
This post moved to http://blog.cumps.be/explorer-bug-long-path-damaged-directories/ with additional screenshots and reproducing it in Vista.
-
FrontPage Server Extensions - IIS Metabase
Currently I'm playing around with IIS and C#, and something I discovered is the following:
First, take a look at the FrontPageWeb property available in the IIS Metabase.
This says 'Setting FrontPageWeb to true causes FrontPage Manager to create the files required for FrontPage Server Extensions. Setting FrontPageWeb to false causes these files to be deleted.'.
Everything seems allright, just like every other property I set this to true and except it to work. Like this:1// First we get the AD object representing our webserver
(Most stuff left out)
2DirectoryEntry iisServerRoot = new DirectoryEntry("IIS://localhost/W3SVC");
3
4// We create a new site on the specified siteId
5DirectoryEntry deNewWwwSite = (DirectoryEntry)iisServerRoot.Invoke("Create", "IIsWebServer", 10);
6
7// Takes care of FrontPage Manager providing files for FrontPage Extensions
8deNewWwwSite.Properties["FrontPageWeb"][0] = true;
9
10deNewWwwSite.Invoke("SetInfo");
11deNewWwwSite.CommitChanges();
12
13deNewWwwSite.Close();
14deNewWwwSite.Dispose();
Well, it didn't work. In IIS it would still say FrontPage Extensions were not present, and the directories didn't get made.
I looked everywhere to find something else involving FrontPage, without any luck.
But then I found this KB article (300543). And althou it's talking about IIS 4.0, 5.0 and 5.1, it does work on IIS 6.0 as well.
So here you go, to install FrontPage Extensions you have to run:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o install -p /LM/W3SVC/SITEID -u USERNAME -sp publish
And to uninstall them:
"C:\Program Files\Common Files\Microsoft Shared\web server extensions\50\bin\owsadm.exe" -o fulluninstall -p /LM/W3SVC/SITEID -u USERNAME -
Importance of Error Messages
.NET gave me an error... A 'Catastrophic failure'.
What's this? Did somebody ran out of inspiration? Every failure is bad! Should I now throw error messages at users stating:
- Disastrous failure.
- Terrible failure.
- Awful failure.
- Dreaded failure.
To read more on error messages, check this: A Review of Error Messages. Make sure to think about your error messages you're giving your users! -
Parameterized Queries - MySQL
Today I was looking over a project I'm working on currently, more specifically, at the SQL queries in it.
I come from a PHP background, where there is no such thing as parameterized queries. You simply build your own SQL string and make sure it doesn't contain anything harmful.
So, not having heard of such thing as parameterized queries, I created my SQL statements the same way in C#, until I read about this practice being "not done". So, I wanted to fix it.
I'm using MySQL with the MyODBC driver. But MySQL is tricky, it doesn't support named parameters, so you have to use a question mark and add parameters in the right order.
No problem I thought, this would be a one-minute fix.
This is what I had (I returned an SQL query string at first):1return String.Format("INSERT INTO zosa_Users(UserVNaam, UserNaam, UserKlasNr, UserKlas) VALUES('{0}', '{1}', {2}, {3});", strFName, strGeslacht, intKlas, klKlas.Id);
And I changed it to:1OdbcCommand insertCmd = new OdbcCommand("INSERT INTO zosa_Users(UserVNaam, UserNaam, UserKlasNr, UserKlas) VALUES('?', '?', ?, ?);", zosaDb);
What did this insert in my database? Well it added a question mark ;)
2insertCmd.Parameters.Add(new OdbcParameter("", strFName));
3insertCmd.Parameters.Add(new OdbcParameter("", strGeslacht));
4insertCmd.Parameters.Add(new OdbcParameter("", intKlas));
5insertCmd.Parameters.Add(new OdbcParameter("", klKlas.Id));
6return insertCmd;
So, I went looking for what was wrong... Did I add my parameters in a wrong way? Is there something wrong with MyODBC? After having done about everything I could think of, it was in the middle of the night and I went to bed. But today I tried something else, remove the single quotes. And it worked!1OdbcCommand insertCmd = new OdbcCommand("INSERT INTO zosa_Users(UserVNaam, UserNaam, UserKlasNr, UserKlas) VALUES(?, ?, ?, ?);", zosaDb);
Such a small thing, but nowhere I managed to find this, nobody ever posted to watch out for this. Having no previous experiences with parameters and the question mark, I simply thought it would safely replace the ? with my value, but still would require the quotes for string values.
2insertCmd.Parameters.Add(new OdbcParameter("", strFName));
3insertCmd.Parameters.Add(new OdbcParameter("", strGeslacht));
4insertCmd.Parameters.Add(new OdbcParameter("", intKlas));
5insertCmd.Parameters.Add(new OdbcParameter("", klKlas.Id));
6return insertCmd;
Don't make the same mistake! It's a stupid one ;) -
Visual Basic 6 - DBGrid, Empty Cells AllowSizing Bug?
Run your code, and this is what it should look like:
Now, go to the Custom properties of the DBGrid, to the Layout tab and uncheck 'AllowSizing'.
Run your program again, and now your DBGrid will indicate there are results, but there will be no text, like this:
Why is it doing this? I really have no idea. But the best part is, when you check the AllowSizing property again, it isn't back to normal. It stays broken.
This 'bug' (don't know if it's a bug) was encountered some days ago, I reproduced it this afternoon, and now I installed VS6 SP6, but the bug remains.
If anyone wants a project which has the bug in it, I uploaded something small (30Kb) that got destroyed by this.
Anyone who has encountered this as well? And perhaps has an explenation of why it's doing this.
Update: Just when I posted this and looked at my post again, I noticed something, the second screenshot only had 2 columns, so I realised it did fetch the records, but didn't knew where to display the data. And when you right click and choose 'Clear Fields' it works again. But the AllowSizing is automatically checked on again. To add some value to this post, maybe anyone knows how to uncheck AllowSizing without the grid resetting it's own columns? -
WiFi - Developer Fusion - Writing Secure Code
It's been a while since my last post. I got injured, my hand got injured, and that's a really really bad thing when you do everything on a computer :(
But there's good news as well. Yesterday, I installed a WiFi access point, along with a PCMCIA card for my laptop, and it's great, the freedom :) Sitting in the living room with your laptop is so much nicer (althou it probably isn't very good for RSI).
I still have to get to trust WiFi, now that I got it, I can start to experiment. I just installed it, and after one night there was already someone trying to connect on it. Good thing there's a MAC Allow list.
Now it's time to do a little commercial. Recently the owner of Developer Fusion asked me if he could use some of my articles on his site. I was very happy he asked :) Be sure to check it out once, very nice site.
If you like it's layout more then this blog layout, these are the articles posted on it: A Console IRC Bot, Associating your program with every file and Executing a .CS file.
I just started reading 'Writing Secure Code, Second Edition' by Michael Howard and David C. LeBlanc as well. It's huge (in my opinion), 757 pages. This must be one of the few (paper) books I read. ;) But it's very very interesting! Especially for my presentation I'm going to give at my school. -
Microsoft Convention - Belgium
Today I went to the Microsoft Convention, in Brussels, Belgium.
Today I'm also very sure I'm a developer rather than a marketing guy. This was a purely marketing based event, and it really wasn't anything that fits me.
But allright, I took some pictures. First we have Bruno Segers with the Opening.
Right after this came Kevin Johnson.
Followed by Scott Woodgate.
He had a talk with Geert Verbeeck, Chief Architect of Sidmar.
In the afternoon were some more talks by various companies, and about certain MS products.
I liked the talk about Microsoft CRM. It's a really nice solution from what I've seen, very user friendly. Can't tell anything about the implementation or developing for it, as I simply didn't see it, marketing-only event, remember ;)
There was a hands-on session for SharePoint also, I liked this as well. SharePoint is nice, so nicely integrated, and so easy to use. Now I understand why so many people develop for it. Also had to chance to use a Pocket PC during this lab. And I'm convinced I'll never buy on myself at the current state. I find them quite useless, but I'm not a busines person, so I don't need anything for my appointments.
Other then that, I don't have much to tell, I won't be going back to day 2, because I don't have the money, especially not for marketing-only. I wanted to try it out once, to see what a marketing-only event was like. And I'll stick to developer events from now on, on those I don't have enough time to see anything that interests me, and especially not to do any hands-on labs, cos I'll miss a session then. But today I had plenty of time, and it's true what they say: on a dev event, everyone's right on time, everybody is too early, on a marketing event, no-one is.
Took some quick picture of myself as well ;)
And, I got a nice gadget as well, a clock! Here's a pic with the clock along with the USB Flashlight from DevDays 2004: -
Noticed on MSDN
I'm proud. I've just been included in the MSDN list of Belux bloggers!
And I also got linked in the March issue of MSDN Flash! :)
I'm happy to be a part of such a big community, really makes you feel appreciated once. Thanks to everyone out there! -
Differences between PHP and ASP.NET
if (((number == 5) && (number2 != 8)) || (admin == true)) {
-
Ancient Technologies - RPG & AS/400
I just finished a school project in RPG. In the beginning I hated RPG and the AS/400 it was running on. When you're used to writing languages like PHP, C++, C#, Perl and even batch, RPG seems like a nightmare, crazy syntax, column based, numeric vs character variable handling, ...
And then we had to do a project for that class. The teacher talked about a previous group doing something with HTML and CGI on the AS/400, so I decided to take on the challenge and write a complete website that uses the AS/400 as back-end with RPG as the language.
Some obstacles I encountered:
- The website was going to be written in PHP, but our AS/400 didn't support it, so the decision was quickly made to host the site on another server. But this adds the added difficulty of communicating between site and AS/400. In the end the site is running on Windows 2000 with IIS and uses DB/400 for data storage on the AS/400.
- The first communication attempt: DB/400 supports stored procedures, so we'll just access the RPG programs trough sprocs. But again, problems, at first we simply couldn't connect to the server, we later figured out it had to do with permissions. But after those permissions there was no way I could call a sproc from PHP.
- So I changed the way of communicating. First I created a PHP class that can easily construct a command to call the RPG program. It takes the program name and parameters and execute it. What happens in the back is, a querystring is constructed, it gets called on the AS/400, there a program pulls in the querystring and parses it, after which it calls the apropiate RPG program. Each RPG program has some return value which gets send back to the PHP object that initially made the call and then the returned info gets processed on the website.
Here's how it goes in the final result:
But in the end, now it's finished, I'm amazed of the result. A fully working PHP website on a seperate server, running Windows, with an AS/400 back-end, using RPG as the language to talk with DB/400. It amazes me that a technology that old can play along with a new technology like PHP.
What do you think about ancient technologies? Do solutions like the one I just described still happen? Did you made one already?
I'd really like to know how much of these things still happen in the business world, because as a student I really have no idea. - The website was going to be written in PHP, but our AS/400 didn't support it, so the decision was quickly made to host the site on another server. But this adds the added difficulty of communicating between site and AS/400. In the end the site is running on Windows 2000 with IIS and uses DB/400 for data storage on the AS/400.
-
Visual Studio.NET and PHP Coloring - Revisted
This post has been moved to http://blog.cumps.be/visual-studio-2008-and-php-coloring/ where you can find more information. (with screenshots!)
-
Custom WordWrapper
Here I am again, with the last article for my birthday gift to you guys :)
This time we create our own WordWrapper method, inspired by an ASP.NET Forums question.
The last one for today: Custom WordWrapper. -
Custom WordWrapper
using System;
-
Outlook and C# - Gather Addresses
Next article is one on how to access Outlook from C#.
Gather Addresses collects email addresses from a given folder in Outlook.
This is the second article for my birthday present ;)
Article #3 will be later tonight, have to format a pc and re-install WinXP first. -
Outlook and C# - Gather Addresses
using System;
-
Birthday - 20 years - Small Console ChatServer
Today's my birthday, I'm turning 20 :)
And because of that I'm giving you guys a present. In the form of some articles.
Going to write 3 articles today for you, starting with how to create a small console chat server.
The other two articles will follow later on today, got to follow some classes first ;) -
Small Console ChatServer
using System;
-
MD5, SHA1, SHA256, SHA384, SHA512 Hash class article.
Today's article is about making hash functions easier to create.
We create a class around MD5, SHA1, SHA256, SHA384 and SHA512.
I've used this in a small project a while ago to hash passwords and it has proven really usefull.
Check it out if you need a hashing class: Create Hashes - MD5, SHA1, SHA256, SHA384, SHA512. -
Create Hashes - MD5, SHA1, SHA256, SHA384, SHA512
using System;
-
Your program as ShellExtension (Registry) - Including Resources
As a follow up to my C# Script program, I've added an article on how to associate your program with every file by adding a registry key.
I also made a small article about including resources in your .exe as an answer to someone's question about Non-Rectangular Forms.
The Notepad bug issue still spooks around in my mind. So very strange... -
Including Resources in .exe
FileStream imageStream = File.OpenRead("Glass.bmp");
-
Associating your program with every file - ShellExtension
Windows Registry Editor Version 5.00
-
Notepad bug? Encoding issue?
Someone showed me a weird text file today. It was a bat file with 'copy MeYou.bak MeYou.txt'. When you would ran it, it would work. But when you opened it in Notepad, there was nothing.
So we decided to look a bit into this and here is something we came up with to 'create' invisible text:
Open notepad and enter:
' abc.bak abc.txt'
(That is: space abc dot bak space abc dot txt, no line break, without the quotes)
It doesn't work with every string, just follow us on this example and use that one.
Save your file. Notepad picks default ANSI as encoding.
Open your file, Notepad seems to open by default in Unicode encoding.
Your text is now invisible.
Does anyone know why the saving default is different from the opening default?
And why does it happen to that particular piece of text. It doesnt happen to ' b.b b.b' or ' .bak .txt'.
It looks the same when viewing it through a hex editor. But apparently it has to do something with encoding.
Anyone who can explain?
Update: When you paste it in IE or Trillian you get '????????', like some people tried in the comments ;)
Update2: In my notepad screenshot the font was Terminal, when I choose Verdana it are indeed squares. Not that invisible anymore, but still wrong :)
Update3: You can find an explanation on why this is happening at The Old New Thing. -
C#-Script
I was playing around with the thought of being able to figure out some other possibilities for C#.
One thing I came up with was, why not make a possibility to quickly write something small in C# and run it. I'm talking really really really small here.
So I decided to write an article about it, maybe someone thinks of something and extends it. Before you tell me it's useless, let me say this is only something done to try out new things and to get ideas.
Here is my version of C#-Script ;)
One frustrating thing that keeps bothering me is. In code i specifically said to not create an executable, and what happens? It creates an executable. Anyone an idea of why it's doing this? Doesn't 'InMemory' mean in RAM, without files on your HD?
Hope you like it :) -
C# Script
using System;
-
Non-Rectangular Forms - C#
I added another article in the 'Basic C# Examples'-series. ;)
It should answer the question of how to make nonsquare windows?
There is another example out there (which I can't find the link of anymore) that uses pointers to run over the image. Because of performance issues. So, I decided to take the GetPixel approach and see if it worked. And it does ;) Don't notice any performance hit here thou, maybe on weaker computers..
How To Make Non-Rectangular Forms. -
Non-Rectangular Form
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) {
-
Basic C# Examples
And because of that, and because I want to raise interest among the people I know, I decided to ask them for questions they had about C#, and try to answer them by example.
I'm gathering subjects to write on, very basic subjects, appealing to students as well. And I'll try to create an application that answers their question and provides code they could extend.
Hopefully I can keep this up, because I'm learning a lot from it as well. It helps you to think of subjects you wouldn't have tought of otherwise. And I have to check out docs and examples as well to write an article about it from scratch.
The first article is about 'How to get on IRC with C#'. I created a basic Console IRC Bot along with some comments. The example uses tcp connections, streams and events. Source code is provided as well.
I hope other students like the idea... (not only students by the way, everyone can use samples!)
Let me know if this is a good plan. (Or if you have negative comments, go ahead as well ;)) -
A Console IRC Bot.
using System;
-
XAML - Irregular Controls
The Longhorn SDK enables you to create XAML apps from VS.NET, so I did.
One of the things I'll be looking for is an editor that generates XAML for me. Because, I find XAML "difficult" to write. Yes it's powerfull and "easy" to do, but if you have to do it all by hand, it takes time. So I'm hoping there will be some editor fast :)
I've seen the demo during the DevDays, where you had a different layout per user. And one of those was the kiddie layout, with the very cool button, which was shaped totally different. So I set out course to create a 'NTFS Permissions For Dummies'.
Here's what i created in Photoshop as a quick idea of what I wanted:
Looks kiddie enough, doesn't it?
Then I started my quest, it seems Longhorn doesn't like it when i want to skew a Listbox with AngleX. When I go over the items it renders strange lines everywhere in my app. Gone was my idea to create these nice shaped controls.
But the gradient worked! And that's actually very nice.
Here's what I ended up with:
It looks kinda nice, the colors still make it look kiddie-like.
Going to check writing the C# codebehind later on this week if I find some time.
If anyone feels lucky and has the time, feel free to try to create my attempt in XAML ;) I'd be very gratefull for it, and amazed.
Update:
Here's an example of my skew experience: AngleX, AngleY. Notice the blue lines.
This is the XAML I used. It also happens with other values. -
Visual Studio.NET and PHP Coloring
This post has been moved to http://blog.cumps.be/visual-studio-2008-and-php-coloring/ where you can find more information. (with screenshots!)
-
Student Evangelist - Longhorn Screenies
Well, here I am, playing mini-Evangelist in my class, telling about all nice .NET things.
And now with Longhorn installed, I wanted to show some screenies, and also prove that Pre-Alpha does not mean "If you touch it, it'll destroy your pc" ;)
I know you can find these anywhere, but these are *my* screenies, my personal sweeties, my preciousssss :)
First The Desktop.
Followed by hitting Ctrl-Alt-Del.
And don't worry, all your great software is still there, like Paint, Calculater and Notepad ;)
Here you got the proof that the IE team actually does add new things, and that it still exists. One of the features is to Clear Browsing Records. And in the back you see Visual Studio .NET Whidbey, with the nice yellow/green indicators to show which unsaved changes there are and which changes already have been saved.
And the end of this screenie round is during the Logoff, after which Remote Desktop closed.
I really like the default look, no kiddie look as in IE. But also not the Win98 look. Very nice black, stylish.
Regarding layout, Explorer doesn't seem to like me, it doesn't want to set my preferred settings for every map, even if I have told it to do so on every occasion. -
I'm On Longhorn - Download Manager == Evil!
I got Longhorn installed!
I'm guessing the .iso got corrupted during my download.
It didn't took as long as I expected to install, no 5 hours like some blogs say. But more something like one hour. I didn't use Virtual PC thou, got my laptop running on LH.
No 4-bit mode on first boot, and after I used my gfx drivers (which installed without any problem) I got it back on 1024x768 on 32-bit.
First did all the tweaks posted on the net, disable the right dockingbar, disable services, ...
Everything was running smooth when I rebooted after those changes. Not so terribly slow, althou shutting down takes some time ;)
It doesn't like Winamp 5, gets closed immediately after it's started. Winamp 2 works great thou. Trillian Pro going fine as well.
Then I installed VS.NET Whidbey. Which gave me about 3 BSOD. but in the end I managed to install it using the 'Repair' function. Going to look at the dump file later on. Could be that my laptop got to warm and that the hardware went crazy.
Made my first HelloWorld in Whidbey, I already love the green/yellow status on the side. As well as the great 'Format Document' together with all the new settings about braces and indenting.
Also did my first XAML file. Then I noticed that I'm missing the Longhorn SDK. Everybody is talking about the PDC DVD. But I only have a CD with Longhorn?
Anyway, after setting the PATH var to include the 1.2 Framework and setting the LAPI var as well, MSBuild works and everything compiles. Next thing I'm going to look for is how to make XAML files with C# codebehind in VS.NET and compile them there.
One big annoyance I'm having: the Download Manager is evil!
I have 2 files in there always saying 'Connecting' and I can't delete or pauze them. If I dare to do that, it doesn't respond anymore, killing explorer doesn't help, logging on again doesn't help either. Only thing I can do is reboot.
Well, I'm running on LH now. When I have some free time and am somewhat familiar with it, expect some comments on it from me.
Update: Apparently I can get the SDK anyway, must have looked over it, another 574.1 MB to download.
Update 2: I can NOT get Longhorn for you, do NOT request it in the comments, I won't give it to you, you have to get it yourself. There's no warez here... -
Hardware lasts longer under Linux - or how politics don't have a clue.
As you can read at Jan Tielens' Bloggings, one of our political parties suggest using Linux instead of Microsoft products.
One of their arguments is that "PC's last longer". Why does hardware last longer depending on the OS that's running on it? Have you ever seen Office destroy your GPU? Maybe when you fool around enough with Linux you can get a driver damage your hardware, but just like with Windows, that's very unlikely unless you're into low level driver development.
Another great argument of their is they can customize it better. Why do you want to customize PC's in a government building? What would you want to add? It's meant for your end-users, so they'll look at the desktop.
Regarding the sysadmin side. Guess which one will cost more a Windows sysadmin or a Linux one. No Active Directory for managing your stuff ;)
They both have decent file permissions and other security settings. Mind you, we are talking about end-user systems here. Not some 24/7 nuclear power plant control server.
It provide jobs. And installing, configuring and maintaining those Windows PC's doesn't provide jobs? They take care of their own or what? (If that would be the case I should start thinking about switching jobs)
Then they start talking about Open Standards. There's a difference between Open Source/Software and Open Standards. Microsoft uses open standards as well.
I'm guessing it's because elections are coming, and we Belgians mostly choose the role of the underdog, Linux in this case. And their party knows how to play the media. With the great 'free' and 'open' words where everyone falls for. (Remember, with open software it's free as in free speech, not free beer)
They like to point to Munchen in their project. Well one of their arguments that it's cheaper gets destroyed by pointing, because it costs more in Munchen.
Ah, and price, a Linux version for the desktop (with support, because that's what a company takes), starts at 179$, SUSE is at $598 and Windows XP is at $299. Now tell me, where's the huge difference everyone is talking about?
We are talking politics here, they interfere in business they totally have no clue of, something they want to do quickly, and now even more then otherwise, because elections are coming, quickly get some arguments and launch them, everyone not into computers will believe us!
Should I talk about support as well? Who just extended their support for Windows 98? Which is quite old already. Can I get some support on my Linux distro X which seemed to have stopped last year? Can I get some support on package X, developed by a informatics student in his free time who now "doesn't feel like working on it anymore"? That means, if you want to use it, you'll have to get the knowledge to develop it further, and in the long run that is not cheaper.
And lastly, what about professionalism? They advertise with a movie of the Bill Gates pie-in-the-face happening. And with a page called microsuck.htm ...
There is one party I'm really not going to vote for. Hopefully they won't ruin it for the rest, because it's we who'll pay for their crazy ideas. -
Longhorn installation failing - 'An error occurred while copying files'
I wanted to install Longhorn today. The 'Longhorn Pre-Alpha Client Preview' version.
So here I go, I format my laptop (which is a test pc) and insert the cd.
After entering the key, choosing where to install and clicking continue, when the timer jumps to "13 minutes left" I get an error.
"An error occurred while copying files". That's it, nothing I can do about this.
I looked on Google for help, but nobody got it, except for one person who fixed it by using another machine.
Then, I installed Virtual PC 2004 on my main computer and decided to install it there. That must work, after all it's a virtual pc, and everyone else already got it to run on Virtual PC.
No luck thou, same error message.
Does anyone have any advice in what I can do? I even don't know where it goes wrong, can I get some debug info here to pass on to the MS team?
There goes my plan to install Longhorn and Whidbey on my test pc :(
Love to hear from someone.
Update: I got some additional info, I mounted the .iso in Virtual PC now, same error. Happens when it has written 424.4MB.
Update 2: When I install Windows 2000, run the Setup from there it starts saying "18 minutes left", the progress bar goes a bit further, untill the reboot message comes. Then it continues installing with "14 minutes left", and a bit after it goes to 13 it gives the same error again. I'm at a dead end now. -
Javascript Open Directory Image Viewer
var sHTML = '<html><head><title>Fotoviewer</title></head>\n<body>\n\t<div%20align="center">\n';
-
Orkut - An Overview
Well, about a month ago (I guess), a lot was going on about Orkut. And now I got in, actually I could get in a lot earlier because I got invited by someone from here, but it must have gone out with the spam mail =/
Let's give this an overview.
It's invite-only, duh, but I get a feeling it has already spread out quite a lot.
It's very blue-ish, and trendy. You get icons for 'trustfulness', 'coolness' and 'sexyness'. Very pixelart stuff.
You got your regular profile stuff, except this one asks a lot of information. General stuff, your interests, contact info, your education, jobs, physical appearance, what turns you on :p etc
Along with a pic of yourself ;)
It's totally built on ASP.NET, not that you would notice a difference as a visitor from a PHP site or something.
There are friends, who get in your network, there are communities on a lot of sections, nothing really special, it has a forum and an event planner.
You can add people to a hot- and crush-list, you can add photos and small notes.
And there's a PM system.
That's about it, nothing more.
It's a nice way to keep your friends organised ;) and to make some new ones maybe. -
DevDays 2004 Belgium - Day 2 - One API To Rule Them All
Welcome back! DevDays 2004 Belgium, Day 2 is over, and that also concludes the entire DevDays over here.
The day starts with an opening keynote by David Chappell about The Road to Longhorn.
This dude is amazing, he comes on stage, and as an introduction he starts taking of his jacket, tie and shirt, and what's under that? Our national football shirt, from the Red Devils.
Check the picture for (unclear) details :)
Oh, and he got some red socks as well. ;)
He compared musicians to developers, only developers get better hotels. They travel around the world and play for audiences.
His session was basically about what Longhorn is and will be. I'm very impressed by the 'One API to rule them all', or WinFX :p
The main message was 'write managed code!'. And preferably one of the new languages. Managed C++ is for people who love pain.
There was also a story about where the codename came from. Above Redmond lies Canada, with a ski-resort there that's very loved with MS folks. There are two mountains there, Whistler and Blackcomb. Now you all know what those code-names are for. But then Blackcomb got set back and something got in between, so they returned to their ski-resort and looked around. What is between these two mountains? And they found a bar, called Longhorn. And there it was, it got called after a bar in Canada.
He kinda told in big lines everything of the Longhorn track of that day.
XAML is the next thing in designing UI's. The designer creates a UI in XAML, and gives it to the dev, who wires up the events.
There was also a comparison between Google and Windows. Google searches in about 4 billion pages, and how long does it take to get a result back? Almost instantly. Now, open up your search in Windows.... This has to improve! This is all about WinFS.
I won't make so many different posts about this day, going to summarize them all in here.
First there was Avalon.
It's amazing what you can do with it! Images in buttons, video in buttons, buttons, images, moving buttons in listboxes, checkboxes in buttons, the whole lot. Gradient buttons, disappearing buttons, everything. XAML is great!
The only question I got about this is, if XAML doesn't get compiled, does that mean that everyone who gets an app can change the UI to what he likes? Or does it get compiled in your final product after all?
One thing to remember thou, Avalon gives you all these neat features, but you don't have to use all of them!. There was a demo app of the worst app ever, with moving things, disappearing, resizing, etc.
There were a lot of people again today.
Then was Indigo. It's great to have all communications under one section, webservices, remoting, enterprise services, ... all in Indigo.
I don't have a pic of this, he moved too much ;)
After that was WinFS.
It's amazing what you can do with this. Searching goes so much faster, and with the nice stack based view, which decreases as you enter a query, it's lovely.
Some questions I got on this matter are:
If your drop all your files in a WinFS store and you got only maps like 'Documents', 'Images', etc.. When you drop 2 or more files in there with the same filename (but actually a different image), how will you keep them apart? Now it's easy, they're in a separate folder, but we can't think in terms of folders anymore.
Something else I want to know. If WinFS stores all the meta-data, is there a way to have the browsing way like we have now, with files and folders, but with the power of WinFS? So that during your everyday work you keep using NTFS and the classic way, but when you go to Search, you get everything nicely cataloged.
And last for today was Whidbey.
Strange picture? Yeah :p
This session actually took 25 minutes longer then planned, he kept giving demo's, incredible. We saw some things about Whitehorse, also some of the stuff I saw on day one. A demo of ObjectSpaces, OneClick, Yukon stored procedures and SpaceInvaders in old console style :)
That was DevDays 2004 Belgium. It was a great experience for me. Hope to go to some more of these things.
Here's a decent picture btw:
In a couple of days I'll tell about the goodies. Got to get some sleep first.
You know, this is actually the first time in my life I had to get up so early to take the train. (Excluded from the times I don't sleep) And boy it's cold outside in the morning.
I hope you liked this feedback, I know it might not been very technically detailed, but you can read all about that in the slides which will become available (or are already?). This was more my view as a student going for the first time.
Oh, and I spoke at DevDays as well:
Don't believe me? Well, you're right, I only took a picture ;) It looks nice thou, doesn't it?
Thanks MS for inviting me! -
DevDays 2004 Belgium - ASP.NET
ASP.NET for pros. By Tim Sneath.
Everything about how ASP.NET works, how you can secure things, how you can impersonate, how IIS6 so much owns IIS5 ;)
Some of the things I learned here was that you can have a web.config per directory. I always thought it was one per app.
Also, that you should not forget to set debug="false" when going to production. Something I've been guilty of already, easy to forget.
Some nice options to recycle the ASP.NET worker process as well, like each week, each 1million request, memory limit, etc
Multiple worker processes.
How an upgraded dll get's taken care off. Overwrite it, old clients still use the old dll, which is in cache, and new visitors get the new one, untill all old visitors are timed out and the old dll is completely gone.
How 'eif' (need to get the url from the slide, it got updated, will try tomorrow) is very usefull for developers to easily log to the event log.
Some nice options with Trace="true", which gives you a complete overview of what your page does. This dus make some debugging easier!
Also when you got Trace enabled site-wide that the trace.axd has a trace per request.
I'll be checking those tracing options out for sure, very nice.
Last session also covers ASP.NET, so I'll add it here. It's the Overview of ASP.NET Whidbey.
First of all, I hate the MS logos in this room, those which keep spinnging around and around in the room and straight into your eyes every X seconds.
There were 2 speakers (got to check their names later on), which were a comic duo I thought. They keep running around, they made a very good impression, and one of them spoke English with a very Dutch accent, it amuzed me to hear some pieces in english and others pronounced in typically dutch. (Note: this is not a negative sentence :p)
I'm sure you all saw what nice Whidbey has to offer, I love the built in webserver. This will finally allow me to easily debug. Even when not having Admin rights.
They gave a lot of demo's about Master Pages, Authentication, User Management, DataAcces 'Things' (forgot the name, remember everything comes from System.Thing. But in the end they also had too little time, seems like everyone had :)
This was the last session of the day, after that was the closing keynote and the Geek Fest, with plenty of food.
On to day 2 :)
Hope you all enjoyed this feedback from me. -
DevDays 2004 Belgium - USB Flashlight
Over lunch we also had a session by Compuware, given by David Boschmans.
How to write .NET apps?
He told about unit testing, QA, etc. IT was quite confusing, he was very nervous, or so it seemed.
The video on the wall also started shaking, strange stuff :)
They gave a nice USB flaslight, which now lights my keyboard when I watch a movie in the dark and I need to check something :p
Cool gadget, pictures will be up later, of all the gadgets toghether. And we did get quite a lot of goodies. =) -
DevDays 2004 Belgium - .NET Framework for Sys Admins
Next was Tim Sneath. With a 2 part session about .NET for sysadmins.
This is actually a session from the IT Pro track, but there were a lot of developers in there.
In the first session he explained about everything the .NET framework is and does, along with some nice demo's. From which I'll give some commands.
First the basic stuff
csc file.cs // compile an exe
csc /t:library file.cs // compile a dll
csc /r:yourdll file.cs // compile an exe with your dll referenced
Then something nice:
ildasm yourapp.exe
This tool gives a nice overview of the generated IL and the metadata. I totally get the concept of why there is no more dll hell.
The metadata includes the version number of your references, along with a possible public key. Which makes sure only your dll gets run, and no trojan dll someone elses got in there.
Something else that got explained was signing.
First you generate a privatepublic keypair with:
sn -k key.snk // create your keypair, keep it safe!
Then you put it in your assembly and you sign it, and that way it can get a strong name.
Some random handy commands I noticed where:
pushd . // store the current dir
popd // return to the dir
start . // open the current dir in explorer
Now the GAC was explained. This is kind of a global assembly storage place, the System32 of .NET if you like.
Some funny things I saw where that he got CommandBar and BandObjects in there ;)
One other usefull tool is ngen.
Your code always gets JIT-ted when run, this is no problem for servers. Which stay on for a long time. But for a workstation and a Windows Forms app, this could make the startup slow. So therefore we generate an image, in native code. This is stored in the GAC as well, this makes your code startup a lot faster. And your app doesn't need a Strong Name for this.
ngen yourapp.exe
ngen yourdll.dll
You could do this with your installer after deployment.
After this, it was lunch :p
Sandwiches and orange juice.
Then back to Tim Sneath for part 2.
The most important thing I got here that isn't on the slides is that user randomly choose Yes or No when prompted for ActiveX controls. Depending on what mood they're in.
It mainly went about deployment and security in this session. How you can easily deploy your apps, with an installer, from a fileshare or from the web.
It showed the ease of XCOPY, along with recommending MSI.
Something that I found weird was, when you execute an exe locally and it doesn't find all required dlls, it won't start. When you run it from the web, it'll start and throw an exception when it can't find the dll when it dynamicly wants to load it. Which, if unhandled, can make your app crash. Why not check for all required dlls before running? Doesn't a HTTP HEAD do the trick to check if it's there or not.
That was all for the .NET for sysadmin sessions.
Next one was about ASP.NET, also by him :p -
DevDays 2004 Belgium - Innovation through Integration
Just before the Keynote started, they showed a robot driving around, bringing a beer, controlled by a PDA. Developed by students from 'KU Leuven'.
And another nice thing was that we, developers, all come on time. The entire room was filled, everyone was there on time. Which apparently only happens with us, all other kinds of people tend to be late :)
First up was Steve Riley (the picture they have there totally didn't look like him at DevDays :p), with the Keynote: "Innovation through Integration".
He first kinda summarised what innovation already has happened over time, and what will happen in the future.
One quote from that was that we at one point in history figured out to save paper by putting everything digitally online, but then came the laserprinter. The laserprinter is the reason why rainforests dissapear, people print a page with a font, decide it doesn't look good, print another font, etc ;)
But the most interesting part for me was the one about security. He spoke about what you have to keep in mind when designing your apps, never add security when it's done, build it in from the start.
One of the things he told he was still afraid of, were keyloggers. Therefore you should never login to something private on a kiosk or something.
Something else was, cars now have a lot of processors as well. And they can fail as well, they even can be rebooted. But in that context he added one very nice question:
"Who of you would today trust your pc with your life?"
Nobody did, so that means there's still a long way to go.
He also talked about the Windows AntiVirus API. Where other AV packets can run onto as well, and you can have multiple AV scanners simultanious as well.
Here's another quote to think about:
"How much security do you need?"
"As much as you need until you die." ;-)
Some words on the integrated part are, integrated training, when you buy a Windows product, you don't have to buy an extra training course, build it into the Help.
Also, dynamic Help. Why should a pro get the same help text as a beginner? The level will always go to the lowest one, and the pro will get all these help he already knows. -
DevDays 2004 Belgium - Introduction
First of all, DevDays 2004 Belgium was in Ghent.
And I live in Bruges, so, got to take the train ofcourse.
;-)
Once arrived in Ghent, the bus took me to the International Congres Center, or the ICC. Where the DevDays were organised. It was a great location, in my opinion.
Here is the .doc with the sessions I followed. (And will follow tomorow ;))
Let's start the overview. The day begins with breakfast, which was nice, as this is all something new for me I never had expected to get free breakfast (and luch and in the evening as well). And free drinks all day long as well :)
There were a bit over 1000 attenteeds I've been told. Here's a pic from the breakfast (sandwiches and stuff).
After having something to eat it's time for the introduction by Bruno Segers (General Manager, Microsoft Belux).
I saw some Microsoft commercials, and I love them :p the ones were you see people doing regular every day things, and you see a possible future being drawn on it. Really beautifull commercial.
As you can see on the picture as well, the logo is a skinhead with a cameleon on his head. Which reflects 'Integrated Innovation'. Symbolic thing :) -
DevDays 2004 Belgium - Day 1
Now, I don't know of those are the PDC bits or not, I guess they are. (Update: as Jason Nadal posted in the comments, this are the PDC bits)
-
How to Trackback?
I have read Scott's post about Trackback, but I still don't get something.
I understand how the mechanism works, but I don't get how .Text implements it.
I realise I have to fill stuff in under the 'Advanced Options' to make Trackback work. But what do I have to fill in?
Anyone who could help me with this?
So far I believe that 'Source Name' and 'Source Url' is optional, but for the other three I don't know.
One way to figure out is by testing, but I don't want to do that because if could leave a lot of Trackbacks behind on the blog I use to test it on, which probably won't be so nice.
Anyone who could explain this?
Thanks -
Setting NTFS Permissions with C#
using Microsoft.Win32.Security;
-
.reg to re-enable user:pass in IE
Here's the .reg for the tweak I mentioned in my last post: iefix.reg
It enables user:pass@ on machine level!
(And just to be safe, not that I fear anything :p)
Disclaimer: I am not responsible if something goes wrong when running this .reg -
Re-Enable user:pass@ IE functionality.
Here's a dillema:
On one side you want to keep your machine up to date with all latest patches, but then there is "Cumulative Security Update for Internet Explorer (832894)", which disables the user:pass@ way of authentication.
Now, do you update and loose this functionality (which can be handy), or don't apply it but have the other security it fixes unpatched?
Here's what I did:
I patched.
...
But I really, really wanted the user:pass back, and it's even in an RFC MS has linked. -
Introduction.
And most importantly: C#
The year before we started getting C# in school, I already started learning it, and boy it's great. I'm addicted to C#, even more then I ever was to PHP.
C# got me in contact with everything .NET related.
I love the framework, the power. It makes things much easier.
It's even easy to convert code from VB.Net to C#! :)
Now I'm at a point where I got a decent coding background, I made all the usual coding mistakes (and probably will make a lot more) and now I'm ready to start applying everything. Creating real C# programs for companies. Getting more involved with other programmers. Giving something back to all the resources that helped me learn things.
One of the things that encouraged me, was being confronted with what could be my future. I had first contact with Microsoft personnel, and they were so friendly and helpful providing me with developer resources, something I had never experienced before. MS folks were the first to discover as real coders. I had email conversations with some about coding stuff, something I otherwise never have, I'm more used to the local help-desk, answering questions and now here these ppl are, answering my questions. That's a real nice feeling. :)
I'm also attending the Belgian Dev-IT Pro Days (DevDays), with the support of MS.
Well, that's about it for now. I got nothing more to tell about myself. If you want to know something, just ask.
Greetings
David