David Hurth's blog

Game of the Week - Street Fighter 2

Tagged:  

It's Friday and time for a bit of fun. This week the game of the week is the classic Street Fighter 2 game. You can play it by using the link below.


Click here to play the game.

This is the first of what will be a weekly post of on-line games, so finish out your week by playing a game.

Facebook Wins!

Tagged:  

If you remember when Facebook first came out, it was kind of a niche site that catered to college students. At the same time MySpace was a giant network the size of Goliath! But, now we can see that David does in fact beat Goliath as Facebook has put MySpace in a position to partner with what has become the more used network.

The partnership, which will be announced later today, is expected to see almost all of the changes visible from MySpace. MySpace users will be able to connect their MySpace profile to their Facebook profile, so that their status updates on Facebook will appear on their MySpace profile. Users will also be able to connect to MySpace using their Facebook account. Facebook will get in return user profile information that will help with targeted advertising.

Facebook has become the most used Social Network and is currently showing no signs of stopping (they are even going after e-mail now). Having said this, it will be interesting to see what happens in a few years. Will Facebook be even bigger or will they find themselves in the same position as MySpace?

Ajax File Upload Tutorial

Tagged:  

As you are writing an Ajax application, you may want to allow users to upload files through an Ajax form. The folks over at AnyExample.com have put together a good tutorial on the subject. The tutorial uses PHP for the back end, but the principal is the same for any server side language.

Below is an excerpt from the tutorial.

How IFRAME file uploading works?

  • There is a simple <form... which contains only <input type="file" ... > field.
    Target for this form is a hidden IFRAME (with "display: none;" CSS style) and
    OnChange event for the file field is set to JavaScript function which checks file extension (optional for this example, but
    very useful in general) and submits form.
  • Special part of the script (marked FILEFRAME, see comments) saves file upload, checks for uploading errors and outputs JavaScript code to that
    hidden IFRAME.
    The javascript code uses parent.window.document object, which allows to modify parent document (visible page, which users is viewing).
    It sets filename value and enables submit button on the other form using getElementById method.
  • The other form has 'description' text-field and hidden field 'filename'. User may fill 'description' field while file is uploading.
    When file uploading is finished, user press submit and "file information" page is generated (based on filename from hidden field and user's
    file description).

Possible drawback of this method is file garbage: files are uploaded even if user does not press submit button. You may need to write 'garbage file
collector' which will delete any unused file.

This example stores all uploaded file in filesystem folder. You need to specify it at the beginning of script, see variables $upload_dir and
$web_upload_dir. There is fail-checking which checks whether it is possible to write create files in upload directory.

We use following functions in this example:

PHP

  • move_uploaded_file - move file uploaded to web server
  • fopen - open file
  • fwrite - write to opened file
  • fclose - close file
  • str_replace - replace one substring by another
  • filesize - returns file size in bytes
  • filemtime - returns file modification time

You can read the full post here.

Fun with Twitter or How to Get Over 500 Twitter Followers in Two Weeks!

Tagged:  

As we all know Twitter is one of the most powerful social networks around. The network is so powerful that if you have a lot of followers on the network and post a link you can get an incredible amount of traffic. The popularity of Twitter was shown today when someone tweeted that Bill Cosby died and it was reported as true by some media (in fact Bill Cosby has said that he is getting family calling his house thinking that he had passed away).

Two weeks ago I thought I would have some fun on twitter and decided to take my Twitter account that only had one follower (my wife) and see how many followers I could get. I was using the account to post tweets about my Porsche Blog. So, the first thing I did is change the user-name to something a bit more descriptive as to what I was posting, theporscheguys. The next thing I did was look for other users that where interested in what I was posting. I did this by following people that where also posting things about Porsche and following people that where following them (this was the key as most of these people will be more likely to follow you).

To make sure that I kept the tweets going (people want to follow people tweet often) I used Feedburner's new Twitter feature that puts a Tweet on Twitter every time something is posted on my Porsche Blog and Porsche Social Network.

I started doing all of this on a Friday and by the following Monday I had over 200 followers (yes 200 in one weekend)! It has been about a week and a half and I now have over 500 followers. My Porsche Blog and Porsche Social Network have increased in traffic by quite a bit. Before I started having all of these followers I was averaging about 30 unique visitors a day and now I am averaging over 600 unique visitors per day and it keeps growing.

