Just a quick note. After a mere two-and-a-half years, I completed the Probability Theory course.

There must be some people around who think that I should feel ashamed that it took so long, but really, I’m plain happy right now and I don’t care. I did it, I’ve got the credits for it, and that’s all.

I think I deserve a beer… :)


As with the width in the previous post, I found myself in need of changing the line height of a page for more comfortable reading. Again, it resulted in a bookmarklet, as so:

javascript:(function(){var a=prompt("Please enter the desired line height!");if(!isNaN(parseInt(a))){var e=document.getElementsByTagName("P");for(var i in e){e[i].style.lineHeight=a+"%";}}})();

Usage: Copy the code above, create a new empty bookmark, and paste this code as location.

Note: it currently supports only <P> tags because I’m reading Wikipedia right now and I needed it for that. Suggestions to expand the list of tags are welcome.


For a little while now, I’ve been using my laptop with a 21.5 inch widescreen LCD at home. It’s a great expreience and all, but I’ve run into a few understandable, but annoying problems.

Most pages on the web are not designed by true webdesigners, and definitely not designed for today’s screens with increasing resolutions and thus width. Put it simply, an article is not comfortable to read when it spans the whole width of 1920 pixels. To overcome this annoying problem, I’ve created two simple bookmarklets to change the width of a page.

Well here they are, click and drag copy and create a new bookmark:

Centered 600

javascript:(function(){document.body.style.width = "600px";document.body.style.margin = "0px auto";})();

Centered UDef

javascript:(function(){var a=prompt("Please enter the desired width!",'');if(!isNaN(parseInt(a))){document.body.style.width=a+"px";document.body.style.margin="0px auto";}})();

The difference between the two is that when Centered 600 shrinks (or increases) the body width to 600px, while Centered UDef prompts the user for the desired width.

Last, I have to mention that the idea came from Arc90’s Readability bookmarklet. It’s a great piece of code, that takes the relevant information from a webpage and removes any kind of clutter from around it, making it easy to read. However, sometimes I’d opt for keeping the clutter and thus these two bookmarklets came to be.

update: Thanks goes to 123 for noting that the links didn’t work. It’s fixed now. All you have to do is copy the code above and manually create a new bookmark.


At the end of last week I’ve decided to install Windows 7 on my laptop. That I did, and while I was at it I also formatted my hard drive hoping that it’ll clear up the mess that it was before. All this is nice and good, but know I’m facing a few questions regarding the software to-be-installed.

For a start I’ve always had this idea of keeping separate virtual drives for development purposes. For example I’d have one for .NET development, one for PHP/Java/whatever, and another one for OSDev. Problem with this approach is that I don’t really have enough free space on my hard drive to have – say – three Windows 7 virtual installs next to the running system. Thinking of going the Linux or UNIX way for the latter two, but I’m not quite sure yet.

p.s.: I’ve a separate USB keyboard finally, which is cool. Not to mention the English keyboard layout… :)


A few minutes ago, I’ve sent a coded update to my Twitter timeline. The message was the following:

Cygwin/NASM->ELF OK. Cygwin/Gcc-RAW OK. Cygwin/LD->PE BAZDMEG!!! Reggel fordíthatok egy cross-compilert :S

To those who are not familiar with what I’m trying to do, and the terminology of it, well, here it goes.

As I mentioned in previous posts here, I’m trying to get into operating system development. My chosen platform would be Mac OS X, but until Mercurysquad finishes the Wi-Fi driver, I’ll stick with Windows. Unfortunately most of the tools best suited for OSDev are for Linux.

That’s where Cygwin comes in. Cygwin is a POSIX library for Windows, that allows running some *nix programs on Windows. I get the almost original GCC, Make, Ld, and so on.

NASM stands for Netwide Assembler, no need to say more on this.

The problem outlined in the above tweet is that I need an ELF-type binary file (Linux executable) as my kernel. NASM creates one for me. GCC creates a nice raw object file for me. And when I try to link them together, the Ld that comes with Cygwin takes the whole thing and turns it into a PE (Windows) executable. I almost cried when I saw the hex dump.

Well, anyhow, I’ll just have to compile a correct version of Ld for myself, tomorrow morning.


Status Report

27Aug09

As the summer is coming to an end, it is only logical to give a quick overview at what heppened to me over the summer.

First of all, I’ve spent most of my time in summer camp, which we call Indiántábor. I’ve spent 5 weeks there. It had both it’s good and bad days, but overall I think this was my best season of camp ever. We’ll have to see later.

On OS development, I hven’t made much progress. As I mentioned in my previous post, I had to figure out how to load another sector from disk and execute it. All this in 16 bit real mode. I finally managed to get it work, the error was the inclusion of a line of code which was not supposed to be there. I also managed to make the switch to 32-bit protected mode and back. At that point I’ve decided that it’s time for me to start using C/C++ as well, beside Assembly. The next day I left for summer camp, and no progress has been made ever since. All this will be clarified in a future post.

