It depends, at first it does matter how you generate the pngs.
With gd, which is not the fastest but very reliable, the function imagepng can be used to write the image to a certain location.
Second is you can get the get request with superglobal array $_GET.
So http://www.funracingleague.com/userbars.php?lfsname=makakazo
can be retrieved via $_GET['lfsname'], but be sure to strip any tags and quote it for use in database statements.
To pump a file from disk to the browser u can use readfile.
Send the header for the png first to inform the browser of the data type eg. header('Content-type: image/png');.
Thats basically it.
A better solution however would be the use of mod_rewrite.
It depends on the host if it is available.
With mod_rewrite you can rewrite requests to the webserver via regular expressions.
A .htaccess for your problem should be a in a seperate folder and look like this.
RewriteEngine On RewriteRule ^(.*)\.png$ userbar.php?lfsname=$1
This would call userbar.php everytime a png is requested. This way userbar.php can directly choose between generating a new png or deliver an already generated one.
The fastest solution from my experience would be somethink like this.
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\.png$ userbar.php?lfsname=$1
It says if the requested file is there deliver it to the browser, if not call the script to generate and deliver it.
Now a second script can be run via cron at a certian interval to delete the already generated ones, forcing the generation of new pngs.
I don't want this to become far off topic, so a short and last explanation.
There are many privateers out there, who startet to rent root-servers (bundled with confixx/plesk etc.) for cutting the costs for hosting multiple sites.
They don't care about linux or php version (actually they don't have an idea what that is). The main goal is keep the server runing at minimal costs, so they run for years (personally I know 2 such guys). As often as I tell them they need to upgrade at least for security reasons,
they are afraid of the costs, the downtime and what else might happen.
So my experience, php 4 might be dead in terms of support but not in terms of usage in servers out there.
Don't be to sure, php applications are part of my work and from time to time there are customers who still use php 4.
Mostly caused by very outdated linux distributions.
# Convert Live For Speed String into an ECMA-48 escaped string. public static function lfs_str_convert_console($str) { // Extra State Information $isTagOpen = FALSE; // Parse String for ($i = 0, $j = 1, $l = strlen($str); $i < $l; ++$i, ++$j) { /* Handle Color Codes */ if ($str{$i} == '^' && is_numeric($str{$j})) { // Get array values' length. $deltaLen = strlen(LFSStrConvert::consoleReplaceArray[$str[$j]]); // Set tag status if ($str{$j} < 8) $isTagOpen = TRUE; else $isTagOpen = FALSE; // Place ECMA-48 Charaters into String. $str = substr($str, 0, $i) . LFSStrConvert::consoleReplaceArray[$str[$j]] . substr($str, $i); // Move Pointer Past The Change. $i += $deltaLen; $j += $deltaLen; // Get new String Length. $l = strlen($str); // Remove The Formatting. $str[$i] = NULL; # Remove ^ $str[$j] = NULL; # Remove Int. } } // Close any tag left open. if ($isTagOpen) $str .= "\033[0m"; return $str; }
# Convert Live For Speed String into an HTML Mark'ed Up String. public static function lfs_str_convert_html($str) { // Extra State Information $isTagOpen = FALSE; // Parse String for ($i = 0, $j = 1, $l = strlen($str); $i < $l; ++$i, ++$j) { /* Handle Color Codes */ if ($str{$i} == '^' && is_numeric($str{$j})) { if ($isTagOpen == TRUE) { // Set State. $isTagOpen = FALSE; // Inject Close Tag $str = substr($str, 0, $i) . '</span>' . substr($str, $i); // Move Str pointers Past ?. $i += 7; $j += 7; $l = strlen($str); } if ($str{$j} < 8) { // Set State $isTagOpen = TRUE; // Inject HTML Markup $str = substr($str, 0, $i) . '<span style="color: #'.LFSStrConvert::htmlReplaceArray[$str[$j]].';">' . substr($str, $i); // Move Pointer Past The Change. $i += 27; $j += 27; // Get new String Length. $l = strlen($str); } // Remove The Formatting. $str[$i] = NULL; # Remove ^. $str[$j] = NULL; # Remove Int. } } // Close any tag left open. if ($isTagOpen) $str .= '</span>'; return $str; }
# Strip All Live For Speed Markup From The String. function lfs_str_strip($str) { return str_replace( array('^0','^1','^2','^3','^4','^5','^6','^7','^8','^9'), array(), str_replace(array('^d','^s','^c','^a','^q','^t','^l','^r','^v'), array('\\','/',':','*','?','"','<','>','|'), $str) ); } } ?>
Would be nice to do some profiling, comparing both approaches.
I wouldn't be surprised if the php interpreter recognizes the constant arrays within the functions and does it only initialize once.
It is not two gravitiy forces. Gravitiy is what pulls you towards the mass centre of earth, with 9.81 m/s² at sealevel.
For ease of use it has been know as 1 G.
So if there is a lateral force pulling with 5 G, it means nothing more but 5 * 9.81 m/s². It is caused by fictitous force rather than gravity.
You're right. My view was one sided. Sorry for the harsh comment.
I was seeing an interpretation of a rule more as a type of bending the rule.
Imho things that are not covered by rule (e.g. where to put the tyres) are freedom of design and not a sign of a bad formed rule.
The rule doesn't say where the tyres have to be, this not part of the rule.
It just says 4 tyres.
And the one and only intepretation of that is put 4 tyres on that car everything else is up to you.
There is no rule that covers every aspect of a design as it would make no sense. So even if a rule has only one interpretation, there are most probably different results in design.
Don't use divs just cause someone says tables are not state of the art.
With divs you will run in much problems when it comes to browser compatibility and it will take a lot more time to sort such things out.
It is better to use a simple layout for development and seperate it from the logics via template engine (e.g. smarty).
So someone else can care for a fancy layout, while you do the vital things.
Well yeah I related the direction g-force according to the car not the track.
I hope you didn't get me wrong there. So high banked ovals would produce high vertical forces.
Tbh. I have no idea of the influences of lateral forces on the brain.
I thought so ppl would rather loose their head before going blackout on lateral g-forces.
If that isn't the case they could a least use half of the brain together with the corresponding eye.
Right, thats what I meant.
For the discussion about blackouts on ovals the lateral forces are not relevant.
So point is not the add vertical and lateral Gs.
The linker tries to link against pthreads, a threading library. (who would have guessed )
It should not be shipped with the project itself, but you can install it from cygwin setup (libs section).
If it is the wrong version (hence gc2 corresponds to gcc 2.9.x and cygwin comes with gcc 4.x ), you would need to adjust the makefile to reflect the installed version.
U need to setup a shoutcast/icecast server first, but be sure there is enough bandwith available.
Second use winamp with shoutcast plugin to stream mp3 data to the server (DJ).
If you run a few laps on the oval (e.g.FZR,BF1), you will notice the effects.
There is slipstreaming as well as losing grip, and it not just a little effect.
Strange is that even with very low wing settings the effect doesn't seem to change.
Well I liked the idea ... maybe it can spread the word of LFS a bit more, if we get into higher rankings.
I use GPU version as well as CPU. The GPU is unbelievable fast compared to cpu. So one day there is no result from cpu and next day there is +4. Maybe thats the "jumpstart"
I was really hoping for more people participating.
Well I will at least participate as long as it is cold in germany and the exhaust
air keeps my foot warm .
I've started such a project years ago for the LFSCAR series.
It is possible to setup a pacecar with the ai, but it cannot run server side.
So a race admin or something like that has to run the app.
It works the following way.
-detect race_start -> ai joins race with predefined skin, setup and car
-grid is reordered to move pace car in front
-the setup limits the top speed of the car by gearing
-fuel is limited so the pace car will join the pits after a certain amount of laps -> send pacecar to spectate
Thats basically it, you could even let it join the race in case of a fcy.
My tries never left early testing stage but it was enough for a proof of concept.