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.
 
  • Locked thread
Shaggar
Apr 26, 2006

master of the sea posted:

I have my first real terrible programmer question, i have an array of hashes where i sort the hashes based on their "due date" key, however, I also want to apply another level of sorting where i want all entries with a certain "type" key to drop to the bottom of the array.
the first part, sorting the array is simple enough, but the second part, what's a smart way to do it? I am using perl

change your sort comparison to first compare by type and if types are different return the comparison result. if types are the same, return the due date comparison

Adbot
ADBOT LOVES YOU

qntm
Jun 17, 2009

master of the sea posted:

I have my first real terrible programmer question, i have an array of hashes where i sort the hashes based on their "due date" key, however, I also want to apply another level of sorting where i want all entries with a certain "type" key to drop to the bottom of the array.
the first part, sorting the array is simple enough, but the second part, what's a smart way to do it? I am using perl

Perl's <=> operator returns -1, 0 or 1 based on the order of the things being compared. -1 is truthy, so you can use this result to short-circuit a boolean operation. So, something like

Perl code:
my @sorted = sort {
	defined $a->{"type"} <=> defined $b->{"type"}
	or $a->{"dueDate"} <=> $b->{"dueDate"}
} @array;

tef
May 30, 2004

-> some l-system crap ->

bobbilljim posted:

lol @ all the olds in this thread not grokking git

lol at all the youngs not grokking svn

it may not have had local commits but it actually had a user interface

there will never be an svn version of http://git-man-page-generator.lokaltog.net/

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
svn is very well designed, the mental model is clean, straightforward and easy to comprehend, the commands are straightforward and unambiguous.

git? well, git is very successful.

Arcsech
Aug 5, 2008
how is visual studio online for an idiot spare time asp.net-on-azure project that i want to keep organized because it may someday become a non-idiot public money making project (it probably wont)

e: also how lol-worthy is tfsvc vs. git? i know git well enough not to gently caress things up most of the time but id be down to use something better too

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

it was pretty cool that you could explain svn to someone in 30 mins even if they hadn't used version control before, and be comfortable that they weren't going to gently caress your repository sideways

Brain Candy
May 18, 2006

hobbesmaster posted:

c++, c#, c++/cli (can't wait to get rid of that project) and windows so it's all dlls and stuff

NuGet, i guess? only saying because I saw it as an option in nexus today

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Subjunctive posted:

it was pretty cool that you could explain svn to someone in 30 mins even if they hadn't used version control before, and be comfortable that they weren't going to gently caress your repository sideways

It's also hard to fuckup mercurial and about as easy to explain to a total noob.

Bloody
Mar 3, 2013

Arcsech posted:

how is visual studio online for an idiot spare time asp.net-on-azure project that i want to keep organized because it may someday become a non-idiot public money making project (it probably wont)

e: also how lol-worthy is tfsvc vs. git? i know git well enough not to gently caress things up most of the time but id be down to use something better too

idk download visual studio community edition and bask in the glory of visual studio?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Janitor Prime posted:

It's also hard to fuckup mercurial and about as easy to explain to a total noob.

yeah, I'm a mercurial partisan these days. glad we're moving from git to hg (though my team is still on perforce until I pick that fight).

Shaggar
Apr 26, 2006

Arcsech posted:

how is visual studio online for an idiot spare time asp.net-on-azure project that i want to keep organized because it may someday become a non-idiot public money making project (it probably wont)

e: also how lol-worthy is tfsvc vs. git? i know git well enough not to gently caress things up most of the time but id be down to use something better too

the vs online team fortress server works well and is super easy 2 setup.

MononcQc
May 29, 2007

Janitor Prime posted:

It's also hard to fuckup mercurial and about as easy to explain to a total noob.

FamDav
Mar 29, 2008

Subjunctive posted:

yeah, I'm a mercurial partisan these days. glad we're moving from git to hg (though my team is still on perforce until I pick that fight).

are you guys still on a single git repo?

Stringent
Dec 22, 2004


image text goes here

Janitor Prime posted:

It's also hard to fuckup mercurial and about as easy to explain to a total noob.

can you delete a branch yet?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i think we need a version control thread

FamDav
Mar 29, 2008

MALE SHOEGAZE posted:

i think we need a version control thread

gonna suck when we have to merge it back in tho

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Stringent posted:

can you delete a branch yet?

You can close them which is supposed to hide them which is good enough for my porpoises.

FamDav posted:

gonna suck when we have to merge it back in tho

We won't use svn

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

FamDav posted:

gonna suck when we have to merge it back in tho

http://forums.somethingawful.com/showthread.php?threadid=3688927

Arcsech
Aug 5, 2008

Bloody posted:

idk download visual studio community edition and bask in the glory of visual studio?

no visual studio online is sort of like github + pivotal + build server + load testing + a bunch of other stuff, not like a cloud version of visual studio despite the confusing name. it is a thing you use alongside visual studio community edition or w/e

Shaggar posted:

the vs online team fortress server works well and is super easy 2 setup.

how is team fortress version control vs git was more what i was going for with that part

although itll just be me working on it at least for now so it probablyu doesnt matter at all

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
tfs is just perforce isn't it?

also hg sounds nice

Bloody
Mar 3, 2013

Team fortress version whatever the gently caress is like part of visual Studio and a Microsoft product so it's probably really loving good

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Bloody posted:

