Programming


3/1/2007: 5:03 pm: JamesComputer, Programming

To update the MySQL server,  you really do not have to run a patch.  That is a common question I was getting from people was where to get the patch.  You actually have to patch the OS and then from there run a command on MySQL.  If you’re OS doesn’t use zoneinfo, there is even a fix for this without having to reinstall a newer version of MySQL.

Taken from http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html:

If your system has its own zoneinfo database (the set of files describing time zones), you should use the mysql_tzinfo_to_sql program for filling the time zone tables. Examples of such systems are Linux, FreeBSD, Sun Solaris, and Mac OS X. One likely location for these files is the /usr/share/zoneinfo directory. If your system does not have a zoneinfo database, you can use the downloadable package described later in this section.

The mysql_tzinfo_to_sql program is used to load the time zone tables. On the command line, pass the zoneinfo directory pathname to mysql_tzinfo_to_sql and send the output into the mysql program. For example:

shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql   

mysql_tzinfo_to_sql reads your system’s time zone files and generates SQL statements from them. mysql processes those statements to load the time zone tables.

mysql_tzinfo_to_sql also can be used to load a single time zone file or to generate leap second information:

  • To load a single time zone file tz_file that corresponds to a time zone name tz_name, invoke mysql_tzinfo_to_sql like this:

    shell> mysql_tzinfo_to_sql tz_file tz_name | mysql -u root mysql 

    With this approach, you must must execute a separate command to load the time zone file for each named zone that the server needs to know about.

  • If your time zone needs to account for leap seconds, initialize the leap second information like this, where tz_file is the name of your time zone file:

    shell> mysql_tzinfo_to_sql –leap tz_file | mysql -u root mysql 

If your system is one that has no zoneinfo database (for example, Windows or HP-UX), you can use the package of pre-built time zone tables that is available for download at the MySQL Developer Zone:

http://dev.mysql.com/downloads/timezones.html   

This time zone package contains .frm, .MYD, and .MYI files for the MyISAM time zone tables. These tables should be part of the mysql database, so you should place the files in the mysql subdirectory of your MySQL server’s data directory. The server should be stopped while you do this and restarted afterward.

Warning: Do not use the downloadable package if your system has a zoneinfo database. Use the mysql_tzinfo_to_sql utility instead. Otherwise, you may cause a difference in datetime handling between MySQL and other applications on your system.

6/5/2006: 1:37 pm: JamesJobs, Programming

Just got the results in from MySQL … I’ve passed both the Certified MySQL Developer Part I and Part II exams.  I took one exam in March and the other in April, but both were beta exams.  That meant that I was not able to get results at the end of the exam.  I’ll put the certified logo up on this post once MySQL releases a certified logo.

MySQL5_0Developer.png 

4/20/2006: 3:48 pm: JamesProgramming

I had taken the MySQL Beta Developer 5.0 Certificatino Exam a couple weeks ago.  Since it was a beta, I knew I would get my results for a good 8 - 12 weeks after the beta exams were supposed to end, which at that time was April 15th.  I stopped over at the MySQL website today, to get the information on the JDBC for MySQL.  That’s when I noticed that the beta exams were extended until May 15th.  I guess their website was not finished being updated, because a lot of places on the page still listed it as ending April 15th.

A bit frustrated with the new date, because I did not want to wait an additional 8 - 12 weeks after May 15th, I sent them an email asking when they intended for the results to be sent.  I was hoping that it was still inteded for 8 - 12 weeks after April 15th.  I quickly received an email from Carsten informing me that they will be grading the exams right after May 15th and that he strongly suspects that I will see the results from my certification exam before the end of May.  Woohoo.

Since the certification has been extended another month, I think I might consider taking the first certification exam for the MySQL 5.0 Administrator certification.  Haven’t decided on that though since I also want to get some Java certifications soon. 

3/9/2006: 1:50 pm: JamesProgramming

While working on a project, everything was working on our beta site just fine.  Once we moved the project to the production site, we ran into an issue on a page that exported a csv file of information inline.  The only difference was that the production site was running SSL.

The basic situation is as follows.  A script written on PHP, running on Apache, through a SSL connection is dynamically generating a file (in our case a csv) and then sending it to the client.  This works correctly through Firefox, but returns an error in Internet Explorer.  The error returned is:

Internet Explorer cannot download <url of link>

Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found.  Please try again later.

Here’s a hint, no matter how many times you try again later, it will not work.  I started with this code:

header("Content-type: application/csv\n");
header("Content-Disposition: attachment; filename=\"$filename\"; size=$size");

After much research, I found the way to fix this is through the Pragma header, making sure it’s anything BUT off-cache.  Once I add a new header, it worked fine through both Firefox and Internet Explorer:

header("Content-type: application/csv\n");
header("Content-Disposition: attachment; filename=\"$filename\"; size=$size");
header("Pragma: turn-off-cache", true);

