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
Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Subjunctive posted:

Or they need to put some RAM in the babby server.

My contribution to the incident was asking if they got the server out of a skip :v:

Adbot
ADBOT LOVES YOU

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

baka kaba posted:

Don't be silly, it clearly gets tomorrow's date today, when today is tomorrow and tomorrow is today

Is your name Arnie?

linusBorlaug
Aug 1, 2013

nuvan posted:

Internal company tool. Also not the only CFMX7 app that we have, though I've never supported any but this and one other.

It has some 800 .cfm files scattered around the codebase, with some 2000 <cfquery>s. Guess how many <cfqueryparam>s there are?

Go on, guess.

At least it's under source control.

I'm gonna guess zero. I just found a query yesterday with 70 values from the form scope and 10 from the url scope. Web facing. Zero queryparams.

nuvan
Mar 29, 2008

And the gentle call of the feral 3am "Everything is going so well you can't help but panic."

linusBorlaug posted:

I'm gonna guess zero. I just found a query yesterday with 70 values from the form scope and 10 from the url scope. Web facing. Zero queryparams.

Correct, sir! Also, how do you still have a database?

I found it's actually a very zen-like experience to go through the codebase adding queryparams. As a result, I've set up a branch where, if I need to relax at work for a bit, I go through and fix up 2 or 3 files.

Of course, in order to keep the zen I'm not verifying the DB column types, just picking based on field name and my memory of the DB structure.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT


I'm the frog

linusBorlaug
Aug 1, 2013

nuvan posted:

Correct, sir! Also, how do you still have a database?

Firewalls and dumb luck.

I have spent so much time just going through and adding cfqueryparams down a list in unparamed queries. If sp_help didn't exist as a quick way to get all my data types, I probably wouldn't have a liver anymore.

TopShelfer
Feb 25, 2007
Me and my deaf girlfriend went out to dinner. All of a sudden all I could hear was "UUUHHHH HHHHUR RRRAA AAAGGGL LLLLLL NGGGG UHHHHRR RRRR" It was awkward and just weird.

TopShelfer fucked around with this message at 03:47 on Nov 29, 2014

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.
I'm sure your employer (or even worse, customer) in the oilfield industry is thrilled with his source code (including obvious security holes) being leaked onto the internet. Sounds like you deserve each other.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Skuto posted:

I'm sure your employer (or even worse, customer) in the oilfield industry is thrilled with his source code (including obvious security holes) being leaked onto the internet. Sounds like you deserve each other.

Seriously wtf mate?

astr0man
Feb 21, 2007

hollyeo deuroga
Also good job leaking it from your personal dropbox account instead of at least using an anonymous pastebin or something

Necc0
Jun 30, 2005

by exmarx
Broken Cake
Dude... what are you doing :stonk:

No Safe Word
Feb 26, 2005

The horror is coming from inside the thread?

power botton
Nov 2, 2011

TopShelfer posted:

I have struck gold...

My company got stuck with trying to fix numerous bugs in this software. Please kill me. This is supposed to be a simple data entry form somehow someway built onto a wordpress theme. In total it is over 100,000 lines of code. Nearly all is unintelligible.

php:
<?
    public function fsrObject() {
        // Configure poo poo hole ..
        $this->__shit_happened = dirname( __FILE__ ) . '/_shit/level-1-' . date( 'Y-m-d' ) . '.txt';
        if ( $this->__shit_happened !== false ) $this->__shit_hole_active = true;

        global $current_user;
        get_currentuserinfo();
        $this->wp_user = $current_user;

    }
?>
Full files for your enjoyment:

https://dl.dropboxusercontent.com/u/6098817/fsr-db.php
https://dl.dropboxusercontent.com/u/6098817/fsr-functions.php
https://dl.dropboxusercontent.com/u/6098817/fsrObject.php
https://dl.dropboxusercontent.com/u/6098817/fsrPageMeta.php
https://dl.dropboxusercontent.com/u/6098817/functions-fsr.php
https://dl.dropboxusercontent.com/u/6098817/functions-fsr.php
https://dl.dropboxusercontent.com/u/6098817/section_die_penetration.form.php

Amazing

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
:f5h::munch:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

That man has three hands.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

TopShelfer posted:

I have struck gold...

My company got stuck with trying to fix numerous bugs in this software. Please kill me. This is supposed to be a simple data entry form somehow someway built onto a wordpress theme. In total it is over 100,000 lines of code. Nearly all is unintelligible.

You are not a good person.

qntm
Jun 17, 2009

TopShelfer posted:

Please kill me.

I think you've killed yourself

Xenoveritas
May 9, 2010
Dinosaur Gum

Suspicious Dish posted:

That man has three hands.

Nah, he just has one of those drinking birds hitting the F5 key. A really, really fast one.

Also, can anyone spot what's wrong with this query when done using the Drupal database API?

SQL code:
SELECT * FROM l INNER JOIN r ON l.id = REPLACE(r.id, '-suffix', '')
That's right, it contains an empty string, which Drupal find-and-replaces with '^' in certain database drivers. (For example, it does in the Oracle driver, but not the MySQL driver. Guess what the module I'm working on was originally tested against and what the actual database is.) That took me a while to notice.

QuarkJets
Sep 8, 2008

Suspicious Dish posted:

That man has three hands.

That's his dick smashing into the F5 key over and over

fritz
Jul 26, 2003

Suspicious Dish posted:

That man has three hands.

Horrors of all kinds welcome in this thread.

Lain Iwakura
Aug 5, 2004

The body exists only to verify one's own existence.

Taco Defender

TopShelfer posted:

I have struck gold...

My company got stuck with trying to fix numerous bugs in this software. Please kill me. This is supposed to be a simple data entry form somehow someway built onto a wordpress theme. In total it is over 100,000 lines of code. Nearly all is unintelligible.

