|
I can read the code fine so i dont see anything wrong with it
|
# ? Oct 19, 2016 17:38 |
|
|
# ? May 28, 2024 15:11 |
|
xzzy posted:Too bad they haven't come up with a way to deal with the fact that the browser is under the control of the user. If you're non-technical, you might paste from your password manager into the address bar, then drag and drop it from there into the input field. Then yahoo has your bank password, because someone decided it's safe to broadcast the contents of the address bar.
|
# ? Oct 19, 2016 18:46 |
|
Took me too long to see the brace mess on the right hand side so I thought it was some kind of clever editor plugin, then I saw it and realized what was actually happening. I actually like Python and I still think that's terrible.
|
# ? Oct 19, 2016 18:53 |
|
Sedro posted:Then yahoo has your bank password, because someone decided it's safe to broadcast the contents of the address bar.
|
# ? Oct 19, 2016 18:55 |
Sedro posted:If you're non-technical, you might paste from your password manager into the address bar, then drag and drop it from there into the input field. But autocomplete is such a good feature! It totally doesn't send out a web request every time I type a new character!
|
|
# ? Oct 19, 2016 19:22 |
|
A sufficiently determined programmer can write Python in any language?
|
# ? Oct 19, 2016 20:53 |
|
Eastern Polish Christmas Tree Notation: Java code:
|
# ? Oct 19, 2016 22:48 |
|
qntm posted:Eastern Polish Christmas Tree Notation: No, see, if you were doing this properly, then you'd have left and right "branches" to align secondary/tertiary operators on when you need to put more than one operator on a single line.
|
# ? Oct 19, 2016 23:04 |
|
xzzy posted:Looks like a screengrab from phpmyadmin to me, so it's probably an internal database. When I was 15 (~8 years ago) I interned as a web developer in my school district's IT department. One of my responsibilities was to bild a work order system that integrated with the pre-existing Active Directory, which had a MSSQL replica that I interfaced with for user data (auth was via SSO token, for curious nerds...) In the staff tables, they interestingly stored the last 4 digits of their SSN's, with a column comment stating "pw: last 4 ln + last 4 ssn". Along, of course, with their usernames. Last 4 letters of their last name + the freely-provided last 4 of their social security numbers. Worked like a charm. Mix that with publicly-accessible RDP to any computer in the district, and you end up with a little rear end in a top hat pulling some millennial Ferris Bueller poo poo sans looks or charm. Also charging other students for the same. I stopped by there a couple years ago. As you might imagine, all the department heads are gone. Didn't show up most of my upper class years and graduated. Ah, I miss high school...
|
# ? Oct 20, 2016 09:05 |
|
So I started a new job ~1.5 years ago. It's a small company with a few developers that maintain an application they initially outsourced like a decade ago. Was written by some Indian code farm, and we just make changes to it as needed. Recently it was rewritten by the same company to use newer tech / look better etc. Just stumbled across this sweet method: code:
foo() blew up? Better do it again!
|
# ? Oct 21, 2016 16:18 |
|
Sab669 posted:So I started a new job ~1.5 years ago. It's a small company with a few developers that maintain an application they initially outsourced like a decade ago. Written by someone who doesn't realise you can rethrow from within catch after doing your logging?
|
# ? Oct 21, 2016 20:37 |
|
i've had a few methods in code that was handed to me that will sometimes work if you suppress errors and run once or twice it had a bunch of try/catches that basically ignored the entire catch and only started logging errors if it failed about 14 times in a row when i say a bunch i don't mean like a for loop or anything just a massive blob of copy pasted try catches one after the other
|
# ? Oct 21, 2016 20:54 |
|
It's like someone wanted OTP "let it crash" without any of the supporting infrastructure.
|
# ? Oct 21, 2016 20:58 |
|
Biowarfare posted:i've had a few methods in code that was handed to me that will sometimes work if you suppress errors and run once or twice I have no idea where that kind of call pattern makes sense outside anything to do with real-world user inputs, really noisy system events, or a process experiencing critical system failures.
|
# ? Oct 21, 2016 22:02 |
|
First day on a new contract.code:
code:
(They're using Unicode curly quotes, probably indicating it was copied from a WordPress blog.) xtal fucked around with this message at 18:13 on Oct 22, 2016 |
# ? Oct 22, 2016 16:45 |
|
xtal posted:First day on a new contract. Or someone uses Microsoft Word as their code editor
|
# ? Oct 22, 2016 18:21 |
|
Sedro posted:Or someone uses Microsoft Word as their code editor earlier this week I had to help someone figure out why their linux commands weren't working, and it eventually turned out they were copy pasting them from word which had helpfully replaced all the hyphens with fancy dashes (which looked identical to hyphens in the terminal) gently caress people who use office for anything code related
|
# ? Oct 22, 2016 19:04 |
|
Soricidus posted:gently caress people who use office for anything code related Like documentation, or planning, or specification. (As I list the ways that typographically correct quotation marks have entered my code.) (Which was caught immediately by the compiler.)
|
# ? Oct 22, 2016 21:30 |
|
Compilers are good Cli programs that give misleading error messages when you use the wrong kind of dash are bad We mostly use confluence for documentation etc so at least that's one less way for office to gently caress things up Soricidus fucked around with this message at 21:39 on Oct 22, 2016 |
# ? Oct 22, 2016 21:37 |
|
Soricidus posted:earlier this week I had to help someone figure out why their linux commands weren't working, and it eventually turned out they were copy pasting them from word which had helpfully replaced all the hyphens with fancy dashes (which looked identical to hyphens in the terminal) Evernote on OSX Would do that with quotes by default as all, but not the windows one.
|
# ? Oct 22, 2016 22:05 |
|
This is more of a browser horror but why on earth does auto correct insert a space after words in email fields? So they deliberately cannot create a valid email unless you chomp it.
|
# ? Oct 24, 2016 01:14 |
|
xtal posted:This is more of a browser horror but why on earth does auto correct insert a space after words in email fields? So they deliberately cannot create a valid email unless you chomp it. If you use input type="email" then autocorrect stops applying and at least the Android default keyboard adds a dedicated "@" key IIRC.
|
# ? Oct 24, 2016 12:11 |
|
HardDiskD posted:If you use input type="email" then autocorrect stops applying and at least the Android default keyboard adds a dedicated "@" key IIRC. Ah, maybe this isn't type=email but name=email or some other heuristic that makes it suggest my email address
|
# ? Oct 24, 2016 13:47 |
|
You can have an input with both type=email and name=email. The name is what your browser uses to look up cached entries, but it's the type that the mobile browser uses that disables autocorrect and adds the "@" key.
|
# ? Oct 24, 2016 14:54 |
|
Every day I run into some thing that unity-C# doesn't let me do that was added in .Net4. Like combining more than two portions of a path at once (this mornings slap in the face; I'm sure I've run into it before but lomarf if I'll remember everything that was added in .Net4 [or .Net3.5 that isn't included in unity's insane cross compiler thing]). Someone remind me why everyone seems to use this garbage fire of a game engine and why I can never have nice things.
|
# ? Oct 24, 2016 15:53 |
|
One day everyone will switch to a dedicated ECS engine written in a specialized Lisp dialect and we'll all be writing games in functional programming paradigms and maybe I'll even have a pony.
|
# ? Oct 24, 2016 16:25 |
|
leper khan posted:Someone remind me why everyone seems to use this garbage fire of a game engine and why I can never have nice things. Because it's an engine where someone with almost no prior coding experience can make Kerbal Space Program. Unfortunately, low-barrier-of-entry seems to be at odds with well-engineered.
|
# ? Oct 24, 2016 16:26 |
|
Game dev is in a weird position where the ultimate goal of "have a thing that does a thing" is at odds with the process of creating said thing and the end result's quality. People wanna make games quick and easy, but that doesn't mean they'll be good.
|
# ? Oct 24, 2016 17:13 |
|
Paradoxically this behaviour exists with online games as well where you'd think long term maintainence is at least a small concern. Nope!
|
# ? Oct 24, 2016 17:27 |
|
Pollyanna posted:Game dev is in a weird position where the ultimate goal of "have a thing that does a thing" is at odds with the process of creating said thing and the end result's quality. People wanna make games quick and easy, but that doesn't mean they'll be good. Drop the word 'game' and you just described 99% of companies out there.
|
# ? Oct 24, 2016 17:40 |
|
I don't see how that's unique to game dev whatsoever. You see the same with enterprise bullshitware software even where you deliver a product half the time just for a press release to get some customer engagement and even if you literally cure cancer by running your software they'd take about 4 weeks minimum before they even saw your software in a real-life demo situation. So in that case, it's fine to "release" some software as long as you have sufficient time to fix it before it actually is used anywhere. You don't get second chances much with App Store based releases of course, though.
|
# ? Oct 24, 2016 17:47 |
|
Hughlander posted:Drop the word 'game' and you just described 99% of companies out there. Touche. xtal posted:Paradoxically this behaviour exists with online games as well where you'd think long term maintainence is at least a small concern. Nope! To be fair, most people drop MMOs that aren't called World of Warcraft fairly quickly, so longevity isn't always a major concern. For things like Overwatch or League of Legends, they're supported by things that aren't the game itself, too.
|
# ? Oct 24, 2016 17:47 |
|
Taken from SOcode:
|
# ? Oct 24, 2016 18:01 |
|
canis minor posted:Taken from SO What? How? How does that even remotely work? JS is full of lovely "magic-tricks" but this one takes the cake (and I'm aware of the truth table).
|
# ? Oct 24, 2016 18:32 |
|
JavaScript is weakly typed so my guess is that the + makes it interpret the strings as scientific notation, but I dunno
|
# ? Oct 24, 2016 18:42 |
|
code:
* num + "e+2" coerces the number to a string and appends "e+2" to it, yielding the string "6.27691e+2". * Math.round("6.27691e+2") coerces the string back to a number, 627.691, then rounds it to 628. * 628 + "e-2" coerces the number to a string again, "628e-2". * And finally +("628e-2") coerces the string back to a number, 6.28. It would not be any less horrific if all of those coercions were explicit.
|
# ? Oct 24, 2016 19:13 |
|
canis minor posted:Taken from SO thank you for coming out today we have ur resume on file
|
# ? Oct 24, 2016 19:15 |
|
String conversions are strange, but this is consistent at least I guess? +(100 + "e-2") -> 1 (number) +(100 + "5") -> 1005 (number)
|
# ? Oct 24, 2016 19:18 |
canis minor posted:Taken from SO What would even make someone write something like this? Involving strings at all sounds like a horribly inefficient way to do that operation. round(x*100.0)/100.0 is not only more readable, it's probably less than 100 instructions depending on your implementation of round(). With string conversions and stuff you're easily into the thousands. Joda fucked around with this message at 19:46 on Oct 24, 2016 |
|
# ? Oct 24, 2016 19:42 |
|
|
# ? May 28, 2024 15:11 |
Also what happens if the number is large enough that it's string representation already includes an exponent? Or is that not a thing in JavaScript?
|
|
# ? Oct 24, 2016 19:45 |