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
LongSack
Jan 17, 2003

Question about implementing searches. Prior to using nHydrate, my ticket search was basically a window that allowed me to select a field to search, a string to search for, whether to do an exact match, a requester and start and end dates. I can also select whether the search parameters should be treated as "or" or "and". In code behind, what happened was that a sql query was generated and fed into my TicketDAL class to get a matching list of tickets.

Using nHydrate, I figured out how to do "and" searches by using chained extension methods, so that my SearchClick() method looks like this:
C# code:

Tickets = new ObservableCollection<Ticket>(from t in Context.Ticket select t)
    .Search(SelectedField,SearchText,Exact)
    .ByRequester(SelectedRequester)
    .ByDate(StartDate,EndDate);

Where (for example) ByRequester looks like this:
C# code:

public static ObservableCollection<Ticket>(this ObservableCollection<Ticket> tix, Requester r)
{
    if (r == null || r.ID == -1)
        return tix;
    return new ObservableCollection<Ticket>(from t in tix where t.RequesterId == r.ID select t);
}

(The "-1" special case is there because the source for the Requester combo box has a fake Requester inserted at index 0 with an ID of -1 and a name of "All Requesters".)

This works great for "and" searches, but I can't think of a good way to implement "or" searches, short of a gnarly bunch of if/then/else blocks. Ideas? TIA

Adbot
ADBOT LOVES YOU

brap
Aug 23, 2004

Grimey Drawer
At the price they're offering OzCode at you might as well spring for Rider.

Night Shade
Jan 13, 2013

Old School
I got the jetbrains toolbox subscription at the apology special price. Totally worth it. Rider surprised me actually, I wasn't expecting it to be as well featured as it is for a first version.

Huge ram hog though, it's running intellij's code model and a standalone resharper analysis engine out of process.

EssOEss
Oct 23, 2006
128-bit approved

quote:

Question about implementing searches

I no longer have any sample code available but back when I implement a search that offered the user great flexibility, the way I did it was that all the GUI operations built Expressions that later got assembled down into the Where() arguments at runtime. Along the lines of:

code:

public IQueryable<Customer> Search()
{
    var userInput = GetSearchOptionsFromWebsiteInput();

    var result = PrepareForQuery(database.Customers, userInput); // Settings like order by and whatnot, as defined by user.

    var query = AssembleQuery(userInput);
    result = result.Where(query); // The actual query by fields
    result = AddGlobalSearchOptions(result, userInput); // Limiting max number of entities, paging and such

    return result;
}

// Probably the wrong type
private Expression<Predicate<Customer>> AssembleQuery(SearchOptions userInput)
{
    var result = NullExpression; // Just making stuff up, I completely forget how you assemble expressions

    foreach (var alternative in userInput.QueryAlternatives)
    {
        var matchFields= NullExpression;

        foreach (var field in alternative.Fields)
        {
            // "and" the fields together
            matchFields = AddFieldToExpressionUsingAndCombining(field.Key, field.Value, field.ComparisonOperation, matchFields);
        }

        // "or" the rows together
        result = MergeExpressionsUsingOrCombining(thisAlternativeMatchingExpression, result);
    }
}
All pseudocode, obviously - I completely forget how it actually worked except that it worked very well.

LongSack
Jan 17, 2003

EssOEss posted:

...snip...

Thanks for the response. While I was puzzling over it this morning, I thought harder on the problem and realized that I was unable to come up with a single use case where I would actually need an "or" search. When searching for a ticket, I generally either have one concrete piece of information (say a Task or a Work Order number) or else I have a date range and possibly a Requester. My existing search handles all that as is, so I'm not gonna mess with it.

Gul Banana
Nov 28, 2003

https://twitter.com/joebelfiore/status/917071399541391360 rip
can we ditch UWP next?

mystes
May 31, 2006

From what I've been reading, it seems like there are people within Microsoft who hate .net and like UWP because it provides an alternative vision where .net isn't the only way to produce WPF applications going forward, so I can't see those people giving up on UWP any time soon. Maybe they could give up on the store and try to integrate the desktop .net framework and UWP again though? I don't know if that would be possible.

