Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

Haquer posted:

I'm guilty of using nondescript variables, but only in situations like so:
code:
for (int i = 0; i < MAX; i++)
Which can lead to bad code, but I still catch myself doing it.

But it's funny that he asked you why you had descriptive variable names. I've yet to have somebody ask me that.

That's fairly reasonable as long as it's in a loop, as you rarely ever need to know what that variable is, usually because it's scope is only within the loop. I don't use i however, I use count, because I seem to always miss i when reading code.

Adbot
ADBOT LOVES YOU

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Yakattak posted:

That's fairly reasonable as long as it's in a loop, as you rarely ever need to know what that variable is, usually because it's scope is only within the loop. I don't use i however, I use count, because I seem to always miss i when reading code.
What do you do when you have to use a nested loop?

(please don't say "count2" :v: )

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

Dijkstracula posted:

What do you do when you have to use a nested loop?

(please don't say "count2" :v: )

Valid point sir, I've actually, never come across such a situation, but I would probably come up with a meaningful count variable, or suffice to i/a/x/y/z/n you know, the usuals. :smuggo:

RussianManiac
Dec 27, 2005

by Ozmaugh

dis astranagant posted:

Implementing a switch with a for case loop :wtc: uattack is an int assigned in a loop a couple lines above this, by the way.

[code]
stuff

You could just not use a for or switch but just divide each case into a subroutine and call them sequentially from somewhere?

dis astranagant
Dec 14, 2006

RussianManiac posted:

You could just not use a for or switch but just divide each case into a subroutine and call them sequentially from somewhere?

It's not even a sequence. It checks uattack for every possible value it can take, then checks if the player isn't in a form that can do that and sets up the attack if possible. It's a roundabout way of running a switch on uattack.

dis astranagant fucked around with this message at 02:10 on Jan 1, 2010

chips
Dec 25, 2004
Mein Führer! I can walk!

tombom posted:

I'm sure this has been posted somewhere around here before, but I haven't seen it.
Spectate Swamp Desktop Search It kind of speaks for itself. He posts a lot and it seems he writes code like this professionally.

SpectateSwamp posted:

Keep going with your Search. The big players in desktop search just don't get it. What sorta works for billions of web pages doesn't when matched up against SSDS. And random is key. If you had tons of family pictures you'd realize the importance. If you had thousands of video clips you would know. I sometimes forget that few, if any of you have or use video to the degree that I do. I probably keep more notes that the rest of you too. Because it's easy for me. SSDS allows me to backup 1 folder and have all my valuable data secure. With secure data. I don't worry about anything.

SSDS code may be not so perfect when it comes to coding standards. But as some of us know, that doesn't matter an iota. If it isn't broke don't fix it. Don't look a gift horse in the mouth. So many of the old adages hold true here. Sharing your imperfect source is brave of you. Good going.

I don't know the full context of this, but he seems hilarious. A search engine that returns random results? How useful

RussianManiac
Dec 27, 2005

by Ozmaugh

SpectateSwamp posted:

If you are in a non-sharing environment. (no copies allowed) Then keep even more notes at home (and
email those to the office) use a digital camera or camcorder to secure the other info you need. Or have
a more gutsy co-worker do the copies for you.

http://forums.thedailywtf.com/forums/t/13917.aspx?PageIndex=1

lol

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

holy crap, this guy is evidentially a legend http://thestupidestmanonearth.com/

chips
Dec 25, 2004
Mein Führer! I can walk!
Here he has a screencast that explains how to set up the Visual Basic 5.0 project for SSDS

Rather than just distributing the VB project files.

http://video.google.ca/videoplay?docid=-7589648200316339053

chips fucked around with this message at 22:59 on Jan 1, 2010

spiritual bypass
Feb 19, 2008

Grimey Drawer
I've got much bigger life problems than my horrible computer programs!
__________________/

Only registered members can see post attachments!

RussianManiac
Dec 27, 2005

by Ozmaugh
lol. I like the fact of how self-confident he sounds thinking himself to be some turbo productive computer genious, yet still programs in VB.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

He's like Hexadecimal's creepy uncle.

RussianManiac
Dec 27, 2005

by Ozmaugh

Dijkstracula posted:

He's like Hexadecimal's creepy uncle.

At least hexadecimal used Java :(

tef
May 30, 2004

-> some l-system crap ->

RussianManiac posted:

At least hexadecimal used Java :(

I wonder how you know this :v:

nbv4
Aug 21, 2002

by Duchess Gummybuns

RussianManiac posted:

lol. I like the fact of how self-confident he sounds thinking himself to be some turbo productive computer genious, yet still programs in VB.

he's the King REoL of the computer programming world

Sam.
Jan 1, 2009

"I thought we had something, Shepard. Something real."
:qq:

Dijkstracula posted:

holy crap, this guy is evidentially a legend http://thestupidestmanonearth.com/

haha seriously

duck monster
Dec 15, 2004

Dijkstracula posted:

holy crap, this guy is evidentially a legend http://thestupidestmanonearth.com/

http://telusplanet.net/public/stonedan/source.txt

This code is spectacular. I haven't seen a GOSUB in decades, outside of old engineering scripts to drive RS232 poo poo around in qbasic (open "com1:" as #1,9600,blah,blah")

edit: Ahaha this is schizophrenic as hell. I don't know if anyone here ever stumbled on the "Kyoon" threads in LF. Kyoon was a paranoid schizophrenic dude , aka "The end times prophet", who managed to stumble into LF and was quickly adopted as the forum crazy-person mascot. This guys like the computer-programmer version of kyoon.

duck monster fucked around with this message at 05:32 on Jan 2, 2010

tripwire
Nov 19, 2004

        ghost flow

tef posted:

I wonder how you know this :v:

:q:

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
It's nice to see that his insanity isn't limited to programming.

RussianManiac
Dec 27, 2005

by Ozmaugh

Plorkyeran posted:

It's nice to see that his insanity isn't limited to programming.

It is a self-reaffirming thing to read reply to that thread and realize that i'm not the only one who can't understand what the gently caress hes talking about.

tripwire
Nov 19, 2004

        ghost flow
Whats so complicated :confused:

Zombywuf
Mar 29, 2008

Isn't numbering boxes on a flowchart a COBOL thing? Because numbers are much more readable than named functions or some such nonsense.

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

Isn't numbering boxes on a flowchart a COBOL thing? Because numbers are much more readable than named functions or some such nonsense.

Those are line numbers

Zombywuf
Mar 29, 2008

tef posted:

Those are line numbers

13627C?

tef
May 30, 2004

-> some l-system crap ->

Zombywuf posted:

13627C?

from the above source:

code:
line_13627:
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 1, 1) = " " Then tt = line_len - 1
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 2, 1) = " " Then tt = line_len - 2
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 3, 1) = " " Then tt = line_len - 3
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 4, 1) = " " Then tt = line_len - 4
line_13627a:
    If tt = 0 Then GoTo line_13628
