Working mini-displayport to VGA adapter for HP Envy 14

So I like a lot of things about my HP Envy 14. There are a lot of positive reviews that agree with my sentiment. One thing that is annoying to me however is the available display output ports on the laptop.

The laptop only has a mini-displayport and hdmi outputs to connect to an external screen. Not having a VGA port is unusual for most computers (save for macs) and is usually not too much of a problem if you have a need to connect to a projector or an external monitor. Most monitors I have seen usually will only have VGA ports, or additionally DVI. HDMI is also fairly common, but displayport is still uncommon. If you’re looking at a projector, you most likely only have the option of VGA right now. In the cases where the monitor/projector you’re trying to connect to does not have a displayport or HDMI connection, you can easily get an adapter to get the right connection. Or so you would think. Continue reading

Posted in misc, Uncategorized | Tagged | 8 Comments

codeigniter 1.7.0 bugs

Update: 1.7.1 fixes both bugs.

So I recently upgraded from codeigniter 1.6.3 to 1.7.0 for a project of mine and I noticed 2 bugs after I had upgraded.  Luckily, they both have simple, easy workarounds.  The first problem I noticed was that the default port for the mysqli driver is not being set correctly. This will cause an error while trying to connect to the database: “Unable to connect to your database server using the provided settings.”  The easy workaround for this is to supply a default port in your database settings file if you use mysqli.  Something like

$db['default']['port'] = "3306";

should do the trick (depending on what you call your db connections and what ports the db uses for connections.  Of course, if you’re not using the default 3306 port, you probably already have a line like this in your configuration).

The second bug I found is that using random ordering with ActiveRecord on a mysql or mysqli connection is broken.  The correct syntax should be something like


However, there seems to be a quote escaping error that will cause an error message to spit out: “Unknown column ‘ RAND() LIMIT 1′ in ‘order clause’”.  The quick hack to solve this (for mysql dbs) is to put the random ordering directly into the first parameter of the order_by() call, like so:


This is not ideal but it’ll get the job done.  If you’re using order by random in a lot of different calls, you may want to try to fix the bug yourself.

Posted in programming | Tagged , , | Leave a comment

How to Type in Pinyin in Windows

As a followup to my previous post, here is how I type pinyin characters in Windows.  Again, this is for Windows XP but it will most likely work with Vista as well.

First, you have to install an additional keyboard.  It doesn’t come built in like normal characters.  I didn’t make this keyboard mapping but I found it on some forum somewhere and I really like it.


Just unzip and run the installer.  The keyboard will show up in the Chinese (PRC) language; it will be a new option in the keyboard layout menu.  The quick (and default way) to switch between keyboard layouts for a language is to use CTRL+SHIFT.

When you’re typing, it will show a preview of what the output will be.  Start typing the word you want to type, and then when all the letters are there, type in 1, 2, 3, or 4 to signify the tone, or don’t press any of those numbers to leave the tone neutral.  Hit enter when you’re done and it will print the characters shown in the preview.

That’s it, quick and easy.

Posted in languages | Tagged , , , | Leave a comment

How to install Magento on Dreamhost

I’m not sure about anyone else but I have had much trouble trying to get the latest version of Magento (version, 1.1.6 as of the time of this writing) installed on a Dreamhost shared server.  The basic, lowest plan supports all the stated requirements for Magento, and I had installed Magento very easily on my local machine (Win XP, Apache 2.2.9, MySQL 5.0.67) using the web installer.  However, I tried doing the exact same thing on the Dreamhost server and I found a deluge of different errors after trying to run the web installer several times.  The errors ranged from an apparent bad .htaccess fill (bad redirect that caused an HTTP 500 error) to several different errors in creating the database tables.

After several tries, I thought I should try a different approach.  The install guide that comes with the downloaded package states that you can do an install from the command line.  I tried doing that and it worked perfectly and easily the very first time.  I’m not sure what it is about the web installer but there was no way I was able to get it to work on dreamhost.

Here’s the command from the install file.  Dreamhost uses php4 as the default from the command line so you have to run the install file script using php5.  Of course fill in the specific values for the options for your installation as necessary.  Hopefully this can save someone else the several hours it took me to figure this out.

/usr/local/php5/bin/php -f install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento_database --db_user magento_user --db_pass 123123 --db_prefix magento_ --url "" --use_rewrites yes --use_secure yes --secure_base_url "" --use_secure_admin yes --admin_lastname Owner --admin_firstname Store --admin_email "" --admin_username admin --admin_password 123123

P.S. I know many people on forums say Magento is slow on a dreamhost shared server but this install was not meant to be a live production site, just something for me to play around with.

Posted in programming | Tagged , , , | 2 Comments

Chrome vs Safari rendering

So when Google released Chrome and released a statement that said it was based on the WebKit rendering engine, I thought it would render pages exactly the same as Safari would, and thus save web developers from having another browser to test against.  Sad to say, I noticed that one site that was displayed incorrectly in different ways in Chrome and Safari.  I wish I had taken a screenshot since the site has since been fixed to display correctly in both browsers now, but the fact stands that Chrome and Safari may render pages differently.  I’m too lazy and don’t care enough to find out what the particular rendering differences are, but I’m sure there are other people that will do so.

Posted in misc, programming | Tagged , , , | Leave a comment

SVN: Expected FS format “2″ ; found format “3″

So I updated the svn server on my linux box earlier this week from 1.5.1 to 1.5.3, compiling from source.  When I tried to create a new repository using the command svnadmin create dir, I saw this error message when I tried to connect to the repository using tortiose svn on windows xp: Expected FS format “2″ ; found format “3″.  I spent a lot of time on Google trying to figure out what could have caused this and how I could fix it.  Some posts that I found said that there were probably old svn libraries lying around somewhere.  This may have been the case for some people with this problem, but I was pretty sure it wasn’t the case for me since I removed my old libraries as per the instructions from the 1.5.3 install guide before I compiled.  I found one post that was different from all the rest I had seen.  I forget where it was but basically it said that there was probably and old version of svnserve running on the server and that was what was causing the problem.  I did indeed have svnserve running in the background as a daemon, so I killed the process and restarted and what do you know, the error was gone.  Hopefully this tip can help anyone else that might be having this problem.  I only found this solution in 1 other place and I was about to give up after a long and fruitless search.

Posted in programming | Tagged , | Leave a comment

Don’t forget to register to vote

Voter registration deadlines  to vote in the upcoming election are coming up.  Here’s a list of the deadlines by state.  Many have already passed but California’s deadline is on Oct. 20.  If you haven’t already registered (or need to update your address as I did), you can fill out a pdf online here and print it out and mail it in.  It would be easier if it could all be done online but there must be some reason that it can’t (I hope; otherwise it would be wasteful in many ways – printing out the forms, mailing it [and paying postage], having someone read them and enter the data into their database).

Posted in misc | Tagged , , | Leave a comment