mystes fucked around with this message at 13:55 on Oct 9, 2017

Dietrich
Sep 11, 2001

Sab669 posted:

Do any of you guys use Visual SVN's sever tool? My boss asked me to look into it as we're upgrading all of our servers, but I've never managed a version control sever so I don't really have anything to compare its features to :shrug:

Reviews seem well and good, but we're a small company with 5 programmers supporting 3 main products so I don't know if any of it really matters to us.

USE GIT.

LongSack
Jan 17, 2003


I can't tell what we're RIPing here - Windows 10 Mobile?

Munkeymon
Aug 14, 2003

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



LongSack posted:

I can't tell what we're RIPing here - Windows 10 Mobile?

Windows Phone :rip:

Too bad, too, because it's pretty slick. I'd use it if not for the lack of apps.

mortarr
Apr 28, 2005

frozen meat at high speed
At my work we currently use an in-house tfs server, but only really use it as a dumping ground for source code and don't use any work item stuff, team stuff or probably a whole bunch of features and we're wondering if we're getting value for money.

At home I use bitbucket/git, which I really like, but I'm not sure if that would scale.

Anyone got any tips for a team of eight with maybe 50-80 active projects looking for an alternative to tfs?

amotea
Mar 23, 2008
Grimey Drawer
Git scales my friend.

Pilsner
Nov 23, 2002

amotea posted:

Git scales my friend.
But only so far:

https://blogs.msdn.microsoft.com/bharry/2017/05/24/the-largest-git-repo-on-the-planet/

amotea
Mar 23, 2008
Grimey Drawer
That's a lot to cram into one repo, nice.

I wonder how it performs if you just clone the whole 300GB repo to a fast SSD, I can't really find the part where they explain exactly why that didn't work.

(I'm sure it's slow, but the articles gloss over it and jump straight to the virtualization part)

Hughlander
May 11, 2005


Serious answer though it does now. One of my friends is on that team and it's amazing what they've done. Commits going back dozens of years.

Dietrich
Sep 11, 2001

Git scales just fine for 99.999999999999% of software projects, teams, and companies.

mortarr
Apr 28, 2005

frozen meat at high speed

Dietrich posted:

Git scales just fine for 99.999999999999% of software projects, teams, and companies.

A follow-up then - is anyone using any paid-for git-based hosted service? I guess I'm looking for unlimited private repos, jira integration, ldap/active directory integration, maybe some kind of continuous integration ability. Any other handy features I should look for when comparing?

If the whole windows repo is now on git, is TFS going to be discontinued?

NihilCredo
Jun 6, 2011

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

mortarr posted:

A follow-up then - is anyone using any paid-for git-based hosted service? I guess I'm looking for unlimited private repos, jira integration, ldap/active directory integration, maybe some kind of continuous integration ability. Any other handy features I should look for when comparing?

Gitlab has all the things you list and works very well. I'm using the hippie freeloader community edition, as a pair of Docker containers on our own servers - and that was pretty much only because I wanted to learn how to set up a CI runner from scratch, otherwise a free cloud account would have been enough.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

mortarr posted:

A follow-up then - is anyone using any paid-for git-based hosted service? I guess I'm looking for unlimited private repos, jira integration, ldap/active directory integration, maybe some kind of continuous integration ability. Any other handy features I should look for when comparing?

If the whole windows repo is now on git, is TFS going to be discontinued?

TFS does all of those things already. Microsoft is moving everyone to VS Team Services internally as a dogfooding thing. It's not going anywhere.

spaced ninja
Apr 10, 2009


Toilet Rascal

New Yorp New Yorp posted:

TFS does all of those things already. Microsoft is moving everyone to VS Team Services internally as a dogfooding thing. It's not going anywhere.

Reminder that TFS and TFVC are two different things. TFS is just the all lifecycle stuff and can use either TFVC or git as the source control. We use Team Services at work and it's pretty decent (and free for 5 developers).

