Jump to content

Coding blunders


Geonovast

Recommended Posts

Mine is KSP-related...

I should have checked the API...

But... here it is:

In a custom PartModule, I used OnUpdate() instead of a KSPEvent, and it ended up running a script to teleport your vessel every frame. Needless to say, the game was unplayable.

A lot of errors could probably be helped by looking at API docs and similar documentation... like trying to call OnGui() from an external script...

Link to comment
Share on other sites

I recall this footshooting was much more funny in times of Fortran, CP/CMS, RPN, ...

RPN (reversed Polish notation):

foot

youself

shoot

you

[execute]

The high tech printer stamps a hole in the magnetic strip.

CP/CMS (IBM mainframe, 70s):

You write a 500 page documentation, attach your foot and the gun and send it down to the operators. 4 weeks later you get a letter stating that a bullet was mentioned in the docs but missing and your request could not be processed.

Fortran:

You can't shoot yourself because there is no foot, no gun and no bullet.

etc. pp.

:-)

Edited by Green Baron
Link to comment
Share on other sites

...and here's where we come up with the old (reworked) "IBM Assembler Opcodes" list.

I used to have a copy of this hanging up on the wall at the office. Man, the flack I would get for it. I tell you, some people just have no sense of humor. Well, when you work for somebody else.....

http://ruthless.zathras.de/fun/top-secret/NewOpCodes.txt

Link to comment
Share on other sites

On 2/27/2018 at 9:32 PM, Shpaget said:

 

That sounds interesting.

Pretty much all the coding I do is various embeded devices we need for our small company. Since I'm not much of a programmer, I mostly play with Arduino stuff which has a lot of safety features built in, so what's the worst I've done in code? Probably forgot the pinMode (pin, OUTPUT), then spent hours debugging the hardware (which is also my design, so I'm thoroughly convinced that the problem is equally likely to be in either place). Not nearly as interesting as crashing an entire data center or something.

I'm much more proficient in destroying hardware, though.

i usually just talk to the registers directly at this point. "the arduino way" is nice to get started but eventually you look at the data sheet and figure you can do with 2 cycles what arduino can do in several. and you can scan an entire port at the same cost as checking a single pin. useful if you need high performance code. 

Link to comment
Share on other sites

Oh man, where do I start?

Well, here's a couple tidbits to get started. I'll be back with more whenever my code breaks next.

I was writing some FORTH the other day, and was trying to allocate an array of size cells. Instead of writing  create s_arr size cells allot, I wrote  create s_arr size allot. Let's not even go into how long it took me to figure out what was going wrong.

As part of the same project, I was fork/execve-ing a process in C and then piping some text to and from it. Everything was crashing horribly... and then I realized I was trying to read from the pipe that led to stdin, and write to the pipe that led to stdout. The stdin and stdout of the program I was piping to, that is. Pipes and forks, I swear...

 

Edited by IncongruousGoat
Link to comment
Share on other sites

On 3/2/2018 at 7:34 AM, LordFerret said:

ROFL :D

Now whenever I see something claim to be Eco, i'm gonna think

"ECO ELECTROCUTE COMPUTER OPERATOR"

I'm not a coder, so I hafta ask, are those real codes with made-up definitions, or completely fiction?

Link to comment
Share on other sites

17 minutes ago, StrandedonEarth said:

ROFL :D

Now whenever I see something claim to be Eco, i'm gonna think

"ECO ELECTROCUTE COMPUTER OPERATOR"

I'm not a coder, so I hafta ask, are those real codes with made-up definitions, or completely fiction?

Assembler Menmonics which should exist ;-)

Not real, but very funny :-)

CBNC   Close, but no cigar ....

Edited by Green Baron
Link to comment
Share on other sites

@StrandedonEarth, as @Green Baron points out - not real.

Here's sample of the real deal...
http://ref.x86asm.net/coder32.html

Back in the day (when I was young), I used to dream 8 and 16 bit opcode stuff in my sleep... remnants of the day's work... and wake up with answers! My GF used to get mad at me (HoneyDo) because I'd be walking around telling her 'NOP NOP NOP'.

 

PS - My personal favorite was always 'HCF' ..... oh if only ..........

Link to comment
Share on other sites

Back in the day, we used to have whiteboard with "Reversed condition club" scoretable. Once in a while, somebody would start swearing loud, then stand up and slowly, with dignity of condemned, walk up to the table to add a point by his name. It was a very special club :-)

Link to comment
Share on other sites

  • 3 years later...

I think I was trying to make a 9x1 array in MATLAB, and normally the syntax for that would have been a colon 9:1. But the thing I was using to create the array was a function, which uses a comma because you're inputting variables, not array indices. So I was ending up with a 9x8x7x6x5x4x3x2x1 array

Link to comment
Share on other sites

Learning to code.

 

Actually, probably all the times I messed up some curvy bracket in an MM patch.

Or, maybe when I used used python's dict.has_key(), not realizing that it had been deprecated for a long time. Had to go and replace every one...

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...