|
If you are not using spaces for indentation then you are wrong and bad and should switch careers
|
# ? Apr 5, 2017 14:21 |
|
|
# ? May 20, 2024 20:21 |
|
I'll be honest I skimmed most of that but I think I accidentally gave you the impression that I couldn't or didn't put together a competent code sample or that modulo arithmetic is whoa out there stuff, I'm sure I wouldn't have gotten the job if that had been the case. I apologise for that, I'll try to phrase things better in future.
|
# ? Apr 5, 2017 14:46 |
|
bigmandan posted:If you are not using spaces for indentation then you are wrong and bad and should switch careers "Spaces", plural?
|
# ? Apr 5, 2017 15:28 |
|
LOOK I AM A TURTLE posted:I also prefer your suggested syntax, but I assumed something like my example was the scenario leper khan was referring to when he said "Tab to indent level then spaces". It's exactly right; it gives everyone the indent level they want to configure without screwing up the code. Most editors [that I use] will mostly do what you want and can preserve your previously set indentation on return. e: It can be a minor PITA though, which presumably is why people don't.
|
# ? Apr 5, 2017 15:50 |
|
Meat Beat Agent posted:"Spaces", plural? If you need more than one level of indentation in your code then I don't want to work with you. And that single level of indentation should be indicated via a ">" symbol, which our customized interpreter converts to tab before executing.
|
# ? Apr 5, 2017 17:20 |
|
Indentation should be handled by the appropriate stylesheet.
|
# ? Apr 5, 2017 17:24 |
|
TooMuchAbstraction posted:If you need more than one level of indentation in your code then I don't want to work with you. Never write Rust.
|
# ? Apr 5, 2017 17:50 |
|
Lookit all you scrubs with bad eyes 'needing' more than a pixel of indentation Buncha babbies
|
# ? Apr 6, 2017 15:27 |
|
code:
|
# ? Apr 6, 2017 16:21 |
|
There's only one good FizzBuzz implementation and I don't know how anyone could argue differently
|
# ? Apr 6, 2017 22:47 |
|
raminasi posted:There's only one good FizzBuzz implementation and I don't know how anyone could argue differently Amazing indeed. But now, to learn tensorflow just to be able to properly solve fizzbuzz seems a bit much. A solution with 4 interfaces and 8 implementations and 20 unit tests could be a bit more down to earth, don't you think?
|
# ? Apr 7, 2017 01:06 |
|
leper khan posted:Please construct a working computer from this pile of 10000 7402s to verify that you can write computer code. 1) wat 2) this is pretty much the entire point and purpose of MHRD (note that MHRD is actually not a very fun game, don't buy it unless you're extremely bored or extremely nerdy) ullerrm fucked around with this message at 04:22 on Apr 7, 2017 |
# ? Apr 7, 2017 02:23 |
|
so it's somewhere between tis-100 and KOHCTPYKTOP?
|
# ? Apr 7, 2017 02:41 |
|
I think so. I want to say KOHCTPYKTOP was super ultra low level, like drawing NPN and PNP transistors and metal layers on a grid with your mouse, and producing gates? MHRD is more like lovely Verilog: The Game. You write out descriptions of pins in, pins out, and gates (or components made from gates) and each level has you writing descriptions for progressively more complex ICs -- muxes/selectors/decoders, half/full adders, flipflops, etc. -- with the final levels being "make an ALU, make an instruction decoder, make octal latches, put it together."
|
# ? Apr 7, 2017 04:22 |
|
raminasi posted:There's only one good FizzBuzz implementation and I don't know how anyone could argue differently Aphyr's latest two blog posts push this genre in magical directions: Acing the technical interview and Hexing the technical interview. The Laplace Demon fucked around with this message at 10:55 on Apr 7, 2017 |
# ? Apr 7, 2017 10:49 |
|
The Laplace Demon posted:Aphyr's latest two blog posts push this genre in magical directions: Acing the technical interview and Hexing the technical interview. quote:You grit your teeth, plant your feet against the floor, and dredge a pretty printer from the void. Your palms are calloused now, your eyelids limned with crystalline, soot-black snowflakes. Every action comes at cost–except, of course, for pure functions, which are side-effect free. this is one of the most beautiful things i have ever read
|
# ? Apr 7, 2017 11:19 |
|
RandomBlue posted:Thanks for more hours of fun trying to figure your stupid poo poo out Microsoft. All I wanted to do was serve up a .NET Core app via Kestrel behind a reverse proxy (as they recommend), using a non-root URL for the app, so http://oh.poo poo/fuckme instead of just http://oh.poo poo. Eventually if you find the magic combination of words you'll find the beginning of the path that leads you to this: The whole .Net core thing feels like a work in progress that has no end. I almost hope they at one point are gonna say "gently caress it" and spend all those resources on the regular .Net framework and getting Mono up to snuff.
|
# ? Apr 7, 2017 17:54 |
|
What kind of witch casts runes for a simple task like cycle detection? Does she call upon the spirits to butter her bread, too? Granny Weatherwax would be ashamed.
|
# ? Apr 7, 2017 23:09 |
|
code:
|
# ? Apr 12, 2017 13:00 |
|
Hammerite posted:
Out of horrible, morbid curiosity, what's the computational overhead on this compared to just the inner if wrapped in an outer if for the is null or empty check, inside an appropriate loop? McGlockenshire fucked around with this message at 16:51 on Apr 12, 2017 |
# ? Apr 12, 2017 16:46 |
|
McGlockenshire posted:Out of horrible, morbid curiosity, what's the computational overhead on this compared to just the inner if wrapped in an outer if for the is null or empty check, inside an appropriate loop? The real "horror" of that example is the roundabout way of filtering out "FB" entries, assuming all the potential edge cases/exceptions are actually accounted for (due to knowing that fooBars will always contain non-null strings with at least a length of two) and wanted exactly like that and not just a disaster waiting to happen. A safer and somewhat saner way to do the above (assuming you want the same outcome sans potential exceptions) would be: C# code:
|
# ? Apr 12, 2017 21:24 |
|
Should I just post my code from when I was learning Javascript? Or would that be considered gore?
|
# ? Apr 13, 2017 15:18 |
|
ZHamburglar posted:Should I just post my code from when I was learning Javascript? Or would that be considered gore? I think that student code gets something of a pass here, much like the birdhouse your 12-year-old made doesn't belong in Crappy Construction Tales. This thread is really for code meant for serious use, written by people who should have known better.
|
# ? Apr 13, 2017 15:57 |
|
ZHamburglar posted:Should I just post my code from when I was learning Javascript? Or would that be considered gore? You can post the Javascript code you're writing now. Or would that be considered gore?
|
# ? Apr 13, 2017 16:16 |
|
McGlockenshire posted:Out of horrible, morbid curiosity, what's the computational overhead on this compared to just the inner if wrapped in an outer if for the is null or empty check, inside an appropriate loop? No idea. You're thinking much more about it than I did. I just changed it to something logically equivalent but a bit less upside down and inside out. The strings are always non-null IIRC, but I can't remember the details because I don't have it in front of me.
|
# ? Apr 13, 2017 16:20 |
|
I'm working on the firmware for a new SoC which has a big emphasis on security. The root of trust on the device is a ROM which for obvious reasons can't be patched. Must be right first time to avoid huge delays and cost overruns. The group of experts responsible for designing and implementing this software: me. Man if this thing gets turned into a 100 million strong botnet I'm never going to be promoted for the rest of my life.
|
# ? Apr 13, 2017 19:08 |
|
I forgot, the same file also had code for pretty-printing the contents of a List<string> as a single string that would insert an ampersand between the second-to-last and last list items if the list had 2 or more elements. Except it did it by constructing the string with just spaces between list items, then if there were 2 or more elements it amended the string by counting back n characters where n is the length of the last list item and inserting "& ". I replaced that with something less silly, too.
|
# ? Apr 13, 2017 21:39 |
|
Hammerite posted:I forgot, the same file also had code for pretty-printing the contents of a List<string> as a single string that would insert an ampersand between the second-to-last and last list items if the list had 2 or more elements. Except it did it by constructing the string with just spaces between list items, then if there were 2 or more elements it amended the string by counting back n characters where n is the length of the last list item and inserting "& ". I replaced that with something less silly, too. Did it do Oxford commas?
|
# ? Apr 13, 2017 21:41 |
|
I worked with a perl/SQL abomination that would build up queries. It had some definitions to help, namelycode:
It started spewing weird errors about SELECT's and clauses, so I kept digging to find something like this: code:
|
# ? Apr 13, 2017 21:47 |
|
Spatial posted:Man if this thing gets turned into a 100 million strong botnet I'm never going to be promoted for the rest of my life. Not if it's your botnet
|
# ? Apr 13, 2017 21:50 |
|
JawnV6 posted:I worked with a perl/SQL abomination that would build up queries. It had some definitions to help, namely That's magical.
|
# ? Apr 13, 2017 21:59 |
|
Nth Doctor posted:Did it do Oxford commas? I'm not sure what you're driving at by asking this but there were no commas, Oxford or otherwise. I can't go into details but it was just spitting out a space-separated list of numbers, like "4 6 8 & 20". (the numbers were strings already, they came from an XML fragment.)
|
# ? Apr 13, 2017 23:18 |
|
TooMuchAbstraction posted:I think that student code gets something of a pass here, much like the birdhouse your 12-year-old made doesn't belong in Crappy Construction Tales. This thread is really for code meant for serious use, written by people who should have known better. Yeah it's always a lot more fun when you see bad code written by professionals
|
# ? Apr 13, 2017 23:23 |
|
JawnV6 posted:I worked with a perl/SQL abomination that would build up queries. It had some definitions to help, namely That random space in there is suspicious as hell. I'd have just left it under the assumption that something, somewhere would somehow depend on that space. ~maintenance programming~
|
# ? Apr 13, 2017 23:45 |
|
redleader posted:That random space in there is suspicious as hell. I'd have just left it under the assumption that something, somewhere would somehow depend on that space. ~maintenance programming~ The first step of maintenance programming if there isn't a good solid unit test framework is to write a unit test framework. Then write some unit tests. Then write more. Then write EVEN MORE. And then, when you think you are done with unit tests? Write some loving more. Then, and only then, when the thought of writing any more unit tests for this product you are going to maintain makes you turn towards a bottle of scotch and a revolver with a single bullet, will you have enough to start working on changing the code.
|
# ? Apr 13, 2017 23:52 |
|
redleader posted:That random space in there is suspicious as hell. I'd have just left it under the assumption that something, somewhere would somehow depend on that space. ~maintenance programming~ I disagree. Removing it was the fastest way to detect that it was a load-bearing space.
|
# ? Apr 13, 2017 23:53 |
|
JawnV6 posted:
|
# ? Apr 14, 2017 00:52 |
|
Having so much fun with .Net Core. Today I found that EF Core doesn't handle GroupBy at all OR Count() right. I mean, who uses group by or count when you can just pull back millions of rows and do all that in your app, right? That's the way almost every PHP app I've ever had the misfortune of checking out their code does it, so it has to be good enough for .Net Core and EF Core, right? On top of that I noticed a huge slow down after a while where a request was taking around 2 seconds to generate a page. I thought that had to be some unindexed query or something, but no, the queries ran in about 10ms total. Restarted the service with a more detailed logging level and everything was fine. Well gently caress me. That usually means it's a memory leak or something worse. So I throw together this API call that just returns a very basic JSON OK response and should consume zero additional memory: code:
This is .Net Core 1.1.1, the latest "release".
|
# ? Apr 14, 2017 06:10 |
|
I'm still not convinced that .NET core is anywhere close to production-ready.
|
# ? Apr 14, 2017 06:55 |
|
|
# ? May 20, 2024 20:21 |
|
redleader posted:I'm still not convinced that .NET core is anywhere close to production-ready. I almost was for minor crap until today. Thankfully I'm only using it on a personal project that I use with 3 other friends. Unfortunately considering it's a Google Wave clone that uses websockets with a 30 second timeout it's leaking memory at 2MB/minute or 2.8GB per day. A pittance.
|
# ? Apr 14, 2017 07:03 |