You are currently browsing thearchives for December, 2007.

My First Flash Game.

Posted 10 months, 3 weeks ago at 2:36 am. 0 comments

Well,

The last 24 hours I have been going crazy learning Flash. I made my first game today.

It’s on Kongregate

wobbledodge icon

I named it WobbleDodge due to some creative thinking of a few buddies. Although I admit it’s not the best game in the world… I think it’s pretty dang good for a first try. I couldn’t of done it without the help of Emanuele Feronato and his wonderful tutorials.

Google Apps

Posted 10 months, 3 weeks ago at 11:52 am. 1 comment

I have set up Google Apps on my new domain now. It was easy to sign up. Last time I tried I had to be put on a waiting list and wait a few months before using it. This time, it got set it up immediately, which was very nice. I had to change a few DNS settings for it work, and this time around, I did it flawlessly thanks to Google’s godaddy specific instructions. Anyways, now I am allowed 100 @wildwobby.com email adresses with 6+Gb of storage each with Gmail’s interface.

So far, I am really impressed with Google apps. They are giving me an email server, over 600Gbs of space (6Gb * 100 accounts). I only need 1 account, so I have 99 (And then I can request for more user. Up to 1,000 I believe) accounts to give if anyone would like to get one. You will also get Google Pages space with a *.wildwobby.com domain which I am setting up now. Well, I’m really starting to like all of this control I have over my server, I can do almost anything I want for free it seems.

http://mail.wildwobby.com/

I’m now known as wildwobby.com!

Posted 10 months, 3 weeks ago at 1:37 am. 0 comments

No more of that blogdns bullshit. I used some left over money in my paypal account from selling photos and bought www.wildwobby.com. It looks nicer, and is easier to remember. It could have gone a little easier. I got confused over the DNS settings. I was switching it back and forth between Godaddy and zoneedit.  Because it takes a while for settings to percolate, I am just seeing the results now…. Half the time it is going to Godaddy’s parked domain page, the other half to my site. I’m hoping I settled on the right setting and I’m pretty sure I did, but I’ll have to wait ’til morning to find out. It’s 1:30 AM here.

Although I’m keeping wildwobby.blogdns.org active (it leads to this site anyways), I am gonna start changing all the links I can that lead to forum signatures of mine. That will be quite a task.  I’m off to get some sleep for now and just wanted to share the news!

Setting LAMP up on Arch Linux

Posted 10 months, 3 weeks ago at 1:06 pm. 1 comment

Setting LAMP up on Arch Linux couldn’t be any easier. To install it basically takes 3 commands.

pacman -S apache php libxml2 mysql

This downloads the latest Arch package binaries of apache, php, and MySQL (also libxml2 which is required for php). After entering the command, pacman will automatically download and install all of the software.

Next, you go into your httpd.conf file which is the configuration file for apache.

nano /etc/httpd/conf/httpd.conf

Near top of the file there are a list of modules, comment out the line that says LoadModule unique_id_module modules/mod_unique_id.so By placing a # infront of the line. Ctrl+X to quit, make sure to type ‘y’ when it asks you to save.

Now, go into you php.ini file.

nano /etc/php/php.ini

Find the list modules there and remove the semicolon (;) from the front of the line that says ;extension=mysql.so. This enables php to work with MySQL.

Now add apache and mysql to start at boot (php doesn’t need to be explicitly started).

nano /etc/rc.conf

Use your down arrow key to navigate to where it says:
DAEMONS=(syslog-ng network netfs crond) and add httpd and mysqld separated by a space within the parentheses.

Now you can either reboot or type in /etc/rc.d/httpd start and /etc/rc.d/mysqld start

Now everything should be setup! Type in the local ip of the server, or if you are on the server ‘localhost’ in your web browser and you should see an Apache test page.

Be sure you go through the httpd.conf on your own again to change some of the settings to suit you. Any question, don’t hesitate to either comment here or post on the Arch Linux Forums. They are pretty quick at getting back usually.

Continue Reading…

Intro to Classes

Posted 10 months, 4 weeks ago at 12:59 pm. 4 comments

We’ve talked about functions before, but now we are going to talk about classes. Classes are pretty much containers for function. They can hold their own variables and functions. You write these classes to make objects. You also have a lot of control over the way the classes interact with each other.

Classes take the following format:
[code lang="c"]
Class Banker{
public $cash = 0;
public $interest = 1.06;
function __construct($balance){
$this->cash = $balance;
}
function deposit($amt){
$this->cash += $amt;
}
function withdraw($amt){
$this->cash -= $amt;
}
function giveInterest(){
$this->cash = $this->interest * $this->cash;
}
function sayBalance(){
echo $this->cash;
}
}
[/code]
Looking through that code you probably see a lot of stuff we talked about in the previous lesson about functions. However, there is also a lot of stuff I haven’t yet talked about.

The first thing I’m going to talk about are the classes variables.
[code lang="c"]
public $cash = 0;
[/code]

ignore the ‘public’ and it’s just declaring a normal variable. However, because it is in a class. It is owned by the class. This is why later in the code when you see us using $this->cash the $this will be replaced by the object because remember, the class is only a blueprint for the object.


Another thing that looks unfamiliar is the ‘__construct()’ function. What that is, is a function that runs right whean object is initiated.

[code lang="c"]
include(’bank.inc.php’);
$bankerBob = new Banker(100);
$bankerBob->giveInterest();
$bankerBob->withdraw(6);
$bankerbob->sayBalance();
[/code]

