View RSS Feed

John

  1. Object Oriented Design The Singleton

    by , 07-15-2008 at 09:00 PM
    One of the many annoyances of programming is a variables scope. Generally variables can be declared within the global namespace or the local namespace. When working with methods and classes global variables appear to be a good idea, however overuse of the global namespace can cause variables to clash, it also undermines encapsulation. Moreover, a class which depends on a global variable is coupled with the project rendering it impossible to reuse (unless the global variable is declared). This will ...
    Categories
    Uncategorized
  2. PHPUnit

    by , 07-07-2008 at 09:00 PM
    All developers at one point or another test their code. Although it generally takes the forum of an echo to make sure your code is being ran or the correct data is being processed – it is a test. The unfortunate side effect is, all those tests will be removed. Therefor, when a piece of functionality breaks within your code, you sit at your desk manually sifting through your files once again adding echo statements to deduce the location of the problem. As an alternative, you might choose to take ...
    Categories
    Uncategorized
  3. PHP Function Overloading

    by , 06-27-2008 at 09:00 PM
    As a college student I am required to use different programming languages depending on the class I am taking. My first two semesters I used Java (while the professor attempted to teach us object oriented programming) and my last semester I used C++. Nonetheless, both languages have vast support for object oriented programming. Several days ago, while working on my php database structure I attempted to overload my connect() function.

    What is function overloading?
    Function overloading is ...
    Categories
    Uncategorized
  4. [PHP-Gtk] Tic-Tac-Toe: Contemplation to Compilation

    by , 06-26-2008 at 09:00 PM
    In one of my previous blogs I showed you how to create a PHP-Gtk window you might use for a Tic-Tac-Toe application. In this blog I intend on showing you the logic needed to finish the application. Lets start off with the code we created in the last blog: [code=”PHP”]
    if (!class_exists('gtk')) {
    die("Please load the php-gtk2 module in your php.inirn");
    }

    $wnd = new GtkWindow();
    $wnd->set_title('Tic-Tac-Toe');
    $wnd->set_size_request(200, 200);
    $wnd->connect_simple('destroy', ...
    Categories
    Uncategorized
  5. SEF URLs without mod_rewrite

    by , 06-23-2008 at 09:00 PM
    If you have done any web development, passing requests becomes an integral part of your code. Whether it is a session id, data to validate, or a view file to load you will most definitely end up passing one request or another. While working on my framework (which uses the model-view-controller design pattern), I decided to pass the controller, which the framework will load, through the URL. Since the controller's primary purpose is to handle incoming http requests, I also passed a “view” parameter ...
    Categories
    Uncategorized
  6. Tic Tac Toe GUI using PHP

    by , 06-22-2008 at 09:00 PM
    Are you a PHP developer who, although enjoys web development, often has urges to create desktop applications? Look no further. I will show you how to create a fully functional Tic-Tac-Toe game using PHP!

    Before we start using any of the Gtk classes, we must first make sure the Gtk module has been loaded in our php.ini. If you try to use a Gtk class without having enabled the module, you will see an error similar to the following:
    Fatal error: Class '<class_name>' not found in
    ...
    Categories
    Uncategorized
  7. PHP Colon Syntax

    by , 06-21-2008 at 09:00 PM
    For any programmer the use of the brace { and } are second nature when defining classes, functions/methods, conditionals, and loops (among other things). PHP (and possible other languages) offer a less common alternate syntax called the colon syntax, which latley, I have come to love. For me a typical piece of code might take on the following format: class MyClass extends YourClass {
         public function __construct($argv)
        {
            ...
    Categories
    Uncategorized
Page 3 of 4 FirstFirst 1234 LastLast