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
Superschaf
May 20, 2010

Vanadium posted:

On github we keep doing that thing where we send a pull request, someone reviews+comments on the commits and suggests changes, and then we amend our commits and push -f them to the pull-requested branch until the pull request gets accepted. I don't think that's that weird a workflow?

Why would you not just keep adding commits? If you think any commits are redundant (merge commits) you can just squash them together.

Adbot
ADBOT LOVES YOU

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

Superschaf posted:

Why would you not just keep adding commits? If you think any commits are redundant (merge commits) you can just squash them together.
If you've pushed them before you've squashed them you have to force push to remove the old (squashed) commits and replace them with the new one.

It's a really dumb default of the push command to push all branches and they are/have changed it but when you're used to having set a config variable that overrides this and end up in a different environment it can be easy to forget.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

I like the fact that he calls it an "involuntary" push. It evokes images of other antiperistaltic behavior.

teamdest
Jul 1, 2007

Sagacity posted:

antiperistaltic

What?

csammis
Aug 26, 2003

Mental Institution

The reverse of a peristaltic process. Peristalsis is the process of moving something through a hollow tube by compressing the sides of the tube. Swallowing is a good example - the digestive system uses peristalsis to move food from one end to the other.



In other words, :barf:

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
Thanks, csammis!

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


If only there was another way to find the definition of a word.

teamdest
Jul 1, 2007
It was more disbelief that the word came up, well, anywhere, but in the context of a bad git push of all things.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Vanadium posted:

On github we keep doing that thing where we send a pull request, someone reviews+comments on the commits and suggests changes, and then we amend our commits and push -f them to the pull-requested branch until the pull request gets accepted. I don't think that's that weird a workflow?

I am not against force pushing a PR branch but that requires you specify a 'repo+refspec' (e.g. git push --force origin +prbranch) to push to the intended branch. `git push --force` (as in literally just that command) is lazy and irresponsible, especially when he apparently had no clue which repos he was an owner of, had repos that were months behind, and didn't understand that GitHub lacks some 'no force push' feature.

My point isn't that he actually used git push --force as much as his apology was half 'sorry', half blaming other factors when it could have been averted by being a bit more diligent with using a dangerous git command.

astr0man
Feb 21, 2007

hollyeo deuroga
I still don't understand what he even intended to do when he push --force'd in multiple repositories at once.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
Right now the best source of documentation for the project I'm working on right now is the .edmx file for EF that's still part of the project, even though we stopped using EF.

That and actually poking into the database and webservices. We're copying a desktop app that called web services as we do a web app, and a lot of our documentation is screenshots put into a powerpoint with big red circles and boxes around things and "copy that."

I wonder if we should have a project horror thread.

Pollyanna
Mar 5, 2005

Milk's on them.


I think the real horror is that apparently Git doesn't implement protection against any malicious attempts at wiping literally everything on it.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Pollyanna posted:

I think the real horror is that apparently Git doesn't implement protection against any malicious attempts at wiping literally everything on it.

This is a preposterous canard.

Pollyanna
Mar 5, 2005

Milk's on them.


What do you mean? I could gain access to the mountains of open repos on there, git add . in an empty folder and do git push -f everything and tada the whole place is dead.

Vanadium
Jan 8, 2005

It's still all in the ref log. :colbert:

astr0man
Feb 21, 2007

hollyeo deuroga
The actual horror in your argument would be giving anonymous write/push access to whoever wants it and has nothing to do with git.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
If you chmod all your files 777, it is trivially easy for some other user to delete all your poo poo. This isn't a unix security vulnerability.

astr0man
Feb 21, 2007

hollyeo deuroga
rm is a coding horror because it allows me to rm -rf /

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Pollyanna posted:

I think the real horror is that apparently Git doesn't implement protection against any malicious attempts at wiping literally everything on it.

