PHP Class vs Object vs Array Attribute Performance
PHPRecently I was curious about the performance (in terms of access and assignment time) between class static attributes, object attributes, and array elements. Say if you're wanting to store some information that is accessed regularly, and want to know which method is the fastest...
Apr 17, 2013   Nick Vogt   Programming

How to Log PHP Errors/Warnings
PHPLogging PHP errors and warnings is important on both your production and development servers. Often times these messages go unnoticed, even if you have display_errors on.

To start logging errors, open up your php.ini file. Scroll down to or search for the line that has the error_log variable. It will probably look like one of these...
Mar 4, 2013   Nick Vogt   Programming

ActionScript 3: Array vs Vector Performance
ActionScript 3With Flash version 10, Adobe added the Vector class, which is similar to an Array but more strict. Each Vector can only contain data of the same type and its data type must be declared during instantiation. I'm not going to go over the syntax to use Vectors in this post, but they are very similar to Arrays and have a lot of the same methods and properties...
Aug 2, 2012   Nick Vogt   Programming

ActionScript 3 Object Pool Tutorial
ActionScript 3If you're unfamiliar with object pooling, it is a way to speed up processing time by keeping objects in memory and reusing them, instead of always instantiating new ones and garbage collecting them.

This example uses package and custom class syntax. If you are unfamiliar with these, see my introduction to package and classes post...
Jul 17, 2012   Nick Vogt   Programming

ActionScript 3: Determine if Object Property Exists
There are two common methods to determine if a property/attribute/variable of some object exists. Both use the property name as a string and neither rely on checking for an error report.

The first is using the hasOwnProperty method:

var myObject:Object = {name:'Jenkins'};

if(myObject.hasOwnProperty('name'))
{
   // Do something
}
May 21, 2012   Nick Vogt   Programming

ActionScript 3 Error 1078: Label must be a simple identifier
This error is often caused by the accidental use of a colon (:) to terminate a statement instead of a semi-colon (;). The error report should give you the error location...
May 20, 2012   Nick Vogt   Programming

PHP: Using Ternary Operator Condition Checks
Ternary is a short way to write if/else condition checks on a single line, and allows you to perform condition checks inline with variable assignments and more...
Apr 5, 2012   Nick Vogt   Programming

PHP: Prevent MySQL Code Injection Exploits
The information in this post is outdated. Please use PDO with real (non-emulated) prepared statments to properly prevent MySQL injection.

Any data that comes from the client-side needs to be properly validated and escaped before using. This is extra important if you're using that data to form part of a database query. Always assume that your users will try to input incorrect information and special characters into fields, and do not rely on HTML or JavaScript to prevent this...
Apr 5, 2012   Nick Vogt   Programming

PHP: Avoid Using Undefined Variables and Indexes
PHP is a fairly loose programming language, which causes many new developers (and experienced ones) to get lazy. If you suppress errors, you can get away with ridiculous things like using undefined variables, without anyone being the wiser. But just because you can get away with it, doesn't mean you should...
Apr 5, 2012   Nick Vogt   Programming

PHP: Use Identical Operator When Comparing User Input (Equals vs Identical)
When comparing two values against each other, it is common to use the "equals" operator (==), and this is fine as long as you have control over the values that are being compared. But what if you're comparing user input against a value, such as in a sign-in script or captcha? Using the equals operator can potentially leave you open for security issues, since PHP handles comparisons between different data types non-intuitively...
Apr 1, 2012   Nick Vogt   Programming



Categories

All Posts
Computer Hardware
PC Gaming
› Programming
Web and Internet
Miscellaneous

Tags

youtube
minecraft
skyrim
call of duty
crysis
facebook
actionscript
php
javascript
tutorial

Series

ActionScript 3 Tutorials
PHP Tutorials
Game Reviews