Team fortress version whatever the gently caress is like part of visual Studio and a Microsoft product so it's probably really loving good

I'm pretty sure it's just perforce

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

FamDav posted:

are you guys still on a single git repo?

no

(in how many threads shall we do this dance?)

Soricidus
Oct 21, 2010
freedom-hating statist shill
I used to like git before it went mainstream. now I prefer this great little source control system you've probably never heard of

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

hobbesmaster posted:

multiple repos are good? then how do you get jenkins to build an installer or w/e that has code from multiple other jenkins projects?

in theory you would use your company's internal nuget server for this but nuget sucks unfortunately

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

hobbesmaster posted:

multiple repos are good? then how do you get jenkins to build an installer or w/e that has code from multiple other jenkins projects?

svn:externals dude

Shaggar
Apr 26, 2006

Arcsech posted:

no visual studio online is sort of like github + pivotal + build server + load testing + a bunch of other stuff, not like a cloud version of visual studio despite the confusing name. it is a thing you use alongside visual studio community edition or w/e


how is team fortress version control vs git was more what i was going for with that part

although itll just be me working on it at least for now so it probablyu doesnt matter at all

don't use git

Shaggar
Apr 26, 2006
team fortress server just works and also has good project, task, and build integration into visual studio as well as the source control.

power botton
Nov 2, 2011

Shaggar posted:

team fortress server just works and also has good project, task, and build integration into visual studio as well as the source control.

does it give you hats if you check in code and it builds

Shaggar
Apr 26, 2006
no but u can get cheevos https://visualstudiogallery.msdn.microsoft.com/ed9e23e2-ff50-43e3-9aa6-c91f27bd6a6d/

Shaggar
Apr 26, 2006
I bet u could make a hat add on tho

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Soricidus posted:

I used to like git before it went mainstream. now I prefer this great little source control system you've probably never heard of

is it hg i bet its hg

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
lmao @ git users.


"buuuuuh me write version control sfotware doo dee dah *drools on nappy*" - Linus

Shaggar
Apr 26, 2006
Linux torvoldos invented Linux and git and both are not very good.

tef
May 30, 2004

-> some l-system crap ->

rotor posted:

lmao @ git users.


"buuuuuh me write version control sfotware doo dee dah *drools on nappy*" - Linus

FamDav
Mar 29, 2008

Subjunctive posted:

no

(in how many threads shall we do this dance?)

oh did i ask this before? i'm just curious because i thought you guys were still running a monorepo, which i find interesting because of how it contrasts with our decidely not monorepo.

Space Whale
Nov 6, 2014
Got a terrible source control question.

So we were working on a class that has some reflection shenanigans going on, where if we add a column to a table that it looks at and we don't also add to the class (It's a DAC) a property that maps to that row, it bleats "PARAMETER NUMBER MISMATCH" or some poo poo. This is C# btw.

So, since me and like 5 other people in two states were told to "GET R DUN" we would pass the file around as we checked in so we'd have a copy of our stuff, merging branches as we go. This went fine for the dev branch/server. Welp then it's time for our UAT. Then our QA. Every time we have a terrible loving merge because we each have different successive versions of the same stupid DAC, and for some reason duplicates are just really hard for git to merge. And some cheeky fucker decided to change linespacing in our properties and their getters/setters.

What I'm asking, basically, is how this could be done better. We use git. We can't just, yanno, go from DEV -> UAT -> QA, we merge our branches (individually) all into dev, then uat, then qa, etc.

:geno:

Space Whale
Nov 6, 2014

Shaggar posted:

don't use git

Shaggar
Apr 26, 2006

Space Whale posted:

Got a terrible source control question.

So we were working on a class that has some reflection shenanigans going on, where if we add a column to a table that it looks at and we don't also add to the class (It's a DAC) a property that maps to that row, it bleats "PARAMETER NUMBER MISMATCH" or some poo poo. This is C# btw.

So, since me and like 5 other people in two states were told to "GET R DUN" we would pass the file around as we checked in so we'd have a copy of our stuff, merging branches as we go. This went fine for the dev branch/server. Welp then it's time for our UAT. Then our QA. Every time we have a terrible loving merge because we each have different successive versions of the same stupid DAC, and for some reason duplicates are just really hard for git to merge. And some cheeky fucker decided to change linespacing in our properties and their getters/setters.

What I'm asking, basically, is how this could be done better. We use git. We can't just, yanno, go from DEV -> UAT -> QA, we merge our branches (individually) all into dev, then uat, then qa, etc.

:geno:

1) don't use an orm and double don't use your own custom orm.

2) separate duties and assign one group to work on your data layer and stick it in a separate project and maybe separate repo if it makes sense. This eliminates conflicts cause no one is working on the same thing, people just work on what they're supposed to and check it in. Then the data team builds their library and publishes it to a central location as a nuget package.

the consumer that uses this lib just references the nuget package and never builds or looks at the source. when you go between environments you're only changing your config file that contains the database connections

this way neither group is dependent on the other's source code and if the data team is that bad with their design that they constantly gently caress poo poo up like that, it doesn't affect the people writing the actual application code.

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

FamDav posted:

oh did i ask this before? i'm just curious because i thought you guys were still running a monorepo, which i find interesting because of how it contrasts with our decidely not monorepo.

we have a few repos, but most of them are deployed in parts. www is the famous monorepo, but I'm not sure it's even a majority of our code at this point.

  • Locked thread