More accurately, Github doesn't, git has hooks that allow you to prevent a force push and there are git servers that let you disable it.
Here is where I shamelessly plug gitano, which I've got commits in, and its primary developer is going to do a talk about it at some conferences in the next couple of weeks.

shadowbolt
Dec 1, 2003

Rubber Ducky, you're the one...

astr0man posted:

rm is a coding horror because it allows me to rm -rf /

GNU rm doesn't unless you give --no-preserve-root. Not that that's the only dangerous case.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Pollyanna posted:

What do you mean? I could gain access to the mountains of open repos on there, git add . in an empty folder and do git push -f everything and tada the whole place is dead.

github != git

Plorkyeran
Mar 22, 2007

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

Thermopyle posted:

github != git

And github still doesn't just give you write access to everyone's repos.

Plorkyeran
Mar 22, 2007

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

astr0man posted:

I still don't understand what he even intended to do when he push --force'd in multiple repositories at once.
The only vaguely reasonable explanation I can think of is that he is very bad at pushing his personal working branches on a regular basis, and decided to solve that with a script to just push absolutely everything on his machine.

a lovely poster
Aug 5, 2011

by Pipski

Edison was a dick posted:

Here is where I shamelessly plug gitano, which I've got commits in, and its primary developer is going to do a talk about it at some conferences in the next couple of weeks.
Nice favicon

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Pollyanna posted:

What do you mean? I could gain access to the mountains of open repos on there, git add . in an empty folder and do git push -f everything and tada the whole place is dead.
You're going to cause a lot of inconvenience but you're not going to get rid of the actual repo as long as someone else has a copy. That is essentially one of the points for DVCS, no?

Mogomra
Nov 5, 2005

simply having a wonderful time

Mogomra's Project Manager posted:

Hey, Mogomra, I told our biggest client that you would fix all the retarded garbage data in this retarded table by 7am tomorrow morning. So fix all the garbage records by 7am tomorrow morning!
code:
CREATE TABLE `transactions` (
  `number` varchar(32) NOT NULL DEFAULT '0',
  `title` varchar(64) NOT NULL DEFAULT '',
  `auction_number` varchar(32) NOT NULL DEFAULT '',
  `type` varchar(16) NOT NULL DEFAULT '',
  `gross_detail_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `balance` text NOT NULL,
  `description` varchar(255) NOT NULL DEFAULT '',
  `vat_rate` varchar(255) NOT NULL DEFAULT '',
  `memo` text NOT NULL,
  `net_detail_amount` decimal(10,6) NOT NULL DEFAULT '0.000000',
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `location_id` int(10) NOT NULL DEFAULT '0',
  `is_fvf` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`number`,`auction_number`,`date`,`type`),
  KEY `number` (`number`),
  KEY `auction_number_description_gross_detail_amt` (`auction_number`,`description`,`gross_detail_amount`),
  KEY `is_fvf` (`auction_number`,`is_fvf`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The cool thing about the "primary key" is that none of those columns are always unique to the rest of the data. Also, type is always an empty string.

We use the table to store eBay listing fees on client's eBay listings (along with a poo poo ton of other different kinds of fees). We never checked anywhere to make sure we're not saving the same fee twice until I was assigned this ticket. The location_id is supposed to relate to the client's store that is being charged the fee. You'd think we'd check to make sure we're saving the fee to the correct store, but nope! We've also been doing this since 2009 at the latest.

There are now over 15k records just for this client alone that either are a duplicate of a fee they were charged, or are saved to the wrong store, or both. Also, it's impossible to tell whether or not the location_id is correct unless you do two joins on other incredibly large tables. All of the data in this table is business critical unless of course they're duplicate records. :shepicide:

Edit: Ah, I just found out he promised 7pm tonight instead of 7am tomorrow.

Mogomra fucked around with this message at 06:44 on Nov 13, 2013

EAT THE EGGS RICOLA
May 29, 2008

That sounds like a job for Open Refine. Or it would if it wasn't completely ridiculous already.

zokie
Feb 13, 2006

Out of many, Sweden
What is the point of NOT NULL DEFAULT = ''? One of my colleagues insists on doing this because "then you don't have to check for NULL when making reports", but UUUUGGGHHH

Dietrich
Sep 11, 2001

Pollyanna posted:

What do you mean? I could gain access to the mountains of open repos on there, git add . in an empty folder and do git push -f everything and tada the whole place is dead.

Too bad literally everyone who ever worked on the repo you killed has all the commits and content in their copy of the repo or that might be a problem.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

zokie posted:

What is the point of NOT NULL DEFAULT = ''? One of my colleagues insists on doing this because "then you don't have to check for NULL when making reports", but UUUUGGGHHH

There are DB experts who believe NULL values should never exist. (I'm pretty sure they don't want you to just replace them with empty strings, though.)

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Essentially, absence of a field should be indicated by just not having a row for it at all. NULLs are only useful when you've denormalized your data such that you can't do that any more.

Disallowing nulls but having a non-null "empty" value in their place seems a bit cargo-culty to me. I guess it could have some value if you legitimately want the empty string to be printed out when there's no data, but that seems like bad separation of concerns with how you're polluting the data model with application logic.

zokie
Feb 13, 2006

Out of many, Sweden

Jabor posted:

Essentially, absence of a field should be indicated by just not having a row for it at all. NULLs are only useful when you've denormalized your data such that you can't do that any more.

Over 9000 NF? And how the hell do you accomplish that?

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Jabor posted:

Disallowing nulls but having a non-null "empty" value in their place seems a bit cargo-culty to me. I guess it could have some value if you legitimately want the empty string to be printed out when there's no data, but that seems like bad separation of concerns with how you're polluting the data model with application logic.

In MySQL it's typically done so the "empty" value is always an empty string instead of sometimes an empty string and sometimes null.

..btt
Mar 26, 2008
What's the problem with that approach, provided that you don't care about the difference between no value and an empty string? I mean, if you do then it's stupid, otherwise it can eliminate the need for a whole load of pointless null checks in your code.

e: vvv sorry, should have quoted, I was asking zokie why he had a problem with the NOT NULL DEFAULT approach

..btt fucked around with this message at 17:30 on Nov 13, 2013

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

..btt posted:

What's the problem with that approach, provided that you don't care about the difference between no value and an empty string? I mean, if you do then it's stupid, otherwise it can eliminate the need for a while load of pointless null checks in your code.

I don't have a problem with it. Some might argue that fields with potentially empty values belong in a related table, but it's not always worth the hassle. I'd rather not have to do a bunch of left joins just because a few customers might not have a middle name or whatever.

Dollas
Sep 16, 2007

$$$$$$$$$
Clapping Larry
code:
if (IsDownloadComplete != true)
{
     MessageBox.Show("Download complete.");
}
I want to add a //welp and recommit.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
All this is moot on ~*Oracle*~ because '' IS NULL there...

..btt
Mar 26, 2008
Every time I read that there's a part of me that believes it's not really true, nobody could design a database that isn't null aware and have, of all people, financial institutions adopt it as their standard RDBMS. It's some in-joke among Oracle-types... right guys? :ohdear:

npe
Oct 15, 2004
It's not that Oracle isn't aware of nulls - it's that the empty string is special case transformed into nulls for you.

It actually used to be possible to accidentally get around this, and forcefully load in empty strings (using their bulk loader utility). These values would not count as nulls but couldn't be queried out unless you did things weird, like specifying length of 0 (since where foo = '' won't work, as '' is immediately transformed into NULL).

Adbot
ADBOT LOVES YOU

Houston Rockets
Apr 15, 2006

code:
# need to skip the first two lines

first_line = True
second_line = False

for line in data:

    if first_line:
        first_line = False
        second_line = True
        continue
    if second_line:
        second_line = False
        continue

    do_stuff(line)

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