I just changed it to turn-off-cache, but anything typed in instead of off-cache would work fine.

2/16/2006: 2:55 pm: JamesLinux, Programming

I had ran into a few issues when I tried running Komodo on my desktop machine that is running an AMD64.  The install went just fine, but when I tried to run Komodo it would fail while looking for libraries.  In my particular case it was the libgtk-x11-2.0.so.0.  When I did `ldd komodo-bin`, I realized that was not the only library that was missing.  It ended up I needed to install more lib32 compat libraries.  The fix to the issue was to emerge ‘app-emulation/emul-linux-x86-gtklibs’ which fixed all my problems and allowed me to run Komodo.

Here is a list of the emul libraries that I have installed on my system in case other people are having problems:

app-emulation/emul-linux-x86-baselibs
app-emulation/emul-linux-x86-compat
app-emulation/emul-linux-x86-glibc
app-emulation/emul-linux-x86-gtklibs
app-emulation/emul-linux-x86-java
app-emulation/emul-linux-x86-soundlibs
app-emulation/emul-linux-x86-xlibs

I’m not saying that you will need all of these.   More than likely you will not need them all.  This is just the list of the ones that I had installed when Komodo is working. 

1/12/2006: 9:52 am: JamesProgramming

Looks like Zend is celebrating their 1000 person to receive a ZCE (Zend Certified Engineer) certification.  They sent me an email about it a couple days ago, but I’ve been so busy that I really have not had a chance to look at it until now.  Apparently, they have created a new ZCE logo for the first 1000 ZCE’s to use.  I just happen to be one of the first 1000.  In case you’re not sure what the Zend Certified Engineer means, it basically is a certification for programming with PHP.

ZCE1000.GIF 

12/17/2005: 1:09 pm: JamesGeneral, Programming

Added the popular photo management software, Gallery, to my blog.  Spent a couple hours this morning getting it installed and configured.  This was not for the faint of heart.  I would say someone with moderate programming skills would be able to do this.  I have been working on the css of the photo gallery.  Not perfect, but good enough to add it to my blog now.

There is a photo link in the side bar now, so you can get to the album link from there.  Quick link to photo gallery

11/30/2005: 6:56 pm: JamesProgramming

Took the PHP Certification Exam today and passed it.  The exam ended up being a lot more difficult than I thought it would be.  I’m now a Zend Certified Engineer.

Zend Certified Engineer 

Not sure what kind of certification I am planning to go after next.  At this point in time I think I am leaning more to a MySQL Core Certification and MySQL Professional Certification.  The other certifications that I’m interested in getting in the future would be java certifications. 

11/18/2005: 2:11 pm: JamesProgramming

For the last couple hours, I’ve been frustrated trying to figure out why I’m having an issue creating a session cookie with PHP while browsing with Internet Explorer.  This was testing some software for work that I wrote, or I wouldn’t have been using Internet Explorer emoticon.

Here is the problem that I ran into.  There is a master page that is being ran on a seperate server than the one that will be displaying this content.  The master page displays my servers content in one of the child frames.  When using internet explorer with the default privacy setting, Medium, I am not able to create a session due to the fact that a cookie will not be accepted by Internet Explorer.

I have found a solution to this problem.  The situation is that when the frame has been created by one server, and the child frame then loads content from a second server, Internet Explorer treats all cookies from the second server (in the child frame) as 3rd party cookies.  Under the Medium privacy level, cookies are not allowed from the secondary server because Internet Explorer "Blocks third-party cookies that do not have a compact privacy policy".  To fix this problem, a compact privacy policy must be added to the headers sent to the client before a cookie is attempted to be created.  The quick way is to just send this string in a header to the client ‘P3P: CP="CAO PSA OUR"’.  To get a better understanding of a compact privacy policy, you can go to http://www.w3.org/P3P/.  There is a bunch of commercial software out there to help you create fully detailed compact privacy policies, or you can use the free one that I found at http://www.the-dma.org/privacy/creating.shtml.

One thing to note is that this issue does not only occur with PHP.  Just happens that’s what I was developing with when I found the issue.  It will occur with any development language that tries to create cookies in the situation where a compact privacy policy does not exist, internet explorer is set on medium privacy level, and a frame page served by one server loads a child frame from another server. 

6/18/2005: 11:19 pm: JamesProgramming

Since I have more free time since I graduated and I want to develop my java skills, I’ve decided to write a program that demonstrates how to do Lattice Multiplication. The program will allow a user to input two different numbers, and then there will be a step button which takes you through the steps and shows you each step along the way. Once it is completed, I will release the source code under GPL license.

UPDATE: Kristin made a sheet up explaining the steps for people that do not know how to do Lattice Multiplication.
LatticeMult.tif

Next Page »