line_13627b:
    If tt > line_len + over_lap Then GoTo line_13628
line_13627c:
    array_aaa(array_pos) = " " + Left(aaa, tt - 1) + " "
    array_ooo(array_pos) = " " + Left(ooo, tt - 1) + " "
    aaa = Mid(aaa, tt)
    ooo = Mid(ooo, tt)
    xxx = Mid(xxx, tt)  'january 21 2001
    GoTo line_13620

Zombywuf
Mar 29, 2008

Haha

That is Basic and COBOL, together at last.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
And anyway, isn't the point of a flowchart to describe the logic flow of the program, not to format the actual code in a weird way?

'Ah yes, array_aaa(array_pos)="y"+left(aa,tt-1)+"y"'

GROVER CURES HOUSE
Aug 26, 2007

Go on...
This man is genuinely schizophrenic.

Kyooncode. :parrot:

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"

Broken Knees Club posted:

This man is genuinely schizophrenic.

Kyooncode. :parrot:

kyoode

RussianManiac
Dec 27, 2005

by Ozmaugh

tef posted:

from the above source:

code:
line_13627:
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 1, 1) = " " Then tt = line_len - 1
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 2, 1) = " " Then tt = line_len - 2
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 3, 1) = " " Then tt = line_len - 3
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 4, 1) = " " Then tt = line_len - 4
line_13627a:
    If tt = 0 Then GoTo line_13628
line_13627b:
    If tt > line_len + over_lap Then GoTo line_13628
line_13627c:
    array_aaa(array_pos) = " " + Left(aaa, tt - 1) + " "
    array_ooo(array_pos) = " " + Left(ooo, tt - 1) + " "
    aaa = Mid(aaa, tt)
    ooo = Mid(ooo, tt)
    xxx = Mid(xxx, tt)  'january 21 2001
    GoTo line_13620

Does VB have nested if statements? Why does he repeat same condition 4 times?

EDIT: Well they do seem to have a side effect, but drat it, it seems like there would be a much much better way to do same poo poo.

nbv4
Aug 21, 2002

by Duchess Gummybuns

RussianManiac posted:

Does VB have nested if statements? Why does he repeat same condition 4 times?

EDIT: Well they do seem to have a side effect, but drat it, it seems like there would be a much much better way to do same poo poo.

