Storing GMT in MySQL, Timezone Conversion in PHP

At Trellis Development we’re working on several applications which need to frequently convert dates between various time zones.

By default, both PHP and MySQL operate using a single timezone which is identified during installation and is quite often the same as the host server. Both tools allow you to specify a different timezone on the fly, and all following date operations work based off of that locale.

The primary goal is to preserve a base standard time so that we can easily convert between different timezones, without loosing the ability to convert again. Two choices emerged – storing a Unix Time stamp or a date string stored using GMT/UTC time.
Continue reading this post…

Published by Michael Botsko on 8/13/2009

Integrating QuickBooks for Mac-based Users

During development of a recent point-of-sale / e-commerce package, I started researching ways of exporting data from a web-based application into QuickBooks. A decent tool called Web Connector allows QB to connect with a web source and share information, and there’s even what appears to be a very thorough PHP class for interfacing.

However, Web Connector is Windows-only. My client runs a Mac.

Disclaimer: Prepare to be disappointed.

Continue reading this post…

Published by Michael Botsko on 7/31/2009

Formsaver now on github

I have moved the source code for my Firefox extension Formsaver over to github, so it’s now open for forking and/or downloading.

Inside is a file called xpi.sh which is a shell script that’s responsible for actually creating a build file that may be loaded into Firefox. It replaces the firefox.xpi file.

http://github.com/botskonet/formsaver/tree/master

Published by Michael Botsko on 7/24/2009

Currently Scheduled PCC Courses

Javascript
I am currently teaching Introduction to Javascript at the PCC Mt. Tabor center in SE Portland. Classes are every Monday until August 24, and there’s still room in the course for those interested. Follow the link above to enroll.

The book was already chosen as I’m essentially a substitute on this one. Despite being published by Microsoft, it covers some essential topics for developing on the web today. It even mentions Firebug (a firefox extension) so it’s nice that it’s not biased towards MSFT.

PHP
In October, I will be teaching the Introduction to PHP course a bit closer to where I live and work. I have not yet selected a book, but I’m currently working on adapting Trellis internal training materials.

There are still spots open so go ahead and register!

Published by Michael Botsko on 7/22/2009

Zend Studio 7

Recently, version 7 of Zend Studio was released. Very unhappy with version 6, but previously satisfied with Zend 5.5, I decided to give it another chance to see if they had any luck improving the user experience.

Zend charges you $399 per year to use this software. They’ve got a standard toolkit for every php developer from phpunit support, documentation support, subversion support, code galleries, etc. These would be very useful if Zend had not gotten the user experience part all wrong. For $399 per year, they better have some great advantage over FREE competitors like NetBeans IDE.

Continue reading this post…

Published by Michael Botsko on 6/24/2009

NetBeans 6.7RC1 Crashes on Mac OS X 10.5.7

After an hour of searching, I found that the problem for me was that java 1.5 on mac was forcing netbeans to run in 64bit mode which was causing it to crash before it even opened.

By following the instructions (reposted with more info) at http://blogs.sun.com/yakshaving/entry/netbeans_will_not_start_on) I was able to get things resolved. As far as I can tell, I have not affected anything else I have.

Published by Michael Botsko on 6/3/2009

Explaining the Field

Many clients have difficulty understanding why things take the time that they do. It’s always been a point of discussion during estimate time and can become a problem when something is added last minute to a project. I wanted to clarify some facts about the web development /design field to help avoid these problems.

The time necessary to develop a clean, well-organized, well-written application that adheres to the standards set by the W3C and community can often surprise clients and leads.

An example…
Continue reading this post…

Published by Michael Botsko on 5/6/2009

WYSIWYG Choices: Nicedit vs. Tinymce

In several recent projects we attempted to replace Tinymce as the leading content editor of choice with the much simpler Nicedit. We did not have any great need for the advanced features Tinymce offers and were looking for a much smaller, easier, faster tool.

