« first day (1627 days earlier)      last day (3338 days later) » 

8:00 PM
@tweray Yeah, we looked at it, went "That's complicated, but interesting".... and then tripped over a set of hard requirements that we decided were best answered with a CQRS approach. You can scale down some of the practices to be applicable in more "normal" development situations, too.
 
but yes, it is good practice when you are architecting to segregate the part need instant response and the part don't, i usually just throw the 2nd part separately into the message busing and that fix most of the case, and do help a lot in performance
 
@tweray The gnashing of teeth while you figure out what "appropriate latency" means for various pieces of the system are is unentertaining, I found.
 
can anyone recommend how I should create a graph from a parsed in network in this format? hastebin.com/kokajeyixa.vhdl
 
@ton.yeung I briefly inspected nservicebus. I found myself comparing it to BizTalk - i.e. "How do you do message transformation?" - and found the answer was usually "You don't". That was before I appreciated the degree to which BizTalk is not a service bus.
 
huh, just got an email from a recruiter for Facebook
 
8:10 PM
Yes, I am appreciating these differences more. The BizTalk crowd seem to call everything that isn't spoke and hub 'point to point integration' and follow up with Devil! Devil I say! SSSSSS!
 
Hrm, i have to compare 2 objects that are of:
public partial class Person
    {

        private List<IdentifierAttribute> identifierField;

        private List<PersonNameAttribute> nameField;

        private List<AddressAttribute> addressField;

        private List<PhoneAttribute> phoneField;

        private List<EmailAttribute> emailField;

        private List<PersonRelationship> relationshipField;
(i have public properties of those)
Is there a clever way (efficient) to compare each property, and if one is different, copy it to another object?
 
@RyanTernier a hash..?
 
@Pheonixblade9 I need to do things like:
p1.Name[0] is different than p2.Name[0] so I need to copy p1.Name[0] to a new object as it needs to be updated
 
just the one array member?
 
@RyanTernier if they aren't different, copying makes no difference, right? So why not just copy everything?
 
8:14 PM
Everything
 
just hash the object :)
 
@TomW I can only update changed data, not data that hasn't changed.
 
does anyone know this date layout type: 2015-03-31
 
@JoJo YYYY-MM-DD
 
.. and what is the fastest way to get C# date layout of 2/25/2015 to that?
 
8:15 PM
!!google c sharp date formatting
 
k
 
might be fastest to just build it with Day(), Month(), Year()
 
you missed the point
date.ToString("M/DD/YYYY");
 
ugh.. I hate it when I do that
k
 
8:22 PM
:)
Before all else fails, use the Googles.
6
 
Google it, find it on stack overflow, test it, if it works comment on SO that the author saved your life
 
I think this might be better
var fromDate = tbStartDate.SelectedDate.Value.Date;
var toDate = tbStopDate.SelectedDate.Value.Date;

var fromDay = fromDate.Day;
var fromMonth = fromDate.Month;
var fromYear = fromDate.Year;

var toDay = toDate.Day;
var toMonth = toDate.Month;
var toYear = toDate.Year;

Session["fromDate"] = fromMonth + "/" + fromDay + "/" + fromYear;
Session["toDate"] = toMonth + "/" + toDay + "/" + toYear;
 
DateTime.ToString default behavior is kinda evil in that it depends on current culture info
I'm reminded of how when using DataTables to pass table-valued-parameters to SQL commands, if you don't specify the column type, the DataTable will call ToString on all arguments and store as string
 
duck
 
which will by happenstance work just fine until the european web server starts throwing errors on the 13th
 
8:26 PM
@TetsujinnoOni you don't expect to all of a sudden transform the whole existing system all into new structure, they were not designed that way. usually just start with some small part when you have to refactor it anyways, and start to build a capable message bus system among that, then you can use same message bus for each every small piece step by step
 
(and by "work just fine" I mean inserting incorrect values for a week or so)
 
@JoJo uhhh. how about fromDate.ToString("MM/DD/YYYY");?
 
