Deus Rex posted:http://peej.github.com/tonic/
|
|
# ? Feb 1, 2013 00:42 |
|
|
# ? Jun 5, 2024 15:47 |
|
Deus Rex posted:http://peej.github.com/tonic/ What's wrong with this? Looks like a JAX-RS clone for PHP. It's unfortunate that the annotations have to be inside a comment but I'm guessing that has more to do with PHP sucking than anything else.
|
# ? Feb 1, 2013 01:14 |
|
Stuffing things in comments is not a terribly uncommon way to extend languages, since it doesn't break all the other tools for the language and is usually easier to implement. The end result nearly always is terrible, though.
|
# ? Feb 1, 2013 01:17 |
Plorkyeran posted:Stuffing things in comments is not a terribly uncommon way to extend languages, since it doesn't break all the other tools for the language and is usually easier to implement. The end result nearly always is terrible, though. I would probably have gone with only overloading shell-style # comments to at least make it reminiscent of C pre-processor. But really, putting anything semantic into comments is retarded. (Now I think about it, Wordpress uses magical comments to identify plugins too. Sigh.)
|
|
# ? Feb 1, 2013 01:27 |
|
I like how in the description the word RESTful links to a non-responding webpage. And I really wanted to learn what RESTful meant too.
|
# ? Feb 1, 2013 04:51 |
|
Optimus Prime Ribs posted:I like how in the description the word RESTful links to a non-responding webpage.
|
# ? Feb 1, 2013 05:31 |
|
nielsm posted:I would probably have gone with only overloading shell-style # comments to at least make it reminiscent of C pre-processor. I'm ok with comment annotations for generating documentation or even for tests but using comments as a demented metaprogramming construct to generate your application is nasty as hell.
|
# ? Feb 1, 2013 05:42 |
|
code:
|
# ? Feb 1, 2013 05:47 |
|
The Gripper posted:RESTful just means your website can have a rest every once in a while. I was about to say, how much more restful can you get?
|
# ? Feb 1, 2013 05:54 |
|
Progressive JPEG posted:
Hmm, yeah, I see the problem. code:
|
# ? Feb 1, 2013 06:23 |
|
edit: I'm an idiot
|
# ? Feb 1, 2013 07:36 |
|
Deus Rex posted:http://peej.github.com/tonic/ This is a standard thing called "Underwater Aspect Weaving" http://net.tutsplus.com/tutorials/php/aspect-oriented-programming-in-php/
|
# ? Feb 1, 2013 07:52 |
|
Still hard to get over a loving backslash being used for namespaces
|
# ? Feb 1, 2013 08:05 |
|
Here's a double horror for you. One of which is mine, and one of which is 10 years before I started here when the company was transitioning from their mainframe/COBOL to MSSQL2000 and VB6.code:
Thankfully that is changing soon. My horror is the "CAST(price AS INT(10,0)) * 0.01 as price" part Apparently 3 years ago when I wrote this, I really wanted that INT to be 10 digits long with no decimal places. Also the fact that this ran on SQL2000 without complaint is a pretty hilarious horror. It's throwing errors in 2008, which is why I caught it.
|
# ? Feb 1, 2013 16:27 |
|
Frozen-Solid posted:My horror is the "CAST(price AS INT(10,0)) * 0.01 as price" part Using integers for monetary values isn't always a horror, especially if you can't be sure your system won't mangle floating points.
|
# ? Feb 1, 2013 19:18 |
|
Not using integers for monetary values is more often a horror.
|
# ? Feb 1, 2013 19:24 |
|
PHP code:
Novo fucked around with this message at 02:28 on Feb 2, 2013 |
# ? Feb 1, 2013 22:39 |
|
trace.log posted:--------------------------------------------------------------------------------------------------------- sigh What happened to the emote of the little guy chucking the book over his shoulder because that seems just about perfect for this.
|
# ? Feb 1, 2013 22:57 |
|
Munkeymon posted:sigh Novo posted:This software costs more than I make in a year. Is that manually parsing the query string, too?
|
# ? Feb 1, 2013 23:01 |
|
It identifies jp2 files as images, but not pngs? Edit: A quick google search reveals what the software is, and holy crap, does it poo poo gold or something because I'm not understanding the pricetag. Golbez fucked around with this message at 23:17 on Feb 1, 2013 |
# ? Feb 1, 2013 23:10 |
|
I swear that wasn't there when I looked. Must just be too much moving poo poo. quote:Is that manually parsing the query string, too? They have to justify the price tag somehow
|
# ? Feb 1, 2013 23:17 |
Novo posted:This software costs more than I make in a year. Does it pay your wage?
|
|
# ? Feb 1, 2013 23:24 |
|
Novo posted:This software costs more than I make in a year. gently caress CONTENTDM. Goddamn do I hate that product so much. Every product the OCLC ships is a horror.
|
# ? Feb 1, 2013 23:51 |
|
Thankfully supporting CONTENTdm is only a small part of my job, and we are going to be phasing it out. Here is another gem:PHP code:
Zamujasa posted:
PHP code:
Novo fucked around with this message at 02:23 on Feb 2, 2013 |
# ? Feb 2, 2013 00:16 |
GrumpyDoctor posted:Not using integers for monetary values is more often a horror. I thought SQL Server has monetary types, are they worse?
|
|
# ? Feb 2, 2013 00:42 |
|
So I found a gem in some intern Javascript we dusted off:code:
If you're astute, you'll also notice that i wasn't declared in the function, so it has global scope. They noticed it too, apparently, and solved it like so: code:
|
# ? Feb 2, 2013 00:49 |
|
Suspicious Dish posted:This is a standard thing called "Underwater Aspect Weaving" That does not sound like a merit badge I'm interested in getting.
|
# ? Feb 2, 2013 00:55 |
|
Golbez posted:It identifies jp2 files as images, but not pngs? I'm not surprised it's poo poo at that price. They're nearly giving it away.
|
# ? Feb 2, 2013 01:18 |
|
Oh God, there are others like me out there? CONTENTdm has been ruining my life for going on six years now. I believe I've shared select bits of code from it in this thread before. We're currently making an in-house front end for it. Actually just me. Nobody else will get involved, I've been perhaps too transparent with my impressions of it.
|
# ? Feb 2, 2013 02:31 |
|
Shy posted:I thought SQL Server has monetary types, are they worse? Has issues with accuracy: http://stackoverflow.com/questions/582797/should-you-choose-the-money-or-decimalx-y-datatypes-in-sql-server (contrived example, yes, but it can be a massive headache) Performance isn't great: http://sqlblog.com/blogs/aaron_bertrand/archive/2008/04/27/performance-storage-comparisons-money-vs-decimal.aspx Plus, precision is fixed at 4 digits (after the decimal point). Normally that's sufficient, but sometimes it will bite you in the rear end. You're better off just using DECIMAL(x,y) and making sure you choose non-retarded values of x and y. Also more portable too. (DECIMAL is ANSI-standard, MONEY is SQL Server specific.)
|
# ? Feb 2, 2013 04:13 |
|
Shy posted:I thought SQL Server has monetary types, are they worse? I don't know anything about SQL server but I suppose I should have said "using floating-point types."
|
# ? Feb 2, 2013 04:17 |
Informative, thanks guys.
|
|
# ? Feb 2, 2013 04:24 |
|
Deus Rex posted:http://peej.github.com/tonic/ I did something like this for annotating functions as plugins for my IRC bot, then I remembered that Python has decorators. Scaevolus fucked around with this message at 05:29 on Feb 2, 2013 |
# ? Feb 2, 2013 05:24 |
|
php:<? while (!feof($configFile)) { $s = fgets($configFile, 512); $s = str_replace("\r", "", $s); $s = str_replace("\n", "", $s); if (strlen($s) > 0) { if (substr($s, 0, 1) != "#") { if (substr($s, 0, 17) == "EnableImageViewer") { $temp = TrimValue($s, 18); if (strcasecmp($temp, "Yes") == 0) { $enabled = 1; } } elseif (substr($s, 0, 16) == "MinJPEGDimension") { $minjpegdim = TrimValue($s, 17); } elseif (substr($s, 0, 20) == "MaxDerivedImageWidth") { $maxderivedimg["width"] = TrimValue($s, 21); } elseif (substr($s, 0, 21) == "MaxDerivedImageHeight") { $maxderivedimg["height"] = TrimValue($s, 22); } elseif (substr($s, 0, 10) == "ZoomLevels") { $temp = TrimValue($s, 11); $temp = $temp . " "; $len = strlen($temp); $start = 0; $n = 0; while ($start < $len) { /* parse out the zoom levels */ $p = strpos($temp, " ", $start); if ($p > 0) { $val = substr($temp, $start, $p - $start); if (strlen($val) > 0) { $zoomlevels[$n] = $val; $n++; } } else { break; } $start = $p + 1; } } elseif (substr($s, 0, 11) == "ViewerWidth") { ?> php:<? /* Strip off leading and trailing whitespace and trailing comment */ function TrimValue($s, $i) { $temp = trim(substr($s, $i)); $p = strpos($temp, ";"); if ($p > 0) { $temp = trim(substr($temp, 0, $p - 1)); } return($temp); } ?>
|
# ? Feb 2, 2013 07:20 |
|
Zamujasa posted:Using integers for monetary values isn't always a horror, especially if you can't be sure your system won't mangle floating points. We aren't using an int. We're using a char(5), that I then have to cast to an int.
|
# ? Feb 2, 2013 12:37 |
Frozen-Solid posted:We aren't using an int. We're using a char(5), that I then have to cast to an int. Char(5)? So you don't support amounts larger than $999.99 ?
|
|
# ? Feb 2, 2013 12:41 |
|
nielsm posted:Char(5)? So you don't support amounts larger than $999.99 ? Correct. But we also don't sell products that expensive.
|
# ? Feb 2, 2013 13:34 |
|
So this may or may not count as a horror: http://openradar.appspot.com/13128709 checkDataDetectors routes any file:// uris (regardless of case) to DDResultCopyExtractedURL. DDResultCopyExtractedURL asserts that the string it gets starts with the exact characters "file://". At the very least, someone needs to write more comprehensive unit tests.
|
# ? Feb 2, 2013 14:16 |
|
Frozen-Solid posted:Correct. But we also don't sell products that expensive. What could possibly go wrong with a presumption like that?
|
# ? Feb 2, 2013 17:38 |
|
|
# ? Jun 5, 2024 15:47 |
|
pigdog posted:What could possibly go wrong with a presumption like that? "Everything's A Dollar" store acquired by "Everything's A Grand," database conversion claims six lives
|
# ? Feb 2, 2013 18:15 |