NoteMe

Windows programming over my head:

I have used Visual Studio 2005 for a while now. Liked it from the start, like every other VS version I have tried. Of course it used a bit more resources then it predecessors, but it also added lots of great functionality I these days can`t live for out.

But it didn`t take me long to get my first problem. At the time I was playing with Managed DirectX to see if it could have any advantages over my daily DirectX programming. But after installing the Platform SDK problems thorned up. And for some reason they where in the Platform SDK it self, and I couldn`t understand why. Lots of lines like this was spewed out in the console window.


c:Program FilesMicrosoft Platform SDKincludewinnt.h(222) : error C2061: synt
ax error : identifier `PVOID64`
c:Program FilesMicrosoft Platform SDKincludewinnt.h(222) : error C2059: synt
ax error : `;`



So off to find a solution it seemed at first to be no official fix to this, but editing this line:

C++ code:

typedef void * POINTER_64 PVOID64;



in winnt.h to:

C++ code:

typedef void * POINTER_64;
typedef void * PVOID64;



seemed to do the trick at first, and I forgot about the whole thing. Until today.

Firefox has for a long time been my favorite browser, even though I use Opera quite a lot too. And one of my "Internet friends" (Ryan Jones) have for a while been using lots of his spare time to patch bugs in Firefox. And I felt it was my time to spend some of my time to give something back for a wonderful project.

But after setting up a development environment and starting to compile Firefox for the first time, errors started to pop out. And again it was in the winnt.h file. 2 seconds later and I remembered what I had done a few months ago. Changing it back the way it was did the trick, and Firefox was happy. What should a poor man do!


PS: I am very aware that half the links on my page is still not working. I`ll get to that too, but there is just too many interesting things in the world that gets in my way..:)

Comments 0

Krugle your way to help:

I bet many does it the same way as me. We stumble over a new programming problem, an undocumented function, or some code that doesn`t work on all platforms or in all browsers.

So what do you do. Well more and more often, people use google or their favorite forum to search for it. But what do you end up doing? Well looking through pages and more pages without finding the help you need.

Wouldn`t it be much better if your search engine only gave you relevant coding snippets and hints. Well that is what Krugle is trying to solve now. They are out in their second beta testing stage. And is more or less ready to go live. I tested it, and I am surprised. It idea is really working. It is nearly as sitting with a big code library in a big company with a sweet user interface, and find only relevant snippets of code, in more or less any language you need.

Just have a look at one of my searches. HLSL With tabs and easy to understand user interface, I get relevant code right in my browser, with no spam or the like. By clicking into one of the code snippets I get syntax colored code right in my browser, and a right pane where I can have a look at the other files in the same project. What more can you ask for.

I am really looking forward to see this go live. I can imagine it taking some load away from Google when it comes to developer. That`s for sure.
Comments 1

An entire OS in .NET?:

Discussions has been kicking back and forth on the Internet lately about why Vista will not be built entirely in .NET as Microsoft might have made users believe earlier.

There is some obvious reasons, why this was not done. First of all C# as we know it today relies on the .NET framework. And the framework has to be built in something. And that can`t be in C#. Entirely safe C# code can not reach deep enough into your hardware to perform all tasks an OS needs it`s programming language to do.

Then again, it always comes up speed issues in discussions about the .NET framework. And people often point at that as the biggest reason. But with today`s rapid hardware development, wouldn`t it make a lot of sense to trade some speed for more reliable OSes? Less blue-screen, and harder for viruses and Trojans to affect your PC.

That`s when I read about Singularity . A new research OS from Microsoft that is indeed more or less written entirely C#. "So it is possible?", you may ask. Well with some trade-offs and some asm code it actually is. Singularity is becoming a proof of it. It is important to understand that this is not a OS you will have the possibilities to buy soon, or if at all ever. It is a research project, where testing new ways of making a more secure OS with new paradigms is at least if not even more important than the fact that it is more or less written in C#.

But as mentioned there is small parts of Singularity that is not written entirely in safe C#. Most noticeably is the garbage collector. But incredible enough parts of the kernel like the memory system, scheduler, and manages devices is primarily written in safe C#, though there are parts written in unsafe C# and a HAL written in C++.

If you think you now can go an download the new OS somewhere, I have to disappoint you. But if you would like to know more about this project I discovered that Channel 9 has an interview with Jim Larus and Galen Hunt , which is really interesting. There is also a great article in the June version of MSDN Magazine which caught my interest in the project.

But if this project will lead somewhere is not sure yet known, but if Minix led to Linux, then why shouldn`t Singularity lead to a new type of Windows never seen before.
Comments 0

