Search
The Way of the Software Engineer

WordPress e-Commerce Plug-In

Posted by admin on December 16th, 2007

I recently built a simple e-commerce site for a friend. As the design of the site was paramount, she found that starting with WordPress and building up a theme gave her the look and feel she was going for. Now, the difficult part of that is the lack of integration between WordPress and e-Commerce systems. ZenCart has long been considered the granddaddy of open source shopping carts, but I have yet to see an effective paring of ZenCart and WordPress.

There does exist a WP e-Commerce plug-in produced by Instinct in New Zealand. So, using their latest version (3.6beta3) I began building this site. Now, the front end of the Instinct package is quite nice. It installs quickly and the user facing interface is easy for beginners to understand.

The problems start when you try to extend it. It has absolutely no data abstraction of any kind. SQL is all over every module of code, including making the same static query inside loops. I made some significant changes to the instinct package and tried to push my changes back to the original developers at Instinct. I’ve had very little response from the developers about including my changes in their releases. (one or two emails and then nothing). I’m considering forking the code and releasing my changes so the large installed base of this application has somewhere to turn to. Their forums are filled with people having problems with the plug-in and most of the problems could be fixed with better SQL handling.

I’ve added features such as: Read the rest of this entry »

Maximizing the Green-ness

Posted by admin on October 12th, 2007

IBM has announced their new energy rating system for computer hardware.  The rating is driven by hardware monitoring systems for cooling and power consumption and can be read in real time.  This looks like a fantastic metric to minimize.

David Anderson PE, IBM green consultant said, “A single mainframe running Linux may be able to perform the same amount of work as approximately 250 x86 processors while using as little as two to ten percent of the amount of energy.”

This is assuming you have a bunch of machines being virtualized on a single mainframe, which means the mainframe is in control of both the hardware monitoring and the scheduling of system resources.  Taking thread priority in to account, the scheduler could be redesigned to optimize (local delta rule?) the the energy use instead of responsiveness for lower priority threads.  It could even be expanded upon to look at the history of it’s environment and give higher priority to certain virtual machines in times of peak use (Approximations based on posterior).

Getting Started with OpenAds Development

Posted by admin on October 4th, 2007

There are a few critical things you’ll need to get started with OpenAds development:

- Subversion
- Java VM (JDK 6)
- Ant builder
- PHPDocumentor

I’m quite sure this isn’t the only way to set up this environment, so you’ll need to modify my instructions to suit your own needs. This assumes you are using a *nix server running Apache with database software already installed. I use VIM.
Read the rest of this entry »

Regular Expression Checker

Posted by admin on September 24th, 2007

data:

regex:

 

Green Code

Posted by admin on September 22nd, 2007

Many hard engineering fields see the impact of their work on the environment directly. Using sustainable materials in your products implies that they’re better for the environment than they might otherwise be. How does this translate to software engineering?

Certainly, there are the direct contributors. The maintainers of the linux ACPI kernel module that allow computers to hibernate in S3 processor state are having a direct impact on energy consumption in computers. Xen and VMWare are saving companies money and energy by reducing the number of computers needed for a particular task. Writing efficient code could be viewed as ‘green’ because you’re (in theory at least) using less energy and producing less heat to perform a calculation.

Centralized processing and repeated where many users display the result of a single calculation instead of calculating it themselves could be considered green. Binary software distributions are a good example of this. Software that must be updated frequently, (like a kernel) should be compiled once and then distributed to all the systems that will use it.

I’m sure there are other things that would improve the ‘greenness’ of software. Any suggestions?

Java 1.6 on OS X

Posted by admin on September 21st, 2007

Apple has a build of java 1.6 available through the Apple Developer Connection site. The build is pretty recent (1.6.0-dp-b88-34) and includes a complete JDK. The package can be installed through the normal GUI method, or by the installer command line utility: `sudo installer -pkg JavaSE6Release1.pkg -target “/” `. However, once this is installed it is not the current default java runtime or library classpath. If you start seeing errors like ‘package javax.script does not exist’, you’ll know that you’re still using the old classpath. The good news is that it’s simple to fix, if you know where to look. I googled on this for at least a day before I realized how stupidly this is.
Read the rest of this entry »

Java and XML

Posted by admin on September 17th, 2007

A fellow engineer asked me about parsing XML in Java and I handed them this utility class I wrote a while ago. The class fit her need so well, she suggested I post it for others to use. It’s only a few lines of code, but it is useful. I find the nodeListTree2Hash method to be particularly useful in debugging (it’s also perhaps a good example of recursion).

XMLParser.java

Use it freely, this is all public domain. If you find it useful, leave a comment below.

Days of the Week

Posted by admin on August 24th, 2007

Years ago I was introduced to a young autistic man while my sister was working at a camp for ‘adult children’.  Steven was polite and well spoken among his peers, but had few real friends.   He also had a savant-like gift for dates.  If Steven were asked, “What day of the week was it on June 19th, 1971?”, he might first be coy and say, “Oh, that’s too hard.  I can’t do that it’s too hard…  that was a Saturday.”

I never contested this, but the aids at the school where he lived told me they had tested his knowledge of dates and found him to be amazingly accurate.  Dates after his birth he could determine with 100% accuraty (and even remember details such as the weather), dates in the near future were very accurate, but not perfect.  Distant past and future dates dropped dramatically in accuracy.  This is unsurprising considering the history of the Gregorian calender’s limited accuracy and intentional inaccuracies like the 1582 ‘gap’.

While Steven’s gift could be accomplished with some reasonably simple math, he could barely multiply two numbers together, let alone apply the algebra needed to navigate a Gregorian calendar.  More likely, his brain had formed a simple pattern classification net and taught it every day since Steven learned the days of the week.  With 16 binary input neurons and 3 output neurons, Steven could process easily enough input patterns for every day of his life (~180 years?), and classify these as one of 7 (ok, 2^3 is 8, but who’s counting) patterns representing the days of the week.  With effort, his brain was able to influence the synapses between these neurons and train them to choose the appropriate ‘day’ pattern from any given ‘date’ pattern.

In truth, he would only need 14 input nodes to represent the days of the week for all time as they repeat every 28 years (2^14=16384 > ~10220 days).  In any case, the brains ability to do approximate complex math through pattern analysis is astounding.

Generative simulation patent?

Posted by admin on August 22nd, 2007


NewScientist
is reporting on predictive software systems being patented. Doesn’t anyone bother looking for prior art anymore? A simple Google search would show you that wake-sleep learning and Hierarchical Temporal Models (HTM) have been around for years now. I’ve even seen papers discussing their use in predicting human behavior relating to music sales.
I’m working on another post that discusses predictive behavior, so I’ll save my ranting for later.

Multipul Experts

Posted by admin on July 3rd, 2007

There exists a model of using several ‘experts’ or classifiers in order to increase the relevancy of a result. In the fish example from Duda, Hart, Stork, a group of experts are asked to determine if a fish is diseased. 9 of them say it’s not, but one disagrees. How do you ask a computer system to choose between the majority or minority opinion. That one dissenter may have specialized knowledge that gives him an advantage and thus has the correct answer. In a human situation, those 10 experts would argue with each other until perhaps others are convinced.

Can one classifier learn from another? That may be difficult in practice. If the majority classifiers could generate fantasy problems and ask the minority dissenter to solve these problems we can determine if the minority opinion should be given greater weight. If the minority expert does better with this type of problem, his ‘opinion’ should be given greater weight; perhaps enough weight to offset the majority. The majority group could then learn from this new data and adjust their weights accordingly.