wilmens™

by William W. Mensah

What happened to the Office Assistants?

  • Tuesday Nov 4,2008 09:56 AM
  • By wmensah
  • In Thoughts

I still can’t believe Microsoft gave up on the Office Assistants in Office 2007. I used to open MS Word just to see the little fella animate :) . That was back then. I think Microsoft could have gone a long way with it – Like yahoo is trying to do with Liam. It’s like having one of those Gigapet things (remember those? I almost thought they were going to take over the world)

My point is that Microsoft should have kept those Office Assistants around and had them do more stuff like?have the dog go empty out the trash on the desktop or something. People like me who sit behind computers all day get bored at some point you know. Oh well…

yay Android!!!

  • Wednesday Oct 29,2008 07:10 PM
  • By wmensah
  • In Stuff

I’m not sure if I’m one of the few or one of the many people excited about Google releasing a mobile operating system. A few of my friends had never heard about it until a link to T-Mobile’s G1 was posted on Google’s Homepage. I also remember seeing a commercial on TV sometime last week. Still don’t hear people talking about it though. The way i see it, there’s no hype. What is not being done right? I mean, I hate to compare it to Apple’s iPhone but some comparison has to be made some where.

Apple came out with a cool phone with a sweet, slick, sexy and an edibly-eye-candified interface (spell checkers wont like that too much), but you get what i mean. I own a touch and the interface and fluid-like animations is something you can really drool over (deny it all you want). Android’s interface is almost there but not quite there yet. I don’t own one myself (yet) so I’m referencing the pictures I’ve seen and videos on YouTube.

Don’t get me wrong – Google’s done a good job (it’s Google, duh! they always do a good job). As a matter of fact, I really want to get my hands on a phone running Android. Google has provided programmers world wide with a new environment to mess around with – whether you’re married to Windows, Linux or Mac you can still develop applications for the operating system and also be able to manipulate the hardware on which the OS runs – free of charge, and it’s all open source (even better). Can’t say quite the same for the iPhone/touch.

Sprint better hop on the Android bandwagon soon because I want one! And I hope some really talented designers out there create some nice themes and icons for it soon. That would be nice :)

myDiary 4.0 rpm

Thanks to Sindhu, below is an rpm version of myDiary 4.0 created with alien for linux users running Mandriva or some other distro of Linux not supporting the .deb package.

mydiary-40-2i386

Thanks Sindhu! :)

http://sindhu.tumblr.com

if myDiary isn’t working for you and typing

$python /usr/share/myDiary.py doesn’t return any desirable results? such as:

import gtkspell ImportError: No module named gtkspell

then you might be missing some modules – gtkspell in this case.

Try installing python-gnome2-extras to see if that helps (just sudo apt-get it via terminal).

Revision Control

  • Wednesday Oct 8,2008 04:20 PM
  • By wmensah
  • In Thoughts

Why would anyone (and i mean anyone) ever worry about creating a version control system even though there’s Subversion, FTPvc and a few others already out there? Beats me. So i’m not sure why i want to go ahead and develop one – hmm…just so I don’t look/feel insane, lets just say I have too much time on my hands and have nothing better to do.

for the record:

Revision control (also known as version control (system) (VCS), source control or (source) code management (SCM)) is the management of multiple revisions of the same unit of information. It is most commonly used in engineering and software development to manage ongoing development of digital documents like application source code, art resources such as blueprints or electronic models, and other projects that may be worked on by a team of people. Changes to these documents are usually identified by incrementing an associated number or letter code, termed the “revision number”, “revision level”, or simply “revision” and associated historically with the person making the change. A simple form of revision control, for example, has the initial issue of a drawing assigned the revision number “1″. When the first change is made, the revision number is incremented to “2″ and so on.” – Wikipedia.

So what might i need (assuming?the repository is going to be created on an FTP server) ?

- GNU DiffUtils

http://en.wikipedia.org/wiki/Diff

- FTPlib

