« first day (1579 days earlier)      last day (3593 days later) » 

user2336660
09:00
so if i had a class that was
class movie{string title; string genre; string rating; (ctor taking all of those things) }
user2336660
how would i take that data from the xml and create the movie objects if the xml document has multiple movies and not only one
@DonnieBrasco You'd have a list of Movies like List<Movie>
user2336660
sure, but what i want to know is how to how to extract all that information from the xml via c#
@CharlieBrown in case you were still interested: I've been deleting empty folders for ages and it seems to go on forever; current theory is that something in there is a symlink
You could just deserialize directly into that POCO
09:08
I've used the XmlSerializer, and kind of gotten used to it. Works like a charm for serializing/deserializing
@DonnieBrasco here is a snippet of code I use to take a XML string into my object
                        XmlSerializer oSerializer = new XmlSerializer(typeof(RoomUpdateRequest));

                        using (StringReader oReader = new StringReader(xmlRoomUpdateRequest))
                        {
                            oRoomUpdateRequest = (RoomUpdateRequest)oSerializer.Deserialize(oReader);
                        }
Then, my RoomUpdateRequest matches my incoming XML
    public class RoomUpdateRequest : IValidatableObject
    {
        [Required]
        public int HotelId { get; set; }

        [Required]
        [StringLength(175)]
        public string Email { get; set; }

        [Required]
        [StringLength(16)]
        public string Password { get; set; }

        [Required]
        [Range(0, 1)]
        public int UserType { get; set; }

        public List<RoomUpdate> RoomUpdates { get; set; }

        public RoomUpdateRequest()
        {
            this.RoomUpdates = new List<RoomUpdate>();
So xmlRoomUpdateRequest is the XML in string variable
user2336660
fantastic, ill give it a try
It works like a charm
If you deserializing multiple files/requests/streams
you can reuse the XmlSeializer (if within the same scope)
and then it will have cached the type
so it deserialize a bit quicker
09:26
Hi All
I have a question regarding mvc
if anyone can help
My favorite thing: Arguing about implementation of conflicting requirements for 2 weeks, when it turns out that it's just a conflict in terminology instead.
"Oh, I thought you meant the *other* type of carriage"
/me sighs
Hi @Neha - what's up?
hi @Squiggle am good
am stuck with one mvc issue
I need to check if am at home page in mvc view
@Squiggle: Haha, that's epic. Who used the wrong terminology? You? :p
And I have no idea how to achieve
what prob @Neha
09:30
I dnt knw how to do
What was the problem
@scheien happens all the time. Each business unit has their own terminology, using the same words to describe different things. I'm tasked with automating business processes across the entire company...
what kind of issue you are facing @Neha
@scheien so nobody was using the "wrong" terminology :-/
aha!
09:31
@Neha explain what you're trying to achieve
YES! I WIN!
SUCK IT, ABNORMALLY LONG FOLDER PATH
I had a recursive directory tree on my system that seemed to go on forever
Only method I could find that didn't crash whatever program was being used was this: superuser.com/questions/717639/…
Cool
Never had that problem though. Nice to know if that ought to happen
Actually I have to place one conditional statement when only am at home page not on any other
on layout of my view
@Squiggle @shankar.parsanamoni
10:00
Morning guys, I have question here. I Have DataGrid, so it shows list of product and one of the colums is price. out of DataGrid i need to get total of price. Now I'm calculating by going one by one in foreach() and doing Total+=each row price, any suggestion to do that, some think like MyDataGrid.Columns["price"].Sum()?
Difficult to describe as a StackOverflow question: Why won't the 'package location' field in the first screenshot here accept dotted paths i.e. ..\..\Out, and how can I make it output to that folder? By 'not accept' I mean it ignores the dots and defaults to the project folder
@Jamaxack: Have you tried using the DataSource property?
From there you can get the elements, cast it to the correct type and use Linq
There is another way: publish profile xml files support VS macros i.e. $(SolutionDir)
But the editor will overwrite it every time the publish profile info is saved
I'd prefer this to 'just work'
var elements = MyDataGrid.DataSource as List<MyType>;
var sum = elements.Sum(x => x.price);
@TomW: Why can't you use the full path?
Or do you want a publish profile that you can use for all your projects?
Does it overwrite the publish.xml everytime you publish?
That I didn't know, that is fubar
10:31
Save, not publish. Save implies updating information so that's not completely out of order, but still annoying
Full path might be different on other people's machines
A common publish profile might be helpful but that isn't what I had in mind
Is the save button based on the publish method?
I just have prev, next, publish, cancel on mine
File system as publish method
I see what you mean. When using the $(solutionDir) it just translates it to the correct path and use that.
tried with $(solutionDir)\test
reads \test after a publish
It does however work with the dotted paths
and it's remembered after a publish
really?
yes
<ExcludeApp_Data>False</ExcludeApp_Data>
<DesktopBuildPackageLocation>..\..\test</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
so for me I have solutiondir\source\project and I would expect ..\..\out to deposit the package in solutiondir\out
It just removed the path when I used the variables
$(solutiondir)\test was saved as \test
..\..\test is saved as expected
10:44
VS2012?
yep
Premium (if that matters)
Clicking the ... button browses to the project folder, not the out folder specified. That implies to me it hasn't recognised it
let's see where it deposits them, one sec
Aah. It actually works, it's the behaviour of the browse button that's wrong
Great! :)
Lunch time! im off for 30mins
enter ..\..\Out and publish - the package is published to solutiondir\out, and ..\..\Out is saved to the profile xml. That's what I wanted. However clicking the browse button sets the folder browser to the project dir, which is wrong. So there's not really any problem at all :)
11:06
@scheien Thank you, it is done
11:37
@Jamaxack: np!
The last one, ewwww
or all of them actually
WHY USE METHODS WHEN YOU HAVE PROPERTIES!
yeah. I thought it might raise other peoples' blood pressure, too.
:)
12:27
Hi, Is there anyways that I can host my webapplication into IIS and can work all together in LAN? using visual studio
I really have no idea but I'm searching for something like more then one people can work together in LAN with same source
I know about TFS but finding something called *offline*
@Justcode use git, not tfs
@KendallFrey thanks any advantage using it? we are using TFS but it sucks in many ways
git can work in a repository by itself, or multiple repositories on the same computer, or over any kind of network
the best part is everything is stored locally so you can always continue to work without a network connection
Hey, any source control system would fit the brief here
I use TFS successfully.
I will never recommend TFS to anyone ever.
Or SVN
12:31
@Squiggle version controlling is very poor
Or Mercurial
Git is just superior to all those
no point in settling for less
Why is it superior?
@Justcode TFS works fine here, and we all know how to use it. 30 developers, 15 projects, automated builds, continuous integration tests, automated deployments...
Just sayin'
@scheien because it's better
branching is easy, you can work offline, the diff tools are smart, and it doesn't make stupid mistakes like some systems I know *cough*
@Squiggle well, here it sucks may be because of the poor knowledge how to use it
12:33
Git is easier and more powerful, but TFS can do fine. Eventually.
@KendallFrey how about the bitbucket?
That's not source control
that's a repository host
oh I see
bitbucket is like github with a different pricing model
@KendallFrey: That sounds fair. Never used git, maybe I should try it out.
12:35
github you pay by repository, bitbucket you pay by user
private repository with up to 5 users is free on bitbucket
@RoelvanUden After using git, TFS puts so many little obstacles in your way and even gets simple things plain wrong
one nice thing of TFS is gated checkins
So,@KendallFrey I should go with git right?
@drch I thought GitHub was X private repos with a given pricing level
@drch It can be nice, but right now it's a major headache for us
It can't even do a build consistently
It rejected my checkin three times because of a simple test failing that never should have failed, and in fact didn't on my machine
Why do the architecty people here insist that services should be deployed by MSI?
Well, there's one reason - explicitly versioned installs. I can accept the desire for that
12:39
Is "Because they are so rusted it's not even funny" an answer?
I've had no objection to just using an MSI to wrap web deploy, but why they have a problem with just using web deploy the way it's designed to be used...
@RoelvanUden I think the actual justification is the aforementioned versioning - as well as 'consistency'. There are some components we get as msi's that we have no choice about. They'd like everything to have the same deployment path
Are they deploying the services through SSCM or something similar?
@scheien I haven't been able to get any concrete information out of them. At the moment decisions are being made without consulting the developers who are going to have to write it, and who are the ones using it day to day
Sounds like awesome management
Sorry mate, you're on a need to know basis
I can see the value of having just one way of doing things. It's a way that's disproportionately difficult though
12:46
@KendallFrey yeah, x private repos with unlimited members
whereas bitbucket is unlimited private repos with n members
That evil mr smith!
"consultancy"
13:17
@BradleyDotNET long day, I have fixed that error now.
It's always the gingers...
@Squiggle How rude.
It's OK I'm allowed to say that. I'm a ginger.
We're all crooks.
I used to be a ginger.. but then I took an arrow to the knee.
*its
runs
[sic]
hello
@RoelvanUden haha
13:40
@RoelvanUden took a carrot to the genes?
Sorry, got nothing
just another reminder that i dislike snow
@Squiggle You're from England, let me explain
Imagine rain that made piles
13:55
yeah but I'm not in England
hey, when did you move?
like, over a year ago.
well shit
i need to move somewhere warmer
me too!
13:57
even parts of canada are warmer than here
where are you at?
that actually looks beautiful @Squiggle
yeah it's better than England ;)
where is it?
14:10
Switzerland
thats awesome
> Why does that leave you in awe?
^ what he said
thats a good question, he leaves me in awe because when i look at the picture, it makes me want to live there :D
So if I make a great looking pic you suddenly want to move to the Netherlands?
Even though it's shit 99% of the time
14:13
yes
i wanted to move to new york city for years, and almost did
just because of the alicia keys song
Sounds like someone needs to see the world
Alicia keys song?
New York, i think it's called, one sec, let me link you
@Squiggle i've seen some of it, i want to keep going :)
@Steve have you visited Europe?
kind of, germany, slovakia, ireland
probably another, i don't remember, it doesn't count much though, i only stayed in the air port :p
well
you all got quiet
i drank a lot of coffee
i am bouncing off of the walls
14:25
I'm debugging failing integration tests. It takes a while.
that sucks
nah it's cool. Better to have failing tests than to have none at all.
yeah
for sure
time spent fighting fires with no tests > time spent fixing tests
time spent fixing tests > time coding * 100000000000000000001
Fixed the tests.
14:47
Fixed commented out
:)
haha, thats how I get tests to pass, if they fail, they must be obsolete tests, DELETE
(JK)
ya'll boring as hell today
@Sippy
15:03
shudup nerd
all hell broke loose at work this morning
vodafone fucked up our internet again
15:16
howso
GOD DAMMMIT, paypal is just the biggest shame in programming history
can those guys stop pushing their new awesome api and ui before they really finish all the feature that the old ones does?
@ton.yeung they built a new rest api to replace its recent SOAP one, and it only support about 10% of the features in the SOAP version
but at least it's not soap
soap is awful
it's awful, but at least it works
it's like, "hey dude, your old ford sucks, let me give you a brand new cardilac but you know, it doesn't have an engine yet..."
At least it's not a Ford
it won't break down
15:33
SOAP or Simple Object Access Protocol, which as its name suggests, is very complicated
@KendallFrey - fords only run downhill
I have to be missing something.
@TravisJ @KendallFrey My Ford Fusion has been a tank, in fact it is ranked as one of the most reliable cars.
@Greg - most of the ford hate came from the 80s versions
found on road dead
I am super impressed with the new Ford Edge
it is pretty sweet, mini suv, awd v6 variable trans
Oh, @TravisJ can I get an assist.
only if you dunk
15:37
public static void Compress(FileInfo file)
{
    try
    {
        using (var content = file.OpenRead())
            if ((File.GetAttributes(file.FullName) & FileAttributes.Hidden) != FileAttributes.Hidden & file.Extension != ".gz")
                using (var output = File.Create(file.FullName.Replace(".xml", ".gz")))
                using (var compress = new GZipStream(output, CompressionMode.Compress))
                {
                    content.CopyTo(compress);
                    Console.WriteLine("Completed Compression of file: " + file);
So, when I compress, it looses the file type but if I don't do the replace ".xml" it does the name plus .xml.gz instead which tweaks out Google.
I'm missing something.
tweaks out google? how is google related to this?
@CharlieBrown It's a Sitemap file.
Quick question guys.... why do I have to implement an interface member in an abstract class that implements the interface?
why are you gzipping your sitemap file?
you should just turn on gzip on your server
and is there a way around this without moving the implementing to the derived concrete classes?
15:42
@MarkW otherwise it wouldnt comform to the interface
but you cant construct an abstract class
shouldnt the contract be pushed to the derived class?
thats how it works in java anyway
its not about construction
@Greg - I don't see why the file extension would be lost
@MarkW - if you don't implement the member, then how is the abstract class implementing the interface?
@TravisJ - Did you see my answer?
@SpencerRuport - I saw it last night at home but didn't look to verify it because it used nested map.
15:44
its not, it should make the concrete classes implement it
@TravisJ Well, I don't see the extension though when I open it.
@MarkW - Why? The concrete class doesn't implement that interface.
@TravisJ - Ah for sure. The second map only makes it easier to verify that it's working. You have the results after the filter.
public interface A {}
public abstract class B : A {}
public class C : B {} //doesn't know about A
It becomes extension less
15:45
because without that behavior... it makes it so that if you want to make sure all derived classes of an abstract class implement some interface, you have to provide the implementation in the abstract class.. which may not be the desired behavior
where as in java... if in an abstract class I implement an interface, it pushes the contract to the derived classes
allowing me to have disperate implementations across any derived instance of the absract class
of said inteface
@MarkW - break up the interfaces
If you could do such a thing, it would invalidate interfaces entirely
doesnt in java
so thats bull
That is because Java is awful
lol
15:46
in c#
It runs terribly slow.
what do you mean Travis
@Greg What code does what? Your question statement is confusing
about breaking up the interfaces
there is only one interface
use multiple interfaces instead of one
15:46
Also, breaks Liskov
So although its possible in Java, doesnt mean its a good idea
I dont see a downside
@KendallFrey The

using (var output = File.Create(file.FullName.Replace(".xml", ".gz")))
                using (var compress = new GZipStream(output, CompressionMode.Compress))
                {
                    content.CopyTo(compress);
public interface IA {}
public interface IB {}
public abstract class C : IA {}
public class D : C, IB {}
@Greg And what does that do?
hum...
15:48
@MarkW you wouldnt be able to substitute one class for another. i.e. "Subtypes must be substitutable for their base types."
I would expect it to convert sitemap.xml into sitemap.gz
sure you could
you just wouldnt know the implementation of the interface contract
but its still guaranteed to bet there
be there*
No its not
yeah lol it is... because the concrete types MUST implement the interface in java
15:49
It the first example I gave, C is not required to implement interface A
I think the issue is Java abstract means different things than c# abstract
ah
I see...
@KendallFrey That, will remove the .xml from the name and apply the .gz which is correct so when the gz is named it won't contain the previous extension of the file. But when it compresses the file in the gz it is extensionless.
but abstract class C doesnt implement IB
so... youre doing an antipattern there with D
thats a normal pattern used throughout the framework
15:50
That isn't an antipattern, it is describing its behavior
@Greg What is extensionless?
well if your reference type is C you should have no expectation that you will have IB's contract
so including IB doesnt seem like an argument to me
@Greg it can't be both .gz and extensionless
That is because abstract class C does not implement IB
But D is expected to implement IB
@KendallFrey I said the gz itself is correct with the name blah.gz the file inside that should be blah.xml is just blah
15:51
exactly... so if youre reference type is C, and you dont know its a D then you wont know about IB.... and there is no problem
ICQ D EDBD B
@Greg .gz files do not contain files. Please explain what you're talking about.
@KendallFrey What do you call the file inside the compressed structure?
so you CAN in fact guarantee that any derived type of C will implement the interface
no?
@Greg There is no file in the .gz file
15:53
you cant say that it wont implement other interfaces... but who cares? you couldnt ever anyway
There is only data
@MarkW - Right
so I still dont see the problem you guy see... :(
@MarkW - Everything which inherits from the abstract class with also implement IA by design.
@KendallFrey Then why does it reflect a file name with a valid extension or no extension?
15:54
right but moving the implementation to the derived type for IA doesnt cause any issues
@MarkW going back to your original questions.. you dont have to implement them in the abstract class
@Greg What?
how do I get around it?
What is reflecting a file name?
15:55
public abstract NotImplentedbuddy();
What file name is it reflecting?
hm, forgot my return type
public abstract void NotGoingToImplementThis();
gotchya
feel sorta derpy for not seeing that
lol
i think we assumed you meant not even having that at all either
@SpencerRuport - Nice :)
15:57
:/
it says.... no suitable method found to override at compile time
@KendallFrey I don't think your following.
I don't think I am either
woops
scratch that
@MarkW - Maybe this will help a little? It is about decoupling but shows the use of interface and abstract with a blurb about using them stackoverflow.com/a/13613544/1026459
@KendallFrey I appreciate the help, until I can either word it clearer or maybe a screen shot I'll attempt to figure it out.
15:59
thx Travis
I got it
@TravisJ - You nerd sniped me with that one :P
wipes brow
@SpencerRuport - lol

« first day (1579 days earlier)      last day (3593 days later) »