Tuesday, November 30, 2010

Fedora - Google Earth: /opt/google-earth/libIGGfx.so ... Permission denied

Your install of Google Earth went fine ...

But then when you try to run Google earth, you get an error something like this:
/opt/google-earth/libIGGfx.so ... Permission denied.

Or you may find this in your /var/log/messages:
Nov 30 09:49:42 lost setroubleshoot: SELinux is preventing /opt/google-earth/googleearth-bin "execmod" access to /opt/google-earth/libIGGfx.so. For complete SELinux messages. run sealert -l e4e45dc0-14cf-49dc-af60-8c8e7e916bdf

Don't worry, just run as root:
# cd /opt/google-earth
# for file in `ls /opt/google-earth` ; do echo "SeLinux type in " $file; chcon -t textrel_shlib_t $file; done
You may still have problems like I did if you are behind a proxy.

so I added this to the beginning of the command to launch google earth:
env http_proxy=http://my.favorite.proxy.com:8080

so now the launch command is:
env http_proxy=http://my.favorite.proxy.com:8080 /opt/google-earth/googleearth %f

Hope that helps.

Thursday, November 25, 2010

Khát Khao Dòng Nước

Bài này làm tôi yên lòng ...

* Here are the chords and lyrics.
* Lượm lời bài với hợp âm ở đây.

Hãy vui long hát với à.

Wednesday, September 08, 2010

PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) in /var/www/html/mediawiki/includes/Exif.php

Have you ever gotten an error like this:

PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) in /var/www/html/mediawiki/includes/Exif.php on line 1018, referer: http://my.favorite.wiki.info/mediawiki

Well, do not worry, here is how you can fix it ... Just edit the LocalSettings.php for your wiki, and change the line that says "ini_set( 'memory_limit', '20M' );" to something like "ini_set( 'memory_limit', '32M' );".

Don't you just love magic numbers in your code?

Friday, August 20, 2010

gedit: Segmentation fault

Do not worry. If you get this error:
Gtk-Message: Failed to load module "atk-bridge": libatk-bridge.so: cannot open shared object file: No such file or directory
Gtk-Message: Failed to load module "gail-gnome": libgail-gnome.so: cannot open shared object file: No such file or directory

** (gedit:2133): WARNING **: Private typelib 'Gedit-3.0' not found
Segmentation fault
This was only happening briefly between updates of fedora rawhide. The problem occurred when I was using gedit 1:2.31.5-1.fc14 and kernel 2.6.34-20.fc14.i686.PAE. It looks like it is a hiccup with the new switch from gtk2 to gtk3.

After simply running yum update, now gedit 2:2.30.2-2.fc14 is installed. And it is working fine.

Monday, August 16, 2010

Unicode Normalization Forms: Interesting issue with Google Translation services and APIs

Drawing on my limited knowledge of the ocean of information which is the mashup of the basic multilingual plane (BMP) and Google AJAX Language API, it looks like the Gtranslate callbacks return inconsistent portions of the BMP for Vietnamese.

For example "Hello girl" vs. "Hello grandma" translated into Vietnamese ...
0000000 042 103 150 141 315 200 157 040 143 303 264 042 012
" C h a 315 200 o c 303 264 " \n

0000000 042 130 151 156 040 143 150 303 240 157 040 142 303 240 042 012
" X i n c h 303 240 o b 303 240 " \n
At first glance, it looks to me like the first one comes back as NFKD and the second one comes back as NFC. It is great that the translator is more polite with Grandma, hence the extra word of deference "Xin", but that is not the difference I am noting here. But rather it is the "à" in the word "chào" that comes back two different ways.

Maybe there is some option somewhere in Google's APIs that allows you to specify the range of unicode characters you want to work from when translating. If anyone knows this, please comment.

Note: Here are two command lines I used to test this:
$ wget -O - "http://www.google.com/uds/Gtranslate?callback=google.language.callbacks.id101&context=22&q=Hello%20girl&langpair=en%7Cvi&key=notsupplied&v=1.0" 2>>/dev/null | cut -d: -f2 | cut -d"}" -f1 | od -bc

$ wget -O - "http://www.google.com/uds/Gtranslate?callback=google.language.callbacks.id101&context=22&q=Hello%20grandma&langpair=en%7Cvi&key=notsupplied&v=1.0" 2>>/dev/null | cut -d: -f2 | cut -d"}" -f1 | od -bc
It looks like this issue is happening in IE7, Firefox, and Android browsers as of this post, but it is not happening on the BlackBerry browser here on my Bold 9700. Looks like the BlackBerry OS is still backward compatible with decomposed forms as well as NFC now. I wonder how it works on the iPhone, but I will not lose any sleep over not knowing.

Monday, August 02, 2010

Dictionary - Từ điển

Chắc nhiều người biết một trang web tiện dụng cho dịch một ngôn ngữ, nhưng tôi quyết định tạo ra cái này đặc biệt cho các trình duyệt web di động được cho người nào chóng dịch một vài từ nhanh hoặc từ tiếng Anh sang tiếng Việt hoặc tiếng Việt sang tiếng Anh bằng Google Translate. Xin vui lòng với.

Many folks probably have a handy page for translating some language, but I decided to create this one specifically for mobile browsers to allow folks to quickly translate a few words from either English to Vietnamese or Vietnamese to English using Google Translate. Enjoy.

This one is one for Vietnamese:

Here is one for Spanish also:

Wednesday, July 21, 2010

Cô Hàng Nước

Nhà tôi chọn bài này ...

* Here are the chords and lyrics.
* Lượm lời bài với hợp âm ở đây.

Hãy vui long hát với à.

Tuesday, July 13, 2010

Google Translate "Side-by-Side View"

Google translate has a great feature where you can not only paste in your favorite text or url to some page in a foreign language, but you can display the translation in a "Side-by-Side View".

Here is an example of a bad translation. In case you do not read Vietnamese, one reason why it is a "bad" translation, is because it basically translates "Jesus loves me" into "I love Jesus", which, I'm sure, is funny for people with sick brains.

It appears that Google translate tries to remember your preferences as to "Side-by-Side View" or the default "Top-Bottom View", and I cannot figure out how to get a "Side-by-Side View" parameter in the urls here, so you will have to click the "Side-by-Side View" icon in the upper right hand side of the page.

Here is an example of a good or at least useful translation. It seems as though, the fewer words or ideas you have on each line, the more useful the translation is.

Wednesday, June 23, 2010

monobook dark

click to enlarge the screenshotSometimes these white backgrounds are just too much. So, I created a dark version of the default monobook skin for mediawiki. You can take a look at it in live action here.

And here is the download of the skin if you want to try it out. Just unzip it into your mediawiki/skins directory and put a copy of your logo at /mediawiki/skins/common/images/wiki_dark.jpg


Saturday, June 19, 2010

Animals ...

Mommy found more than one turtle ...

The girls found some baby birds in their nest ...

This duck is always hanging around ...

I think this one has more hair on his head than me ... sigh.

Friday, June 18, 2010

Understanding unicode ... a 5 minute deep dive

While Unicode provides a number for each character in our universe, there is also a "Unicode transformation format" that is an encoding for each of those characters. And it is this encoded character format that is actually used on the wild, wild web pages you are looking at now.

So basically, for each character, there is a number, called a Unicode number, and then there is an encoding of that character called the Unicode transformation format for the character. The most common encoding on the web at this time is called utf-8.

Not many people including myself can remember all of the details of unicodes, so I thought that this brief explanation could help lots of folks. Web developers might want to understand how a browser actually grabs a character on a web page of the wild, wild web and transforms it from the binary bits that it starts with into a Unicode character, and then figures out which of the fonts at hand have a character matching that Unicode value, or vice versa.

So, the following is an example showing the basics of how to convert from the Unicode number of a character to the Unicode Transformation Format using the 8-bit blocks that are used on the web. Stated another way, below it is shown how to convert from a Unicode number to utf-8.

From a Unicode number to UTF-8