oh wait.. I forgot I am trying to get 2015-03-31
 
Dispose > Find All References > Noooo visual studio you mong not thaaaat
 
@tweray platform update project from Powerbuilder/Sybase to C#/WPF/SQLServer2014. We were trying very hard to separate concerns, but some interesting requirements practices that got forced on the team lead to having to reanalyze things late in the cycle.
 
8:28 PM
@MikeAsdf duh, don't localize and set thread to en-US ;)
 
date.ToString("YYYY-MM-DD")
 
@JoJo hopefully it's intuitive enough that you can figure out how to change it
 
kk
lets take it out for a spin..
Argh.. YYYY-02-DD
just my luck..
 
datetime.tostring format string is case sensitive.
 
@TetsujinnoOni well, god bless you guys... the last thing i want to do is just sit together with bunch of people and talk about "big map", it will never reach anything productive. Usually what i like to do is drag 1 or 2 developer together with me, and drag the guy from business team who can make decision, we sit together and just talk about one feature for 30 minutes, come up with a plan, then the next
 
8:32 PM
@JoJo duck
 
general question. Which is more efficient:
if(a is myType) { myType b = a as myType; /* do work */ }
-- or --
myType b = a as MyType;
if(b != null) // do work
 
@NETscape duck
@KendallFrey GOOSE!
 
@tweray we were explicitly not allowed to talk to the business guys by the other-consulting-firm guy who was the "project owner". EVERYONE on the team was continually incensed, and we did what we could to make progress and train the long-term group that was transitioning from PB to .Net
 
@SteveG oh fuckkk run
 
im runnin!
 
8:33 PM
I feel I should not have had to convert that date to begin with
 
lol no u not
 
rather you guys.. this is 2015 for crying out loud ;)
 
star date 85 23 point 8
 
@KendallFrey how do star dates work
 
apologies for your childhood, but they don't
 
8:35 PM
LOL
 
@TetsujinnoOni that's the beauty of consulting companies :) . I am lucky that i got a chance to quit, and find a boss who can really sit down and talk about exact things. anyways if someone still need training to use .net, then i don't suggest to use any complex technology, just put everything in a single solution and make everything public static so they don't have any chance to mess up xD
 
eh
they do too :(
 
@tweray It was a consulting engagement, and we got them moved along to a WPF + WebAPI model with CQRS-derived message bus distribution to coordinate between the Sybase and SQL Server backends.
 
> In other words, under the Next Generation system of stardates, January 1, 2323 would seem to correspond to stardate 0. This probably shouldn't be taken too seriously, because Star Trek's stardates have never been too internally consistent, but we're mentioning it here because it's kinda fun.
 
@TetsujinnoOni o_O well... they are going to mess it up, period. think about the good part, since they are going to screw up anyways, you guys can try whatever hyper black technology you like for some good experience. good luck with that xD
 
8:41 PM
@tweray that was last year's engagement... and focusing on "black stuff goes in here to make implementation easy" was pretty important.
 
@KendallFrey booo
 
Hello party people!
 
there is no way yyyy-MM-dd can be justified.. why would yyyy and dd be lowercase but MM not?
 
@JoJo ISO standards
!!wiki iso 8601
 
just wow
 
8:45 PM
mm is minutes
 
kk
 
ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date and time-related data. It was issued by the International Organization for Standardization (ISO) and was first published in 1988. The purpose of this standard is to provide an unambiguous and well-defined method of representing dates and times, so as to avoid misinterpretation of numeric representations of dates and times, particularly when data are transferred between countries with different conventions for writing numeric dates...
 
@JoJo don't be annoyed by it, this shit wouldn't exist if not for ISO standards
 
amen
 
@JoJo i find it logical. Since both minutes and Months can be represented by an M it makes sense that the "larger one" (Months) would be represented by a upper case M and not a lower case one. Only years are represented by y so it wouldn't make sense to have an upper case y just because
 
8:49 PM
you have both month and minutes, one is obviously going to be "mm"... what should the other be? pretend your the spec writer.
 
I've done the .ToString("yyyy-mm-dd");-misstake a few times.
 
"wtf month is 47?"
 
@Pheonixblade9 is usually my reaction.
 
mm is Minutes
:)
 
