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
Che Delilas
Nov 23, 2009
FREE TIBET WEED

epalm posted:

This is how I do it. I have Services (what you just referred to as Managers) which represents The App (which is its own VS class lib) which sits in between the UI (an ASP.NET controller, a WPF viewmodel, etc) and a datastore (SQL Server, WhateverNoSql, InMemoryMock, etc). I end up with app.dll which contains all the services and business logic and has no references to anything but does define repository interfaces, data.dll has a reference to app.dll and implements the interfaces in whichever way it needs to (entity framework, for example), and at that point you can tack on an ASP/Console/WPF project which has a reference to app.dll (and probably to data.dll if you're doing IoC just to specify which datastore your app wants to use).

See, I like the way this sounds. I already have separate projects for my Domain and my UI, but my data access layer is folded into the domain. It arguably belongs there, but I think it's been muddying my mental waters a bit when it comes to thinking about where certain operations belong. Explicitly separating the data layer may help me with that, even if it does introduce extra complexity when it comes to the other data operations (which don't at the moment require extra calculation the way adding an Item does).

Adbot
ADBOT LOVES YOU

ninjeff
Jan 19, 2004

Dietrich posted:

I don't know. The Repository should know how to ferry data to and from a database, and that's pretty much it.

At the very least, you should put the new SKU calculation code into it's own class where you can mock the data coming from the database, then set up test cases where you pass it data that should lead to various scenarios and validate that the result is what you expect.

It doesn't really seem like a calculation you can efficiently perform in memory in the general case, though - what could the repository-agnostic input be, other than "a list of all the SKUs currently in use"? Or am I misunderstanding what you're suggesting?

This is going to be a trade-off between efficiency and having your business logic in code. In this case I would err on the side of efficiency because it's a very simple but data-intensive calculation that admits quite a lot of database optimization. There are definitely situations where I would give up some efficiency for the sake of keeping logic in code, though.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
I started playing with SignalR tonight, it's pretty neat. Any ideas on best practices for actually using it in conjunction with WebAPI? I have an idea for a goofy little game.

raminasi
Jan 25, 2005

a last drink with no ice
I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

Che Delilas posted:

Right now the new Items are being created by the ASP.NET MVC model binder (i.e. behind the scenes when the user posts the form). Is it possible to modify or replace the model binder with something that could use an ItemFactory?

...

The factory sounds like the ticket, I'm just not sure how to work it into the MVC framework. If it's possible, I'm sure I can find out how.

Simple answer: don't do it.

The problem here is that you've got a domain model as an Action method parameter. Change your method signature to accept all the primitive types that you need to instantiate an item and pass that to a factory on your own (or a service/manager/whatever).

glompix
Jan 19, 2004

propane grill-pilled

Ithaqua posted:

I started playing with SignalR tonight, it's pretty neat. Any ideas on best practices for actually using it in conjunction with WebAPI? I have an idea for a goofy little game.

I'm actually wondering this too. I have a pet project I'm about to bring SignalR into, and am just thinking of ditching the MVC controller I'm using for data services and using SignalR for everything. Websockets just make more sense for implicit/instant saves, which I'm wanting to move to.

GoodCleanFun
Jan 28, 2004

GrumpyDoctor posted:

I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently.

I think you could do something similar to this attached behavior solution: http://znite.wordpress.com/2010/02/20/mvvm-mouseover-binding/.

Essential
Aug 14, 2003
I was under the impression that with Entity Framework I could eagerly load to my heart's content, but I'm not seeing that happen. I thought I could just do this:

code:
Dim entityList = (From s In entityContext.Entity1.Include("Entity2.Entity3")
Where Entity1.Property = "value"
Select s()).ToList()
But that's not loading Entity2 or Entity3 until I navigate to one of their properties. I thought by using the "Include" I would force EF to load the parent and all related entities immediately.

I'm trying to make 1 call to sql to get all of the data I need but unfortunately I'm making the first and then 2 for every enumeration on the entityList.

Is there no way to force EF to load all this data?

raminasi
Jan 25, 2005

a last drink with no ice

GoodCleanFun posted:

