|
This was for a "pre-exam" or whatever they wanted to call it, but it had multiple choice, the answer for one of them was this:code:
quote:There is trailing whitespace after one of the }s. This is really fun when I need to copy-paste something like a password and the extra space fucks everything up.
|
# ? Sep 13, 2011 23:19 |
|
|
# ? May 13, 2024 22:37 |
|
Zamujasa posted:This was for a "pre-exam" or whatever they wanted to call it, but it had multiple choice, the answer for one of them was this: I guess I don't mind key,val especially in a one line foreach statement when you can see the declaration immediately above you. Its kind of close to the pseudo you might right down. This isn't exactly a horror, but its from some code I wrote a while back. Who cares about what exception happened? I DON'T! code:
|
# ? Sep 14, 2011 00:34 |
|
Innocent Bystander posted:I guess I don't mind key,val especially in a one line foreach statement when you can see the declaration immediately above you. Its kind of close to the pseudo you might right down. The horror is that $val => $key is backwards
|
# ? Sep 14, 2011 01:59 |
|
NotShadowStar posted:The horror is that $val => $key is backwards As far as I can tell it's mapping a color's name to its hex code. The names appear in reverse order in the code, but logically it's perfectly consistent.
|
# ? Sep 14, 2011 02:02 |
|
Nobody's pointed out the real horror of using <font> tags?
|
# ? Sep 14, 2011 02:03 |
|
yaoi prophet posted:Nobody's pointed out the real horror of using <font> tags? Heh, PHP is a magnet for horrors so I just assumed it was in the PHP code, but you're absolutely right xD
|
# ? Sep 14, 2011 02:48 |
|
yaoi prophet posted:Nobody's pointed out the real horror of using <font> tags?
|
# ? Sep 14, 2011 04:50 |
|
Classicist posted:As far as I can tell it's mapping a color's name to its hex code. The names appear in reverse order in the code, but logically it's perfectly consistent. He said this was for a multiple choice exam and the only answer that made sense was foreach($arr as $val => $key) which is completely backwards.
|
# ? Sep 14, 2011 05:04 |
|
NotShadowStar posted:He said this was for a multiple choice exam and the only answer that made sense was foreach($arr as $val => $key) which is completely backwards. Hmm, he was taking a multiple choice test on programming. Perhaps the test authors were trying to make an obscenely saracastic self-commentary?
|
# ? Sep 14, 2011 05:08 |
|
Fren posted:"No subclassing in Javascript? Oh well " The worst thing to happen to JavaScript was being born with a C-family syntax.
|
# ? Sep 14, 2011 07:17 |
|
Coffeescript! vvv so do I, it's an unironic recommendation Opinion Haver fucked around with this message at 07:38 on Sep 14, 2011 |
# ? Sep 14, 2011 07:19 |
|
yaoi prophet posted:Coffeescript! I like CS
|
# ? Sep 14, 2011 07:35 |
|
Monkeyseesaw posted:The worst thing to happen to JavaScript was being born with a C-family syntax. I've seen it argued that its C-like syntax helped it (or was necessary, even, to) get adopted everywhere, and it turns out it's not at all a bad language. I would've said the same thing as you a year ago, but I've changed my mind.
|
# ? Sep 14, 2011 09:16 |
|
Innocent Bystander posted:Heh, PHP is a magnet for horrors so I just assumed it was in the PHP code, but you're absolutely right xD It was, because the foreach thing was meant to be the focus; the font tag was used for simplicity (I didn't feel like writing out a span or the original's <option>s) quote:
code:
To put it another way, $key=>$val is a lot like calling a deadbolt a key and calling a key a deadbolt. It's completely backwards for no real reason other than to try to trick people who are taking the exam; while I give them some points for being creative, using an answer that is so obviously backwards really isn't helping.
|
# ? Sep 14, 2011 09:38 |
|
pokeyman posted:I've seen it argued that its C-like syntax helped it (or was necessary, even, to) get adopted everywhere, and it turns out it's not at all a bad language. I would've said the same thing as you a year ago, but I've changed my mind. javascript is a terrible language and youre only giving it the benfit of a doubt because it becomes ok once you bolt 3 frameworks on top of it
|
# ? Sep 14, 2011 09:50 |
|
Markov Chain Chomp posted:javascript is a terrible language and youre only giving it the benfit of a doubt because it becomes ok once you bolt 3 frameworks on top of it Which three frameworks did you have in mind? It's a decent language if you change the syntax a bit. I'll happily concede that it's too easy to do stupid things in straight JavaScript.
|
# ? Sep 14, 2011 10:59 |
|
My cousin owns a small business consulting company. I came to work for him as the IT/tech guy who does all of the tech work, graphics design, video editing, and website making. The websites they had I would link would provide a good laugh to CoC but that would be unprofessional. Sorry. Anyways, the guy who made them still works here and is currently throwing a fit that 1: he isn't responsible for all of this anymore, and 2: I'm changing up his "masterpieces". -The websites were made in Microsoft Word. He added a banner and some links and put it in tables. -The homepage to each of the websites that I now control is around 17 printed pages long. -Autostarting videos "PODs" on nearly every page. I get annoyed and close them. I'd hate to think we're losing customers who also get annoyed and close them. -Images are all resized and with borders made in Word. Yes, it is a lo-res image with a pink highlight border around it. My eyes are not deceiving me. -Testimonial pages with nearly 50 YouTube iframe embeds per page. Some of them are Flash-based as well so they don't load on iOS devices. -Pages are not concise, there are spelling errors, and its written like a speech. 17 pages of stream-of-conscious first person narrative voice inviting you to the latest conference. -FTP sites are messy with all of the old pages from 2-8 years ago which were never cataloged. I come in and redesign the pages using proper coding (basic compared to a lot of stuff you all do, I know) and constantly get bitched at because "tables are easier and quicker to edit than CSS" although the real reason is "I made this why are you changing it". The most recent rant I have received is "what you're doing is taking too long, just paste the Word document straight into Dreamweaver with the markup". In short, it annoys me and forces me to keep my mouth shut since the job is quite nice otherwise. I have to start working for the day though. While updating the horrendous webpages I accidentally messed up a JavaScript form which just so happens to be the end of the world to some people. Must fix. Apok fucked around with this message at 14:09 on Sep 14, 2011 |
# ? Sep 14, 2011 14:02 |
|
We got some new equipment in at work that you communicate with by sending/receiving strings over RS-232. After having some trouble getting the thing to function consistently I called the manufacturer and an engineer explained how their 'send a string response' system works: The device's firmware creates a set of char arrays for each possible string response, plus a set of pointers to those arrays. When it's time to send a string the code grabs the appropriate pointer, puts the value at the memory location being pointed to into the RS-232 buffer, and then increments the pointer itself (not pointer + an offset value) and returns the next character until a termination character is reached (which is 0x0D, or carriage return, because hey why not). This means that by the end of a string read the pointer is aimed at the termination character, not at the base of the char array. So, if you read a value you'll get the correct response once but then subsequent reads just return the termination character because the pointer is in the wrong place. How do you reset the pointer to the beginning of the array? You don't. Instead, a hardware timer on the microcontroller goes off every 500 ms and triggers some code that resets all the char array pointers to their default positions. As long as you only read any particular string less often than once per 500 ms you are reasonably safe, unless of course the pointer happens to get reset midway through a read in which case you could get a partial duplicate string like 12312345 instead of 12345. Part of me wants to believe that I just didn't understand the engineer's explanation properly and that things really don't work that way, but the model he described matches up pretty well with how the system behaves in the lab.
|
# ? Sep 14, 2011 15:21 |
|
Hardware is the worst.
|
# ? Sep 14, 2011 15:25 |
|
PDP-1 posted:We got some new equipment in at work that you communicate with by sending/receiving strings over RS-232. After having some trouble getting the thing to function consistently I called the manufacturer and an engineer explained how their 'send a string response' system works: This seems more like an elaborate troll than the actions of a legitimate hardware firm
|
# ? Sep 14, 2011 16:00 |
|
that does not at all fall outside of my expectations for "EE code".
|
# ? Sep 14, 2011 16:05 |
|
Shocking tales of Redundancy:code:
code:
|
# ? Sep 14, 2011 17:02 |
|
Otto Skorzeny posted:This seems more like an elaborate troll than the actions of a legitimate hardware firm
|
# ? Sep 14, 2011 17:56 |
|
PDP-1 posted:We got some new equipment in at work that you communicate with by sending/receiving strings over RS-232. After having some trouble getting the thing to function consistently I called the manufacturer and an engineer explained how their 'send a string response' system works:
|
# ? Sep 14, 2011 18:26 |
|
pokeyman posted:Which three frameworks did you have in mind? Sorry, I was just using a bit of hyperbole, there's no specific 3. But, IMO, JS ranks up there with PHP in terms of "lets you do stupid things".
|
# ? Sep 14, 2011 20:31 |
|
Otto Skorzeny posted:This seems more like an elaborate troll than the actions of a legitimate hardware firm Agilent and Keithley seem to be the only measurement hardware companies in existence who can produce an I/O spec that doesn't feel like an elaborate troll. Once you get down into the second and third tier of equipment vendors you'll always be interfacing with a coding horror of some type. The only reason this one stood out was that the support engineer flat out admitted that they were using hardware timers to reset variables and you usually don't get that kind of detailed description - you typically just have to guess at what is going on then write an interface object to hide the WTF from the rest of your program. TasteMyHouse posted:that does not at all fall outside of my expectations for "EE code". I'm an EE myself and can attest that as a group we are extremely poo poo coders, but we aren't the absolute worst. The true Vogon Poets of the coding universe are PhD physicists who decide that since they are very smart and Boolean logic is very simple they should be able to figure out how to program a control system on their own within a day or two. They grab a copy of LabVIEW and a fistful of GPIB cables and go create something with lots of motors, lasers, and power high-voltage supplies that doesn't work, damages the equipment, or poses a severe danger to themselves and other members of the lab staff. Possibly all three things at once.
|
# ? Sep 14, 2011 20:59 |
|
Markov Chain Chomp posted:Sorry, I was just using a bit of hyperbole, there's no specific 3. But, IMO, JS ranks up there with PHP in terms of "lets you do stupid things". I like JS, but I'm of the opinion that if you can't use coffescript at least use underscore.js http://documentcloud.github.com/underscore/ It makes dealing with the weakass collections in JS way better.
|
# ? Sep 14, 2011 21:27 |
|
PDP-1 posted:I'm an EE myself
|
# ? Sep 14, 2011 21:30 |
|
PDP-1 posted:I'm an EE myself and can attest that as a group we are extremely poo poo coders, but we aren't the absolute worst. The true Vogon Poets of the coding universe are PhD physicists who decide that since they are very smart and Boolean logic is very simple they should be able to figure out how to program a control system on their own within a day or two. They grab a copy of LabVIEW and a fistful of GPIB cables and go create something with lots of motors, lasers, and power high-voltage supplies that doesn't work, damages the equipment, or poses a severe danger to themselves and other members of the lab staff. Possibly all three things at once. It never actually occurred to me that the sort of skills required to make the insane simulations written in FORTRAN77 I've seen coming from physicists might also be applied to control systems. Chilling. Though to be fair, physicists are dangerous to everyone in their lab even when they're not using computers. The school I went to kept radiation sources on a table under a big pile of lead blocks. Like, a big pile of bricks made out of lead. There was a hole on one side in order to have a beam for exposing samples, and a sign on the table telling you about said beam and suggesting that you might want to go around the other way. The other end of the beam was the concrete wall a couple of meters from the table.
|
# ? Sep 15, 2011 01:39 |
|
Apok posted:My cousin owns a small business consulting company. I came to work for him as the IT/tech guy who does all of the tech work, graphics design, video editing, and website making. Do the websites have any sort of analytics on them? Especially if the place is your cousin, if you can provide some evidence that your redesigned sites are much more effective then it should be trivial to make the guy shut up -- especially if his works of art are actually driving away customers.
|
# ? Sep 15, 2011 01:47 |
|
Markov Chain Chomp posted:Sorry, I was just using a bit of hyperbole, there's no specific 3. But, IMO, JS ranks up there with PHP in terms of "lets you do stupid things". JS went from conception to implementation to production in a manner of eight days (4realz), but it's clever enough that you have more than enough tools to get over the deficiencies of the language. PHP, as of 5.3, is only now starting to give you enough tools to get over the totally poo poo aspects of the language, and even then good luck requiring 5.3 for your project and have it be generally released as lots of lovely $5 web hosts still run PHP 4.2 People have been mad as hell that Wordpress 3.2 requires PHP >5.2 because they can't upgrade. This is the state of PHP, damned if you do damned if you don't. NotShadowStar fucked around with this message at 02:47 on Sep 15, 2011 |
# ? Sep 15, 2011 02:44 |
|
URL a = new URL("http://stackoverflow.com"); URL b = new URL("http://stackexchange.com"); System.out.println(a.equals(b)); true whose brilliant idea was this
|
# ? Sep 15, 2011 04:59 |
|
Aleksei Vasiliev posted:URL a = new URL("http://stackoverflow.com"); Oh my god that's fantastic. quote:Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP.
|
# ? Sep 15, 2011 05:08 |
|
PDP-1 posted:The true Vogon Poets of the coding universe are PhD physicists who decide that since they are very smart and Boolean logic is very simple they should be able to figure out how to program a control system on their own within a day or two. I had a physics PhD join my team about 6 years ago. The company standard was still VC6, but he insisted that he was going to use VS2005 (which had only been out for a few months). I told him he could dev in notepad if he wanted, but all the builds were still going to be done on VC6 so his stuff better still work there. Since the VS2005 C++ compiler was a bit stricter than the VC6 one, he ended up with a whole bunch of warnings. So he "fixed" the code to make the warnings go away. One that I recall was something like code:
I got a random report from the tester that there was rubbish data coming thru to the DB. After a bunch of investigation, it turned out that this PhD dude had "fixed" his warnings by changing the code to code:
Luckily he was on a contract rather than permanent, so we didn't renew his contract. In his interview he also rated himself a 10/10 as a C++ programmer (which to me means you should be working for EDG or sitting on the C++0x committee), but couldn't answer straightforward questions about stack unwinding etc.
|
# ? Sep 15, 2011 08:34 |
|
Aleksei Vasiliev posted:URL a = new URL("http://stackoverflow.com"); You know what's awesome about this? If the machine you're running on has no DNS, your calls to equals will hang the thread for a second or two while the name lookups time out.
|
# ? Sep 15, 2011 09:39 |
|
code:
code:
|
# ? Sep 15, 2011 11:41 |
|
Clavius posted:Hey friend who is still living in 2002 web design land, you should consider a few more modern techniques. *Many links and hours of advice* TOO MUCH THINKING
|
# ? Sep 15, 2011 15:47 |
|
gold brick posted:That reminds me of a coworker I used to have. He (still) prefers table layouts, but asked me once how I would lay out a simple form using divs, etc. I looked it over without saying anything for about 5-6 seconds before he said "Well, if we were doing tables, I know I wouldn't have to think this hard". It could be worse, he could get on board and move onto the next phase: Replacing table tr and td tags with div tags and floating goddamn everything instead of actually learning how to separate layout and content properly. That poo poo is impossible to fix. I can at least see what the incompetent gently caress has broken in a table layout.
|
# ? Sep 15, 2011 16:51 |
|
We just found this beauty in the administration area of one of our websites:code:
code:
If the guy still worked here, I would be kicking his rear end so hard right now.
|
# ? Sep 15, 2011 17:16 |
|
|
# ? May 13, 2024 22:37 |
|
I just realized that in MUMPS, since '+' and '-' are also unary operators, this is legal syntax.code:
|
# ? Sep 15, 2011 19:02 |