EssOEss
Oct 23, 2006
128-bit approved
I can also attest to Team Services (VSTS) being awesome. The development cadence by Microsoft is also pretty impressive - new features out every month and actual live developers responding to me when I report issues. I was amazed when I had them offer to apply a hotfix to my account in less than 24 hours from my report.

Pilsner
Nov 23, 2002

We've also used both TFS team stuff and TFS version control at work for a decade. I've never had much of a problem with either, but our project managers (aka. non-productive staff) always complained about a lack of overview in TFS team, until the past 1-2 years where MS has really put in some new features quickly and made it more modern.

I've also never had a problem with TFS version control; it's simple, reliable, and easy for new people to learn in 5 minutes, but alas, new hires have insisted and convinced management to switch everything to Git+GitFlow, so now everything is chaos (except on my little team, we stay on TFS). Not a day goes by where I don't hear my former co-workers be confused about how to do what in Git, and the branching madness. Oh well.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

New Yorp New Yorp posted:

TFS does all of those things already. Microsoft is moving everyone to VS Team Services internally as a dogfooding thing. It's not going anywhere.

That's the goal, but there are still areas that VSTS doesn't cover yet, like handling open source repos that require a public/private divide. .Net core, Mono, and the other open source Xamarin bits are still built on Jenkins.

But most people here are not going to have those issues. Generally, I like VSTS and they are doing a good job of listening to feedback so we can get on it faster.

Nova69
Jul 12, 2012

I started my graduate job at this place a month ago, and they currently use on-premises TFS, there's been murmurings about moving to VSTS but nothing concrete, what's the difference between the two systems? Presumably both use the TFS version control system?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Nova88 posted:

I started my graduate job at this place a month ago, and they currently use on-premises TFS, there's been murmurings about moving to VSTS but nothing concrete, what's the difference between the two systems? Presumably both use the TFS version control system?

Someone said this earlier but I'll emphasize: TFVC and TFS are not the same thing. TFS is a platform, which supports two version control systems: Git and TFVC (unless you're running a 5+ year old version of TFS, in which case god help you). TFVC is an old-school Subversion-style centralized VC system. Git is Git, and they've built enterprisey Git features like Pull Requests and the like.

TFS and VSTS are the same platform, except VSTS is cloud-hosted by Microsoft and free for 5 users. TFS gets roughly quarterly updates and requires a multi-tier enterprisey installation architecture. VSTS is updated every 3 weeks with no intervention on your part.

The only hardware you'll want on-prem for VSTS is (most likely) build/deployment infrastructure. There's a hosted agent pool but 1) it costs money beyond 240 minutes a month, 2) you have no control over the software loadout, 3) Each build runs on a separate VM so there's no caching of stuff. The build/deploy agent is .NET core and runs on Windows , MacOS, and various flavors of Linux. It takes about 5 seconds to install and auto-updates.

You can basically do a "lift and shift" operation from on-prem to VSTS as long as your version of TFS is recent (the requirements change as new on-prem versions are released). You detach your TFS collection, run an import tool, and it tells you what needs to happen to convert it into a Team Services account. It's not pain-free but it's way better than any of the alternatives (and trust me, I've seen them all).

New Yorp New Yorp fucked around with this message at 14:51 on Oct 11, 2017

Dietrich
Sep 11, 2001

Pilsner posted:

We've also used both TFS team stuff and TFS version control at work for a decade. I've never had much of a problem with either, but our project managers (aka. non-productive staff) always complained about a lack of overview in TFS team, until the past 1-2 years where MS has really put in some new features quickly and made it more modern.

I've also never had a problem with TFS version control; it's simple, reliable, and easy for new people to learn in 5 minutes, but alas, new hires have insisted and convinced management to switch everything to Git+GitFlow, so now everything is chaos (except on my little team, we stay on TFS). Not a day goes by where I don't hear my former co-workers be confused about how to do what in Git, and the branching madness. Oh well.

"Branching Madness"

Nova69
Jul 12, 2012

New Yorp New Yorp posted:

Someone said this earlier but I'll emphasize: TFVC and TFS are not the same thing. TFS is a platform, which supports two version control systems: Git and TFVC (unless you're running a 5+ year old version of TFS, in which case god help you). TFVC is an old-school Subversion-style centralized VC system. Git is Git, and they've built enterprisey Git features like Pull Requests and the like.

