programming Archive

Upgrading to PHPUnit 3.5 on Zend Studio

Here's a quick clip I made to show those who hankering to have an updated PHPUnit plugin for Zend Studio.I hope this video is obsoleted soon so others don't have to endure the annoyance.View in HD! Subscribe in a reader...
Read More

Worthy of distribution: PHPUnit’s dbunit testing rundown

This is by far the most complete and best example of a rundown of database testing using PHPUnit's "dbunit" extension. It seems it's difficult to track down a whole rundown on the more technical aspects of 'getting into it'.The Ultimate Guide to Database-Testing with PHPUnitAuthor: Benjamin Eberlei (kontakt@beberlei.de)http://www.beberlei.de/dbunit.html Subscribe in a...
Read More

Interfaces in PHP are worthless. Blasphemy? yes.

What is the purpose of an interface? One would simply say "they're a contract, etc.", and you'd be right.Long story short, all PHP interfaces do - is enforce:- What methods are implemented- What their signatures look likeHowever there's one HUGE (in my book) fundamental lack: RETURN TYPES.Thus, I will call...
Read More

PHPUnit and apache ant junitreport task

There's not a whole lot of 'purdy' interfaces for parsing junit results. For what little that's out there - it's even a bit more difficult when you consider the PHP camp looking for a parser for the output from the likes of PHPUnit. If you're looking for an easy way out...
Read More

Add “th” (“nd”, “st”) to a number … painlessly – Part 2

So in the previous post I posted my recipe for adding rank suffixes to numbers.Sometimes - a simple problem can be frustratingly goofy to solve. I took a lazy shortcut by passing the number through mktime - then to date to do it for me.After analyzing what I came up...
Read More

Add “th” (“nd”, “st”) to a number … painlessly.

There's not enough out there about this trick - but you don't need a convoluted solution to add rank indicators to a number, so to add more noise to google search, here my variant is:[crayon-5bcc24de5112f652863599/]Make sure you visit part 2!Logical breakdown:First we get mod of $n against 10 - essentially...
Read More

Staying on top of things

One of the things that's crucial to my workflow where I work; is to know as soon as possible when changes are made to our mainline repositories. Same with tickets in our Trac ticket system, when it hits the pipes - I need to know.I could setup a fancy hook...
Read More

JQuery UI tip: floated divs inside JQueryUI tabs

There's a somewhat confusing problem that can happen if you want to use a multi column (floated div) chunk of content for a tab in JQuery UI tabs. Basically, the floats inside the tab container cause the tab container to lose it's height, making your content appear outside of the tab...
Read More

A real life look at crazy variable names

Here's a list of somewhat unique/funny variable names I've either created or worked with in the past year or so that have made me either stop and chuckle, or shake my fists in doom. const ZOMBIEA toggle switch to determine if a cleanup script I wrote should report but not...
Read More

Hashing out those regex

Priceless utility I found not to long ago and thought I'd drop a note about it.There's an online version - as well as an Adobe AIR app that is simple and lightweight to install.Check it out: http://gskinner.com/RegExr/A must-have for people who have to hammer out some levels of regular expressions Subscribe...
Read More

PHPCodesniffer and Zend Studio/Eclipse – Part 3

( Double-click the video to view more clearly )  Subscribe in a reader...
Read More

PHPCodesniffer and Zend Studio/Eclipse – Part 2

( Double-click the video to view more clearly )  Subscribe in a reader...
Read More

A priceless gem

A co-worker linked this to me today as a 'MUST HAVE JQUERY PLUGIN'. I totally agree.http://plugins.jquery.com/project/crash Subscribe in a reader...
Read More

Take it to the next step

Very cool (albeit somehow hectic page) on pythian on a recent Rasmus session.There's a HUGE amount of information in this for people wanting to 'step to the next level' with web application development. You'll have to turn over some stones of your own and reapply some of this to you...
Read More

Duct tape programmer

Good article on slashdot about my type of programmer, the ones I try to describe in my 'good programmer' posts/rants.http://developers.slashdot.org/story/09/09/25/1257226/The-Duct-Tape-Programmer Subscribe in a reader...
Read More

OOP

Since I can remember, I always thought there was an irrational gravitation towards OOP from people. "If you don't do OO, you're not a programmer" is an underlying sentiment in all circles of programmers.Now, I firmly believe that OO design is definitely a great way to organize, process and a...
Read More

Overengineeringalisminity

More often than not, developers thrive for the opportunity for self-developmental moments by designing something super abstract - and in the end become disappointed and unhappy with it because designing things that are too abstract can be just as limiting, if not more limiting and difficult to work with than...
Read More

Good programmers

Truths about good programmers:0. They know the difference between writing it 'quickly' and writing it 'right'1. They know that the ability to do both is necessary.2. They know that when writing it quickly, if you have to stop and think about something, think about the data storage schema, not the...
Read More

Programming through inductive reasoning

I'll never forget my Geometry class in high school, not just because it was fun, but the teacher was kind of an oddball (in a good kind of way). I learned so much from this class it was unbelievable, it was a life changing experience because it taught the true...
Read More

Canonically speaking

A co-worker and I recently got into a discussion regarding table naming - specifically prefixes and how to group them.A common approach you see, is to group the tables around a system using a prefix for it's name:_newsevents_news_newsevents_categories_newsevents_aclThe hardest thing about keeping everything 'integrated' is to get other developer's off...
Read More