- http://nbpfaus.net/~pfau/ftplib/ftplib.html

…more to be added….

The sweetness of Sun xVM VirtualBox

  • Monday Oct 6,2008 05:23 PM
  • By wmensah
  • In Stuff

Here I have Ubuntu 8.04 running as a guest on Windows Vista via VirtualBox.

?

Cashforlaptops.com – legit or scam?

  • Tuesday Sep 30,2008 05:22 PM
  • By wmensah
  • In Bookmarks

Many people wonder whether Cashforlaptops.com is legit or just another one of those scams. Well I had a laptop I needed to get rid of. I didn’t know where to take it or who to sell it to (I don’t trust eBay that much). It wasn’t broken or anything, I just had a craving for better specs than it offered so I decided to give Cashforlaptops a try. After all, what could possibly go wrong? Nothing more than giving my laptop away for free. Ouch! lol.

Ok, well I went ahead and got a quote from their site. They offered $290 for my laptop after I’d provided the brand name and some relevant information…..model, cosmetic condition, etc. I decided to go with it. After a day or 2, I received an email from them asking for my address so they can send me stuff for packaging which I gave them and which they did (via Fedex – tracking number provided), after about a week or so.

The box they sent had a return shipping label in it so all I had to do was to place my laptop in the box, take off the original label and replace it with the new shipping label they’d provided.

After Fedex came to pick the package, I sent the people at Cashforlaptops an email to let them know that the package is on its way and also gave them a tracking number.

A week later, I received another email saying the laptop had been checked and is just as I’d described it so they sent my check, which I received after a week – the exact amount as quoted.

So the whole process took about 4 weeks. So if you ask me whether Cashforlaptops can be trusted or not, from my experience I’ll say YES – plus you don’t have to pay for packaging and shipping.?

I did read in some forums though that some people received less money than they’d been quoted (after being notified of course) because some defects were found on their laptops or the laptops weren’t exactly as described. In the end it’s your call, so just use your discretion.

This is a question you’ll probably be asking after you install and run myDiary 4.2 (GTK) for Windows. It’s ok, I asked myself the same thing when I tried the application on a different computer other than the one I’d created the ported version on. This is what it looked like:

?

myDiary with squares for text

myDiary with squares for text

?

This happens when the application can’t find the library files it needs to run correctly. For the case of the fonts, some pango files/modules could not be found, if not all. Basically, the solution is to make sure you have GTK 2+ Runtime Environment on the system you’re trying to run the application. This will make available all the dynamic link libraries and python modules needed by myDiary.

A GTK installer comes with myDiary’s installer. When installing myDiary, make sure the box where you’re asked if you want to install GTK is checked and also make sure you go through GTK’s installation process after myDiary is installed. If you ignored this the first time you installed myDiary (GTK), simply reinstall it. This should fix both the issue with the text and images and you should have myDiary in all its beauty:

?

?

myDiary (GTK) with text and images

myDiary (GTK) with text and images

If you still can’t get it to work after that, try copying the folder:?myDiary\lib\gtk-2.0\2.10.0\loaders to wherever GTK was installed to. You can figure this out by typing %GTK_BASEPATH% from Command Prompt. Or better yet, if GTK got installed to C:\Program Files\Common Files\…, re-install GTK to a directory where administrative privileges are not required when writing to, eg. C:\GTK.

If you experience any further issues or can’t resolve this issue, send an email to support@wilmens.net providing your version of Microsoft Windows, the path where GTK was installed to (%GTK_BASEPATH%) and the path where you installed myDiary to.

An even better solution….

  • Saturday Sep 27,2008 11:52 AM
  • By wmensah
  • In myDiary

So in my last blog the solution was to write a python script to perform the search and replace on the gtk_basepaths in the 2 files and then have a batch file call python and pass the script to it. That is great, but only as long as the user already has python installed on the computer. If not, then that could be a problem because there will be no way to execute the python script. And you don’t really want to ask the user to please go and download python before you run the installer because it depends on python…that’s kind of silly.