DirectPython gives access to DX9 from Python:

I remember before DirectX 7 came out, there was a lot of different wrappers for DirectX 6 that Visual Basic programmers could use. I used my self a wrapper called DirectX C and had a lot of fun with it. But that is a long time ago, and after DX 7 came Visual Basic was supported, and then dropped again when DX 9 came out, but in stead replaced with .NET languages like VB.NET and C#.

Now it looks like it is happening again. I just stumbled over a SourceForge project that makes a DX9c wrapper for Python. Just like the old wrappers for Visual Basic.

The project is really in the beginning stage, but there is already about 15 samples on their homepage, and more is commming. So we just have to wait and see what the response from the Python community will be.

On the other hand, if you are not a big DirectX fan, you can always make simple games with for example PyGame and LiveWire . Might not be as impressive as DirectX games can be, but should get you let you have an easy start in the right direction if you want to start with game programming.
Comments 0

Transforming pictures into fantastic HTML (Source):

Before you lose the interest, just take a look here . Look it is text. It is Linux code transformed to a picture. Cool isn`t it? Do you want to know how to make something like that. Or even better yet, you want a free application to make it for you? Keep on reading.

When I saw this, I showed it to Wossname and he was just as excited as I was. Since we are partners in crime when it comes to C# hacking, we decided to make an application to take pictures as input and output HTML code.

The concept is simple, but the output is fantastic eye candy. The final application has 3 optimization levels, and can both output our Doomsharp code, or just fill in with lots of # symbols. To show off the different methods here we have all of them tested with the picture from this article:


So there you go. Maybe not the most exiting picture, so take a look at other pictures I have converted.


And now you can make as many as you want too. All you need to do is to download the source (C# 2005) or this EXE , to start making your own web pages. And make sure you have the .NET 2.0 runtimes on your computer. Even if it is written in C# there might be code there that is not added to the Mono runtimes yet (untested), so I am not sure if it will work on any other platform then Windows. If there is a big interest for porting it to Linux then I might consider doing so. But for now, sorry.

PS: To make full optimization, you need to have this CSS file in the same folder as the HTML file this application creats for you (can also be found in the source download). If you have any questions on how to use the application, please add a comment to the blog.

Comments 42

Friend = C# + Linux;:

One of my friends have in the last weeks fallen in love with Linux, after been using Windows all his life. But that is not how I know him. We have been members of the same forum way too long, and also done one of the coolest applications ever in the history together. Namely DoomSharp .

We could only do this because of his (and of course mine ;)) C# skills, but now he has gone over to the enemy. Or has he? With Mono he can still compile his C# applications, and they will still run on Windows. Now how cool isn`t that.

So what is a better thing to do, then start to write about how this works out. And it is just that Adam Ward has started to do in his new blog. So if you want to read about cool cross platform C# tricks and how he is doing in Linux, then I suggest you bookmark his home page. I have added him to del.icio.us already.
Comments 2

IE 7 addons anyone?:

I read earlier today that Internet Explorer is a dead albatross . But I am not so sure about that. First of all. Microsoft don`t tend to lose battles like this. Second of all, they have been a bit on their heels before, but managed to hit back. Just think about the Netscape era.

And I am affraid it will be like that this time too. Too many are not willing to put in enough effort to understand that there are alternatives. I have several friends and Ex Girl Friends that think Internet Explorer is the same as the internet, and don`t understand that it is just a tool to help you get online.