While I’ve used nicedit before in basic situations and had no problems, I encountered several fatal issues which caused us to revert to Tinymce.

Inner-DIV Implementation
Nicedit creates a new DIV element that relies on some newer HTML features to work properly. Multiple issues stemmed from this, but the primary problem was that all CSS from parent elements would cascade into the DIV, thus forcing me to reset or modify some of them.

Tinymce uses an iframe which is a completely new document, so all CSS does not filter through. This also helps avoid the following content problems.

API
When ajax load/save techniques were used, there were problems with how Nicedit would copy it’s content back to the textarea, thus requiring extra programming. The API documentation is not that great, so it was a little difficult.

Elements Used
In firefox, Nicedit would use a different set of markup elements than it would in IE, making the output harder to predict. This issue is partly due to the use of the Inner-DIV and contenteditable attribute. When filtering the input for markup, we had to allow for both sets of elements. In firefox, the elements were all SPANs with style attributes, which isn’t anywhere near semantic.

Firefox LI Bug
Instances of the editor inside of a list item would have a fatal problem with newlines. While you could type alphanumeric characters, newline key presses would have no result. This was a fatal problem that took some time to debug, but it’s been filed and is awaiting resolution.

Obviously, nicedit is a lot less powerful and has a much smaller community. While it works well for quick needs, nicedit just didn’t work for more standard uses, and we found tinymce a much better solution despite it’s bulk. Since then I’ve managed to weed out a lot of tinymce code we weren’t using, optimize it like crazy, and create some custom plugins for it.

Published by Michael Botsko on 4/20/2009

Additional Policy Change: Specs

Since the recent policy changes we announced in January, it’s become necessary to expand on the new policy regarding project specifications. Project spec documents can be a chore sometimes, but they’re almost the most important aspect of the entire project.

The new policy from January requires that any projects above $1k have an official specifications document and (optionally) mockups that define the official scope of the work. This document needs to be started by the client as they document what they want, and finished on our end as we document the work and technology involved.

But what happens is that it’s often a chick-or-the-egg scenario where clients need an estimate before they can spend time doing a spec, and we need a spec before I can do an estimate.

Beginning immediately, we’re slightly modifying the policy:

We will provide a pre-spec estimate for initial approval. This estimate will clearly be labeled as pre-spec, but will not guarantee the final cost. Once approved, we will require a spec document/material to be submitted by the client. We’ll review the documents, add the technical portion, discuss the revisions, and then provide a final estimate. Before work begins, a signed copy of the project spec and the final estimate must be returned.

To help explain why this document is necessary and how it can be created, please read the “Project Spec Requirements” document.

Published by Michael Botsko on 4/20/2009

jQuery Form Builder Plugin

Trellis Development (a parent company of web-based products which I co-founded) has been developing a custom content management system which needed a form creation tool. I adapted a form builder that I created for a previous project as a jQuery 1.3 plugin. It loads in existing form structure data through an XML file (which would be generated on the server) and passes the changes as a serialized array back to the server.

View the Demonstration
Get source from github

I’ve forked the code from the cms to serve as a stand-alone plugin. It’s extremely easy to setup, as all you need to do is to activate it on an un/ordered list item element. Then, write your backend code to handle the incoming array as you need, and output the xml data for when the form loads.

<ul id="form-builder"></ul>
$(document).ready(function(){
	$('#form-builder').formbuilder({
		'save_url': 'save.php',
		'load_url': 'form-a.xml'
	});
});

The save_url is the url that the ajax will be sent to when the user saves the form. The form information is serialized so that the backend programming may handle it as an array.

The load_url is the url of an xml file that describes any existing form information, and the system uses it to restore the fields.

This requires jQuery 1.3+ and uses the scrollTo plugin for nice scrolling.

Please report all issues and feature suggestions at https://snowy-evening.com/botsko/jquery-form-builder/

This is the first revision that’s external to our cms so I’ve labeled it 0.1.

Published by Michael Botsko on 4/7/2009