MySQLi PHP conversion tool

I just got the MySQL AB newsletter in my inbox this evening and there’s an interesting tool they introduce that will convert existing PHP scripts that use the standard (“old”) mysql extension to use the new mysqli. “i” stands for “improved” – the new extension is faster and can take advantage of the new MySQL features introduced after version 4.1:

The new extension ext/mysqli supports all new features of the MySQL Server Version 4.1 and higher, for example Prepared Statements and support for Character Sets. Prepared statements are a great step ahead, especially nowadays when everybody is concerned about security.

The article goes on to explain that a WordPress installation can be converted to mysqli and ready to use in under 45 seconds. What it won’t do is create things like prepared statments, which of course, is up to the developer!

The full article is located here: http://forge.mysql.com/wiki/Converting_to_MySQLi

Interview questions… for a PHP job

Last week I went through one and a half hellish days of interviewing candidates for my replacement – one position for PHP and another for the research coordinating. Larry and I talked to over a dozen people. It wasn’t bad, per-se, but I wouldn’t do so many all at once again. It really made me realize how the whole interviewing process must run like a well-oiled machine so it won’t kill you in the process!

We didn’t have a lot of people apply for the PHP job, but it was a good experience for me nonetheless. I gave each person 6 questions to answer as part of the interview so I could gauge where they’re at:
Continue reading “Interview questions… for a PHP job”

DFL major release!

Lots of news over here at the Digital Fish Library. We just moved the production, qa, and dev staging sites to our new servers over the weekend, and at the same time made some major updates public that will surely allow the website to grow with few pains over the next several months.

1) Family accounts: read-up on various fish families we have in our digital collection. Be forewarned that a lot of the content is not yet available because our editing timeline is a bit behind schedule.
2) Different browse views: peruse the collection by recent additions/edits, species name, family name, and soon by Order.
3) Habitat identification tags: quick visual reference of what types of habitats the fish are typically found in.
4) RSS Feeds! We now have an RSS feed of all recently updated species accounts. You can also plug it into your Apple RSS screen saver (how cool!): http://www.digitalfishlibrary.org/feed/. We have it running on the active display in our lab’s waiting area right now.
5) Lots more content (just about). We have a lot more content going up today. Stay tuned.
6) Cross-linking: We link back and forth between family and species accounts, as well as to the SIO MVC database and Fishbase.
7) Photos: we’re in the process of adding photographs of the fish to the species accounts. It just makes everything look nice and museum-like.

My last day on the project is Oct 23, but you can expect a few more minor updates before I leave.

SEO your URL

If you’re looking for some help on learning mod_rewrite, this post isn’t for you. sorry. Instead, I’m going to show you a neat little trick that will make sure you always have one the www in front of your domain name. Why is it important? Potentially for your stats package, definitely for search engine ranking (no duplicated content), and even for uniformity across brand(?). Though it’s not necessarily part of your “brand” it is important to be consistent with the URLs you send people or have others link to.

For the purposes of this example, we want our URLs to always have the www in front: www.digitalfishlibrary.org

Step 1:
Open (or create) your .htaccess file and add RewriteEngine On if it isn’t already in there.

Step 2:
Below the RewriteEngine On line, add the following Rewrite condition/rule pair:
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

We use the http 301 response code to tell browsers and search engines that this is a permanent redirect, thus updating their records. Little-known fact: web browsers are supposed to automatically update bookmarks to the new URL from a 301 code. Search engines probably do the same with their indices.

Changing scenery… Downtown!

It was a bitter sweet week this week. I took a job with a company in downtown (San Diego), thus marking my remaining two weeks at UCSD. Sweet, of course, because I’m finally at the level where my skills are (very) marketable. Bitter? I’ve been in research for over four years now – under Dr. Lawrence (Larry) Frank at the Center for fMRI and the Center for Scientific Computation in Imaging. I’ve poured a lot of my life into the Digital Fish Library as the sole web designer/developer, and I can safely say it’s a project I’m proud of. Of course, there are things that, given the time, I would change about it – mostly to spruce-up the design aspect, but such is life and I’m pleased with my work overall.

It’s time to move on. Opportunity knocked and I took it. I’m excited to start at 212Interactive on October 25 doing PHP/MySQL development…

Pre-QA isn’t good for interviews

