March 2004 - Posts
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.
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:
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!
In response to a thread on the
ASP.NET Forums I decided to publish the answers in an overview on my blog.
Someone asked on what the difference were between PHP and ASP.NET and how he did certain things.
My answers are based on using C# as the language for your ASP.NET application.
__________________________________
1.
Is there any difference between '' and "" in ASP.NET? Yes, ' ' is used for characters while " " is for strings.
Take this for example:
'a' = a in memory
"a" = a and \0 in memory
Something usefull about escaping in ASP.NET is the following:
@"bla\bla" == "bla\\bla"
A string with an @ in front of it is seen as a literal, where you don't have to escape special characters.
2.
How would I do something like: print $variable.'string'; in ASP.NET? You would use the following: Response.Write(variable + "string");
But it isn't very recommended to use Response.Write, take a look at all the server controls you have, like a Label for example.
3.
Within an if language construct, what would be the equivalent of "and" and "or?" Actually PHP supports the same being used in ASP.NET:
and --> &&
or --> ||
Example:
if (((number == 5) && (number2 != 8)) || (admin == true)) {
// do stuff
}
Would correspond to:
if (number = 5 AND number2 NOT equal to 8 ) OR we're an admin., do stuff.
4.
Would someone be able to tell me how I could make an ASP.NET equivalent of this PHP Function: function num($number){
return '#' . str_pad($number, 3, '0', STR_PAD_LEFT);
}
You need a function which returns a string, and which formats a string:
public string num(int number) {
return String.Format("#{0}", number.ToString("000"));
}
5. How do I create a mutidimensional array?
Try this:
// 2 dimensional arrays
int [,] a1;
a1 = new int[3,2];
int [,] a2 = {{1,2}, {3,4}, {5,6}};
// jagged arrays
int[][] a3;
a3 = new int[3][];
a3[0] = new int[5]{1, 2, 3, 4 ,5};
a3[1] = new int[3];
a3[2] = new int[4]{21, 22, 23, 24};
Loop over them to see the elements.
__________________________________
Got a question yourself? Ask it, and I'll try to help :)
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:

Ofcourse there were also a lot of obstacles getting to know RPG and the way it works with the system, especially in the capitalization departement, sometimes it's case sensitive when you don't want it, and another time it's back to case insensitive.
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.
This post has been moved to http://blog.cumps.be/visual-studio-2008-and-php-coloring/ where you can find more information. (with screenshots!)
Archived version below
-----------------------------
A while ago I talked about Visual Studio.NET and PHP Coloring, and how to make it real with a tweak.
In the mean time I switched to VS.Php from Jcx.Software. I got a mail from them today announcing a new beta version.
I'm really happy about it, it is far more embedded into VS.NET then with the tweak. And it has a lot more capabilities. One of the best capabilities would be Intellisense and tooltips. Now I don't have to visit php.net as often as before ;)
Check it out once.
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.
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.
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 ;)
More Posts