But there is still people who is hoping that Firefox will overtake IE in relative short time . But we can`t forget that IE is soon out in a new version. And this time they are better prepared. Well it is maybe a few more lines of code they need to beat other popular browsers both in compability and usability, but they are getting close.

But one of the things Firefox for example have been really good at lately is to build up a user group. And especially by letting their fans build extensions and themes for the popular browser. But this time IE will try to do the same. They just released the new add-On page for IE 7. By first climps it looks very promissing. But we just have to see if the IE fans will be just as creative as the Firefox fans are when it comes writing up small usefull add-ons.

When I am first on about browsers. I can also congratulate Opera with finaly comming out with a public beta of Opera. Their first Opera version that will pass the Acid 2 test.
Comments 0

"Dear Visual Studio Express users":

That was the message I woke up to today, and the sun was shining outside. I have for a long time been a Visual Studio users. I touched Visual Basic for the first time when I was about 14, and after that I have been using all major parts of the Visual Studio family.

It has not been a big problem this year, since I got pay for my work here at CERN since we have licens for Visual Studio, and most of the time I am not in Windows after all, so no need for it. But I am still a student, and in a couple of months, there is no more work here, but probably a master degree waiting for me at a University somewhere in Europe. And then the money question will come up again, and I am back on a budget.

So that was why I was smiling so much this morning when I found out that Visual Studio Express will from now on be permanently free . That is great news. It was only ment to be free for one year, but since the community have helped making it a hit like it is today, the developers wants to give something back.

But not only that. They are also giving away a lot of free well documented Starter Kits . You can now easy controll your Lego Mindstorms or add functionality to Skype easily with Visual Studio Express. And it is all free. So if you don`t already have Visual Studio in one or an other form on your computer. I would recomend you to jump over to Microsoft and download Visual Studio Express right away.
Comments 0

Virus found bug on Linux:

I had to laugh a bit when I started reading up about the new consept virus that has been in the media so much lately. Well in theory this sounds very interesting, or mayb scary, but it wasn`t before I read an article at NewsForge yesterday the fun began.

They got a hold of the virus and started testing. But for some reason they couldn`t make it work in some of the newer Linux kernels. And a mail to Linus Torvalds was sendt to see if he had any idea why the virus did not work.

And today the answer came. It seemed like a bug in the kernel that made it not work. An error that higher level language compilers never had found. Linus Torcalds made a patch, and new testing now shows that the virus is now also working on newer Linux kernels. So in the end, no one should blame Linux for not beeing fast at patching up errors in it`s code :)
Comments 0

Firefox extension tool:

I have for a long time wanted to do this. And now I have done it. In the simplest way possible, but at least done it. Made a small tool to pack up and unpack the extension I have been working on for a while now. It has been a lot of packing and un packing, and finaly it can be done automaticaly with a pack script and an unpack script.

At the moment it only works on Linux machines with ZIP, and Python installed. And I am not going to change that for a while I think, since I am only using Linux to develop the extension. And at the moment some of the names are hardcoded for the files, so right out of the box it will only work for this extension. But it should be easy to change the names like vbf.jar to something that you use, and vbf.xpi to what your extension is called. And if you have any problems using it, then please just give me a wink.

If you just want to have a look at the code, here is the pack script:

Python code:


#!/usr/bin/python

import os
import sys


os.chdir("chrome/")

os.system("zip -r vbf.jar *")
os.system("mv vbf.jar ../")
os.system("rm -r *")
os.system("mv ../vbf.jar .")

os.chdir("..")

os.system("zip vbf.xpi -r chrome install.rdf")
os.system("rm ./install.rdf")
os.system("rm -r ./chrome")



And here you have the unpack script.

Python code:


#!/usr/bin/python

import os
import sys


os.system("unzip ./vbf.xpi")
os.system("rm ./vbf.xpi")

os.chdir("chrome/")

os.system("unzip vbf.jar")
os.system("rm vbf.jar")




How you use them:
Unpack: Leave the vbf.xpi file in the same folder as the unpack script, run the script and it is unpacked.
Pack: Leave the script in the same folder as the "chrome" folder and the "install.rdf" file, and run it. And it is packed again.

Enjoy. And please give me feedback if you need any help what so ever to use it. And just as a note, from the next version of the vBulleting extension these scripts will be in the vbf.xpi file.

Comments 0
NoteMe - Øyvind Østlund