wilmens™

by William W. Mensah

It’s pretty simple.

- Close Visual Basic 2008 if you have it opened.

- Go into My Documents or wherever the Visual Studio 2008 directory was created and rename the directory to something else. Preferably, append some characters to the end of the current name

- Start Visual Basic 2008 from your start menu

- When it’s done initializing, try opening the recent project you want to remove from the list. Visual Basic should say it can’t find it and ask if you want the project to be removed from the list – click yes!

- Exit Visual Basic 2008, go back into My Documents (or where you have the VB directory created) and delete the new Visual Basic 2008 directory that was created.

- Rename the original directory (that was renamed) back to its original name and then start VB again.

- Done.

Wordpress for Blackberry

  • Thursday Feb 25,2010 10:48 PM
  • By wmensah
  • In Stuff

Just found a Wordpress app in the Blackberry app store and I must say: I’m really impressed. The level of convenience is amazing.

Got Wordpress? Got a Blackberry? You’ve got to have it!

www.example.com and example.com – same? or different?

  • Monday Feb 22,2010 11:31 AM
  • By wmensah
  • In Thoughts

Well I just learned that they are not the same (by default) – the hard way. Spent 3 hours last night trying to figure out why a site I was working on’s login system works fine the first time and then when you click the site’s logo (or some other link that takes you to the home page), it ‘kicks you out’ and takes you back to the login page even though you JUST logged in.

First I thought it was my PHP session that was timing out incredibly fast but I also realized that after logging in twice, everything is fine. Hmm…very strange.

I downloaded the Web Developer add-on for Firefox, and discovered that two sessions were being created after each login – 2 different session IDs, so I jumped into my code and realized that the URL I was typing in the browser was http://example.com and the url the site’s logo pointed to was http://www.example.com. So every time I clicked on the logo, I was taken to the second url (for which the session hasn’t been saved yet). And after that url’s session has been saved there are 2 different session information to be used regardless of whether you visit www.example.com or just example.com

So what now? did some Googling to find out how to automatically add a www to example.com if the user doesn’t add when typing the url and found a solution that worked here: http://snippetdb.com/htaccess/add-www

It’s pretty simple actually, all I had to do was use the mod_rewrite snippet:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^snippetdb.com$
RewriteRule (.*) http://www.snippetdb.com$1 [R=301]

by adding it to my .htaccess file and everything worked fine.

Nice!

Pattern Recognition

Gotten into some sweet pattern recognition stuff and its taking away a good amount of time from software development – like working on myDiary and stuff. Several features have been requested but I haven’t had a chance to get to them yet. I kind of like PR though. Makes you feel intelligent. ha!

New Year

Happy New Year. myDiary is 2 years old. Unbelievable!

HTML form, 1 element array vs javascript

  • Friday Oct 30,2009 10:45 AM
  • By wmensah
  • In Thoughts

For some reason, when you create an array inside a HTML form and pass it to a javascript function, the 1st element in the array turns out to be undefined when it is the only element in the array.

This can occur, for example, in the case where you have a group of checkboxes and want to pass an array of them to a javascript function to, lets say, check/uncheck all of them. If there is only one checkbox, don’t blow your brains out wondering why it’s not working. Do an alert inside the javascript function and try to print out the value of the first element. You’ll find out that it’s undefined.

I’ve Googled/Binged (can we make that a term now?) around and haven’t found any legit solution, so my suggestion is to use a hidden checkbox field and assign it a value (that will be stored in the array) that would never be used when being processed by your javascript function – like a negative number if your array is storing only positive numbers.

That should save you some headache. If there’s a better solution/workaround, please comment on this.

Discretization

For the record, the attributes (values) of each instance have to be replaced by their respective bin numbers after running infogain on the columns.

myDiary 4.5 Beta 3

when u want to share stuff with the general public – you tweet or update your facebook status. When you want to keep it personal, you use myDiary. New version available: http://www.wilmens.net/downloads/myDiary-4.5-Beta3-Setup.exe

Got my mojo working :)

  • Sunday Jul 19,2009 03:29 AM
  • By wmensah
  • In Stuff

So I finally download Palm’s mojo SDK hoping it will be a quick and glorious download and install operation – but boy was I wrong! I run into quite a number of problems before finally getting it to work.

First, installing on my 64-bit copy of Windows 7 was a no-no! Installation will begin and progress to the end only to roll back everything and tell me it was interrupted. Wow, really? Interrupted by what? Retired a 2nd and 3rd time (and even a 4th time, i think) only to get the same error. Strange.

Okay, well I booted into my Windows Vista (64-bit) partition and repeated the installation process. As usual, I went with all the default setup options and ended up installing the SDK to C:\Program Files (x86). It was after that I found out online that the SDK doesn’t do too well with the parentheses in the path – ugh!

Looking for a way out, I thought to myself……..hmm, maybe 64-bit Windows is really out of the question (because Palm claim’s it’s not currently supported, or kind of), and decided to attempt installing it on Ubuntu 8.04 which I have set up in VirtualBox on Windows Vista (see sweetness of Sun xVM VirtualBox). Doing so, installation went well and I didn’t encounter any errors/problems starting up the emulator. The splash screen showed up for a few seconds and then an instance of VirtualBox was started but with a blank screen. The blank screen just sat there and stared me in the face like “what do you expect me to do? load some kind an interface?” Why I was getting a blank screen? I have no idea! Fine, forget the SDK on Linux via VirtualBox. What in the world am I doing wrong here? Everyone in every forum online seems to have happily installed the SDK.

Several forums recommended installing the SDK to a path such as C:\Palm, which I humbly followed later on, hoping I’d come across the remedy; oh but now guess what? The SDK can’t figure out where I have VirtualBox installed and thinks I might have an older version installed. I got the error:

“Palm emulator requires that virtualbox 2.2.0 or higher is installed”

Wow, really? Umm, now what?
Googling didn’t help much. So after playing around for a bit, I remembered that I have 2 Program Files directories. One is simply “Program Files” and the other is “Program Files (x86)”. I also realized that the “Program Files” directory also contained a subdirectory (…\Program Files\Sun) where virtualbox was installed. Hmm, that might work.

Not feeling like going through the whole process of uninstalling and reinstalling the SDK in  Program Files, I simply copied and pasted the entire Palm directory from C:\Program Files (x86) to C:\Program Files and then double-clicked on palm-emulator.exe (inside the bin folder) – AND THAT’S WHEN IT WORKED!

Here’s a screenshot.

Palm Mojo SDK emulator (Windows Vista 64-bit)

Palm Mojo SDK emulator (Windows Vista 64-bit)

By the way, I came across a solution to the Windows 7 RC (64-bit) installation issue here. I haven’t gone through with it to verify that it works though.

wilmens wallpaper

  • Tuesday Jul 14,2009 10:29 AM
  • By wmensah
  • In Stuff

Love the background at www.wilmens.net? Well now you can download it and set it as your desktop wallpaper for free.

wilmens wallpaper

wilmens wallpaper

WordPress Loves AJAX