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
Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Blaming MS in any way is pretty dumb as it's a bug in the Github plugin written by Github.

Adbot
ADBOT LOVES YOU

loinburger
Jul 10, 2004
Sweet Sauce Jones
He assigned blame in order of revenue and in reverse order of culpability: Microsoft (did nothing wrong), then Amazon (didn't jump to help him fix his fuckup), then Github (released a buggy plugin)

Steve French
Sep 8, 2003

It was made worse by the fact that the private information he accidentally posted publicly was AWS keys, but that's still a pretty lovely bug even if the private info was something that would generally be considered OK to put in a private github repo.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
And even so, what kind of AWS keys do you generate that gives you that kind of platform access? Like, the only kind of thing his application was doing that might need keys that have permission to manage EC2 instances would be some kind of watchtower app that monitors running servers.

Jesus loving Christ, IAM exists for a reason. Goddamn idiots using AWS without reading the documentation.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
He said he was doing it for testing only, a 10-minute hack. If I'm doing something quick and dirty, I'm gonna just check my keys into GitHub, and make sure it's private.

baquerd
Jul 2, 2007

by FactsAreUseless

Blinkz0rz posted:

And even so, what kind of AWS keys do you generate that gives you that kind of platform access? Like, the only kind of thing his application was doing that might need keys that have permission to manage EC2 instances would be some kind of watchtower app that monitors running servers.

Jesus loving Christ, IAM exists for a reason. Goddamn idiots using AWS without reading the documentation.

Root admin access keys are easier to use though, you don't even have to configure them more than once :downs:

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
Durr but I deactivated my keys, how is it possible that someone is spawning other instances. Could it be because with those root keys someone created another IAM user that spawned full permission keys?

Suspicious Dish posted:

He said he was doing it for testing only, a 10-minute hack. If I'm doing something quick and dirty, I'm gonna just check my keys into GitHub, and make sure it's private.

NO. DON'T.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Why not just use your keys ... without checking them in to version control? It's not like checking them in actually buys you anything for your 10-minute test app that you're running in your local machine anyway.

sarehu
Apr 20, 2007

(call/cc call/cc)
Just don't use the cloud.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

sarehu posted:

Just don't use the cloud.

The use of "~~~€the cloud£™~¿~~¿¿¶
To describe the processes of handing your poo poo to some other guy on the Internet until you want it is a coding horror. It's all just someone else's Datacenter.

Ochowie
Nov 9, 2007

Jabor posted:

Why not just use your keys ... without checking them in to version control? It's not like checking them in actually buys you anything for your 10-minute test app that you're running in your local machine anyway.

This. I still don't understand what he hoped to achieve with checking the keys in.

canis minor
May 4, 2011

Today, for a first time, I've used a XML validator that doesn't parse CDATA. Am I correct to assume that if it doesn't parse CDATA then it's a regex parser?

vvv Yeah, but on the other hand - global company, millions of customers, etc.

canis minor fucked around with this message at 13:43 on Sep 2, 2015

nielsm
Jun 1, 2009



canis minor posted:

Today, for a first time, I've used a XML validator that doesn't parse CDATA. Am I correct to assume that if it doesn't parse CDATA then it's a regex parser?

Sounds likely. Or at least written by someone who never bothered to read any specification and just guessed at what XML looks like.

feedmegin
Jul 30, 2008

Suspicious Dish posted:

He said he was doing it for testing only, a 10-minute hack. If I'm doing something quick and dirty, I'm gonna just check my keys into GitHub, and make sure it's private.

Edit: Ugh.

Space Kablooey
May 6, 2009


nielsm posted:

Sounds likely. Or at least written by someone who never bothered to read any specification and just guessed at what XML looks like.

Pictured: What XML looks like*:
code:
<Client>
	<FirstName="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
	<Type="Fart"/>
	<LastName="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
</Client>
It was an actual spec that was sent to me.

Space Kablooey fucked around with this message at 18:09 on Sep 2, 2015

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

HardDisk posted:

Pictured: What XML looks like*:
code:
<Client>
	<FirstName="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
	<Type="Fart"/>
	<LastName="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"/>
</Client>
It was an actual spec that was sent to me.

Hey, someone at NeXTApple sat down and came up with XML Plists and thought "good job self, this is brilliant and we should definitely unleash it upon the world". Every loving Xcode project, IB XIB/Storyboard, and serialized data is this positional XML format where the name of the attribute is in a tag called "key" and the value's type follows it as the next tag.

code:
<key>farts</key>
<true/>
<key>butts</key>
<dict>
    <key>sigh</key>
    <real>5.7</real>
</dict>

Simulated fucked around with this message at 18:55 on Sep 2, 2015

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Ender.uNF posted:

Hey, someone at NeXTApple sat down and came up with XML Plists and thought "good job self, this is brilliant and we should definitely unleash it upon the world". Every loving Xcode project, IB XIB/Storyboard, and serialized data is this positional XML format where the name of the attribute is in a tag called "key" and the value's type follows it as the next tag.

code:
<key>farts</key>
<true/>
<key>butts</key>
<dict>
    <key>sigh</key>
    <real>5.7</real>
</dict>

We have something dumb like that. We have a certain type of web content that is published from a document management system. This content can have many sections, and those sections have specific types that control their formatting. So of course, they used this XML structure:
code:
<content>
  <intro-warnings count=4>
    <intro-warning>some content</intro-warning>
   ..(3 more of these)
 </intro-warnings>
 <main-paragraphs count=2>
   <main-paragraph>text</main-paragraph>
   <main-paragraph>texttexttext
            <screenshots count=2>
                   <screenshot uri=(uri) \>
                   <screenshot uri=(uri) \>
             </screenshots>
   </main-paragraph>
 </main-paragraphs>
</content>
Except there's 50 possible section types and there's a few that can be nested within each other 4-5 layers deep. The templates to render this into an attractive-to-look-at website are xslts with thousands of lines worth of xslt-foreach loops, also nested arbitrarily deep. When I tried to explain to the owner of this system that if you use a more normal XML format (and stop trying to treat it as some sort of ghetto array of arrays), you can write really simple xslts using apply-templates that would achieve the same thing with 10% of the code. Trying to write xpath queries against this garbage, though, just ensures that you don't hit everything because the same content type can appear within different parents at different nesting levels.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Ochowie posted:

This. I still don't understand what he hoped to achieve with checking the keys in.

Setting up environment variables or reading .gitignored config files is too hard. :iiam:

zergstain
Dec 15, 2005

Ender.uNF posted:

Hey, someone at NeXTApple sat down and came up with XML Plists and thought "good job self, this is brilliant and we should definitely unleash it upon the world". Every loving Xcode project, IB XIB/Storyboard, and serialized data is this positional XML format where the name of the attribute is in a tag called "key" and the value's type follows it as the next tag.

code:

<key>farts</key>
<true/>
<key>butts</key>
<dict>
    <key>sigh</key>
    <real>5.7</real>
</dict>

I'm guessing you're suggesting that key should be an attribute of the type tag, or XML is the wrong tool for serialization. I'm not sure which.

Assuming the former, is there some way in a DTD or w/e to say an attribute is mandatory or forbidden based on the parent element? Since <dict> requires keys and <array> forbids them.

loinburger
Jul 10, 2004
Sweet Sauce Jones
I was returning JSON from all of my controller methods; the front end developer apparently doesn't understand JSON and insists that I return strings so that he can do poo poo like "string.indexOf("Is Completed = true;") > -1". He also won't change that "Is Completed" to something like "isCompleted" and so I've got to do ridiculous variable name splitting with my toString builder. I hate him.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

zergstain posted:

I'm guessing you're suggesting that key should be an attribute of the type tag, or XML is the wrong tool for serialization. I'm not sure which.

Assuming the former, is there some way in a DTD or w/e to say an attribute is mandatory or forbidden based on the parent element? Since <dict> requires keys and <array> forbids them.
Yes, with XML Schema the same tag name can be used for two unrelated elements as long as you never make both elements valid in the same place.

ChickenWing
Jul 22, 2010

:v:

loinburger posted:

I was returning JSON from all of my controller methods; the front end developer apparently doesn't understand JSON and insists that I return strings so that he can do poo poo like "string.indexOf("Is Completed = true;") > -1". He also won't change that "Is Completed" to something like "isCompleted" and so I've got to do ridiculous variable name splitting with my toString builder. I hate him.

:psyduck:

brap
Aug 23, 2004

Grimey Drawer
Yeah you need to stop and correct that because that can only be the tip of an iceberg of horror.

loinburger
Jul 10, 2004
Sweet Sauce Jones
The problem is that my boss has a mild to moderate dislike for me because he used to be the back end developer, but they hired me to replace him because he was awful and I then rewrote all of his awful code (e.g. he was using Mongo for a transient queue - what the gently caress?) - so there's no point in asking him to arbitrate. My boss's boss thinks I'm awesome but he's also busy as hell, so I don't want to escalate anything to him unless it gets extremely ridiculous - in this case I wasted an hour or two on a variable name splitter, so meh.

canis minor
May 4, 2011

loinburger posted:

I was returning JSON from all of my controller methods; the front end developer apparently doesn't understand JSON and insists that I return strings so that he can do poo poo like "string.indexOf("Is Completed = true;") > -1". He also won't change that "Is Completed" to something like "isCompleted" and so I've got to do ridiculous variable name splitting with my toString builder. I hate him.

I'd return: Is Complеtеd = true; to brighten his day. Or I'd set him on fire, I don't know which one.

quote:

"Is Complеtеd = true;".indexOf("Is Completed = true;");
-1

:v:

e's are cyrillic

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

loinburger posted:

The problem is that my boss has a mild to moderate dislike for me because he used to be the back end developer, but they hired me to replace him because he was awful and I then rewrote all of his awful code (e.g. he was using Mongo for a transient queue - what the gently caress?) - so there's no point in asking him to arbitrate. My boss's boss thinks I'm awesome but he's also busy as hell, so I don't want to escalate anything to him unless it gets extremely ridiculous - in this case I wasted an hour or two on a variable name splitter, so meh.

I think that this counts as ridiculous. If this guy is demanding this as a change, imagine what the rest of his code looks like, and imagine the unmitigated maintenance nightmare it will become.

I mean, it's called JAVASCRIPT object notation, he doesn't even need to do anything to parse it!

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

loinburger posted:

The problem is that my boss has a mild to moderate dislike for me because he used to be the back end developer, but they hired me to replace him because he was awful and I then rewrote all of his awful code (e.g. he was using Mongo for a transient queue - what the gently caress?) - so there's no point in asking him to arbitrate. My boss's boss thinks I'm awesome but he's also busy as hell, so I don't want to escalate anything to him unless it gets extremely ridiculous - in this case I wasted an hour or two on a variable name splitter, so meh.

Well, I guess it depends on what your threshold is for finding things "extremely ridiculous", but insisting on doing some crazy string matching/parsing instead of using JSON or XML or something sane that anyone might have heard of, has got to come close. You have to think about whether the code you're writing is an asset to the company and whether you're helping the next person who'll do each of your jobs to do his or her job effectively, IMO.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



I feel like this is another one of those times where someone is going to have to ask -- why exactly are you working there of all places?

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

I had two coworkers who used to write that kind of stupid concatenation / indexOf tricks when they needed to store some information as a loose string.

However, that was because they had literally never heard the word "serialisation". Once I showed it to them, their reaction was "oh wow, I can do this stuff with a one-liner from the standard library and it works on any object? awesome!" and they were all too happy to delete their terrible functions.

What I'm saying is, your frontend developer is a terrible person before being a terrible frontend developer.

loinburger
Jul 10, 2004
Sweet Sauce Jones

piratepilates posted:

I feel like this is another one of those times where someone is going to have to ask -- why exactly are you working there of all places?

The idiot front-end developer is actually the most tolerable nemesis that I've had in a long time. Previously I had a senior programmer who wanted users to be able to upload youtube videos directly from our website (instead of uploading them to youtube and then pasting the link to our website), so he insisted that the correct way to do this was to allow users to upload whatever they wanted (including copyrighted porn) directly to the company's official youtube account even though Youtube Direct offered a much faster and safer alternative. Prior to that I had two senior developers who hated each other, and so we had crap like Spring dependency injection coupled with Guice dependency injection because one developer liked Spring and the other developer liked Guice and their boss wasn't competent enough to arbitrate. Prior to that I had a co-worker who didn't know how to reboot her computer and a co-worker who didn't understand the difference between && and ||. And so on. So now I'm a very broken person who views poo poo like "turn this JSON into an awful string" as "whatever, at least this rear end in a top hat isn't asking me the difference between && and ||"

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

loinburger posted:

The idiot front-end developer is actually the most tolerable nemesis that I've had in a long time. Previously I had a senior programmer who wanted users to be able to upload youtube videos directly from our website (instead of uploading them to youtube and then pasting the link to our website), so he insisted that the correct way to do this was to allow users to upload whatever they wanted (including copyrighted porn) directly to the company's official youtube account even though Youtube Direct offered a much faster and safer alternative. Prior to that I had two senior developers who hated each other, and so we had crap like Spring dependency injection coupled with Guice dependency injection because one developer liked Spring and the other developer liked Guice and their boss wasn't competent enough to arbitrate. Prior to that I had a co-worker who didn't know how to reboot her computer and a co-worker who didn't understand the difference between && and ||. And so on. So now I'm a very broken person who views poo poo like "turn this JSON into an awful string" as "whatever, at least this rear end in a top hat isn't asking me the difference between && and ||"
I am now much more confident in my abilities.

How do you not know the difference between && and ||? Maybe it's just because I teach logic on occasion but seriously, :psyduck:.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Ghost of Reagan Past posted:

I am now much more confident in my abilities.

How do you not know the difference between && and ||? Maybe it's just because I teach logic on occasion but seriously, :psyduck:.

&& is an rvalue reference, and || is string concatenation

loinburger
Jul 10, 2004
Sweet Sauce Jones
What was especially annoying is that he'd ask me whether he should use && or ||, and then he'd doubt my advice, e.g. "You should use && here" "Are you sure it shouldn't be ||?" "gently caress you". He was eventually fired for being an awful programmer. The one who didn't know how to reboot her computer was fired for falsifying her timecard ("I didn't know I wasn't allowed to do that!")

rarbatrol
Apr 17, 2011

Hurt//maim//kill.
I once discovered a bug in our software while on a support call, in a function which written to de-duplicate slashes within a string. It was, more or less, this:
code:
While input.IndexOf("\\") > -1
    input = input.Replace("\\", "\")
End While
The problem being that the detection was culture-insensitive and the replace was.

rarbatrol fucked around with this message at 02:03 on Sep 4, 2015

sarehu
Apr 20, 2007

(call/cc call/cc)
The real horror here is the VB string escaping.

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

sarehu posted:

The real horror here is the VB string escaping.

There's no string escaping in that snippet.

Sedro
Dec 31, 2008
How does the culture matter for backslashes?

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

Sedro posted:

How does the culture matter for backslashes?

In this instance, there was a string which had a slash, and then a myanmar unicode character, and then another slash. The replace simply didn't see the same pair of slashes that the indexOf did. (also I got the culture-sensitivity backwards in my original post, and corrected it)

sarehu
Apr 20, 2007

(call/cc call/cc)

rarbatrol posted:

There's no string escaping in that snippet.

Hence the horror...

Adbot
ADBOT LOVES YOU

ryde
Sep 9, 2011

God I love young girls

loinburger posted:

I was returning JSON from all of my controller methods; the front end developer apparently doesn't understand JSON and insists that I return strings so that he can do poo poo like "string.indexOf("Is Completed = true;") > -1". He also won't change that "Is Completed" to something like "isCompleted" and so I've got to do ridiculous variable name splitting with my toString builder. I hate him.

I don't suppose there's any way you can just commit it as actual JSON and tell him to deal with it, is there? Because whoever inherits that code is going to be cursing your name.

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