maybe he doesn't realize you can have multiple statements in one "Then" clause?

fritz
Jul 26, 2003

tef posted:

code:
line_13627:
    If (tt = 0 Or tt > line_len + over_lap) And Mid(aaa, line_len - 1, 1) = " " Then tt = line_len - 1


does vb use '=' for both assignment and equality‽

Sprawl
Nov 21, 2005


I'm a huge retarded sperglord who can't spell, but Starfleet Dental would still take me and I love them for it!

fritz posted:

does vb use '=' for both assignment and equality‽

Yes you do but you can't assign values in an Condition area but the after "Then" part does assign a value. I can't even imagine using code that looked like that its painful.

spiritual bypass
Feb 19, 2008

Grimey Drawer
I usually get a good chuckle by looking at the code that some affiliates think my employer should place on their websites. For some reason, in addition to the horror that is tracking pixels, they like to include JavaScript that generates tracking pixels. I found this in one today and was sincerely confused
code:
document.write('<i' + 'mg height="1" width="1" border="0" ' + 'src="' + url + '&ifr' + 'ame=0"' + ' />');
document.write('</ifr' + 'ame>');
Why would a programmer go out of his way to do extra concatenations on a string that have no effect?

BattleMaster
Aug 14, 2000

rt4 posted:

I usually get a good chuckle by looking at the code that some affiliates think my employer should place on their websites. For some reason, in addition to the horror that is tracking pixels, they like to include JavaScript that generates tracking pixels. I found this in one today and was sincerely confused
code:
document.write('<i' + 'mg height="1" width="1" border="0" ' + 'src="' + url + '&ifr' + 'ame=0"' + ' />');
document.write('</ifr' + 'ame>');
Why would a programmer go out of his way to do extra concatenations on a string that have no effect?

I think it's meant to protect it from filtering.

RussianManiac
Dec 27, 2005

by Ozmaugh

rt4 posted:

I usually get a good chuckle by looking at the code that some affiliates think my employer should place on their websites. For some reason, in addition to the horror that is tracking pixels, they like to include JavaScript that generates tracking pixels. I found this in one today and was sincerely confused
code:
document.write('<i' + 'mg height="1" width="1" border="0" ' + 'src="' + url + '&ifr' + 'ame=0"' + ' />');
document.write('</ifr' + 'ame>');
Why would a programmer go out of his way to do extra concatenations on a string that have no effect?

Maybe its generated by something, and that something is loving up?

Sprawl
Nov 21, 2005


I'm a huge retarded sperglord who can't spell, but Starfleet Dental would still take me and I love them for it!

rt4 posted:

I usually get a good chuckle by looking at the code that some affiliates think my employer should place on their websites. For some reason, in addition to the horror that is tracking pixels, they like to include JavaScript that generates tracking pixels. I found this in one today and was sincerely confused
code:
document.write('<i' + 'mg height="1" width="1" border="0" ' + 'src="' + url + '&ifr' + 'ame=0"' + ' />');
document.write('</ifr' + 'ame>');
Why would a programmer go out of his way to do extra concatenations on a string that have no effect?

I would venture to get around ad blockers.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



zootm posted:

I knew a guy who did something near-identical to this (in Java) when I was at uni. I suggested the single-line version and he just kinda looked stunned, then said he'd "maybe think about doing it that way later". Oh, well.

That was amateur horror. It takes professionals to create Live Horrors

code:
function util_clearBlanks(str) {
   return util_clearAllBlanks(str,0);
}
function util_clearAllBlanks(str,intern) {
   var db, sss;
   var i,j,k;
   var out = "";

   if (str != "") {
      sss = str.toString();
      db = sss.split(" ");
      
      for (i=0; (i<db.length) && (db[i] == ""); i++) { }
      for (j=db.length-1; (j>=0) && (db[j] == ""); j--) { }
   
      //alert(db.length + " - " + i + " - " + j);
      for (k=i; k<=j; k++) {
         //alert("'" + db[k] + "'");
         if (db[k] != "") {
            if (intern != 1 && out != "") out = out + " ";
            // if (out != "") out = out + " ";
            out = out + db[k];
         }
      }
   } else {
      out = str;
   }
   
   return(out);
}

zombienietzsche
Dec 9, 2003

Munkeymon posted:

That was amateur horror. It takes professionals to create Live Horrors

my... my god...

Adbot
ADBOT LOVES YOU

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.

Munkeymon posted:

That was amateur horror. It takes professionals to create Live Horrors

I want to quote my favorite line, but I just can't decide: they're all so bad.

Have you considered joining the rank of heroes who have come to work with a shotgun and a heart tempered in justice?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply