|
Sebbe posted:So, apparently PHP lets you redefine the VM opcodes... from within the language itself. comment on that page posted:Who thought this would be a great idea? This is insane. I have nothing to add.
|
# ? Oct 20, 2015 18:31 |
|
|
# ? May 27, 2024 03:56 |
|
Sebbe posted:So, apparently PHP lets you redefine the VM opcodes... from within the language itself. why
|
# ? Oct 20, 2015 18:35 |
|
"It's called monkeypatching. It's a little… look, it's a thing we do in Ruby for fun." "Who can monkeypatch the most? You guys are real crazy, hey look out for these guys. Hell I can monkeypatch. For twenty bucks I'll patch VM opcodes at runtime!" "Woah, woah, Rasmus- calm down-" "Ok, ZEND_EXIT, Chickenfuckers!"
|
# ? Oct 20, 2015 18:41 |
|
Xarn posted:I have nothing to add. Yeah which one of you guys was that?
|
# ? Oct 20, 2015 18:52 |
|
Truth posted:Who thought this would be a great idea? Is that really a question that you have to ask?
|
# ? Oct 20, 2015 19:15 |
|
Speaking of ruby, go here: https://github.com/Shopify/liquid/issues/216 Scroll down / find "CEO Shopify" on oage.
|
# ? Oct 20, 2015 19:20 |
|
Sebbe posted:So, apparently PHP lets you redefine the VM opcodes... from within the language itself. Good news is that it's not actually built into the language; it's an extension. https://github.com/krakjoe/uopz
|
# ? Oct 20, 2015 22:29 |
|
IT BEGINS posted:Small dev horror. Asked one of our senior devs to pair with the new guy to work on adding a feature to our 'remote' authentication. Asked him to also test drive it or at least cover it so some of the guys that are new to testing have a real example to look at. Sounds like the senior dev has correctly identified the horrors of test-first.
|
# ? Oct 21, 2015 01:47 |
|
return0 posted:Sounds like the senior dev has correctly identified the horrors of test-first. Maybe. Then again, it's not getting tested at all now, soooooooo
|
# ? Oct 21, 2015 02:07 |
|
Sebbe posted:So, apparently PHP lets you redefine the VM opcodes... from within the language itself. Not really, uopz is basically a VM introspection module, it's not part of the core language. It's like linking gdb into your program and saying C lets you change values in other stack frames.
|
# ? Oct 21, 2015 02:24 |
|
I think I'll start posting tiny horrors from our production codebase once per day and see how long these ~70k LoCs keep delivering. Let's start with a classic. How do you check if a Decimal variable is negative? Answer: If quantity.ToString().Substring(0, 1) = "-" Then ...
|
# ? Oct 21, 2015 06:31 |
|
NihilCredo posted:I think I'll start posting tiny horrors from our production codebase once per day and see how long these ~70k LoCs keep delivering. Classic
|
# ? Oct 21, 2015 06:35 |
Maybe they couldn't just use regular comparison operators because they were really concerned about negative zero? (I have no idea how negative zero works with .toString())
|
|
# ? Oct 21, 2015 06:39 |
|
There's a negative zero?
|
# ? Oct 21, 2015 07:05 |
|
NihilCredo posted:I think I'll start posting tiny horrors from our production codebase once per day and see how long these ~70k LoCs keep delivering.
|
# ? Oct 21, 2015 07:06 |
|
Jumpingmanjim posted:There's a negative zero? In IEEE floating point, yes. Though by specification it == compares with positive 0 as true. (dividing by it produces negative infinity instead of infinity, though).
|
# ? Oct 21, 2015 07:07 |
|
Jumpingmanjim posted:There's a negative zero? I'm pretty sure there was some old hardware that did. e: beat
|
# ? Oct 21, 2015 07:07 |
|
Jumpingmanjim posted:There's a negative zero? Sure is. Have an exponent of zero, a mantissa of zero, and a negative sign, and you get a float that's negative zero.
|
# ? Oct 21, 2015 07:08 |
|
FamDav posted:someone who knows nothing about han unification: it was about saving space No Han unification may have meant no Unicode at all. Nobody would have accepted exploding text size 4x or a variable-length encoding in the early '90s
|
# ? Oct 21, 2015 10:32 |
|
Pavlov posted:I'm pretty sure there was some old hardware that did. As you note, old hardware using one's-complement (CDC 6000) or sign-magnitude (early IBM gear) could also have negative zero for integers.
|
# ? Oct 21, 2015 10:43 |
|
hackbunny posted:No Han unification may have meant no Unicode at all. Nobody would have accepted exploding text size 4x or a variable-length encoding in the early '90s Unicode is a variable length encoding (except for UTF-32), and it's not like anybody on the committee would have had to deal with exploding text size that much since Unicode was built to be compatible with ASCII. ErIog fucked around with this message at 14:05 on Oct 21, 2015 |
# ? Oct 21, 2015 13:59 |
|
Kazinsal posted:Sure is. Have an exponent of zero, a mantissa of zero, and a negative sign, and you get a float that's negative zero. It's even used! Type into your browser's console: -Math.pow(10, -10000); Although: > -0 == 0 true > -0 === 0 true edit: >1/-0 -Infinity >1/0 Infinity >Infinity == -Infinity false >Infinity === -Infinity false canis minor fucked around with this message at 16:54 on Oct 21, 2015 |
# ? Oct 21, 2015 14:01 |
|
ErIog posted:Unicode is a variable length encoding (except for UTF-32), and it's not like anybody on the committee would have had to deal with exploding text size that much since Unicode was built to be compatible with ASCII. Sure, it is today. But in 1992, it was a fixed-width two-byte encoding.
|
# ? Oct 21, 2015 15:09 |
|
ErIog posted:Unicode is a variable length encoding (except for UTF-32), and it's not like anybody on the committee would have had to deal with exploding text size that much since Unicode was built to be compatible with ASCII. He is talking about the early days of Unicode, where everyone assumed it was (potentially) fixed-width.
|
# ? Oct 21, 2015 15:10 |
|
Jsor posted:In IEEE floating point, yes. Though by specification it == compares with positive 0 as true. (dividing by it produces negative infinity instead of infinity, though).
|
# ? Oct 21, 2015 16:48 |
|
hackbunny posted:Nobody would have accepted exploding text size 4x or a variable-length encoding in the early '90s The other problem is that Windows NT and Java, brand new systems, came out at the time when most folks were on board with Unicode solving the world's problems but it had not yet exceeded the BMP. It was relatively simple to build new systems around UCS-2 even if they should have known better. Of course, now, Unicode has expanded beyond what UCS-2 can support, and UTF-16 is a variable length encoding, not backwards compatible with ASCII, weirdly implements surrogate pairs, and is generally a mess to deal with. UTF-8 is still great.
|
# ? Oct 21, 2015 17:57 |
|
Sedro posted:There was a .NET bug where struct equality was implemented as a memcmp, so your struct with -0.0f was not equal to your struct with 0.0f When you say was do you mean it was changed? I thought this was still the case.
|
# ? Oct 21, 2015 19:15 |
|
ExcessBLarg! posted:Many of those systems, if they use Unicode at all, use UTF-8 today and happily support emoji or whatever. Too bad the display fonts haven't caught up.
|
# ? Oct 21, 2015 20:00 |
|
I pasted https://codepoints.net/U+1F4A9 into Visual Studio the other day and was pretty surprised when it worked.
|
# ? Oct 21, 2015 20:24 |
|
EssOEss posted:When you say was do you mean it was changed? I thought this was still the case.
|
# ? Oct 21, 2015 21:13 |
|
Munkeymon posted:I pasted https://codepoints.net/U+1F4A9 into Visual Studio the other day and was pretty surprised when it worked. https://dotnetfiddle.net/qOkMCD I'd have pasted it but the F# compiler apparently has better Unicode support than the SA forums. NihilCredo fucked around with this message at 22:25 on Oct 21, 2015 |
# ? Oct 21, 2015 22:19 |
|
The forums "support" it just fine. You can spam unicode and emoji all you want and it works. If the characters don't show up, it's your browser or the font you're using.
|
# ? Oct 21, 2015 22:22 |
|
xzzy posted:The forums "support" it just fine. You can spam unicode and emoji all you want and it works. Not inside [ code ] blocks, they use a different font. 💩 code:
|
# ? Oct 21, 2015 22:26 |
|
Well now that's just silly. They must be running it through one of php's escaping functions to preserve the formatting. Another SA forums coding horror: smileys are case sensitive. vs
|
# ? Oct 21, 2015 22:29 |
|
I'm disappointed that :h_a_w: doesn't work either.
|
# ? Oct 21, 2015 22:31 |
|
All the weird culturally-specific emoji are presumably Japan's revenge for han unification.
|
# ? Oct 21, 2015 23:04 |
|
I appreciate that it seems like anything goes now when it comes to emojis in Unicode. Thank you iOS 9.1 for bringing me support for http://graphemica.com/🖕 Edit: And phone-posting apparently broke this. It was supposed to be the middle finger emoji. Flobbster fucked around with this message at 02:12 on Oct 22, 2015 |
# ? Oct 22, 2015 00:12 |
|
xzzy posted:Too bad the display fonts haven't caught up. $ echo -e "\xf0\x9f\x8d\x94" 🍔 CLOSED WORKSFORME
|
# ? Oct 22, 2015 00:16 |
|
Not a horror but came across this on a random reddit post: "I like to live dangerously, [ $[ $RANDOM % 6] == 0 ] && rm -rf / || echo Click" They were looking for something to put on a CS club shirt. I liked this. I laughed.
|
# ? Oct 22, 2015 05:59 |
|
|
# ? May 27, 2024 03:56 |
|
What font are you using?
|
# ? Oct 22, 2015 06:28 |