@ohmusama exactly my point.
 
8:57 PM
never too late to the party i guess
 
I like MMM personally
 
"I've done the .ToString("yyyy-mm-dd");-misstake a few times."
 
mm is the sound I make when I eat my sandwich
 
Is there an easy way to have Control Parameter to a default html drop down?
 
@Greg what do you mean with control parameter?
 
8:58 PM
for readability I like DD MMM YYYY
for sorting, ISO8601 clearly
 
@diemaus Web-Forms SQL Data Source.
 
you should format according to your users
 
The proper (logical way) to do it would be yyyy-MM-dd HH:mm:ss.fff+Z
Ouch, web-forms. No idea.
 
for sorting sure, but what about when we hit year 10000?
 
Well, microsoft thought of that!
yyyyy-MM-dd HH:mm:ss.fff+Z
 
8:59 PM
nice
its going to break so many programs though
lol
 
But currently, writing 02015 looks a bit odd.
 
and we're 8000 years away
nothing I write today will EVER be needed in 8000 years
 
I don't know how many people will be using my applications ~8000 years from now.
But yyyyy is a valid format for DateTime.
 
I don't think c# will exist in 8000 years
 
I will from this day on, start writing my dates as: 020150331230016
or: yyyyyMMddHHmmss
 
9:03 PM
if I have a Location class, and I've parsed in multiple locations to that class, how should I go about outputting each Location? any advice?
 
its so, non-compact
 
@BrianJ in rot-13-base64-encoded HTML-table, encrypted with PGP
 
@diemaus this isn't MVC, its a C# app
 
And i was absolutely not kidding (;
DataGrid?
Do you need to "use" the data? i.e. manipulate it from your app?
 
Just for testing purposes I want to see that each location has been parsed in correctly
 
9:05 PM
@diemaus That make sense?
 
I'll show you the parsed in string of objs
 
@BrianJ write some unit tests
 
its for a console application
mentioned it here last week
text based game
 
@BrianJ Pretty sure that's not VHDL :P
 
9:07 PM
@KendallFrey maybe it somehow encoded?
 
Question: myList.ToDictionary(o => o.Id)works great, but throws if there is a duplicate object. Any thoughts on a work around?
 
hastebin fail, needs formatting
 
@ohmusama .Distinct()?
 
okay I'll re format @CharlieBrown
 
39
Q: Convert list to dictionary using linq and not worrying about duplicates

leoraI have a list of Person objects. I want to convert to a Dictionary where the key is the first and last name (concatenated) and the value is the Person object. The issue is that I have some duplicated people, so this blows up if I use this code: private Dictionary<string, Person> _people = new D...

14
Q: How do you get the duplicate key that ToDictionary() has failed on?

Robert HarveyI'm creating a Dictionary object, using IEnumerable's ToDictionary() extension method: var dictionary = new Dictionary<string, MyType> (myCollection.ToDictionary<MyType, string>(k => k.Key)); When it executes, it throws the following ArgumentException: An item with the same key has alr...

 
9:09 PM
the first one works
I would use distinct
but my objects are not set up for that
 
@ohmusama there is also a DistinctBy(x => x.Prop) extension in some lib.
 
how about now? @CharlieBrown hastebin.com/lojayijufe.vhdl
 
@BrianJ better.
 
can't really use it, licencing is a pain at work
 
@BrianJ seeing as it is a console app, you don't have much choice then: Console.WriteLine/Console.Write
@ohmusama then write one yourself.
 
9:11 PM
you see what I'm getting at? each Location object has been parsed in and a get/set called on it, just wondering I can access each location by index? for example the name attr
 
true, true
but I'm lazy
 
Have you serialized your data to a class @BrianJ?
 
yeah this is the class, its Java btw, just looking for some advice on how to approach the problem: hastebin.com/eqaqizapab.java
@diemaus
 
@BrianJ i have no idea. I tend to avoid Java like it was PHP
 
java, i quit
send it to the java people
 
9:14 PM
This is the C# room.
 
@BrianJ but, i do say again, write a unit test, no matter what language. The unit test will show you how to create the public interface you want
 
Hrm... This seems to easy and there must be a mistake.
Person.Address (List<AddressType>)

 updatedValues.Address = updatePerson.Address.Where(a => CurrentMemberRecord.Address.Any(address => address.CompareTo(a) == 0)).ToList();
I implement ICOmparable<T> on the Address type to allow for this comparison. HOwever, I worry that order might be an issue with this
 
CompareTo(a) seems akward
Would be more syntactically correct to do IEquatable<T>
 
Figured it out.
 
I have a PersonObject with 10 properties of List<T>, and I need to compare each one for speicifc values. I can't hash because there are hashed data within those objects that will be different
@CharlieBrown That could work too, I just need a way to say "They equal, they don't equal, or one exists / doesn't exist"
 
9:21 PM
with iequatable<T> you can use linq operators like Union<> and others (Intersect)
 
Never used those to be honest ;)
 
Intersect will find the matches between 2 lists
 
My requirement is:
The updated data must be compared against the data already stored in the system. If the incoming data is different, update only the specific bits that are different. If the system data has data that doesn't exist in the incoming data, remove that data from the system. If the data is the same, do not update.
 
yeah, classic total pain in the butt
 
do they have IDs?
 
9:24 PM
So there's 3 possible outcomes, which is why I used the CompareTo<T> as I can give -1,0, 1 as return types
 
@RyanTernier if the data is different, why can't you just overwrite the whole damn thing? just switch the reference
 
I could "brute force" this and create 1000 lines of code to deal with it, but it turns into a maintenance nightmare
@Pheonixblade9 Because the business dates of the data would get updated, which would send out massive amounts of distributions to all health authorities
 
or implement dirty checking on properties, then hit it with automapper
 
which means my team would get a lot of phone calls
 
@RyanTernier use reflection..?
 
9:25 PM
@CharlieBrown I thought about using automapper, but we're a bit too far ahead
 
@diemaus yeah I'll figure it out, gonna try the unit test as @CharlieBrown suggested. The main thing I want to do is load in the first location, then access following locations based on their position in the list
 
@Pheonixblade9 I could, but I only care about 20% of the properties on each object ;)
 
well then make a data annotation for the fields?
[Watch] or something
 
Or an interface that only has the properties you're interested in examining?
 
@CharlieBrown Intersect looks like it would be magic to use, does it matter in the order you have the lists?
 
9:32 PM
anyone know efficiency of yield return vs composing a list and returning that as an object?
 
It's really not about efficiency.
yield return will just "pause" while you go through the list
 
@ohmusama efficiency in speed, space, maintenance, or some other dimension?
 
uhm, anything that you know
there are always tradeoffs
 
Have you guys ever made a "ProviderProvider"?
IModelValidatorProviderProvider ASP.NET 5 MVC has one.
 
@ohmusama if you are using yield return, you can do allocations only as you need them. This may be significantly more memory efficient, may allow you to handle unmanaged resources better, or may be completely a non-issue, depending on what you're actually delivering.
 
9:43 PM
just curious, I was doing a transform simple from type a to type b that involved some recursion but I wasn't sure if I should get the results back and store them in memory twice effectively if that is faster, etc
since List.Add is a method call per item
and List has a tendency to be bad for large numbers of things, when it expands its internal array and does an Array.Copy
granted I could just declare my own array assuming i know the size up front
which i do
these are the things I think about all day
 
This may seem dumb, but I've got a bunch of drop down list. Four to be exact, but they're your typical select id... approach for web-forms. When I change the top one, all the sub parameters should also refresh, how can I do? trigger that?
 
do they need to have new data?
for example top is country, second is state/prov, third is city
 