TFS and VSTS are the same platform, except VSTS is cloud-hosted by Microsoft and free for 5 users. TFS gets roughly quarterly updates and requires a multi-tier enterprisey installation architecture. VSTS is updated every 3 weeks with no intervention on your part.

The only hardware you'll want on-prem for VSTS is (most likely) build/deployment infrastructure. There's a hosted agent pool but 1) it costs money beyond 240 minutes a month, 2) you have no control over the software loadout, 3) Each build runs on a separate VM so there's no caching of stuff. The build/deploy agent is .NET core and runs on Windows , MacOS, and various flavors of Linux. It takes about 5 seconds to install and auto-updates.

You can basically do a "lift and shift" operation from on-prem to VSTS as long as your version of TFS is recent (the requirements change as new on-prem versions are released). You detach your TFS collection, run an import tool, and it tells you what needs to happen to convert it into a Team Services account. It's not pain-free but it's way better than any of the alternatives (and trust me, I've seen them all).

We're currently on TFS 2015, but using TFVC, which has been quite an adjustment for me as I've only ever used git before. The murmurings regarding moving to VSTS have mentioned having lose our version control history with a move to VSTS...

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Nova88 posted:

We're currently on TFS 2015, but using TFVC, which has been quite an adjustment for me as I've only ever used git before. The murmurings regarding moving to VSTS have mentioned having lose our version control history with a move to VSTS...

https://docs.microsoft.com/en-us/vsts/articles/migration-overview

You'll need to be on TFS 2017 to do it, and the target will change to TFS 2018 later this year/early next year.

Or, if you just want to move source code, you can typically use Git-TFS.

1) Git-TFS from on-prem to turn your TFVC repo into a Git repo with all history intact
2a) Git-TFS to VSTS to play back the history migrated in Step #1 to VSTS
or
2b) Add an empty Git repo to VSTS, add a remote to your local Git repo, and force push the repo created in Step #1.

brap
Aug 23, 2004

Grimey Drawer

Pilsner posted:

We've also used both TFS team stuff and TFS version control at work for a decade. I've never had much of a problem with either, but our project managers (aka. non-productive staff) always complained about a lack of overview in TFS team, until the past 1-2 years where MS has really put in some new features quickly and made it more modern.

I've also never had a problem with TFS version control; it's simple, reliable, and easy for new people to learn in 5 minutes, but alas, new hires have insisted and convinced management to switch everything to Git+GitFlow, so now everything is chaos (except on my little team, we stay on TFS). Not a day goes by where I don't hear my former co-workers be confused about how to do what in Git, and the branching madness. Oh well.

When I think of my experience with TFVC, I think of files with no changes that are listed in my pending changes anyway because they've been "checked out". I think of Visual Studio refusing to let me edit a file because the VPN went down (clients who insist on TFS also insist we VPN to their on-site TFS) or someone believed I shouldn't have the right to check out that file. I think of being unable to rename a file because someone somewhere has it checked out. I think of waiting for network operations to complete in order to view the history of changes to a file.

Were we misusing TFVC, or perhaps using some outdated variant of it?

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!

fleshweasel posted:

When I think of my experience with TFVC, I think of files with no changes that are listed in my pending changes anyway because they've been "checked out". I think of Visual Studio refusing to let me edit a file because the VPN went down (clients who insist on TFS also insist we VPN to their on-site TFS) or someone believed I shouldn't have the right to check out that file. I think of being unable to rename a file because someone somewhere has it checked out. I think of waiting for network operations to complete in order to view the history of changes to a file.

Were we misusing TFVC, or perhaps using some outdated variant of it?

No, those are all downsides to TFVC (and most other centralized VC for that matter) but it's still entirely possible to get work done efficiently with them. Yes, it depends on a reliable connection to the VC server and a flakey VPN blocks that, but that can be solved at the IT level rather than switching VC platforms.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

