Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Allegro's relevance makes me happy

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Allegro's relevance makes me happy
Samuel Henderson
Member #3,757
August 2003
avatar

furinkan said:

Does this look fine to you? It took me several minutes to discern what he was doing; It never even occurred to me that somebody would solve a problem like that.

<?php
//$due_date is in the format YYYY-MM-DD, as is common in SQL DB's
$date = date('m', strtotime($due_date)).'/'.date('d', strtotime($due_date)).'/'.date('Y', strtotime($due_date));
?>

I read the comment first and then skimmed the next line. Knowing this line was likely a date formatting conversion the 'm/d/Y' jumped out at me. As quickly as I skimmed the line (0.000001 seconds... yes, even faster than our Fearless Leader!) I knew exactly what it was doing, even without having to research what strtotime did.

That's not so say what he did was elegant or wasn't a WTF.

=================================================
Paul whoknows: Why is this thread still open?
Onewing: Because it is a pthread: a thread for me to pee on.

AMCerasoli
Member #11,955
May 2010
avatar

I use to save data as timestamps, so I would have done $date = date('d/m/Y', $timestamp);

furinkan
Member #10,271
October 2008
avatar

I'm pushing to use timestamps more, but I don't have time to rewrite our entire codebase. Everything needs done yesterday, so don't waste any time! But, oh... I still expect PHP gold out of you. ;)

Trezker
Member #1,739
December 2001
avatar

Everyone has enough already.
If you're not dying you have enough. If you want anything more you're just greedy. >:(

furinkan
Member #10,271
October 2008
avatar

You're right. That fourth slice of pineapple & ham pizza, was just greedy of me. You can have it back, but you'll have to wait a while.

Johan Halmén
Member #1,550
September 2001

Bill Gates got rich by not spending money on ridiculously over priced eyeglass frames.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

Arthur Kalliokoski
Second in Command
February 2005
avatar

{"name":"billgates-saves-for-a-lamborghini.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/b\/fb68178f932e8410982c54420c71064f.png","w":550,"h":2185,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/b\/fb68178f932e8410982c54420c71064f"}billgates-saves-for-a-lamborghini.png

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

furinkan
Member #10,271
October 2008
avatar

{"name":"93339552-bill-gates.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/2\/124016adc95afa8488ec38ab2101a9d2.jpg","w":609,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/2\/124016adc95afa8488ec38ab2101a9d2"}93339552-bill-gates.jpg
Frozen solid. Just like our products. <3

I decided to switch one of my projects over to python and Allegro 5 before I get too deep into it. I thought: Oh, I don't wanna compile allegro 5.0.9! :'( The most difficult part was downloading the source. I keep forgetting: I'm not on Windows anymore. I can have aptitude do all my work for me.

weapon_S
Member #7,859
October 2006
avatar

SiegeLord
Member #7,827
October 2006
avatar

weapon_S said:

C(++)
C#(?)
D
Objective C(?)
Python
Java

This list is for A5... answers for A4 are different:

  • C - Obvs

  • C++ - No, but you can use C headers

  • C# - No

  • D - Yes

  • Objective C - Doesn't exist afaik, but you can use C headers

  • Python - When it works... yes

  • Java - Doesn't exist afaik

Also, the newest Humble Bundle appears to have an Allegro 5 powered game: Beat Hazard Ultra.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

 1   2   3   4 


Go to: