Tag: Programming

CTGradient code bloat

While getting rid of extraneous junk in an application package is easy using Trimmit, the only way to prevent "code bloat" (and accompanying excess RAM and CPU usage) is through good programming practices. Where most developers fall short is in poor optimization of borrowed code. Let’s take CTGradient as an example as it’s well known and used (or more accurately, abused) in dozens of applications.

Continue Reading CTGradient code bloat

Programming Challenge #3

Another little puzzle to keep you thinking. I saw this problem during the reign of the dinosaurs, and thought it was pretty clever.

Continue Reading Programming Challenge #3

Programming challenge #2

Another little mini-question to keep you thinking. The first one was definitely too easy, so we’ll slowly increase the degree of difficulty as we go along.

No more trigonometric functions this time; we’re going to Cartesian coordinates. This is a re-adapted version of a sample problem from Google Code Jam. Here it is.

Continue Reading Programming challenge #2

Programming challenge #1

Programming is more than simply remembering a few functions and properties and calling them. It’s about thinking, processing, ordering, planning and implementing. Programming, real programming, requires a keen understanding of what you want to do, what you’re doing, and what needs to be done. Sound complicated? It’s not. Here’s the first of a few questions that you as a programmer should be able to do in your sleep. You can leave answers in the comments. The programming language you use doesn’t matter.

Continue Reading Programming challenge #1

Forget text files - here’s a .php only database system

What do you do when you’re writing a web app that needs to store data, but using a dedicated relational database system would be overkill? Many developers are taking advantage of PHP’s file editing capabilities to use plain text files to store and retrieve data. While this is a more lightweight solution, reading the contents of a file is not always the fastest way to retrieve stored information. Here’s my very own technique to use a database-like system with PHP files only, with just one line of code needed to grab the information, ready to be used.

This technique is best suited to situations when speed is required in accessing the data. It works best with small amounts of data, and it’s possible to store arrays, strings, numbers, etc. Let’s explore the basic theory behind the system.

Continue Reading Forget text files - here’s a .php only database system

CSS Style guide generator

For a web designer, remembering the properties of all the CSS classes, IDs and elements that have been written, often over multiple stylesheets, can be a real task. Often developers need to keep referring back to their CSS to check the definitions, look at the properties and classes and find the right element. This is time wasted. Time that could be spent on more constructive endeavours.

Continue Reading CSS Style guide generator