That code shows basic implementation of the class. First, we include the file the class is in. Then we declare the variable $bankerBob to be an object of the Banker class. The 100 inside the class initiation as an argument will go to the __construct() function I started talking about earlier. The account will be made with 100 dollars of what ever currency we want to imagine. The interest function adds 6 bucks to the account because 6% of 100 is 6. We then withdraw 6 bucks and bankerBob will tell us we have 100 again.

Make sense? Good.

This concludes the Introduction To Classes lesson. Comment if you are stuck with anything or have questions! Happy PHP-ing and also hope you had a Merry Christmas.

P.S. I am experimenting with different code display plug-ins. If anyone has any recommendations, say it!

Edit: I have now also found a fix to the html entity problem in wordpress thanks to this helpful site.

Click Heat

Posted 11 months ago at 12:37 am. 1 comment

I’ve always been interested in the software necessary to generate a heat map showing where everyone is clicking on a site. I remember seeing other people show images of it. I spent a good 30 minutes looking on google trying to find a good, free one to no avail. Then, something amazing happend, I decided to try out Stumble Upon to add my site to it. I did, and the thought I’d try stumbling around. The first site was garbage, the second was that all-famous helicopter game, and then the third linked me to Click Heat! Now isn’t that just coincidental!

I immediately downloaded it, setup was easy, took 3 minutes. clicked around on my site a few times, and the opened up my ‘heat map’ and its…. beautiful. Although there ain’t to many clicks. Thats understandable seeing as I just installed the damn thing 5 minutes ago and this isn’t (yet) the kind of site that has a constant flow of visitor. Just showed my 10-15 randomly placed clicks. I do however see great potential.

The software itself is a javascript that sends out an AJAX request with the click coordinates. They are stored in a final and then when I want to view a heat map, php uses GD to create the image for the selected time range. It even has a feature so that it won’t log clicks from specific IPs (like my own) so it won’t pollute the data.

All in all, this was a great stumble that I can’t believe I haven’t found before I recommend it to all of you in need.

Official Site of Click Heat

 

My Favorite Linux Distro

Posted 11 months ago at 12:26 pm. 0 comments

I’ve been using Linux on and off for about a year now. While I still use Windows XP as my main operating system, I have a relatively old computer with a 1.6Ghz Intel P4. I have tried a number of distros on it. Debian, Ubuntu, Damn Small, and Arch Linux. I like Arch the most. It runs the quickest, feels the most configurable, and is on a rolling release cycle with packages that aren’t frozen as in Debian. Before Arch, I liked Debian the most. It was very easy to set up, and had an awesome package management system (Aptitude). Arch however, has a very similar package management system (Pacmac). I thought ubuntu was really cool, EXTREMELY easy to set up and use as a desktop. The reason I didn’t like it is because it was just an even more simplified version of Debian, and I wanted to try something different, not to mention I SSH into the machine many times more than I VNC into it. I have learned so much about Linux over the past year I feel very comfortable with the command line doing almost anything. Arch Linux is my favorite distro out of all that I have tried for what I use it for. The only thing that was problematic for me was setting up xorg. The video card in the machine is an old Nvidia Vanta. It was troublesome for me getting the xorg.conf set up and working. But hey, it was my first time, Debian , Ubuntu, and DSL did it automatically.

Anyways, whats your favorite Linux distro? Comment this post and tell us why!

Arch Linux Logo

Introduction to Functions

Posted 11 months ago at 4:34 pm. 0 comments

Hello again,

Welcome to my first real article. In this post I will be discussing functions, specifically in PHP. I am assuming you know basic PHP syntax, but if you don’t, it is easy enough to learn on your own.

In PHP there are 2 ‘types’ of functions. There are the ones that are there by default, and then the ones that you, personally, create. The ones that are there by default are very basic, and fundamental. The ones you will soon learn how to create yourself accomplish things like cleaning up the code, condensing the code, avoiding redundancy, and making it easier to read all around.

Examples of default functions include: include(), echo(), print(), etc…

Custom functions are made up by you. Here is an example.

function sayHelloWorld(){
echo "Hello World!";
}

With that included into your script, you can now write just write

sayHelloWorld();

And it will output “Hello World!”

As you can see, this is in fact a lot neater. While this is a simple example, it shows the power of functions. Say you wrote about 100+ lines of code for a login script, you could just make it into one big function that looks like this…

function loginUser($username, $password){
//code
if('foo' == 'bar'){
return true;
}else{
return false;
}
}

Now in that example, you might have seen something I haven’t talked about. Arguments.

function loginUser($username, $password){

the two variabls separated by the comma are called arguments. This is how you talk to the code, and give in information to work with. In that example, for the function’s ‘blue print’ if you will, I’m saying that when I call the function, I will be providing it with those two variables in that format. So lets say I wanted to directly call this function, I would write
loginUser('wildwobby', 'thisismypass');
And then, the function will replace all the instances of the $username with the value of wildwobby, and all instances of $password with the value of thisismypass.

The other thing you probably see is the
return true;
return false;

While it doesn’t make sense in my example without any real code, you would set it up so the function returns true if in fact the login was successful and false if it wasn’t. This is how the function talks back to you. you could put it into an if statement, and if the login went successful, it will execute the script within the if statement.
if(loginUser('wildwobby', 'thisismypass')){
echo "You have been logged in!";
}else{
echo "Sorry, there was a problem with the login.";
}

This concludes the introduction to functions. Hopefully you know enough to start playing with this new wonderful skill of yours. Don’t hesitate to comment and let me know what you thought. Also, be sure to play around with php trying a bunch of random stuff on your own as it is truly the way to learn how to program!