Let's start with a non-English character ệ and its unicode number which is U+1EC7, and give you the answer right away, which is "E1BB87" in utf-8 hex. Now, let me show you how to get from U+1EC7 to "E1BB87".

Using the following "table A" from the request for comments, in this case, RFC 3629:

Char. number range  |        UTF-8 octet sequence
(hexadecimal) | (binary)
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

Step 1.

Determine the number of octets required from the character number and the first column of the table above. So our unicode value of 1EC7 for the character ệ places us on the third row between 0800 and FFFF:
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx

And here are some math details describing 1EC7:
1 E C 7 in hex
1 14 12 7 in decimal
1 16 14 7 in octal
0001 1110 1100 0111 in binary

Step 2.

Prepare the high-order bits in accordance with the second column of table A.

Since 1EC7 is between 0800 and FFFF, the given binary is:
1110xxxx 10xxxxxx 10xxxxxx which shows the little x(s) for 4 bits and then more x(s) for an additional 6 bits and then more x(s) for an additional 6 bits for a total of 16 bits or 16 x(s). And since 16 bits is equivalent to 2 bytes, it is understandable why some people refer to this as double byte encoding, even though the final number of bytes in utf-8 for this character will be three.
So the high order bits will be:
1110xxxx 10xxxxxx 10xxxxxx

And the low order bits will be:
0001 1110 1100 0111

As follows:
1110xxxx 10xxxxxx 10xxxxxx
+ 0001 111011 000111
11100001 10111011 10000111

and then the math details to get us to hex bytes:

1110 0001 1011 1011 1000 0111 in binary
16 1 10 13 10 7 in octal
14 1 8 11 8 7 in decimal
E 1 B B 8 7 in hex

Finally, the unicode number U+1EC7 encodes to the three hex bytes E1 BB 87 of utf-8. And these utf-8 bytes are what you will actually find on a web page of the wild, wild web.

A Handy cross check

If you like perl, you can use "perldoc -f pack" and you will find:
B A bit string (descending bit order inside each byte).
H A hex string (high nybble first).
So here is a line of perl code that verifies the hex and binary answer found above for the character ệ:
$ echo "ệ" | perl -lpe 'print unpack "H*"; $_ = unpack "B*";'


You can easily see how this algorithm works both backwards and forwards. Well, a browser can use these same steps in reverse in order to figure out what character in its font matrix to use for rendering the bytes "e1 bb 87" that it pulled off of a web page in the wild.

Hope that helps you understand the web a little better. Enjoy.


For more details you could start with the following documents:
RFC 3629
Look up characters given a unicode number
Look up unicode numbers given a character

Thursday, June 17, 2010