I think you could do something similar to this attached behavior solution: http://znite.wordpress.com/2010/02/20/mvvm-mouseover-binding/.

This is close, but I don't know enough WPF to be able to extend it. My problem is that he's binding an item (a Person) in his ListBox to his viewmodel's CurrentPerson property, and using properties of that Person to generate his description text, but I want to use Button objects, which don't have description text. I guess I could roll my own "Button-with-description-text" subclass, but that seems overkill.

epswing
Nov 4, 2003

Soiled Meat
Maybe just hijack one of the string Dependency Properties like ToolTip? Put the description in there. I think there are ways of disabling or hiding tooltips. Then use theButton.ToolTip in whatever binding you need.

Sedro
Dec 31, 2008

GrumpyDoctor posted:

I've got a WPF control with a bunch of buttons and a "description" label. I want the description text to be updated whenever a button is hovered (with an explanation of what the button does). What's the best way to do this? Some kind of trigger wizardry? Just saying "gently caress it" and writing two code-behind events for each button? Binding directly to IsMouseOver isn't possible, apparently.

XML code:
<StackPanel>
    <Button x:Name="FirstButton" Content="First"/>
    <Button x:Name="SecondButton" Content="Second"/>
    <Button x:Name="ThirdButton" Content="Third"/>
    <Label>
        <Label.Style>
            <Style TargetType="{x:Type Label}">
                <Setter Property="Content" Value="Nothing hovered"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=FirstButton}" Value="True">
                        <Setter Property="Content" Value="First button hovered"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=SecondButton}" Value="True">
                        <Setter Property="Content" Value="Second button hovered"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsMouseOver, ElementName=ThirdButton}" Value="True">
                        <Setter Property="Content" Value="Third button hovered"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Label.Style>
    </Label>
</StackPanel>

Qaz Kwaz
Jul 24, 2003
What's your email? I've got some shitty posts that you NEED to read.
Does anyone have experience doing continuous deployment from Bamboo to Azure?

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I have a pretty specific question that I'm hoping someone can help with. I'm using DevExpress ASP.NET components in MVC and I'm having some trouble getting a GridView to behave correctly.

I can get the data loaded into the grid, and I can get the paging/sorting to work for the first click, but it then leaves me with a loading panel that won't go away. I've posted some more specific information and code examples here: http://stackoverflow.com/questions/21273148/devexpress-asp-net-mvc-gridview-callbacks-result-in-infinite-loading-animation

I'm going a little nuts trying to figure this out. I get no Javascript errors, the information is clearly coming back okay because the GridView refreshes with the (for example) second page of data but it just won't quit with the loading panel.

I've Googled the heck out of this and even though I've found a few instances of people having a similar problem, I can't find anything that fixes it for me.

Edit: never mind, it was a really, really stupid error on my end

putin is a cunt fucked around with this message at 06:21 on Jan 29, 2014

chippy
Aug 16, 2006

OK I DON'T GET IT
Is migrating projects between different versions of Visual Studio generally safe? I work on a variety of projects and generally open them in whatever version they've been created with, but I have one older VB.NET project that's in VS 2008, which has been annoying me so I just opened it up in 2013. It seems to be building and running ok so far, but are there any pitfalls I should be aware of? It was the full version of VS 2008 and this is the express edition of 2013, and it's a WPF app, if any of those things make a difference.

e: One thing I have noticed is that it's automatically switched the target platform from 3.5 to 4.0 without asking me.

chippy fucked around with this message at 11:00 on Jan 30, 2014

zerofunk
Apr 24, 2004
Depending on what you're doing, you may find that support for certain project types is discontinued between versions. I think this has been a bit more common with web related projects in the past. I don't primarily work in Visual Studio, so I don't have a lot of experience with it. I do know that we currently have setup projects in a 2010 solution and I believe they dropped support for those in 2012.

It probably goes without saying, but you definitely want things in source control before you migrate. I think Visual Studio does produce a report of what was changed. However, I'd still want to look at diffs for things like the project files.

chippy
Aug 16, 2006

