|
Aleksei Vasiliev posted:The site is also a horror itself: http://phpsadness.com/?page=sad/18 Possibly the author is expecting static variables to be bound to the class itself in some way, like you see in Java?
|
![]() |
|
![]()
|
# ? May 14, 2024 10:17 |
|
daft punk railroad posted:
See also gcc's -Wall
|
![]() |
|
Plorkyeran posted:Anyone who actually uses string.Empty deserves it.
|
![]() |
|
fritz posted:See also gcc's -Wall -Wall is "all generally useful warnings", not "all warnings" I suppose you could try submitting a patch changing it to -Wall-generally-useful. Good luck with that.
|
![]() |
|
My favourite piece of PHP stupidness is displayed at http://www.php.net/manual/en/function.ctype-digit.phpcode:
code:
|
![]() |
|
http://stackoverflow.com/questions/6163683/cycles-in-family-tree-softwarequote:I am developer of Family tree software (written in C++ and Qt). I had no problems till one of my customers mailed me a bug report. The problem is that he has two children with his own daughter. And he can't use my software because of errors. Those errors are result of my various assertions and invariants about family graph being processed (for example after walking a cycle the program states that X can't be both father and grandfather of Y). How should I resolve those errors, without removing all data assertions? Masterful troll, or all kinds of horror at once?
|
![]() |
|
In my time in human genetics I gave up on validating degree of relations, because there would always be some manner of hosed up breeding that blew up the whole thing. Usually these came from middle eastern populations where in the desert areas families still did arranged marriages. Though they were usually fascinating to study because there was no cases of what we were studying in the population before, there was some hosed up marriage loop and every person after that was affected. tl;dr when dealing with families don't assume anything because people can and do gently caress everybody.
|
![]() |
|
NotShadowStar posted:tl;dr when dealing with families don't assume anything because people can and do gently caress everybody. see: all of Europe's royalty.
|
![]() |
|
Orzo posted:why does it matter, they're both the same
|
![]() |
|
SimpleXML weirdness in PHP Short explanation: the value of a SimpleXML object always resolves to false. php:<? $x = simplexml_load_string('<a><b>test</b></a>'); /* A valid object */ if ($x) { /* true */ } if (!$x) { /* false */ } if ($x === false) { /* false */ } if ($x == false) { /* loving TRUE */ } ?>
|
![]() |
|
NotShadowStar posted:Holy poo poo they are literally using goto: in the C code of PHP yes. this happens. frequently.
|
![]() |
|
Hammerite posted:http://stackoverflow.com/questions/6163683/cycles-in-family-tree-software The problem is really just a data error and can easily be solved by simply killing everyone involved and removing their memories from the annals of history.
|
![]() |
|
pseudorandom name posted:-Wall is "all generally useful warnings", not "all warnings" So it's a valid point that in a PHP context 'all' does not mean 'all' but it is not valid to observe that in a gcc context 'all' does not mean 'all'?
|
![]() |
|
To be fair, gcc has it described as -Wall Emits all generally useful warnings that gcc can provide. Specific warnings can also be flagged using -Wwarning, where warning is replaced by a string identifying an item for which you want to list warnings. while php has it as // Report all PHP errors (see changelog) error_reporting(E_ALL);
|
![]() |
|
php has E_ACTUALLY_ALL mysql has mysql_real_escape_string gcc has -W/all/arning/tf and the rest of us has neckbeards making excuses for why it's turtles all the way down
|
![]() |
|
DaTroof posted:php has E_ACTUALLY_ALL i declare this the clang own zone
|
![]() |
|
To show that horrors happen anywhere, affecting thousands of people from someone who didn't think properly, written from very smart people who just didn't think at the time. Anyone can do it. When you read in a file in Ruby, the mechanism keeps track of what files have been loaded so it doesn't load and evaluate the same file twice. Standard stuff. When the language changed from 1.8 to 1.9 lots of stuff was rewritten, one of these was checking if the file has already been loaded. As it is written in 1.9 code:
code:
|
![]() |
|
Broken Knees Club posted:i declare this the clang own zone clang also has -Wall
|
![]() |
|
The Ruby require thing is from http://rhnh.net/2011/05/28/speeding-up-rails-startup-time It has fancy graphs and stuff ![]()
|
![]() |
|
Pollyzoid posted:The Ruby require thing is from http://rhnh.net/2011/05/28/speeding-up-rails-startup-time ... And that, kids, is why you learn about big O...
|
![]() |
|
pseudorandom name posted:clang also has -Wall But Clang doesn't vomit text at you, the errors are actually useful!
|
![]() |
|
StackOverflow posted:closed as too localized We can learn from their optimism.
|
![]() |
|
DaTroof posted:mysql has mysql_real_escape_string Isn't this part of PHP's API for interacting with MySQL, and not inherently part of MySQL itself? Oh, PHP, a language that lets you define when you really mean it.
|
![]() |
|
Doc Hawkins posted:We can learn from their optimism.
|
![]() |
|
Doc Hawkins posted:We can learn from their optimism. I think everyone involved in genealogy software should be aware of situations like these and handle them properly. For a lot of royals in the past (and nonroyals, of course), families were not really in trees. More like rotten stumps.
|
![]() |
|
Chairman Steve posted:Isn't this part of PHP's API for interacting with MySQL, and not inherently part of MySQL itself? PHp's API for interacting with mysql should bloody well be prepare, execute, fetch Not real escape string
|
![]() |
|
Chairman Steve posted:Isn't this part of PHP's API for interacting with MySQL, and not inherently part of MySQL itself? Not exactly, although there are two ways to look at it The mysql_escape_string and mysql_real_escape_string functions are indeed artifacts of mysql's C api; the question then becomes, why the hell is the default binding in a dynamic language such a thin wrapper around the C api that this sort of horseshit is exposed? One might reasonably say, "loving Perl did better than this in the Year of our Lord Nineteen Hundred and Ninety Four with DBI, and that wasn't tied to one database to boot, how is PHP such a shitshow now?" The answer to both is, "PHP".
|
![]() |
|
Chairman Steve posted:Isn't this part of PHP's API for interacting with MySQL, and not inherently part of MySQL itself? The mysql_real_escape_string() function is part of the MySQL C API. The original PHP API for MySQL was just a bunch of wrappers around C functions. It's a double horror. Edit: Otto said it better. DaTroof fucked around with this message at 06:19 on May 30, 2011 |
![]() |
|
Otto Skorzeny posted:the question then becomes, why the hell is the default binding in a dynamic language such a thin wrapper around the C api that this sort of horseshit is exposed? Hilariously, php-internals uses the thin-wrapper-over-a-library thing as an example of an outstanding design.
|
![]() |
|
Doc Hawkins posted:We can learn from their optimism. Cultural imperialism sure makes software design a lot easier.
|
![]() |
|
Otto Skorzeny posted:The mysql_escape_string and mysql_real_escape_string functions are indeed artifacts of mysql's C api... And I learned something new today!
|
![]() |
|
ymgve posted:I think everyone involved in genealogy software should be aware of situations like these and handle them properly. For a lot of royals in the past (and nonroyals, of course), families were not really in trees. More like rotten stumps. Not just royals - some people manage to trace their way several hundred years back, and if one fork of that comes from some small island or isolated valley in a corner of Europe, you're bound to get some overlaps and cross-connections. On a very related note, I just read about some interesting modelling of common ancestry: If you have population of size N, where the number of people is constant and there are no immigrants, you have to go back roughly log2(N) generations to find the first person who is an ancestor of everyone currently alive in that population. For e.g. N=4000, that's ~12 generations, or 200-300 years. (It's not quite as bad as it sounds, since it's entirely possible for not a single gene variant from that person to exist in the current population.) I also like how there's a name and wikipedia article for "how reproduction between two individuals who knowingly or unknowingly share an ancestor causes the number of distinct ancestors in the family tree of their offspring to be smaller than it could otherwise be".
|
![]() |
|
Whenever I get into a PHP debate with PHP supporters (they exist), I ask them if they'd write a web app in a C core with a template language. Of course the answer is 'hell no' because of how absolutely dangerous that is. Then I show them how most of the PHP functions are 1-1 just wrappers to a C API library, and PHP is pretty much exactly a template language in front of a C core. Invariably the conversation gets hilarious how much they backpedal after that.
|
![]() |
|
Zombywuf posted:Cultural imperialism sure makes software design a lot easier. Heh. For a second, I thought you were talking about the incest. It seems reasonable to want to keep the site's content useful for as many people (specifically, the anglophone internet-enabled-computer-havers that use the site) as they can. Most people won't need to know what the best tech conferences in New York are.
|
![]() |
|
Doc Hawkins posted:Heh. For a second, I thought you were talking about the incest. I did too ![]()
|
![]() |
|
Doc Hawkins posted:Heh. For a second, I thought you were talking about the incest. The guy asking the question's name is Partick Höse. Make of that what you will. Also, I was talking about incest. How dare you deny genealogy software to our European royalty? Zombywuf fucked around with this message at 11:30 on May 31, 2011 |
![]() |
|
Wheany posted:
Actually, it's code:
![]()
|
![]() |
|
http://www.google.com/search?&q=site:pastebin.com+mysql_connect+-localhost
|
![]() |
|
quote:@Chelle: use mysql_real_escape_string() on the value of $id: $sql = "select functionName(" . mysql_real_escape_string($id, $link) . ")" and then use $sql in mysql_query() ![]()
|
![]() |
|
![]()
|
# ? May 14, 2024 10:17 |
|
Today I saw a MySQL database for an old internal webapp. It has one column that contains base64-encoded XML for data.
|
![]() |