I’m just going to throw this out there… if you have a piece of software, site, etc that isn’t quite at the QA stages, no matter how rockin’ in might be, you might want to consider holding off on showing it to others until you know the demo is going to work. I think I’m done showing people demonstrations of Mr. Fish Lite until the backend VTK issues are ironed out, which thankfully is *not* my job. There are some pesky UI issues I need to iron-out with IE box models and transparent PNG support as well, but at least those are things I can fix pretty quickly.

My advice, show some screenshots or maybe even make a snazzy video demonstration where you can control all the variables.

In the meantime you can see a screenshot of Mr. Fish Lite here

Anchor tags and Safari

I found an interesting “bug” in Apple’s Safari today while updating a page on Flood’s deprecating website (new version coming up in September). First of all, for the record, nobody on the team designed the template currently in-use (Aug, 2006).

I just needed to put an anchor near the end of the page… pretty standard stuff. The problem is that Safari wasn’t jumping down the page – only a couple lines. Odd because IE and FireFox jumped just fine. I’d never had that problem before, but I traced it down to something pretty simple (and maybe even conceivably reasonable). Safari jumps to the beginning of the paragraph or div that the named anchor resides in. The problem with the Flood page is that the original designers didn’t really use p tags, or divs, for that matter (in fact, simply adding a p tag will disrupt the page design… go figure). So Safari would simply jump down to just below the heading tag.

The fix? I put empty div tags around the a name tags. Problem solved!

Wireless mesh networks in Africa

I’ve never been to Africa before, but I have many friends who have. I know that their internet access there (in Malawi, at least) could often be a lot better. The problem most likely arises from the lack of a solid data infrastructure. There are DSL solutions, but from what I’ve read they can be fairly unreliable, depending on where you are. Furthermore, Malawi often sees rolling black-outs. I don’t know exactly why they do this, but I imagine it probably has something to do with budgets.

Propagating network connections over long distances using wireless isn’t a new idea. In fact, it’s something many companies and municipalities across the world are considering in rural areas. All one needs is a pair of unidirectional, high-gain antennas pointed at each other and you can create a link between nodes miles apart. I’ve even seen experiments in the San Francisco bay area using nothing more than the asian frying scoop (round, mesh ladle of sorts) and a USB 802.11 adapter to connect to another one several miles away. But this isn’t the purpose of my post – just a little side note and something which may be a feature of my ideas later on.

What I AM thinking about:
My church, Flood, works closely with the African Bible College in Malawi. They’ve been around for quite a while, and even have a very good reputation for the quality of education they provide. But it’s only now that they’re getting broadband installed. All of a sudden they have an opportunity to connect their computer lab, their administrative offices, and their professors to a (faster) connection. The major hurdle, however, is that there’s probably no data cabling installed anywhere between buildings (or even within, for that matter). So the idea came to me when I read about MIT’s RoofNet project. Perfect! You buy a bunch of Netgear routers, flash them with a special distribution of linux and other customized software packages, and all of a sudden you have a pretty nice 802.11b/g mesh network. I could imagine littering these all over the campus, thus negating the need for dedicated ethernet links, additional switches, etc. I’m going to continue looking into this idea and talk to Flood’s resident networking pro, Seth Eaton, to see what he has been thinking of for this project. Perhaps the folks over at Meraki Networks (spin-off from RoofNet) wouldn’t mind donating some units in the perfect test location?? Seriously guys, please consider it and we can work something out =)

Maybe I’m going to Africa sooner than I thought!

Fedora FC5 black screen install woes – FIX

Here’s a quick post for those having difficulties installing Fedora Core 5 (FC5) on systems with ATI cards.

Our new 80 node cluster install at the DFL is just about finished. I get two Dell PowerEdge 1425s all to myself for web stuffs. First order of business: ditch RedHat Enterprise Linux. I need cutting-edge software.

The install process goes fine in graphical mode until it’s time to restart. Reboot. After loading the system the screen goes black and doesn’t seem to respond to keyboard input. I could, however, log-in to the system via SSH and do some minor investigation, though it was painfully slow. Uptime showed a heavy processor load, and top showed that Xorg was taking up around 100% processor time. Hmm… Clearly a video card/driver-related issue.

I did some searching and found probably the easiest video card fix I’ve ever come across. (And remember – these instructions are ONLY for ATI cards). At the install boot prompt [boot: ] simply enter linux vesa. The install process went smoothly and the server is now usable in graphical mode.

Hey there! Come check out all-new content at my new mistercameron.com!