Archive for the ‘Uncategorized’ Category

My Final OpenGL Project: ChessGL3d

So I had an earlier post about starting my OpenGL experience for the first time. Well here is the culmination of my experience. I created a rough OpenGL version of Chess. I will post this as soon as I get some time. In the mean while, here are some screen shots. Enjoy.

WPF Context Menu Not Showing Up

So I came across a problem with WPF and context menus. Whenever I added a context menu to a right click on a window or panel it would simple not open. The only time that a context menu would appear is when I right clicked on a button or label that was a child of the panel I added it to. I searched everywhere online for a solution and couldn’t find one. Finally, I figured it out myself. For some strange reason, a context menu will not appear if you to not manually set a background color for a component or child component. So to fix the problem, simple set a background color for which components you want the top level context menu to appear.

How To: Dual Monitors in Ubuntu with Nvidia

I noticed that a lot of people are getting “cannot parse xorg.conf” message when they try to set up dual monitors with Nvidia settings manager in ubuntu. Here is the solution.

On the command line:

sudo nvidia-xconfig

You should see it tell you that it overrode your xorg.conf. If you get warnings don’t worry, it’s likely just indicating that there was a previous problem. Then on the command line again, type this:

sudo nvidia-settings

Now setup your dual monitor or triple monitor configuration as you want (with Twin View and the correct orientation). Then hit save configuration at the bottom and you should see that you get no error.

Reboot and enjoy.

Change Default Grub Settings In Ubuntu

I was surprised to see how wrong the entries on the Internet were about changing the default OS that grub boots into. Here are the correct instructions for how to do this (it has been tested on ubuntu 9.10).

sudo gedit /etc/default/grub

Then change the GRUB_DEFAULT=0 line to the number that you want to boot. i.e. if you are trying to boot into the 5 entry in the grub bootloader, put 5. You can also change the number of second grub will wait before booting using GRUB_TIMEOUT.

Then you need to update grub:

sudo update-grub

If you see something like this, congrats! You did it!

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-17-generic
Found initrd image: /boot/initrd.img-2.6.31-17-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done

Reboot to see the changes.

First post from my iPhone

My first post from my iPhone.

Java Othello Game Posted

Finally got around to posting my Othello game as an applet and jar download in the games section. I still haven’t felt like making an AI for it and I’m not sure when I will be able to do it, since I’ll have real work to do this semester and the rest of the time will be filled with relaxation time, specifically Star Trek: Online.

Anyway it’s nice when I get to post some of my work since it gives me a sense of actually accomplishing something once and a while, and my little game section seems to be growing fairly nicely :-) .

New Server

So I have a new server now, moved from dreamhost to rackspace cloud. Mainly this was done to learn more about apache server configurations, as well as have a greater amount of control over what happens on my site. So far so good!

OpenMP and GCC Optimization

So I encountered and interesting little affect while compiling some C code in OpenMP using GCC. Seems that my code ran fine without any automatic optimization flags (-O2, -O3), but when I turned them on, went haywire. The sequential version wasn’t affected.

I tracked down the problem and found that it was actually do to my use of the private variable in the OpenMP directive. Here is a sample of the problem.

 

#pragma omp parallel
{
	#pragma omp for private(i, j, new_j, skip_next)                      	for(i = 0; i < n; i++)
        	{                                                                    	// Set each thread on one row of the loop
                	skip_next = 0;
                	for(j = 0; j < n; j++)                                       	{
				....

The problem actually occured because I did not have ’skip_next=0′ on line 5 of this code. This didn’t seem to matter when optimization was disabled but did cause incorrect semantics when I turned it on. Seems like OpenMP says you must assume that all privates are uninitialized when you start a new directive block. If you want them to be private but start with some default value, do what I did above or add the variable to the firstprivate() attribute instead of the private attribute:

 

#pragma omp for firstprivate(skip_next) private(i, j, new_j)

New Theme

Let’s hope there are no major issues. I’ve had some problems with iFrames before and because I’m too lazy to fix it myself I just look for a new one. So far though, this one seems pretty spiffy.

New Caching, Dedicated Memory

I have just enabled page caching on here and soon hope to have dedicated memory from dreamhost, so I should be able to speed up page loads significantly without decimating my wallet.

Return top