Browsing the archives for the Applications category.

Problems with Gamingstats

Applications, Coding, Projects, Web developing

I just fixed problem on Gamingstats that affected all of the users. This time invalid username was filtered to empty string, causing updating process to halt. Problematic user is now removed from the system, but the bug is still there. I try to fix it tomorrow or something.

I am not sure if I continue to support this project. It has way too many problems. First is that changes to Steamcommunity usually breaks up my system and I have to find out the changes and it takes lot of time. (this time the problem was my fault, but yeah). Another thing that kills my motivation is that I don’t use this site anymore myself. So it isn’t anymore so fun to work with it. It is more like a job that I don’t get money for.

Most likely I am going to close the application, release it under GPL license and move forward. There is only couple of users that uses the service and I think that the system is way too buggy. I had to rewrite the parser because my webhost didn’t had all the plugins and stuff that I used when I coded on local development server. Because of that, the updater doesn’t have the best stability with bad input…

I was going to sleep one hour ago, but because the system didn’t work as I expected I wasted one hour trying to fix it. And my website also went down once when I tried to fix it, so I am not very happy with this project currently.

So yeah back to sleep now… ->

No Comments

Gamingstats beta released!

Applications, Coding, Games, Projects

For couple of weeks I have been coding Gamingstats. It is simple website/webapp that collects information from users steam profile daily and then generates statistics for user. Collecting and generating stats all happens on the servers background cron script, so user just needs to enter his/her steamcommunity url.

Because some users have lots of games (100+) It creates lots of data to database. (Played time for every game, every day = lots of data) And because it generates lots of data, I have created steamgroup. To enable time tracking for games, you need to join to the steamgroup. This way I can control growth of the database.

Project is still in beta and there can be some bugs. I may add some more stuff to it in future, like better layout/design and forums signature system, but now I just want to make sure it works.

System doesn’t currently work with the steamcommunity profile id’s (eg 76561197974577294), but it works well with the custom profile urls.

http://gamingstats.pelikoira.net/

No Comments

Project release: TF2LogAnalyzer

Applications, Coding, Projects

I have been building TF2LogAnalyzer for couple of weeks and now this project is finished.

TF2LogAnalyzer is working on two major parts. First is small client that reads tf2 client log files and sends them to tf2loganalyzer.pelikoira.net. Then the backend system generates statistics from the user logs in realtime.

However, I found couple of problems with this system.

  • It is way too hard for users to get the application working
  • Logs that tf2 client provides doesn’t really have any other information than kills

Some things I learned on this project

  • If you need to choose between feature/user friendliness, it is usually better to take the second one.
  • Dont try to create statistics from logs that doesn’t really have any information
  • jQuery.load() function is AWESOME

However, this project was great experience. I learned couple nice html/css/jquery tricks that I can use on my future projects. Feel free to try it out, but it may not be the easiest system to gather stats. But if this system gets hundreds of users, I may rethink developing more of it.

Now I can start couple of other projects that I have been thinking of. Tf2 map and simple 2d platformer c++ game… And I could also try to write more posts to this blog. :P

No Comments

Testing MySQL performance (SELECT query)

Applications, Coding, Linux, Web developing

Is SELECT column1,column2 FROM table faster than “SELECT * FROM table? Should I only pick data that I need, or just take everything?

I personally like to take everything, because it is much easier to develop applications that way, but many sites recommends to take only data that is needed because of speed.

So, I wanted to test this and see if there is a major speed difference.

On small databases (something like 10-1000 rows) there is almost none difference. I wanted to see the difference on a huge database, so I wrote little script that will fill the database with 1 million rows of random data. Then I coded another script for testing the speed differences on SELECT query.

Scripts used to build the test

Here is the database structure:

mysql> desc test;
+---------+--------------+------+-----+---------+----------------+
| Field   | Type         | Null | Key | Default | Extra          |
+---------+--------------+------+-----+---------+----------------+
| ID      | int(11)      | NO   | PRI | NULL    | auto_increment |
| field_a | varchar(500) | NO   |     | NULL    |                |
| field_b | varchar(500) | NO   |     | NULL    |                |
| field_c | varchar(500) | NO   |     | NULL    |                |
| field_d | varchar(500) | NO   |     | NULL    |                |
+---------+--------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

And here is the script that I used to fill the database:

<?php

echo("Connecting to the database...\n");
mysql_pconnect("localhost","lauri","") or die();
mysql_select_db("test") or die();

echo("Starting to fill the database...\n");

$amount = 1000000;
for($i = 0;$i < $amount;$i++){
$rand1 = random();
$rand2 = random();
$rand3 = random();
$rand4 = random();

query("INSERT INTO test(field_a,field_b,field_c,field_d) VALUES('$rand1','$rand2','$rand3','$rand4');");
echo("Value: $i \n");
}

--snip--

?>

(In the –snip– there is only the random() function creating random 9 char strings, and my query function that does normal querys to the database)

And here is the script that I used to test the SELECT speed:

<?php
echo("Connecting to the database...\n");
mysql_pconnect("localhost","lauri","") or die();
mysql_select_db("test") or die();

$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
echo("Executing full select\n");
$result = query("SELECT * FROM test");
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];

$diff = $etimer-$stimer;
echo("TIME: $diff\n");

$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
echo("Executing partial select\n");
$result = query("SELECT field_a FROM test");
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];

$diff = $etimer-$stimer;
echo("TIME: $diff\n");

--snip--
?>

(Snip contains the database query function, I stole found nice timer script from desilva)

Results

I executed the testing script against 1 million rows of random data, here is the results:

Connecting to the database...
Executing full select
TIME: 1.77005004883
Executing partial select
TIME: 1.03216195107

So there is only 0.7 second difference with million rows of data…

In my opinion, the 0.7 second difference is so small that if you are working on project that doesn’t have massive databases, you shouldn’t worry about selecting only fields that you need, but if you are working on something that has lots of users and huge databases, selecting only data you need may help speed of the script lot.

After the tests I realized that the varchar size of 500 is way bigger what I used… I changed the varchar size to 10 and executed the tests again. Results here with varchar(10):

Connecting to the database...
Executing full select
TIME: 1.71709799767
Executing partial select
TIME: 0.975940942764

Not huge difference either, but if you need all the speed you can get, make the sizes of columns right… Not way too big like I did.

System

I used my home-server with 3Ghz Pentium 4 processor with hyper-threading. 2 gigs of ram and normal 7200 rpm 80g hard-disk. Operating system was Debian with normal installation of PHP5 and MySQL via apt-get with default settings.

No Comments

Yet another update for Awesome Note!

Applications, Review, iPod touch/iPhone apps

Some time ago there came a update for  the Awesome note iPhone app. Because I have this application and I have done couple posts about it, I decided that it is good to post about the update also. There is couple new features that I like lot. Example new way to change themes, read only notes and ability to add images to notes.

But the greatest thing is that they finally fixed the “password protected” folders. Because now they are really secure. It is no longer possible to delete folder to see content of passlocked folder. It is also possible to lock the whole application.

No Comments
« Older Posts