OK I DON'T GET IT
Oh yeah, everything's in source control so there's no danger of my hosing it into some unrecoverable state, and I took a copy to migrate and see what happened anyway. The migration report shows only the project/solution files being changed, none of the source files seemed to be touched at all. Haven't diffed the files yet to see what actually changed. The only thing that seemed to break was a reference to System.Windows.Forms.DataVisualization, which seemed kind of strange, but I was able to just add the ref back in, maybe it was just a different version or something. Might have been something to do with going from .NET 3.5 to 4.0 I guess.

I've carried on work in 2008 for now though as I've got poo poo to do, maybe I'll come back to it later.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug
The biggest problem I've ran into is VS2012 no longer support Visual Studio Setup Projects (vdproj). You need to use WIX. You can browse this StackOverflow thread for more info about it. Besides that there's always minor breaking changes but I've never ran into one.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

gariig posted:

The biggest problem I've ran into is VS2012 no longer support Visual Studio Setup Projects (vdproj). You need to use WIX. You can browse this StackOverflow thread for more info about it. Besides that there's always minor breaking changes but I've never ran into one.

It also doesn't support old-style database projects (use SSDT instead!) or Web Deploy projects (use proper release management tools instead!).

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
I'm not sure if this is a .NET problem or a Unity problem, but I have this xml data:
XML code:
<?xml version="1.0" encoding="utf-8" ?>
<Mapset>
    <Map name="The First">
        <Row>
            <Hex height="4" connections="nw ne e"/>
            <Hex height="1" connections=""/>
        </Row>
        <Row>
            <Hex height="3" connections="nw ne se"/>
            <Hex height="2" connections="se sw e"/>
        </Row>
    </Map>
    <Map name="another Map">
        <Row>
            <Hex height="4" connections="nw ne e"/>
            <Hex height="1" connections=""/>
        </Row>
        <Row>
            <Hex height="3" connections="nw ne se"/>
            <Hex height="2" connections="se sw e"/>
        </Row>
        <Row>
            <Hex height="3.0" connections="nw ne se sw e w"/>
            <Hex height="2.0" connections="nw ne sw e w"/>
            <Hex height="1.0" connections="nw se sw e w"/>
            <Hex height="4.0" connections="ne se sw e"/>
            <Hex height="3.0" connections="nw ne se sw w"/>
            <Hex height="-1.0" connections="nw ne se sw e"/>
            <Hex height="3.0" connections="sw e"/>
            <Hex height="2.0" connections="se sw e w"/>
            <Hex height="3.0" connections="nw ne sw w"/>
            <Hex height="2.0" connections="w"/>
            <Hex height="3.0" connections=""/>
            <Hex height="2.0" connections="e w"/>
        </Row>
    </Map>
</Mapset>
It's supposed to describe hex-based maps in our game. I generated a schema using xsd.exe and then classes from the xsd. However, when I try to instantiate an XMLSerializer: XmlSerializer serializer = new XmlSerializer(typeof(Mapset)); I get an exception:

quote:

InvalidOperationException: MapsetMapRowHex is not a collection
System.Xml.Serialization.TypeData.get_ListItemType ()
System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.XmlAttributes atts, Int32 nestingLevel)
I omitted most of the stack trace because I don't think it's relevant.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
What does the XSD and generated class look like?

wwb
Aug 17, 2004

Wheany posted:

I'm not sure if this is a .NET problem or a Unity problem, but I have this xml data:
XML code:
<?xml version="1.0" encoding="utf-8" ?>
<Mapset>
    <Map name="The First">
        <Row>
            <Hex height="4" connections="nw ne e"/>
            <Hex height="1" connections=""/>
        </Row>
        <Row>
            <Hex height="3" connections="nw ne se"/>
            <Hex height="2" connections="se sw e"/>
        </Row>
    </Map>
    <Map name="another Map">
        <Row>
            <Hex height="4" connections="nw ne e"/>
            <Hex height="1" connections=""/>
        </Row>
        <Row>
            <Hex height="3" connections="nw ne se"/>
            <Hex height="2" connections="se sw e"/>
        </Row>
        <Row>
            <Hex height="3.0" connections="nw ne se sw e w"/>
            <Hex height="2.0" connections="nw ne sw e w"/>
            <Hex height="1.0" connections="nw se sw e w"/>
            <Hex height="4.0" connections="ne se sw e"/>
            <Hex height="3.0" connections="nw ne se sw w"/>
            <Hex height="-1.0" connections="nw ne se sw e"/>
            <Hex height="3.0" connections="sw e"/>
            <Hex height="2.0" connections="se sw e w"/>
            <Hex height="3.0" connections="nw ne sw w"/>
            <Hex height="2.0" connections="w"/>
            <Hex height="3.0" connections=""/>
            <Hex height="2.0" connections="e w"/>
        </Row>
    </Map>