[WARNING] Unable to get resource 'org.someorg.project:project-proto:pom:some-version' from repository project-repo (http://repository.somecompany.com/

Do not worry, you are probably just behind a proxy. Try putting a file named "~/.m2/settings.xml " in your home directory's maven directory, or wherever your .m2 directory is:

Make the contents of the file something like this:
Replacing all of the relevant bits and removing any unnecessary lines, like username and password, if they are not needed.

Hope that helps.

Friday, June 11, 2010

A few of us ...


Sunday, May 23, 2010

Tình Ca Du Mục

She likes this song. So do I.
Nhà tôi thích bài này. Tôi cũng vậy.

* Here are the chords and lyrics.
* Lượm lời bài với hợp âm ở đây.

Hãy vui long với à.

Saturday, May 08, 2010

Red Roses for a Blue Lady

Played on a modest mahogany ukulele made by Cordoba ... model 20TM-CE. I was feeling a bit edgy and put a low g string on it that was made for a concert uke, but it was long enough for this tenor and sounded ok ??? ... I guess I got a bit out of control, but it was fun.

* Here are the chords and lyrics.


Monday, May 03, 2010

The Linux

Linux is now a definite article according to this story. Here is some of the evidence:
The team at Adobe can now use the Google’s open source Android platform which is similar to the Linux but for your mobile.
It's about time.

"The Google" on the other hand ... Impetuous.

Wednesday, April 07, 2010

I'll Soar

Finally got around to writing a gospel parody of Jason Mraz's "I'm Yours" and played it on a concert uke for fun ...

* Here are the chords and lyrics.


Tuesday, March 09, 2010

jQuery's show() function does not work on my BlackBerry ... sometimes :-)

Sometimes the show function in jQuery does not work in the (4.6.1) BlackBerry browser. Below is a detailed explanation the problem, followed by a solution showing how to fix this, and then an educated guess at the reason for the problem:

1) The problem may occur if you have something like the following javascript code in your web page:
<script src="js/jquery-1.4.1.min.js" ></script>
$(document).ready( function() {
$('div.features').hide(); // hide all divs of class="features"
$('div.features').first().show(); // show the first div of class "features"
function reveal(featureId) {
$('div.features').hide(); // hide all divs of class="features"
$('div#' + featureId).show(); // show the div with id=featureId
<select onchange="reveal(this.options[selectedIndex].value)" >
<option value="feature1" >BB Browser feature 1</option>
<option value="feature2" >BB Browser feature 2</option>
<option value="feature3" >BB Browser feature 3</option>
<div id="feature1" class="features">BB Browser feature 1</div>
<div id="feature2" class="features">BB Browser feature 2</div>
<div id="feature3" class="features">BB Browser feature 3</div>
Now if the "reveal" function is called using the <select onchange="reveal(...)"> as shown above, the call to the show() function will sometimes not have the desired effect of changing the display style of the div from "none" to "block".

2) My suggested solution or fix for this:
Use .css("display", "block") instead of .show()

3) Why is this happening only on my BlackBerry?
It appears that on the BlackBerry browser (at least the version noted) there is a race condition that causes this as follows:
a) Sometimes jQuery's data cache of the display values is set before the $(document).ready function is called, and so the styles are all cached as "display:block" which results in the expected behavior.

b) but sometimes jQuery's data cache of the display values occurs after the $(document).ready function is called, and so the styles are cached as "display:none" (except for the first one in this example). Which results in only being able to "reveal" the first feature ... jQuery's show() function is in fact getting called in any case. It is simply setting the display style to the cached value which is "none" in this case.

c) It appears that this issue starts occurring only after returning to the page a few times, or by returning to the page using a bookmark. You can try it here with your BlackBerry browser.
There may be some magic jQuery function that could be called in $(document).ready function before the hide(s) take place to make sure that jQuery's data cache is populated with the desired values first, but I'll leave that and any other errors in this discription of the issue to the jQuery experts in the comments below :-)

Hope that helps.

NOTE: This was discovered while testing with a BlackBerry 8350i running v4.6.1.204 of the BlackBerry OS using the jQuery.fn.show function with javascript turned on, of course.
NOTE: This was discovered using jquery-1.4.1.min.js
NOTE: Could not reproduce this issue using a BlackBerry 9700 running v5.0.0.330 of the BlackBerry OS ... it just works fine.

Thursday, March 04, 2010

The good and the bad ...

How many trashy youtube videos get advertised for us to see? How many comments are made about each and every detail of those videos? Now let's examine the other edge of the sword of truth. How many good things can you find in a video like this ...


Tuesday, February 23, 2010

Error getting repository data for rawhide, repository not found

If you get this error, do not worry. This issue is "normal" with Fedora. No other distro that I am aware of changes your default repositories without letting you know, except Fedora. So that is the problem. Yum has decided to replace your /etc/yum.repos.d/fedora-rawhide.repo file with NOTHING.

So you can issue the following command:
# cp /etc/yum.repos.d/fedora-rawhide.repo.rpmnew /etc/yum.repos.d/fedora-rawhide.repo
And you may be back to normal.

I say you "may" be back to normal, because, in my case, there is still an issue. I am behind a "transparent" proxy and the folks who update the fedora-rawhide.repo file love to use https. Well, this causes me to get the following error: "Cannot retrieve metalink for repository: rawhide. Please verify its path and try again". If you simply edit the fedora-rawhide.repo file and change the https to http, updates work fine.