10:01 PM
Well, they correlate:
        <select id="drpSection" runat="server" datasourceid="dsSection" datatextfield="Name" datavaluefield="CategoryId" />
        <select id="drpGroup" runat="server" datasourceid="dsGroup" datatextfield="Name" datavaluefield="CategoryId" />
        <select id="drpCat" runat="server" datasourceid="dsCat" datatextfield="Name" datavaluefield="CategoryId" />
        <select id="drpSubCat" runat="server" datasourceid="dsSubCat" datatextfield="Name" datavaluefield="CategoryId" />
So when you choose a section, group, cat, and subcat should change. When you change group cat and subcat should change.
 
you can load all the data locally into js arrays, and then have js events update the stuff.
its how I tend to do things, but you could always do ajax requests back to the server bound to the onChange (I think?) event
 
Hm, sigh
 
<asp:Select onChange="update"
its been a while since I've done webforms
 
What would that do?
You saying couple update to a function which is an Ajax call?
The problem I have no, I change section group changes but cat and subcat don't change.
 
I think winforms has some sort of ajax helper thing that updates parts of the page if needed, best of my knowledge
the codebehind then updates the collections responsible for populating the data in the other drop downs, and binds the data, which will cause a psudo page reload
 
10:08 PM
...?
 
you are not using <asp:...?
 
No, trying to use default
 
okay, I'd just use javascript then
easiest thing, imho
 
Okay. I may have an idea by tweaking ControlParameter
 
10:30 PM
ConditionalWeakTable<TKey, TValue> is never a perfect fit for me
 
10:52 PM
wtf
there are 3 database strategies in this project
there is a .sqlproj, a code-first model, and an .edmx file
 
I know how to fix it, but I don't wanna break the other guy's shit
there is a severe lack of deleting unused code
 
@JohanLarsson why use that vs a dictionary?
 
to prevent leaks
 
ohh, I see, so if GC is called, it abandons it if it is the only reference
interesting
 
10:59 PM
@Pheonixblade9 HAHAH FEEL MY PAIN!
 
otherwise, its basically a dictionary then
 
you know, I just got an email from facebook recruiting earlier today...
:P
 
All those wallmart employees...
 
why not just order online and pick up?
 
apparently people like the social aspect of shopping?
 
11:10 PM
yeah, I really love seeing all those middle aged women in sweat pants
 
Grocery stores should be used for produce and perishables. For the rest, Hi Amazon.
 
although the college girls in yoga pants ain't so bad
 
People of wallmart - youtube.com/watch?v=OVrweqoHT7Q
didn't expect it to show "that" image haha
 
lol
@RyanTernier did you ever have trouble meeting people as an engineer?
it's a very common theme in Seattle for women to explicitly say "I don't date engineers"
 
People... as in girls? or as in other people? ;)
It's not hard, it's just "hard" for me to go out and meet new people. I wish it was easier for me :\
Bri always says "Just go to the bar and start playing pool with some guys" i'm like "um... wha.... er.... .. um... no?"
 
11:13 PM
lol
I don't have a problem meeting guys
girls just always seem so defensive here
 
When I was in the dating stage of my life, I got so fucking friendzoned
 
you've met me, I'm not a creep
I don't believe in the friendzone any more really
 
Hot girls would invite me over to their house, and i'd give them a foot rub and talk about shit... i friendzoned myself.
 
I just don't meet anyone
and I don't feel encouraged to meet people, because everyone is taken or uninterested anyways
 
They'd say "Hey, thanks for fixing my shower. Do you want to try it out?" i'd say "no, sorry I need to go shopping".
 
11:15 PM
hahahahaha
 
<-- so f''n naive.
 
that's YOUR fault :P
I definitely had some of those moments in high school and college
 
anyways, i gota scoot out. going to the fair tonight.
 
have fun
 
we got a new puppy :)
 
11:15 PM
whoo!
 
Cheers
 

« first day (1627 days earlier)      last day (3338 days later) »