Also related to OS development is the fact, that so far I’ve been using Windows. As many osdevers know it’s far not the best choice. I’ve tried Linux a few years back, but it didn’t really met my requirements, so I decided to go with a different operating system, Mac OS X. Right now I’m only doing expreiments with the OS so that I can gather enough knowledge of it to be able to make a seamless and errorless switch in the next few months.

Since I was the one who created the Indiantabor.hu website, people from the camp have been telling me for years to create a gallery for it as well. Since the site is written in PHP, for the past few weeks I’ve been thinking about it a lot, because it’s been a while since I’ve last programmed in PHP. Nevertheless, I’ve made my decision, back to PHP, therefore a new version of the aforementioned site with a gallery is on the way.

Last but not least I’m in the middle of an application to a Morgan-Stanley internship. I’ve already passed the telephone interview, and the technical and interpersonal interviews have taken place as well. No result from them so far.

That’s about it, school begins on the 7th of September. Good day to everyone.


Assembly Demo

29Jun09

At the moment, I’m at the beginning of gathering the required programming and technical knowledge to start writing my own OS. I’ve been messing around with assembly, and now I have a very-very-and I mean VERY simple screenshot to show you:

What do we see here?

  • The video mode has been switched to VGA.
  • We’ve printed the string on the screen.
  • We’ve drawn a straight line.

Not much, I know. Pretty simple code too. But note, that no DOS functions were used, all this runs from the boot sector of a 3.5 floppy.

Next step is to read sector no. 1 from the floppy into the memory…


 

For some time now, I have been having trouble with deleting folders that contain a lot and – I mean a _lot_ – of files. Such folders are very hard to remove either with Windows Explorer or Total Commander.
The reason for that is unknown to me. I guessing it has something to do with reading the file attributes – which is completely unnecessary. For a while now I have been searching for a solution and I believe to have found it.
Note: I do not claim anything, just saying that I completely forgot about this possibility.
So here it goes. Very simple. Open up the command prompt, navigate to the folder of interest (or it’s parent folder) and type the command:
rmdir “<foldername>” /S
Change <foldername> to the name of the folder you would like to delete. The S switch ensures that all files and subfolders will be deleted as well.
After hitting <Enter> you’ll be prompted to approve the delete, and the deletion occurs.
While using Total Commander, the deletion of a fairly large folder (read: ~350MB, ~20k files) would take somewhere up to an hour, with the command above it’s less than ten seconds. Sweet, eh? Cheers!

For some time now, I have been having trouble with deleting folders that contain a lot and – I mean a lot - of files. Such folders are very hard to remove either with Windows Explorer or Total Commander.

The reason for that is unknown to me. I’m guessing it has something to do with reading the file attributes – which is completely unnecessary. For a while now I have been searching for a solution and I believe to have found it.

So here it goes. Very simple. Open up the command prompt, navigate to the folder of interest (or it’s parent folder) and type the command:

rmdir "<foldername>" /S

Change <foldername> to the name of the folder you would like to delete. The S switch ensures that all files and subfolders will be deleted as well.

After hitting <Enter> you’ll be prompted to approve the delete, and the deletion occurs.

While using Total Commander, the deletion of a fairly large folder (read: ~350MB, ~20k files) would take somewhere up to an hour, with the command above it’s less than ten seconds. Sweet, eh? Cheers!


2GB

27May09

… of RAM. As of some time today, there is 2GB of RAM in my laptop. That’s twice that size than before. As I expected, boot time and the overall performance did not improve that much. On the other hand startup time for VS2010, Photoshop and the like did in fact improve a lot.

The in-depth explanation for that is when you start a program, the operating system checks whether there is enough space in the physical RAM. Note: With Vista and 1GB of RAM, there is hardly enough space for Notepad. If there isn’t, then it moves some stuff to the virtual memory which is on the HDD. Think about it… Starting a program like Photoshop, which in itself may use up well more than 500MB of RAM, after a while the opsys is writing parts of the program that is startin up to the disk. Bit of overhead, ain’t it? Reading the program from the disk just to write it back…

Finally some numbers. With 1GB of RAM, VS2008 alone would use up 9x%. Now with 2GB of RAM, having VS2010 and Photoshop running, memory consumption totals at 63%. Sweet.


The full title should be First Impressions on Visual Studio 2010 Team Suite Beta 1 – Part I. For obvious reasons (khm, it wouldn’t fit) I truncated it. Part I refers to the fact that this really is a first impressions review. I installed it, and now I share what I’ve noticed when I first ran the software. There won’t be no juicy in-depth details, pixel-by-pixel comparisons. Just the surface.

