View RSS Feed

John

  1. PHP Automagic

    by , 06-17-2008 at 09:00 PM
    When working with classes in PHP, to create a new object, the class must be included by one of the following functions: include(), require(), include_once(), require_once(). However, when working with a library of code (with over one hundred classes) manually including every class when necessary (one line per file) can become tedious. It can also cause unnecessary inclusions, and give classes access to some objects that they do not need. Is there a way to "magically"; include the class ...
    Categories
    Uncategorized
  2. T_PAAMAYIM_NEKUDOTAYIM

    by , 06-10-2008 at 09:00 PM
    After working with PHP for close to four years now, I've become familiar with most token names, warnings, parse, and syntax errors. However, today I stumbled across a new one:Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_STRING or T_VARIABLE or '{' or '$' in file on line line After a quick search I found that Paamayim Nekudotayim is Hebrew for "two colons." It was not very hard to find my problem as it was a dumb syntax error $db = new DATABASE_DB; $db = $db->::getInstance($dbinfo);. ...
    Categories
    Uncategorized
  3. The Bash Prompt

    by , 06-07-2008 at 09:00 PM
    The Bash Prompt So I have been using Linux as my primary operating system for over a year now. Although I am an avid fan and now despise Windows, Linux does have its annoyances. One of which I have lived with was the bash prompt. The problem I had was, when traversing deep into directories, the bash prompt took up most of the terminal window. For example: john@lubun2-insp1520:/home/john/www/phpmyadmin/libraries/engines$This would cause commands to wrap onto the next line and often confuse me. I ...
    Categories
    Uncategorized
  4. Resistors

    by , 06-01-2008 at 09:00 PM
    When dealing with electronics one of the main components you deal with are resistors. I recently engaged myself in a small project which required such knowledge. I figured I would share with you what I had to learn.

    First off, what is a resistor? A resistor is a two terminal electrical component that opposes the flow of current. Connecting a 9 volt battery to a light emitting diode which has a maximum voltage of 1.2 volts would cause the LED to burn out. Hence the need for a resistor. ...
    Categories
    Uncategorized
  5. The Ternary Operator

    by , 05-31-2008 at 09:00 PM
    With Jordan away on vacation, I decided to fulfill my role as an administrator and fix a bug one of our members pointed out. One the homepage, rather than showing the number of "Replies" it showed the number of "Views." Jordan originally wrote the code for the tabs, but while trying to debug it, I realized how much more elegant the ternary operator is. Most operators are binary because they operate on two operands. The ternary operator thus operates on three operands - and it ...
    Categories
    Uncategorized
Page 4 of 4 FirstFirst ... 234