fleshweasel posted:

When I think of my experience with TFVC, I think of files with no changes that are listed in my pending changes anyway because they've been "checked out". I think of Visual Studio refusing to let me edit a file because the VPN went down (clients who insist on TFS also insist we VPN to their on-site TFS) or someone believed I shouldn't have the right to check out that file. I think of being unable to rename a file because someone somewhere has it checked out. I think of waiting for network operations to complete in order to view the history of changes to a file.

Were we misusing TFVC, or perhaps using some outdated variant of it?

Local workspaces solve almost all of those problems.

Dietrich
Sep 11, 2001

If git is too confusing to you to switch from TFVC just use git and never branch anything, because even there it's vastly superior.

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!

Dietrich posted:

If git is too confusing to you to switch from TFVC just use git and never branch anything, because even there it's vastly superior.

What if your TFVC has release branches?

I love git. I use it at my current job after years of Perforce and I'm glad I do. I would recommend it for any new non-game project. But I do get tired of git-heads pretending that it's zero cost to migrate a team to git.

Pilsner
Nov 23, 2002

fleshweasel posted:

When I think of my experience with TFVC, I think of files with no changes that are listed in my pending changes anyway because they've been "checked out". I think of Visual Studio refusing to let me edit a file because the VPN went down (clients who insist on TFS also insist we VPN to their on-site TFS) or someone believed I shouldn't have the right to check out that file. I think of being unable to rename a file because someone somewhere has it checked out. I think of waiting for network operations to complete in order to view the history of changes to a file.

Were we misusing TFVC, or perhaps using some outdated variant of it?

You're right that the whole "checkout / checkin" concept is pretty old fashioned. I prefer SVN's concept where it's just code code code (in any file you want)..... "commit". Of course committing to the central repo will require an internet connection, just like it does in Git.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Pilsner posted:

I prefer SVN's concept where it's just code code code (in any file you want)..... "commit".

TFVC local workspaces do exactly that.

mortarr
Apr 28, 2005

frozen meat at high speed

New Yorp New Yorp posted:

unless you're running a 5+ year old version of TFS, in which case god help you

Ahaha... my org has a long history of not updating software - I think it was you I was bugging a few years back about migrating from VSS to TFS, and now here I am again.

Gul Banana
Nov 28, 2003

Eggnogium posted:

What if your TFVC has release branches?

I love git. I use it at my current job after years of Perforce and I'm glad I do. I would recommend it for any new non-game project. But I do get tired of git-heads pretending that it's zero cost to migrate a team to git.

it’s not so much that it’s zero-cost; it’s that the benefits always outweigh the costs. the distributed model is so much better that even for the most change-averse of teams it’s easy to predict it will be a worthwhile switch

Pilsner
Nov 23, 2002

Gul Banana posted:

it’s not so much that it’s zero-cost; it’s that the benefits always outweigh the costs. the distributed model is so much better that even for the most change-averse of teams it’s easy to predict it will be a worthwhile switch
How can you say the benefits always outweight the costs, no matter how great the costs?

Dietrich
Sep 11, 2001

Pilsner posted:

How can you say the benefits always outweight the costs, no matter how great the costs?

It'd be pretty strange that 99% of modern development proceeds under git and microsoft is moving to git if it weren't better than svn or tfvc.

Adbot
ADBOT LOVES YOU

Hughlander
May 11, 2005

Pilsner posted:

How can you say the benefits always outweight the costs, no matter how great the costs?

Most likely limited experience. Like my last project had a 5 year code history, ~3-400 gigs of source assets that would be cooked to ~50 gig of binary assets. We went with a split source control system of p4 for content, git for code. And just keeping the two in lockstep was a huge pain in the rear end. We tried everything, git-lfs, set of scripts that were basically git-lfs (upload blobs to an s3 bucket, with a manifest file to sync them elsewhere and then sym link them to their final place, etc...) It was always a huge pain to deal with. On the current one we just went full p4. I still loving hate p4 but it handles the case of a large amount of source code + even larger binary assets better for end users than anything else.


But god I hate p4.

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