</Mapset>
It's supposed to describe hex-based maps in our game. I generated a schema using xsd.exe and then classes from the xsd. However, when I try to instantiate an XMLSerializer: XmlSerializer serializer = new XmlSerializer(typeof(Mapset)); I get an exception:

I omitted most of the stack trace because I don't think it's relevant.

No idea about the xsd because I don't use that junk but the class to handle this is pretty easy -- trick is to us the [XmlElement] attribute on the array properties for the Maps under MapSet and the rows under the Map. I can work up a code example a bit later if that don't help.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
XSD:
XML code:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Mapset" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="Mapset" msdata:IsDataSet="true" msdata:Locale="en-US">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Map">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Row" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Hex" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:attribute name="height" type="xs:string" />
                        <xs:attribute name="connections" type="xs:string" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" />
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
C#:
C# code:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18408
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

// 
// This source code was auto-generated by xsd, Version=4.0.30319.18020.
// 


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.18020")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class Mapset {
    
    private MapsetMap[] itemsField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Map", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public MapsetMap[] Items {
        get {
            return this.itemsField;
        }
        set {
            this.itemsField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.18020")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class MapsetMap {
    
    private MapsetMapRowHex[][] rowField;
    
    private string nameField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    [System.Xml.Serialization.XmlArrayItemAttribute("Hex", typeof(MapsetMapRowHex), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
    public MapsetMapRowHex[][] Row {
        get {
            return this.rowField;
        }
        set {
            this.rowField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string name {
        get {
            return this.nameField;
        }
        set {
            this.nameField = value;
        }
    }
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.18020")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class MapsetMapRowHex {
    
    private string heightField;
    
    private string connectionsField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string height {
        get {
            return this.heightField;
        }
        set {
            this.heightField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlAttributeAttribute()]
    public string connections {
        get {
            return this.connectionsField;
        }
        set {
            this.connectionsField = value;
        }
    }
}

I have not touched these since I assumed it would Just Work. However I am planning on changing the connections attribute to an [Flags] enum.

Edit:

wwb posted:

No idea about the xsd because I don't use that junk but the class to handle this is pretty easy -- trick is to us the [XmlElement] attribute on the array properties for the Maps under MapSet and the rows under the Map. I can work up a code example a bit later if that don't help.

I'm going the "Arbitrary XML" -> code route, not the other way around.

Wheany fucked around with this message at 15:48 on Jan 30, 2014

wwb
Aug 17, 2004

Yup, that is usually where I start too. Write class, write unit test to deserailize, play attribute voodoo until it works.

XSD is some old poo poo (like 2002, .NET 1.0 old).

You need something like

code:
public class MapSet
{
    [XmlAttribute("name)"]
    public string Name { get; set; }
    
    [XmlElement("Map")]
    public Map[] Maps { get; set; }
}

public class Map
{
   [XmlElement("Row")]
   public Row[] Rows { get; set; }
}

public class Row
{
   [XmlElement("Hex")]
   public Hex[] Hexes { get; set; }
}

public class Hex 
{ 
    [XmlAttribute("height")]
    public int Height { get; set; }

    [XmlAttribute("connections")]
    public string Connections { get; set }
}

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

wwb posted:

Yup, that is usually where I start too. Write class, write unit test to deserailize, play attribute voodoo until it works.

XSD is some old poo poo (like 2002, .NET 1.0 old).

You need something like

code:
public class MapSet

:stare: Yeah, I guess generated code always looks messier than hand-written code. That seems to have done it after a couple of minor tweaks. Thanks.

Although I'm still interested in why the hell the generated code didn't work.

wwb
Aug 17, 2004

Just glancing at it the generator seemed to think your maprowhex was a 2 dimensional array for some reason. It wasn't the bestest thing in it's day once the xml got non-trivial.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

wwb posted:

Just glancing at it the generator seemed to think your maprowhex was a 2 dimensional array for some reason. It wasn't the bestest thing in it's day once the xml got non-trivial.

Okay, is there something similar that people actually use in 2014? I just followed the instructions here http://elegantcode.com/2010/08/07/dont-parse-that-xml/ after having had good experiences with JAXB on Java side.

aBagorn
Aug 26, 2004
This is a little more generalized than a specific .NET question, but since I'm using it in a .NET app I'll ask here.

Ok, let's say I have 3 List<Foo> that contain elements that could be common to all three, two, or none.

I want to create a 4th list that combines all the elements of the 3, but orders them so that Foos that appear in all of them get put first, then 2, then the unique ones. (think kind of like a search engine?)

What's the best approach to go about this?

wwb
Aug 17, 2004

To be honest I fell into hand-wiring my deserialization back in 2003 or so and never looked back but I'm finnicky about having my objects look like I want them to look not like whatever they are sending down the wire and such.

raminasi
Jan 25, 2005

a last drink with no ice

aBagorn posted:

This is a little more generalized than a specific .NET question, but since I'm using it in a .NET app I'll ask here.

Ok, let's say I have 3 List<Foo> that contain elements that could be common to all three, two, or none.

I want to create a 4th list that combines all the elements of the 3, but orders them so that Foos that appear in all of them get put first, then 2, then the unique ones. (think kind of like a search engine?)

What's the best approach to go about this?

e: I misunderstood the question and Ithaqua's answer is better.

raminasi fucked around with this message at 19:23 on Jan 30, 2014

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

GrumpyDoctor posted:

Here's how I'd do it:

C# code:
using System.Linq;

var result =
    lists
    .SelectMany(x => x) // Concatenate all lists
    .GroupBy(x => x) // Identify common groups, using default equality
    .OrderByDescending(group => group.Count()) // Sort by group size
    .SelectMany(group => group); // Flatten groups into single list
(I haven't tested this.)

I went with this:
listOne.Concat(listTwo).Concat(listThree).GroupBy(l => l).Select(s => new { s.Key, Count = s.Count() }).OrderByDescending(o => o.Count);

Gul Banana
Nov 28, 2003

Wheany posted:

Okay, is there something similar that people actually use in 2014? I just followed the instructions here http://elegantcode.com/2010/08/07/dont-parse-that-xml/ after having had good experiences with JAXB on Java side.

DataContractSerializer

aBagorn
Aug 26, 2004

Ithaqua posted:

I went with this:
listOne.Concat(listTwo).Concat(listThree).GroupBy(l => l).Select(s => new { s.Key, Count = s.Count() }).OrderByDescending(o => o.Count);

Holy crap, that's pretty much what I need! I'll fiddle around with it and add a couple of .ThenByDescending() because I'll need to put items that are only in list 2 ahead of those only in list 1, etc etc.

Awesome!

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

I don't understand. Is there some tool that generates classes from arbitrary xml/schema using that? That's what I meant with my question.

Gul Banana
Nov 28, 2003

Yes, the newer tool is svcutil.exe. with the /dconly flag, it will generate classes from an xsd, hopefully with more success than xsd.exe had.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Gul Banana posted:

Yes, the newer tool is svcutil.exe. with the /dconly flag, it will generate classes from an xsd, hopefully with more success than xsd.exe had.

Thank you.

I feel like I'm doing C# the same way I was doing PHP in 2002, just google it and then click on the first link that goes to W3schools. "Hmm, mysql_query, eh?"

cletus42o
Apr 11, 2003

Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
College Slice
I'm using Visual Studio for the first time in my life, Visual Studio Express 2012 for Windows Phone to be exact. I have this XAML:

code:
<TextBlock Margin="20,20,0,0"
  TextWrapping="Wrap"
  Grid.Row="0"
  Foreground="Navy"
  FontSize="20"
  FontFamily="Arial Unicode MS"
  Text="{Binding Path=Title, Converter={StaticResource FormatTitle}}" />
Which loads fine in the design view (and in the Windows Phone emulator) - at least until the next time I make a change anywhere in the project. Then Visual Studio flags the entire block of XAML containing this TextBlock and says "Invalid XAML." I delete the entirety of the Text attribute (the binding), the error goes away. I paste the code back in, and everything works fine again - until the next time I make a change somewhere in my project.

What could I be doing wrong that would cause this behavior?

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

VS2012 Express RTM? If so, install Update 4. I seem to recall some XAML issues got fixed between RTM and Update 4.

Or better yet, just install VS2013.

cletus42o
Apr 11, 2003

Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
College Slice

Ithaqua posted:

VS2012 Express RTM? If so, install Update 4. I seem to recall some XAML issues got fixed between RTM and Update 4.

Or better yet, just install VS2013.
I'm already on Update 4.

Visual Studio Express 2012 for Windows Phone is the latest version "for Windows Phone" that they have for download on the Visual Studio page. I've never done any .NET work prior to this so I'd be concerned about jumping to 2013 if it doesn't have the Windows Phone functionality built in.

edit - Apparently this might be due to having spaces in my project name or path to the project.. Ugh. I'll try making those adjustments.

double edit - That did seem to resolve the issue. I had tried it before but didn't know to change the assembly name also.

cletus42o fucked around with this message at 16:54 on Jan 31, 2014

Opulent Ceremony
Feb 22, 2012
TFS 2013 with Git question, if this is better off in the Source Control thread I can move it. I'm hoping for feedback on a good way to manage our projects. We hope to use project management features of TFS like bug-tracking and such.

We've got several different .NET solutions, and everyone has different ideas about how to organize this:

1) Single TFS project, single Git repo where each solution is in a different branch (really multiple branches per solution for development/production etc). Seems like switching between branches to get to a different solution would suck, because we couldn't work on more than one solution/branch without committing changes before the branch switch? Also seems to take a long time to switch between branches since it removes and adds a bunch of files each time.

2) Multiple TFS projects, one solution per project, one Git repo for that project, multiple branches to accommodate development/production etc. Will this make it harder to work with in-house libraries that are shared across solutions?

3) Single TFS project, multiple Git repos for the solutions?

None of us are terribly familiar with TFS and Git, so I'm hoping someone in here can offer some good pros and cons, or to point out obviously good/bad ideas.

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Opulent Ceremony posted:

TFS 2013 with Git question, if this is better off in the Source Control thread I can move it. I'm hoping for feedback on a good way to manage our projects. We hope to use project management features of TFS like bug-tracking and such.

We've got several different .NET solutions, and everyone has different ideas about how to organize this:

1) Single TFS project, single Git repo where each solution is in a different branch (really multiple branches per solution for development/production etc). Seems like switching between branches to get to a different solution would suck, because we couldn't work on more than one solution/branch without committing changes before the branch switch? Also seems to take a long time to switch between branches since it removes and adds a bunch of files each time.

2) Multiple TFS projects, one solution per project, one Git repo for that project, multiple branches to accommodate development/production etc. Will this make it harder to work with in-house libraries that are shared across solutions?

3) Single TFS project, multiple Git repos for the solutions?

None of us are terribly familiar with TFS and Git, so I'm hoping someone in here can offer some good pros and cons, or to point out obviously good/bad ideas.

First off, answer this question: Why do you want to use Git over standard TFVC? Git is generally a lot harder to use effectively. Full disclosure: I am massively biased against Git.

Think of a team project as a "portfolio". If you have a bunch of interrelated applications, then they should all be in the same team project. You can subdivide them into more discrete units by using multiple teams and areas within your team project.

If you have totally separate applications that share nothing, then you can split them into different team projects.

You definitely don't want to store different different applications in different branches; that's not what branches are for. Branches are for isolating work in progress so that multiple developers can work on multiple things without potentially leaving your baseline source code in a broken state.

My gut instinct would be to keep everything within the team project in a single repository, but the Git experts out there may disagree. The idea is to keep things that are interrelated and share pieces all together and in sync with one another.

New Yorp New Yorp fucked around with this message at 01:12 on Feb 1, 2014

  • Locked thread