My Final OpenGL Project: ChessGL3d
- March 6th, 2010
- Write comment
Archive for the ‘Uncategorized’ Category
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.
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.
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.
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
.
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!
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)
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.
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.