Ok so here’s the better solution:

Since the user is supposed to be running Windows, the system on which the installer is going to be run on should be able to execute .vbs files (visual basic script) via command prompt (ah, something we already have :) ). So if you write the search and replace algorithm in vbs you can execute this script with the batch file and the world will be safe.

The algorithm for such a visual basic script can be found here:

Here’s the script:


Const ForReading = 1
Const ForWriting = 2

strFileName = Wscript.Arguments(0)
strOldText = Wscript.Arguments(1)
strNewText = Wscript.Arguments(2)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOldText, strNewText)

Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close

?

For a better understanding of how the script works, read the explanation provided at the link above. In my case I had to change a few things within the script to get it to work the way I wanted but I’ll come back to that later.?

Ok, so the script can be executed like so:

cscript replace.vbs "C:\Scripts\Text.txt" "Jim " "James "

where replace.vbs is the name of the script, C:\Scripts\Text.txt is the file which contains the text to be replaced, “Jim” is the text to find and “James” is the replacement.?

Since I wanted to replace <gtk_basepath> with the value of the GTK_BASEPATH environment variable and then change C:\GTK to C:\\GTK for instance (assuming C:\GTK is the value of the environment variable) I changed the line:

strNewText = Wscript.Arguments(2)

to read:

strNewText = Replace(Wscript.Arguments(2), "\", "\\")

and then from the batch file I called the vb script like so:

start replace.vbs <file_to_replace> %GTK_BASEPATH%

note: in command prompt, %GTK_BASEPATH% returns the value of the environment variable.

that did the trick.

Problem Solved!

  • Wednesday Sep 24,2008 09:04 PM
  • By wmensah
  • In myDiary

I finally got everything working just the way I want it. Below is a summary of the problem and the solution to it

Problem:

GTK 2.0 Runtime Environment gets installed in 2 different directories based on which version of Windows you’re running. In my case, Vista and XP

In Vista, it was installed to: C:\Program Files (x86)\Common Files\

In XP, it was installed to C:\

As a result the GTK_BASEPATH environment had 2 different values for each operating system – not such a good thing.

Unfortunately for my python application which requires pango modules to run, the pango.modules and gdk-pixbuf.loaders files had paths to the necessary dll files hard-coded in them.

This is a portion of my pango.modules file

# Pango Modules file

# Automatically generated file, do not edit

#

# ModulesPath = C:\GTK\lib\pango\1.6.0\modules

#

“C:\\GTK\\lib\\pango\\1.6.0\\modules\\pango-arabic-fc.dll” ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*

“C:\\GTK\\lib\\pango\\1.6.0\\modules\\pango-arabic-lang.dll” ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*

Notice how C:\\GTK has been hard-coded. This created a problem whenever the application was installed and run on a different computer other than mine (on which the hard-coded paths made sense). I suppose the executable file pango-querymodules.exe is supposed to fix this but I had weird results instead. So my solution?….

Solution:

  • Manually go inside these two files: pango.modules and gdk-pixbuf.loaders and replace every instance of GTK’s base path with some string of your choice ( I used <gtk_basepath> for mine).
  • Create a python file to access the two files that has hard-coded paths in them: pango.modules and gdk-pixbuf.loaders and perform a search and replace <gtk_basepath> with the value of the GTK_BASEPATH environment variable. You can do something like:

import os
replacestring = os.environ['GTK_BASEPATH']

where replacestring is a variable that will be used to replace every instance of <gtk_basepath> in both files (watch out for ‘\’ and ‘\\’)

  • Finally create a batch file to execute this python file after installation is complete. You can use the same batch file to delete the python file after that when done because you wont need it anymore.?

My batch file looked like this:

START PYTHON postscript.py

DEL postscript.py

And that’s it, pango.modules and gdk-pixbuf.loaders should now have the correct paths to GTK no matter where it is installed.

I hope this helps someone.

WordPress Loves AJAX