php:
<?
    public function fsrObject() {
        // Configure poo poo hole ..
        $this->__shit_happened = dirname( __FILE__ ) . '/_shit/level-1-' . date( 'Y-m-d' ) . '.txt';
        if ( $this->__shit_happened !== false ) $this->__shit_hole_active = true;

        global $current_user;
        get_currentuserinfo();
        $this->wp_user = $current_user;

    }
?>
Full files for your enjoyment:

https://dl.dropboxusercontent.com/u/6098817/fsr-db.php
https://dl.dropboxusercontent.com/u/6098817/fsr-functions.php
https://dl.dropboxusercontent.com/u/6098817/fsrObject.php
https://dl.dropboxusercontent.com/u/6098817/fsrPageMeta.php
https://dl.dropboxusercontent.com/u/6098817/functions-fsr.php
https://dl.dropboxusercontent.com/u/6098817/functions-fsr.php
https://dl.dropboxusercontent.com/u/6098817/section_die_penetration.form.php

Why would you repost your company's source code like that?

I guess it's a good thing you took it down already.

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS

I hope you were planning on finding a new job.

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock

NSA thanks you for making the job easier for them

Voronoi Potato
Apr 4, 2010

Suspicious Dish posted:

That man has three hands.

That's not his hand. Why did he post so much code when a snippet would be fine?

Fart Sandwiches
Apr 4, 2006

i never asked for this

Voronoi Potato posted:

That's not his hand. Why did he post so much code when a snippet would be fine?

Check his post history. Dude was probably high.

qntm
Jun 17, 2009
To be fair, every line of that code was horrendous. SQL query with 31 INNER JOINs, class with over 1400 member variables, nested ternary operators with assignment expressions as arguments... And is it a horror for a switch statement to use decimal numbers as cases?

Mogomra
Nov 5, 2005

simply having a wonderful time
I don't think anyone is questioning the horror in the code.

Why would anyone post that much, apparently unaltered, closed source code is beyond me, and the rest of this thread.



:thejoke:

Westie
May 30, 2013



Baboon Simulator

qntm posted:

To be fair, every line of that code was horrendous. SQL query with 31 INNER JOINs, class with over 1400 member variables, nested ternary operators with assignment expressions as arguments... And is it a horror for a switch statement to use decimal numbers as cases?

I wish I wasn't as slow at reading this thread.

Munkeymon
Aug 14, 2003

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



qntm posted:

To be fair, every line of that code was horrendous. SQL query with 31 INNER JOINs, class with over 1400 member variables, nested ternary operators with assignment expressions as arguments... And is it a horror for a switch statement to use decimal numbers as cases?

You mean like
php:
<?
case 2.54:
    die_horribly();
    break;
case 2.55:
    sunshine_and_rainbows();
    break;
?>
?

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS
Am I the only person who just hates switch statements of all kinds?

astr0man
Feb 21, 2007

hollyeo deuroga

down with slavery posted:

Am I the only person who just hates switch statements of all kinds?

Nope. https://www.python.org/dev/peps/pep-3103

hobbesmaster
Jan 28, 2008

down with slavery posted:

Am I the only person who just hates switch statements of all kinds?

It should pretty much only be used with enums and is horribly abused in practice with everything else.

Then again a giant if/else or ternary chain can be just as bad or worse

Munkeymon
Aug 14, 2003

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



hobbesmaster posted:

It should pretty much only be used with enums and is horribly abused in practice with everything else.

Then again a giant if/else or ternary chain can be just as bad or worse

Global dictionary of values -> handlers :unsmigghh:

Soricidus
Oct 21, 2010
freedom-hating statist shill

hobbesmaster posted:

It should pretty much only be used with enums and is horribly abused in practice with everything else.

switch/case on enums is basically a bad language's substitute for pattern matching on algebraic data types.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Suspicious Dish posted:

That man has three hands.

Geeze, everyone's a critic

:munch:

hobbesmaster
Jan 28, 2008

Soricidus posted:

switch/case on enums is basically a simpler language's substitute for pattern matching on algebraic data types.

switch/case can be used to implement a particularly feature not in the language, yes. goto's and longjmps are also used regularly in C code that needs exception handling.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I gotta admit, I'm a coding horror. Something about switch/case just feels so right to me. Generally not for controlling program execution, but I do a lot of undifferentiated string parsing from multiple suspect sources (e.g. EDI files, csv files, multi-standard XML files) so if I want to store "red" then I'm SELECT CASE'ing through "crimson","redd","rouge","scarlet","blood" etc etc.

Athas
Aug 6, 2007

fuck that joker

Mogomra posted:

I don't think anyone is questioning the horror in the code.

Why would anyone post that much, apparently unaltered, closed source code is beyond me, and the rest of this thread.



:thejoke:

Is this source code really something a competitor would want to steal?

(I've never worked on/with closed source code, so I don't have much intuitive understanding as to why it's supposed to be sensitive. Most code is almost useless without its documentation or supporting environment anyway, and if it's not, you probably can't claim you wrote it without it being trivially obvious that you did not.)

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy
It's not about stealing it, it's about breaking the NDA or other contract you inevitably signed with your employer saying you won't share proprietary code. Posting snippets like in this thread is excusable, posting 7 whole files is not.

There are plenty of other reasons an employer wouldn't want this code to get out. What happens when someone identifies the company? Now a Google search could tell us that the company has terrible, terrible coding practice and suddenly they have a hard time hiring developers or have to start paying more for them.

Adbot
ADBOT LOVES YOU

Westie
May 30, 2013



Baboon Simulator

Bognar posted:

or have to start paying more for them.

And that's a bad thing? :getin:

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