Archive for the ‘Uncategorized’ Category

Diablo III and StarCraft II

Thursday, 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

Easy WordPress and Google Calendar Integration

Tuesday, July 1st, 2008

http://www.googletutor.com/2008/02/19/easy-wordpress-and-google-calendar-integration/
http://code.google.com/p/wpng-calendar/

The Wordpress Google calendar plugin allows for the integration of a Google calendar into a Wordpress blog. This section describes how to install the plugin and get it working.
1. Request Google GDATA API key (see link below)
2. Upload the contents of the ZIP file to the /wp-content/plugins/ directory
3. Activate the plugin through the Plugins menu
4. Configure your GDATA API key in the plugin options panel
5. Configure a Google calendar in the plugin options panel
6. Configure the option to render the description field as Wiki markup
7. Create a page and add the ’show-wpng-calendar’ custom field with the number of weeks you want to be displayed
8. Add the widget to your sidebar and configure the title and number of events to display

Blizzard Announces Diablo 3

Monday, June 30th, 2008

After a week long tease by Blizzard, Diablo 3 has just been announced in Paris. The splash screen has been updated at their homepage.

http://www.blizzard.com/diablo3/

PDT: PHP Development Tools for Eclipse Platform

Friday, June 27th, 2008

The PDT project provides a PHP Development Tools framework for the Eclipse platform. This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Project in providing developers with PHP capabilities.

Project Principles:
* Intuitive and easy to learn
* Seamless integration with the Web Tools project
* Adherence to Eclipse standards
* Extensibility
* Continuous support of PHP developments

phpDocumentor

Friday, June 27th, 2008

phpDocumentor tags are very similar to tags for the JavaDoc tool for Sun’s Java Programming Language. Tags are only parsed if they are the first thing on a new line of a DocBlock. You may use the @ character freely throughout documents as long as it does not begin a new line. An example:

/**
* tags demonstration
* @author this tag is parsed, but this @version tag is ignored
* @version 1.0 this version tag is parsed
*/

Web site blocking techniques

Wednesday, June 25th, 2008

To deploy the web-site blocking mechanism in Squid, add the following entries to your Squid configuration file (in my system, it’s called squid.conf and it’s located in the /etc/squid directory):

acl bad url_regex “/etc/squid/squid-block.acl”
http_access deny bad

The file /etc/squid/squid-block.acl contains web sites or words you want to block. You can name the file whatever you like. If a site has the URL or word listed in squid-block.acl file, it won’t be accesible to your users. The entries below are found in squid-block.acl file used by my clients:

.oracle.com
.playboy.com.br
sex

With the squid-block.acl file in action, internet users cannot access the following sites:

* Sites that have addresses ending with .oracle.com
* Sites that have addresses ending with .playboy.com.br
* Sites containing the word “sex” in its pages

You should beware that by blocking sites containing the word “sex”, you will also block sites such as Middlesex University, Sussex University, etc. To resolve this problem, you can put those sites in a special file called squid-noblock.acl:

^http://www.middlesex.ac.uk
^http://www.sussex.ac.uk

Javascript: Get URL Variables

Tuesday, June 24th, 2008
<script type="text/javascript">
// Read a page's GET URL variables and return them as an associative array.
function getUrlVars() {
  var vars = [], hash;
  var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
  for(var i = 0; i < hashes.length; i++) {
    hash = hashes[i].split('=');
    vars.push(hash[0]);
    vars[hash[0]] = hash[1];
  }
  return vars;
}
// Example for URL http://www.example.com/index.html?hello=bonjour&goodevening=bonsoir
var hash = getUrlVars();
// alert(hash['hello']); // prints 'bonjour'
// alert(hash['goodevening']); // prints 'bonsoir'
</script>

Reset Wordpress Password

Wednesday, June 18th, 2008

update wp_users set user_pass = md5(’admin’) where user_login = ‘admin’;

Javascript String Search

Tuesday, June 17th, 2008

object.search(regexp)

This method is used to search for a match between a regular expression and the specified string. If a match is found, the search method returns the index of the regular expression within the string. If no match is found, a value of -1 is returned.

The first example of code below uses the search method to look for a match between the regular expression ‘rExp’ and the characters in the ‘myString’ string object and displays the resulting value in the browser. In the second example, removing the ‘i’ (ignore case) flag from the regular expression causes the value of the search to be returned as -1

Code:
myString = new String(”Go to DevGuru.com”)
rExp = /devguru.com/gi;
results = myString.search(rExp)
document.write(results)

Output:
6

myString = new String(”Go to DevGuru.com”)
rExp = /devguru.com/g;
results = myString.search(rExp)
document.write(results)

Output:
-1

Fixing ffmpeg on Ubuntu

Tuesday, June 17th, 2008

Reference: https://wiki.ubuntu.com/ffmpeg
For a litany of legal reasons, ffmpeg does not come with all of the necessary things enabled for you to encode video for the iPod Video by default. Therefore, we need to build it from source and install some other libraries and programs, as well. Make sure you have multiverse and universe enabled.

sudo apt-get remove ffmpeg
sudo apt-get install liba52-dev libdts-dev libgsm1-dev libvorbis-dev  libxvidcore4 \
libxvidcore-dev libdc1394-dev libfaac-dev liblame-dev libx264-dev libfaad2-dev libtheora-dev \
libsdl1.2-dev libmpeg4ip-dev
wget http://ffmpeg.mplayerhq.hu/ffmpeg-export-snapshot.tar.bz2
tar jxvf ffmpeg-export-snapshot.tar.bz2
cd ffmpeg-export-*
./configure --prefix=/usr/local --disable-debug --enable-shared --enable-gpl --enable-postproc \
--enable-swscale --enable-pthreads --enable-x11grab --enable-liba52 --enable-libdc1394 \
--enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora \
--enable-libvorbis --enable-libx264 --enable-libxvid
make
sudo make install

Trying to compile ffmpeg from svn gives the following error:
libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:224: error: ‘X264_ME_TESA’ undeclared (first use in this…

Solved. Installing these two packages:
http://www.brloh.eu/ubuntu/libx264-dev_0.svn20080408-0.0ubuntu1_i386.deb
http://www.brloh.eu/ubuntu/libx264-59_0.svn20080408-0.0ubuntu1_i386.deb