Operators are one of the core components of any programming language. Knowing how they are classified and how they can be used is extremely important. This post might teach you some new operators. Since the samples are pulled from multiple languages, you may even learn something cool about a new language. Enjoy, and please point [...]
Today I realized that I did not completely understand the “static” keyword as it applies to variables, which is used in many programming languages. If you weren’t aware of the full breadth of how the static keyword alters a variable, this post should be a mind blower. So, let’s start simple. Take the following example [...]
A continuation in my self-assigned crash course in design patterns, I’ve been learning more about the observer pattern recently. It’s a cool pattern, and I’m hoping I can convince some of you that it’s worth learning more about. I only have time for a quick post, and hopefully I can get in the major points [...]
Also posted in Software Design |
Why ANOTHER article about Singletons? If you search for ‘Singleton’ in Google or StackOverflow you get a bajillion and a half results. That makes sense, because it’s one of the most commonly implemented design patterns in the history of software. Some reasons for the popularity of the Singleton are: A. It makes more intuitive sense [...]
Also posted in C++, JavaScript, PHP |
PHP’s dbase extension allows you to work with .dbf files in PHP. After php 5.2, you can no longer compile php with dbase support, so here’s how you can add it to your php installation: 1. Download dbase: http://pecl.php.net/get/dbase 2. Extract and cd into. 3. sudo phpize 4. sudo ./configure && sudo make && sudo [...]
I’ve been working on a Linux driven network for my family’s small business, Froedge Machine. It’s been an awesome, engrossing experience so far working on this – and the farther I delve the more I realize just how approachable this type of project is. I’m far along enough in the project now that I can [...]
Also posted in Networking |
Number 5 of the 12 PCI compliance steps in the SAQ D is to “Use and regularly update anti-virus software or programs.” We all know that this *really* isn’t needed – but it’s in the PCI compliance requirements – so here’s an easy way to do it. Install ClamAV: sudo apt-get install clamav And then [...]
Also posted in PCI Compliance |
I was recently debugging an issue with Codeigniter Payments and HMVC. The issue was that config files were not being loaded if they were deeply nested – for example: config/payments/my_gateway.php The MX_Config path explodes the filepath provided on forward slashes, so if you do anything other than this->load->config(‘whatever’), the file you want won’t get loaded, [...]
Also posted in CodeIgniter, PHP |
I’ve been compiling PHP from source lately. Some common baseline options I’m using: sudo ./configure –with-mysql –with-apxs2=/usr/sbin/apxs –with-mcrypt=/usr/local/src/php-5.3.8/ext/mcrypt –with-config-file-path=/etc –with-openssl In my local dev environment, I place all my language source files in /usr/local/src (ie php 5.3.8) and then symlink any needed command line features. For example /bin/php would symlink to /usr/local/src/sapi/cli. That way, If [...]
Continuing my “Do it Yourself” exploratory programming trend, I took one look at the CampaignMonitor SDK today and decided I’d write my own. Their API is RESTful, well documented, and easy to work with, so why not? Here is the final product: https://github.com/calvinfroedge/FuelPHP—CampaignMonitor-API-Package What I like about this API wrapper is the simplicity, and specifying [...]
Also posted in FuelPHP, PHP |