|
ChubbyThePhat posted:Not a horror but came across this on a random reddit post: code:
|
# ? Oct 22, 2015 06:52 |
|
|
# ? Jun 1, 2024 18:11 |
|
Whether you brace one-liners or not, code that looks like this:code:
|
# ? Oct 22, 2015 12:41 |
|
Sinestro posted:What font are you using? OSX has done Unicode well for a while. The screenshot I posted was a rhel6 based system running KDE.. which is a little more dicey. I haven't tried it on rhel7 yet, maybe they improved it.
|
# ? Oct 22, 2015 13:45 |
|
xzzy posted:The forums "support" it just fine. You can spam unicode and emoji all you want and it works. Since the last re-design it's actually gotten worse. The lambda in my title stopped working (for me on Windows, at least) when that went in, for example
|
# ? Oct 22, 2015 15:21 |
|
Lamba is showing up on my OSX system. Get the placeholder on my Windows 10 machine though. I thought Unicode support on Windows was pretty good these days, guess there's some gaps!
|
# ? Oct 22, 2015 15:33 |
|
Lambda works perfectly well on my Windows 10.
|
# ? Oct 22, 2015 16:18 |
|
It's a web font from Google, so it's mainly their fault. Worked fine for years when it was using system fonts. As usual with web stuff, the more things improve the more broken everything gets. Anyone know of an extension that'll block web fonts on a per-domain basis?
|
# ? Oct 22, 2015 16:19 |
|
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. Our production database uses floating point numbers for things that have no business being floating point numbers. Apparently someone before my time ran into issues with rounding (big surprise), so the currently used rounding function involves a conversion to string, chopping off some decimals and converting back. Now it seems to work as expected.
|
# ? Oct 22, 2015 17:02 |
|
Works for me on Firefox, placeholder on Chrome, same results with web font (Roboto) enabled or disabled. An issue with Chrome maybe?
|
# ? Oct 22, 2015 17:03 |
|
Chrome has historically struggled with Unicode for god only knows what reason. It wasn't until, what, a few months ago that they finally added support on OS X for emoji? And then right after they rolled that out, the skin tone modifiers came along and those weren't supported correctly either. The drat frustrating part is that this is all stuff that Just Works in the underlying text APIs on OS X. I guess they have their own layers of stuff on top of those because of the need for cross-platform support and that's what's loving up their text processing, but come on.
|
# ? Oct 22, 2015 17:24 |
|
All web browsers suck, we should start work on a new one. This time we'll get it right!
|
# ? Oct 22, 2015 17:27 |
|
xzzy posted:All web browsers suck, we should start work on a new one. This time we'll get it right! Pff, are you saying you don't browse by just curl-ing the pagesource?
|
# ? Oct 22, 2015 18:31 |
|
ChubbyThePhat posted:Not a horror but came across this on a random reddit post: I'm totally stealing this.
|
# ? Oct 22, 2015 18:37 |
|
PYTHONIOENCODING!!!! e: I am perfectly capable of doing my encoding myself. You keep your grubby paws off my code, Pythonio! e2: While I'm at it False - True == -1, thanks Python for clearing that up I always wondered. Karate Bastard fucked around with this message at 20:08 on Oct 22, 2015 |
# ? Oct 22, 2015 18:42 |
|
Karate Bastard posted:PYTHONIOENCODING!!!! "Booleans in Python are implemented as a subclass of integers."
|
# ? Oct 22, 2015 20:31 |
|
Karate Bastard posted:e2: While I'm at it False - True == -1, thanks Python for clearing that up I always wondered. This one is true in quite a few languages. False==0, any other value evaluates as true but the True keyword==1. Bool is basically a teeny-tiny enum in many languages.
|
# ? Oct 22, 2015 20:36 |
|
necrotic posted:"Booleans in Python are implemented as a subclass of integers." That makes so much sense, and I'm happy they could make that very common use pattern just work by default. There is literally a mountain of code that hinges on boolean arithmetics, and it's real neat that it just blends in with the code rather requiring us to bloat it all up with unnecessary exception handling. I wonder why they didn't go all the way and made all other things subclasses of interegers as well, like colors, and horses? Like, being able to just trust that Red - Turquoise == -8 would be so valuable to me, just like I can now just know that I can increment i by doing i += (None != -1) & (None == None).
|
# ? Oct 22, 2015 20:55 |
|
Karate Bastard posted:That makes so much sense, and I'm happy they could make that very common use pattern just work by default. There is literally a mountain of code that hinges on boolean arithmetics, and it's real neat that it just blends in with the code rather requiring us to bloat it all up with unnecessary exception handling. I wonder why they didn't go all the way and made all other things subclasses of interegers as well, like colors, and horses? Like, being able to just trust that Red - Turquoise == -8 would be so valuable to me, just like I can now just know that I can increment i by doing i += (None != -1) & (None == None). Unfortunately red - turquoise equals dark red (#be1f30). -8 is just silly.
|
# ? Oct 22, 2015 21:05 |
|
e^(pi * i) + True == False
|
# ? Oct 22, 2015 21:09 |
|
You are right. Obviously, Red - Turquoise == 12459824. What was I thikning?
|
# ? Oct 22, 2015 21:14 |
|
It was better in older versions of the language where True and False were literally just variables that you could reassign to anything you liked.
|
# ? Oct 22, 2015 21:16 |
|
Pavlov posted:Pff, are you saying you don't browse by just curl-ing the pagesource? Look at this poser. Telnet to port 80 and type in your GET request.
|
# ? Oct 22, 2015 21:29 |
|
Soricidus posted:It was better in older versions of the language where True and False were literally just variables that you could reassign to anything you liked. I http://mindprod.com/jgloss/unmain.html code:
|
# ? Oct 22, 2015 21:42 |
|
Pavlov posted:Pff, are you saying you don't browse by just curl-ing the pagesource? Richard stallman detected
|
# ? Oct 22, 2015 21:42 |
|
LeftistMuslimObama posted:This one is true in quite a few languages. False==0, any other value evaluates as true but the True keyword==1. Bool is basically a teeny-tiny enum in many languages. just because a lot of languages do it doesn't mean it's a good thing also enums as ints are a travesty and even more so ints as sum types.
|
# ? Oct 22, 2015 22:02 |
|
Ithaqua posted:Richard stallman detected He didn't mention emacs though
|
# ? Oct 22, 2015 22:16 |
|
ChubbyThePhat posted:Not a horror but came across this on a random reddit post: I put this in the company /etc/bashrc years ago: code:
|
# ? Oct 22, 2015 22:27 |
|
Ithaqua posted:Richard stallman detected I'm pretty sure I read once that Stallman actually requests a remote server to curl the page, and then email it to him. ...Which he opens in Emacs.
|
# ? Oct 22, 2015 22:28 |
|
quote:I generally do not connect to web sites from my own machine, aside from a few sites I have some special relationship with. I usually fetch web pages from other sites by sending mail to a program (see git://git.gnu.org/womb/hacks.git) that fetches them, much like wget, and then mails them back to me. Then I look at them using a web browser, unless it is easy to see the text in the HTML page directly. I usually try lynx first, then a graphical browser if the page needs it (using konqueror, which won't fetch from other sites in such a situation).
|
# ? Oct 22, 2015 22:35 |
|
Pavlov posted:I'm pretty sure I read once that Stallman actually requests a remote server to curl the page, and then email it to him. The fun part is that facebook still probably knows his favorite type of porn.
|
# ? Oct 22, 2015 22:38 |
|
Browsing such objectionable pornography, all the time, that Stallman. Hell to have oneself connected with that sort of thing.
|
# ? Oct 22, 2015 22:39 |
|
xzzy posted:The fun part is that facebook still probably knows his favorite type of porn. This gets really terrifying when you connect it to the idea that he visits "unrelated websites" through Tor.
|
# ? Oct 22, 2015 23:18 |
|
Karate Bastard posted:I quote:Hungarian Notation is the tactical nuclear weapon of source code obfuscation techniques; use it! Due to the sheer volume of source code contaminated by this idiom nothing can kill a maintenance engineer faster than a well planned Hungarian Notation attack. This guy knows what's up.
|
# ? Oct 23, 2015 00:38 |
|
contrapants posted:I put this in the company /etc/bashrc years ago: so, on april fools, emacs users can actually use emacs?
|
# ? Oct 23, 2015 01:43 |
|
Oh goodie, I have some code for you guys! This comes from a very large chip vendor that will remain nameless, but I bet someone here will recognize their bad coding style.code:
0x21 should be RATE_A(0)|RATE_B(RB_50HZ)|MODE_NORMAL|ACTIVE; which documents the intent AND isn't fragile as poo poo. Yes, the assumption that pthisDev is just a pointer to global thisDev is exactly that, so I have no loving clue what they thought they were doing. The entire thing is frustrating as poo poo to follow because of constant pointer/global aliasing issues. Open-coded byte-stuffing serial transmission scheme because __attribute__((packed)) and HTONS() on a structure was just too difficult. Thank god I can just delete all that poo poo. It remains to be determined if it'd be faster for me to do the calibration matrix math myself instead of trying to wedge this poo poo into my code. I've already spent an hour cleaning up pointer/global confusion.
|
# ? Oct 23, 2015 02:11 |
|
Dessert Rose posted:so, on april fools, emacs users can actually use emacs? Imagine how surprised they'll be!
|
# ? Oct 23, 2015 02:11 |
|
Flobbster posted:The drat frustrating part is that this is all stuff that Just Works in the underlying text APIs on OS X. I guess they have their own layers of stuff on top of those because of the need for cross-platform support and that's what's loving up their text processing, but come on. The issue for browsers isn't the cross-platform part; each platform has a full text display implementation written to native APIs, even if it shares a shaping/glyph selection/etc. subsystem. The issue for browsers is that they put demands on text that virtually no system APIs can support, in terms of performance and functionality.
|
# ? Oct 23, 2015 02:34 |
|
KaneTW posted:just because a lot of languages do it doesn't mean it's a good thing i mean, what's the good way to do bools and enums? I'm genuinely curious. When you get right down to it, no matter how you represent it it's going to have some consistent integer value underneath, even if you go to pains for it to be inaccessible. And people will go to further pains to get at that value anyway. So just leave them as ints, imo. Makes coding up console menu options really easy if you want to be lazy and require numerical input .
|
# ? Oct 23, 2015 05:47 |
|
code:
code:
|
# ? Oct 23, 2015 05:52 |
|
|
# ? Jun 1, 2024 18:11 |
|
xzzy posted:Imagine how surprised they'll be! i can't stand emacs, The best editor i ever saw was an old DOS editor called edit.exe amazing then and todays editors are not even close. and in linux if i haven't got vi i will not use the system.
|
# ? Oct 23, 2015 05:57 |