So, if you follow these tips you can get quite a few followers and possibly much more traffic to your site.

IE 9 a Huge Leap Forward in CSS Support

Tagged:  

More information about Internet Explorer 9 is being released and it appears that it will be a huge leap forward from IE8. IE 9 will have much better support for CSS, especially CSS 3. This will help all web developers make much better page designs with less browser issues (at least if you don't need to make it backwards compatible to IE 8 and IE 7).

It is great to finally see Microsoft really working on a better standards supporting browser (hopefully all of this actually makes it to the final release).

You can view the table of CSS compatibility here.

The Future of Social Networks

Tagged:  

We know that there are a lot of social networks, with new social networks launched everyday. Most of these social networks die because not many people use them.

I believe that the issue may often be that these sites do not separate themselves from existing social networks. Most of these networks are almost exactly the same as a Facebook, Twitter, Digg or Flickr and since they are going for the same audience they have very little chance at surviving.

I think that in general the future of social networks is to create social networks for smaller niche groups. Take for instance a site that i have been working on. The Porsche Guys Club, which is a free on-line Porsche auto club. The idea of this social network is to connect Porsche fans in the same way as a traditional auto club, but without the cost and overhead of a traditional club.

You can take a look at the site here.

So, this is an example of what I think the future of social networks will be, but I'd love to hear your thoughts on the subject.

iPhone 4 - Is it Worth Getting?

Tagged:  

As you know the new iPhone 4 has just been release recently. The question on everyone's mind has got to be, is it worth getting the new phone. From what I've heard and seen, it doesn't seem to be a huge improvement over the old device, as Steve Jobs promised.

Is this phone destined to fail? From it's being over hyped to the fiasco that happened at the reveal (if you haven't heard Steve Jobs had a bit of a Bill Gates Windows 95 moment). Only time will tell if this phone will be the big hit that Steve Jobs thinks it will be.

In addition, with the release of the new phone, AT&T will no longer offer an unlimited data plan, unless you already have that plan. The maximum data allowed will be 2GB, which for heavy users could lead to some huge bills, if they don't watch out.

So, if you have one of the new iPhone 4's let us know if you think it is a huge step forward.

A More Intelligent Open in New Window Script

Tagged:  

Recently, I needed to create a small JavaScript that would make links for documents and outside web sites open the links in a new window. However, any link from the web site that held the links needed to open in the same window. This was made a bit more complicated by the fact that the system that was holding the links (a third party web content management system) did not allow for the user to decide if they wanted the link to open in a new window when they created a new link.

Because I could edit the JavaScript that loaded when the page was loaded, the solution that I came up with was to call the below function in a function that was called onload. What this JavaScript does is go through all of the links on the page and any link that matches the criteria is changed to have a target of blank.

function AddTarget(){
	var TargetTag2 = document.getElementsByTagName("a");
	
	for(var a=0; a

Sometimes a simple JavaScript can save the day.

Making it to the Ajaxonomy Home Page

Tagged:  

As you may know, Ajaxonomy is an open blog that allows for you to sign up for an account and write blog posts on our site. When you write a post all that we ask is that it relates to the theme of this site (so web development or technology related).

If you write a well written post about web development or a technology, there is a good chance that this post will get promoted to the front page.

What we will remove from our site is anything that looks like spam (we are currently, removing many spam articles from our site). So, make sure that you write something that a web developer will find interesting and we would love to get you on the front page of our large traffic site.

So, keep writing good articles and we look forward on promoting your post to the front page.

Flash comes to the iPhone

Tagged:  

A new iPhone app allows users to view Flash content on their iPhone and iPad. How it works is that you download an app and it connects to a computer where Flash is run. The current free version of the app is very limited, but a $9.99 a month unlimited version is scheduled for release soon. All of this comes after Apple CEO Steve Jobs has said that Flash would not be released on the iPhone or iPad.

From what has happened in the past (most notably with the Windows Virtual machine that apple released after hackers created a way to run Windows on the Mac), I wouldn't be surprised if Apple releases a Flash application of there own soon.

You can read more about it here.

Syndicate content