Well then. Let’s begin.

We begin – naturally – by clicking on the Visual Studio 2010 icon in the Start Menu. It’s easy to find because it’s the same as the old ones, except it now has a 10 instead of a 9 in the lower right corner.

When VS starts, we’re immediately hit by the new design. As it was stated by Microsoft, they redesigned the look and feel for WPF (more on that later). It is impressive. Looks good, feels good. The default dark blue background is a good choice, it emphasizes that the code is the important stuff here, not the menus or toolbars. Here, have a look:

As you can see, there is no Start Page. Well, that’s my bad, because in fact this is the second time I’ve started the program. As you could have guessed, I’ve closed the Start Page the first time, and it didn’t open automatically this time around. It’s a small but very important change that shows they realized that it’s better to observe what the user does instead of asking him (or her) stupid questions. Thumbs up there.

Although the new Start Page (yes, it’s been updated) is worth looking at. It now has three pages (I don’t know what the official term is), namely Welcome, Projects and Visual Studio.

The first page – Welcome – doesn’t mean much to me. In fact it means so little that I forgot what’s on it by the time I’ve got around to writing this. Sorry, but I don’t think it’s important.

Projects is what you see on the picture. It has icons for Recent Projects, New Project and Open Project. The meaning and functionality of these is pretty straightforward, I won’t waste any more bits on that.

The third page is Visual Studio, with links to Help, MSDN Library and that sort of stuff. Links really.

I doubt that I’ll ever use anything but the Projects page here. Nonetheless, the improvements are welcome.

Since we create new projects often, let’s create a new project. Another stunning discovery, they’ve changed the New Project dialog completely. OK, maybe not so completely, but it looks way different than before. Right?

We’re given a nice and thorough list of project types, organized into well defined categories. Creating the „Recent Templates” seems to be a good idea. Although I’m not so sure I’ll want to waste an extra click just to select the required project type from „Recent Templates” when it’s usually an already available option on the first list.

„Online Templates” is another good idea, which I couldn’t get to work however. I’ll keep in mind that this is still Beta 1, so hopefully it’ll work in future releases.

Apart from those, we still have the option to select which .NET version we are targeting, we can search for a project type if we can’t find it and we’re given a description about the selected project type. This last one is the evolution of the small description bar that used to reside at the bottom of the list. Somehow I never understood how they were supposed to fit the difference between e.g. a „Web Site” and a „Web Application” on that very little space. Well, it’s solved now. Lot’s of room for some marketing b/s.

Anyway, from the New Project dialog, I’ve proceeded to create a new Console Application project. That’s because I’m more interested in writing code than designing user interfaces. (I do the latter in Photoshop, then type it in.)

Yeah baby, new IntelliSense. Finally! The dudes working on the C# editor have finally decided to take the next step in IntelliSense evolution. I must say it’s been done well. The first impression is a lighter window without the ugly and fat window border. The second is not an impression but a surprise. The new IntelliSense window filters the possibilities based on what you type, therefore showing only those items that in some way match what you’re typing. This is a long awaited and very welcome improvement.

As is the highlighting of related items in the code, as seen on the picture. Don’t really know how to describe what’s happening here. When I position the cursor (not the mouse cursor) in a variable name or a method name, it highlights every other occurrence of that. In this case the cursor is located somewhere in the PrintSomething function call in the main body. The effect is unmistakable.

Another small change to the code editor is the way how selections look. When selecting a part of the code, we’re presented with the familiar gradient and border we’ve already met in Extension Blend. Eye candy, related to the switch to WPF.

upd (2009.05.27.): I do have to add this here. I have just discovered another addition to the VS2010 code editor. Namely that it scrolls downward until the last line is at the top of the page. That allows us to position the portion of the code we are working on anywhere on the screen whereever we see fit.

Since I’ve planned this review to be as short as possible, I’m stopping here. I don’t want to go into more new features, I’ll say some bad stuff instead.

Yeah, up to this point I’ve really seemed enthusiastic about this new release. Well there is a downside, and it’s big. It’s performance.

The performance of VSTS2010 is horrible. The switch to managed code and WPF was the worst that could happen to VS in terms of performance. The eye candy is nice and all, but come on guys! Ten seconds for hitting an Enter??? Enough time to make a coffee and have a cigarette when building a simple Hello World app??? That just won’t do.

Or what about the Toolbox? Do you actually load all the controls when opening the toolbar? Way too slow and I’d have expected you to sort that out ‘cause that little problem has been with us since VS2003.

In any case, I’ll continue discovering the wonders of VSTS2010 another time. Stay tuned for some UML modeling and ASP.NET development in VSTS2010…