Giant Mammoths

Ξ February 13th, 2008 | → 0 Comments | ∇ sanity adventures, stuff and junk |

I’ve just returned from a weekend trip to Mammoth, CA. A bunch of slackers all headed up in a van with the intent of hurling ourselves down the face of a mountain on sticks strapped to our feet. Naturally, I got separated and lost thanks to the reliable Maker Effect. I ended up going around the backside of the mountain and falling face first down a run too hard for my skill level. I had a great time doing it though. A little from the ol’ pedia on the ski area:
The Mammoth Mountain Ski Area is a large ski resort located in eastern California on the east side of the Sierra Nevada mountain range in the Inyo National Forest. The ski area, commonly called simply Mammoth, has the best terrain park according to Transworld Snowboarding Magazine, and is consistently ranked in the top ten ski resorts by Ski Magazine.

Original post by Maker

 

To copy a file

Ξ September 22nd, 2007 | → 0 Comments | ∇ boring, stuff and junk |

Recently a friend asked me how I would go about copying a file on his Windows machine to the same directory but append the date to the filename in the standard ISO 8601 format (YYYYMMDD) with the leading zeros, of course. At first I gave him the following answer for a windows batch file:

SET myfile=win.ini
FOR /F “tokens=1-4 delims=/ ” %%I IN (’DATE /t’) DO SET mydate=%%L%%J%%K
copy %myfile% %myfile%-%mydate

Which got me to thinking of how to do it in some other languages, out of boredom. So here it is in Classic ASP:

<%
file = “win.ini”
set fs=Server.CreateObject(”Scripting.FileSystemObject”)
fs.CopyFile file, file & “-” & Year(date) & Right(Cstr(100 + Month(date)),2) & Right(Cstr(100 + Day(date)),2)
%>

And the best for last, here it is in PHP:

<?
$file = ‘win.ini’;
if(!copy($file,$file.’-’.date(”YmdHis”))) { echo ‘File copy failed’; }
?>

If you can do this in a language not presented here, please […]

Original post by Maker

 

  • Rumours and Lies