Random Post: 6. Made of Honor - $4.2M
RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • Contact Us
  • deviantART
  • Newsletter
  • Online Booking
  • Registration
  • Tell A Friend
  •  

    PHP: Get Country By Geo IP

    July 18th, 2008

    To use it, you’ll have to first download the GeoIP Free Country file and extract it into a directory in your Web server. Then you’ll have to pick which language API to use with the database file. For simplicity, we’re going to use the pure PHP version because it doesn’t require any additional configuration or Apache modules. Remember to read the license terms before installing these on your Web site to ensure you are in compliance.

    The code in Listing A demonstrates the basics of using the module (geoip.inc) to access the GeoIP Free Country database (GeoIP.dat). The example assumes both the PHP include and the country database file are in the same directory as the PHP file itself. You’ll have to change the paths as needed if this is not the case in your installation.

    The sample code is pretty straightforward. After including the GeoIP PHP function library, the first step is to open the GeoIP database file with the geoip_open() function. This function accepts two arguments: the path to the database file and the type of database.

    We then use the handle returned by the call to geoip_open() to obtain the two-letter country code and human-friendly name corresponding to the given IP address, via the geoip_country_code_by_addr() and geoip_country_code_by_name() functions, respectively. Both functions accept two arguments: the handle returned by geoip_open() and the IP address to resolve.

    Once the required information is obtained, we close the database file with a call to geoip_close(). Simple as that.


    Wget using Cookies Firefox3

    July 16th, 2008

    Firefox 3 does not use cookies.txt but rather cookies.sqlite.
    Solution: Uses a python script to extract the data from cookies.sqlite.
    http://blog.schlunzen.org/2008/06/19/firefox-3-und-cookiestxt/

    #!/usr/bin/python
    
    import sqlite3 as db
    import sys
    
    cookiedb = '/home/USENAME/.mozilla/firefox/PROFIL/cookies.sqlite'
    targetfile = '/home/USERNAME/cookies.txt'
    what = sys.argv[1]
    connection = db.connect(cookiedb)
    cursor = connection.cursor()
    contents = “host, path, isSecure, expiry, name, value”
    
    cursor.execute(”SELECT ” +contents+ ” FROM moz_cookies WHERE host LIKE ‘%”
                   +what+ “%’”)
    
    file = open(targetfile, ‘w’)
    index = 0
    for row in cursor.fetchall():
      file.write(”%s\tTRUE\t%s\t%s\t%d\t%s\t%s\n” % (row[0], row[1],
                 str(bool(row[2])).upper(), row[3], str(row[4]), str(row[5])))
      index += 1
    
    print “Gesucht nach: %s” % what
    print “Exportiert: %d” % index
    
    file.close()
    connection.close()

    7. Indiana Jones and the Kingdom of the Crystal Skull - $3.8M

    July 8th, 2008

    In 1957, Indiana Jones is thrust back in action, venturing into the jungles of South America in a race against Soviet agents to find the mystical Crystal Skull.


    1. Hancock - $62.6M

    July 8th, 2008

    There are heroes… there are superheroes… and then there\’s Hancock. With great power comes great responsibility — everyone knows that — everyone, that is, but Hancock. Edgy, conflicted, sarcastic, and misunderstood, Hancock\’s well-intentioned heroics might get the job done and save countless lives, but always seem to leave jaw-dropping damage in their wake. The public has finally had enough — as grateful as they are to have their local hero, the good citizens of Los Angeles are wondering what they ever did to deserve this guy. Hancock isn\’t the kind of man who cares what other people think — until the day that he saves the life of PR executive Ray Embrey, and the sardonic superhero begins to realize that he may have a vulnerable side after all. Facing that will be Hancock\’s greatest challenge yet — and a task that may prove impossible as Ray\’s wife, Mary, insists that he\’s a lost cause.


    9. Sex and the City - $2.4M

    July 8th, 2008

    The continuing adventures of Carrie, Samantha, Charlotte and Miranda as they live their lives in Manhattan four years after the series ended.


    3. Wanted - $20.1M

    July 8th, 2008

    Loosely based on the comic book miniseries of the same by Mark Millar and J.G. Jones, WANTED, directed by Timur Bekmambetov, follows anxiety-prone office drone Wesley Gibson (James McAvoy) as he is inducted into the Fraternity, a clan of powerful killers that counted his father as a member. Pursued by rogue agent Cross (Thomas Kretschmann), Wesley is trained by the sleek, sexy Fox (Angelina Jolie) and the charismatic Sloan (Morgan Freeman), among others, to be just as proficient and deadly as his father. Once Wesley becomes a master assassin, he must confront Cross, and contend with the stunning ramifications of that encounter.<br><br>Straying rather far from the WANTED comic\’s supervillain-centric premise, WANTED runs with the edgy Eastern European aesthetic of Russian helmer Bekmambetov, who garnered international recognition with the stylish vampire epic NIGHT WATCH. While Jolie is a gleefully destructive presence in her action-heavy scenes, the film belongs to McAvoy, who transforms from milquetoast to manhunter with verve and charm. And like the similarly themed THE MATRIX before it, WANTED also showcases some eye-catching special effects, most notably in the loopy concept of “curving bullets.” Though devotees of the WANTED comic may be dismayed with the many liberties taken with the story, the movie is undeniably energetic and entertaining, making it fun summer blockbuster fare.


    phpBB3 Coding Guidelines

    July 7th, 2008

    http://area51.phpbb.com/docs/coding-guidelines.html

    4. Templating
    File naming
    Variables
    Blocks/Loops
    Including files
    PHP
    Conditionals/Control structures
    Extended syntax for Blocks/Loops


    Wordpress: add_action

    July 4th, 2008

    Hooks a function on to a specific action. See Plugin API for a list of hooks for action.
    Usage

    Examples
    To email some friends whenever an entry is posted on your blog:
    function email_friends($post_ID) {
    $friends = ‘bob@example.org, susie@example.org’;
    mail($friends, “sally’s blog updated” , ‘I just put something on my blog: http://blog.example.com’);
    return $post_ID;
    }
    add_action(’publish_post’, ‘email_friends’);

    Parameters

    $tag
    (string) The name of the action you wish to hook onto.

    $function_to_add
    (callback) The name of the function you wish to be called. Note: any of the syntaxes explained in the PHP documentation for the ‘callback’ type are valid.

    $priority
    How important your function is. Alter this to make your function be called before or after other functions. The default is 10, so (for example) setting it to 5 would make it run earlier and setting it to 12 would make it run later.

    $accepted_args
    How many arguments your function takes. In WordPress 1.5.1+, hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. For example, the action comment_id_not_found will pass any functions that hook onto it the ID of the requested comment.


    Diablo III and StarCraft II

    July 3rd, 2008

    Diablo III is an action role-playing game currently in development and the third installment of Blizzard’s Diablo franchise. It was unveiled on June 28, 2008 at the 2008 Blizzard Entertainment Worldwide Invitational in Paris, France.

    StarCraft II is a military science fiction real-time strategy video game currently under development by Blizzard Entertainment as a sequel to the award-winning 1998 video game StarCraft. First announced on May 19, 2007, in Seoul, South Korea,[5][6] StarCraft II is being developed for concurrent release on Windows XP, Windows Vista, and Mac OS X. The game has no certain release date[4] although a multiplayer demonstration was playable at BlizzCon 2007


    Heroes (TV series) Season 3

    July 3rd, 2008

    Season three will open with a two-hour episode, set to air Monday, September 22, 2008.
    http://en.wikipedia.org/wiki/Heroes_(TV_series)


    Rudy Cahayadi is Digg proof thanks to caching by WP Super Cache!