It appears that there is some software downstream from the fedora-rawhide.repo parsing that has problems conducting https through our "transparent" proxy ... imagine that.

Thursday, February 11, 2010

Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory

Do not worry. Here is the solution to your problem:

Answer: Just try specifying a video output driver on the command line when you launch mplayer like this:
mplayer -vo xv video.wmv
You can get a list of "Available video output drivers" with the command "mplayer -vo help".

Details, if you are interested:

The problem is that the selected (or default) video output driver was vdpau, and no one working on the mplayer packages and software cares enough about having the software package work with your configuration of hardware and software. But do not worry, you are now blessed with this answer, and the video output driver can be specified on the command line (e.g. -vo xv).

The order of configuration options that mplayer will scrawl before it finally decides to (only) try the (missing) vdpau driver is not so obvious, but I think it roughly goes like this:

1. Check the ~/.mplayer/config for the (user specific) default video output driver, if any
2. Then check /etc/mplayer/mplayer.conf for the (system specific) default video output driver, if any
3. Then check in the compile options that mplayer was built with for a default (build specific).

If the mplayer command you were using was compiled with the vdpau option and there are no default video output drivers specified in ~/.mplayer/config or /etc/mplayer/mplayer.conf (which is either a common occurrence or I am the only person on the planet earth who has ever had problems with a configuration option on a linux box) then it will fall back to the compiled default which in this case was vdpau.

More details, imagine that:

Another similar issue is that mplayer may work fine while gmplayer gives this same error using the same options you just tried with mplayer. Well guess what? gmplayer uses yet another config file, ~/.mplayer/gui.conf, and it will default to the last video driver specified (or defaulted to in the compile options). So again, just specify a video output driver on the command line, or put one in one of the myriad of config files mentioned here.

Hope that helps.

Tuesday, February 09, 2010

Kick users out of terminal services in Windows Server

If you need to boot some users out of terminal services in Windows Server, try the following:

1) Start
2) All Programs
3) Administrative Tools
4) Terminal Services Manager (this is also called tsadmin.exe)
5) Right click on the user you want to boot in the "Users" tab and click
6a) Disconnect - which may leave some of their applications running, I guess
6b) Log Off - which will log the user off, and should kill any processes they have running.

Of course you will need Administrator privileges to do this.

Since Windows limits you to 2 remote sessions, if someone has two disconnected sessions, you will not be able to log in without additional software, imagine that. So instead you could try using a different operating system that treats administrators like first class citizens.

Wednesday, January 20, 2010

You are *required* to use the date.timezone setting or the date_default_timezone_set() function.

warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /var/www/html/drupal-6.15/modules/node/node.module on line 802.
If you get an error something like this. Do not worry. Just edit your /etc/php.ini file (the location of yours may differ) and add an entry for the date.timezone that should look something like this:
date.timezone = "America/New_York"
Then restart your webserver:
service httpd restart
Of course, your commands for restarting your webserver may be different depending on your lifestyle. But, no more errors from php functions trying to figure out what time it is.

Hope that helps.

Monday, January 04, 2010

Solution: Cannot create a desktop icon in KDE version 4.x

If you cannot create a link to your favorite application in KDE version 4, do not worry. Here is a procedure that may help you:

1) right click on your desktop
2) click "Desktop Activity Settings"
3) select "Activity" from the list on the left
4) change the "Activity Type" from "Desktop" to "Folder View"
5) click "Apply"
6) click "Ok"

Now you should be able to:
1) right click on your desktop
2) Create New
3) Link to Application

Hope that helps.

I have no idea why the KDE folks think that we should all magically know that we need to change our Activity Types from Desktop to Folder View, and that this would obviously change the desktop behavior to allow for adding an application icon to the desktop. If we picked random words from the dictionary, and substituted them for "Activity", "Desktop", and "Folder View" it would probably make more since why the new settings should allow an application launcher to be added to the desktop.

What is amazing and randomly wrong is that the default Activity Type called Desktop does NOT allow someone to add an icon to launch an application.

What do you think?