Archive for the ‘PHP’ Category

Generating graphs from MySQL table data

Wednesday, April 18th, 2012

Graphs and charts are a useful visual way to view historical data - they make it easier to detect trends and get a big-picture view of data. All we need is timestamped data - table rows that are stamped with a specific date/time format, that can be used to group rows into time periods.

Time stamped data

In order to aggregate table data by time periods / ranges, we need a date/time column in the table we want to analyze. Appropriate types for such a column include TIMESTAMP, DATETIME and DATE, but we can also use string / numeric types for grouping data together if they contain some sort of date/time information - though those will be much less flexible than native date/time types.

I usually opt to go with the TIMESTAMP format, for a couple of reasons - (more…)

Breaking down the PayPal API

Saturday, April 23rd, 2011

PayPal is the most popular platform for receiving online payments. The relative ease of opening a PayPal account and receiving payments compared to opening a merchant account for a traditional payment gateway is the number one reason, and another is the comprehensive API they provide for their payment services.

Foreclosure: The PayPal API is amongst the worst I've ever had to deal with - inconsistencies, sometimes poor and conflicting documentation, unpredictable failures and account changes and major differences between the live and sandbox versions all conspire to make working with the PayPal API quite a pain in the ass.

Unfortunately, there doesn't seem to be any better alternatives currently, so hopefully this guide will help ease the pain for some of you out there taking your lumps working the API into your applications.
(more…)

Database optimization techniques you can actually use

Friday, March 25th, 2011

I just saw an article on Smashing Magazine titled "Speeding up your website's database". I love Smashing's contribution to the webdev community, but their articles are getting longer and more basic at the same time.

I understand the need for simplicity because of the wide audience of Smashing Magazine, but I'd wish they'd give something more than the absolute basics you could find in almost any other site out there. I also didn't like some of the methods mentioned there for profiling (or the code itself), so I here is my starter guide to optimizing database performance.
(more…)

(mis-)Adventures with Amazon Simple Email Services (SES)

Wednesday, March 23rd, 2011

Amazon has recently launched a new service as part of its web-services offerings - Amazon Simple Email Service (or SES for short), an HTTP API for sending Emails. The main selling points are Amazon's usual scalability power, as well as a relatively low price point for sending Emails (10 cents per 1000 Emails, not counting bandwidth). They also promise to improve deliverability using filters and feedback loops.
(more…)

Last call for the Binpress programming contest

Tuesday, February 15th, 2011

The Binpress programming contest is entering the last stretch - 10 days left until the end. Over $40,000 in prize value is still up for grabs - request an invitation and get your submission entered.

A short recap - my startup, Binpress - a marketplace for source-code, is running a programming contest for best submission of a source-code package in one of the 6 top web languages - PHP, Python, Ruby, Java, ASP.NET (C#, VB.NET) and Javascript. One grand winner and two runner ups will be chosen, as well as the top pick for each language. We have over $40,000 value in cash and prizes that is sponsored by companies such as Google, Amazon, PayPal and Zend.

So far we've had over 70 submissions in the various languages. Some of the submissions are really top notch and there's no clear winner right now. Submissions will start go out to our judges next week for review and the judging will take up to two weeks after the deadline for the contest.

Hope to see what you have to offer there!