« first day (1684 days earlier)      last day (3264 days later) » 

10:01 PM
@JohanLarsson I think Advanced Serial Port Monitor might go into promiscuous mode. I only used a trial, and it was kinda tricky to use.
 
In any case, ienumerable is about processing a sequence, not about adding to a collection so I don't think it solves the problem
 
IEnumerable is good for using in a chained sequence of sequence processing.
For example, I am glad that using .Where().Select() doesn't cause enumeration
 
Yep
 
dumb sample perhaps
I use IReadOnlyList<T> to show that a sequence is not lazy. Ie that it has been ToArray or ToListed
 
10:05 PM
I don't get it
 
Yeah I would just IList to show that
 
nah, IList exposes mutable
also not generic
 
So does I readonly
You didn't demo it properly
 
does what?
 
Doesn't ireadonly still expose add?
 
10:07 PM
no, I just linked the msdn
 
I thought that Ireadonly implemented ilist
 
it exposes .Count and the get part of the indexer
IList<T> probably implements IReadOnlyList<T>
nope
@NETscape ty sir
 
Readonly collection implementation ilist and icollection
Which have add methods
Which throw in this case
 
Ireadonly no
 
10:11 PM
ah, ok
 
Readonly yes
 
I'm not talking about the Liskov breaking guys
 
But in general you should be safe with ienumerable
Although I'm kind of coming full circle against my hate for ienumerable abuse
I just say it because ienumerable.count does a check if it's an IList, so that count and any and first etc are O(1) ops
 
perhaps a better sample
 
But I like your approach of indicating that something had already been enumerated
 
10:18 PM
also covariant, I don't see any downsides really
 
IAlreadyEnumerated
 
:)
It shuts up R# also iirc
 
@drch - lol
 
nice to be able to use for loops when it is a fit
 
Srsly though there should be a Wrapper that enumerates once
Seems like a novel Ide
a
 
10:21 PM
how do you mean?
 
A Wrapper class that calls ToList once
But maybe in a safer way so that modifications don't persist
 
Oh man, that would be a pain to implement
 
@drch Sort of like Seq.cache in F#? ;)
 
In the end though, would you rather new Wrapper() or .ToList() ?
 
(though that still enumerates lazily)
 
10:25 PM
@ReedCopsey perhaps. Admittedly my F# is fairly poor
 
see the remarks - I think it's basically what you're after ;)
 
@ReedCopsey - Did you write the remarks? :)
 
Actually @ReedCopsey, since you're here. Where does F# fit into normal everyday Web Apps? Or desktop apps for that matter?
 
@drch - Just replace all your c# with f#
 
@TravisJ nope ;)
 
10:27 PM
I'm interested but I don't know how to fit it into my normal tasks.
 
@drch Wherever you want it to fit in -
it depends a bit on what you're doing, and how much you want to embrace it
 
ok maybe a better question
 
but it's still .NET, so its easy to write libraries that are consumable from C# code
 
In a normal every day Web app or desktop app
When do you say "this is a problem for F#"
 
I don't, really - the only real "problem" tends to be a lack of built-in tooling
ie: no templates in the box
 
10:30 PM
@ReedCopsey - Does the F# team ever integrate code that you've written?
 
yeah - I've had 2 pull requests accepted
so I have an F# mug ;)
 
Nice! :)
 
I want a signalr t-shirt
Although I think my code has long since been refactored out
 
I have an SO t-shirt but I am terrified to wear it for fear of ruining it somehow either in the wash or randomly.
 
hahaha
I have a few of them - and a sweatshirt, and two jackets now :)
the jackets are actually really nice
though they're new SE jackets are probably nicer - I just wish they had the SO logo and not the SE one on them :S
 
10:34 PM
they should send you one every year
 
Post that on meta
 
no reason, usually newer members, should get better gear than the veterans
 
I wish we got a little bit of rep from chat
 
yeah, that'd be nice - tough to track how to assign it though
 
I've helped a zillion newbs in here
 
10:35 PM
you got a logo
 
I think that some questions are better suited for chat as well
 
^
 
1
A: Serialization of a class with events

Johan LarssonYou should do: [field: NonSerialized] public event ChangedEventHandler Changed; As described in the docs: In the case of events, you must also add the field attribute qualifier when applying the NonSerialized attribute so that the attribute is applied to the underlying delegate rather than...

^is pretty nice, did not know until today
used to write in in the 8+ answer way
 
javascriptserializer uses [ScriptIgnore]
 
architect is the name of a design smell right?
 
10:38 PM
someone comes in chat and enables feature by prefixing their question with a "Q:" or Q:<tab>, like a tag... people that respond to the post. user can choose everyone that has helped, each question is worth 5 rep. if 5 people help, they all get one rep, if 10 people help they all get 1 rep, if 2 people help, first to answer gets 3 rep, second gets 2 rep.
 
@drch - Okay, has question for you. I have a datetime in c#, and I am using EF to query to see if the field in mssql is within 5 days of that datetime. What do you think that would look like? I wanted to just Math.Abs(a - b) < 5 but I don't think that would translate properly.
 
TimeSpan? or is that not allowed in EF?
 
Well it would get translated to SQL
And I am not sure how SQL deals with the subtraction of two datetimes
And also I am fairly positive it has no Math class
 
I think you have to do some sql func BS
 
ugh
Ah, I know :) Will be extra verbose
 
10:40 PM
It's better to use the native datediff to avoid it happening in memory
 
datediff?
Ah but this is in a linq where clause
 
Or whatever the tsql is to compare dates by days
 
.Where( entity => entity.Date - memoryDate > 5 )
super naive version^
 
Or, you just calculate the datetime first
 
The problem is that with the EF query, I think if I do where entity.Date < nextMonth && entity.Date > prevMonth it will not short circuit
So it will literally pull every record
 
10:42 PM
I calc the datetime first like:
DateTime cutoff = memoryDate.AddDays(-5);
 
Is the datetime something absolute? Or is it based on the data in the record?
 
So the in memory date is may 29th for example
and I am looking for stuff within 5 days of that in the table
 
if(DateTime.Compare(dateTime.AddDays(-5), DateTime.Now) >= 0) ?
 
Ie, if you say max = datetime.Now - 5 days, that easy
 
@ohmusama wouldn't compare on Days only though...
the only down side
 
10:45 PM
I feel like I already solved this issue =/
 
PS I get real Internet on Friday so I can then write proper code in chat
 
I think using two where clauses must work, will test, thanks for input :D
CreationDate.AddDays(-5) < entity.DateCreated &&
CreationDate.AddDays(5) > entity.DateCreated
 
Yeah so long as that date is some variable it should work nicely
 
realize that 05/27/15 != 05/27/15
 
?
Why is that
 
10:50 PM
DateTime includes hh mm ss
 
Ah, yes of course :D
That isn't entirely what you said though :P
 
well i'm typing it the same way people think about it :)
 
But I'd you had something like (x.CreatedDate - x.ModifiedDate).Total days >5 you would probably get an exception
Would be nice if .Net had a date class
 
TimeSpan ts = CreationDate - entity.DateCreated;
if(ts.Days <= 5)
{
    //within 5 days
}
wouldn't throw exception, they are structs
but doesn't take into account timezones
 
just use DateTimeOffset
 
10:58 PM
Meh
I prefer storing everything as utc
 
yeah, go update your DB to convert everything to DTO... but you can't because you didn't store their timezone info in the first place. well shucks... looks like you can't use DTO
timezones are stupid
is it bad i didn't know what minuend and subtrahend were? i kind of implied, but never heard them being used before
 
Huh?
Sorry autocorrect
I have German and English autocorrect installed
 
I was hoping we were going to go on a german word train
 
@drch - gesundheit
 
That's why some words will randomly be capitalized
 
11:02 PM
I do that Normally
 
@ohmusama wir könnten das gerne machen :)
 
Naturlich
 
oops, I didn't add days before linq
LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.
 
But I think after your said 'bin' then what would naturally come after would be 'ein Berliner'
 
that would be a good ending to that sentence
as it is the most famous
 
11:04 PM
well, if i knew nouns and verbs, and adverbs, and the rest of deutsch, I might be able to read that
 
loads database into memory
8.07%
 
I'm pretty sure the more famous ending is "... Hitler!"
 
lol
I don't think so
 
@TravisJ Yeah that's what I meant about the date being a pre calculated variable and not something based on the record itself
 
was a minor fix
 
11:06 PM
I let my database grow too big
31 million rows
 
Man I habe no Internet in the new flat yet, so I had a marathon on the weekend of the German version of The Office
You would be surprised at how often there are Hitler jokes
 
DIE BEARS, DAS BEETS, DIE BATTELSHTAR GALACTICA
First thing that came to mind.
 
hahahaha
 
Whenever I imagine Germans in comedic situations they're always yelling.
 
i meant 'heil hitler' ... the ending being hitler
and they are always yelling, so their life is basically a joke...? now i get it!
 
11:10 PM
we started off with "Ich bin"
 
oh haha. how oddly fitting that was
 
12.08%
 
BTW I think it's Bären, Roterüben, Battleship Gallactica
Beet = red turnip
 
Maybe I just associate all humor on that side of the pond with John Cleese.
And he's always yelling.
 
That whole sketch is yelling
 
11:17 PM
That whole show is yelling.
 
Yeah ha
You young kids in chat should consider coming to this side of the pond btw
 
I've become an expert on Visas in the past few years
 
I've done a European backpacking trip. And I'm visiting again in August
 
Where in August?
Man that is really young john Cleese
 
11:21 PM
Vienna. I'm gonna go hiking in the Alps if all goes to plan.
 
Nice
Vienna is probably the next place I will move to
BTW if the dates aren't set in stone you should postpone it till Sept and experience oktoberfest
 
@drch - cross your fingers, we have an L1 pending :D
 
@drch - I debated that but I've heard it's super crowded.
 
It's crowded because it's awesome
 
Yeah exactly
 
11:28 PM
Lately I've been wanting to get away from the crowds of people on vacation. Hence the hiking.
 
They made a bunch of rules for the next one
 
But I'll probably check it out someday.
 
Before, all of the tents were completely reserved
Starting this year, they can only reserve 50% during the daytime and 70% in the evening I think
@SpencerRuport Yeah but it's worth checking out for one day. Even if it's during the week
 
For the uninitiated (me) what are "the tents" and what is reserved?
 
There are 14 big beer tents
 
11:31 PM
Is there seating in them or something?
 
Think like circus tents that hold 4k Pete.
People.
 
And what does a reservation in a tent get you?
 
Honestly it gets you a place to sit
Because otherwise it would be taken
 
gotcha :)
 
11:32 PM
It's like a reservation at a restaurant or whatever
 
Makes sense.
 
But they are trying this year to bring it back to the jedermann
The every day Joe
So there are now limits about how much of the tent for they can book and how much has to be reserved for people list showing up
Like, on the weekends, you have to show up at 8am to get a seat in a tent when they open at 10:30
During the week it's a lot easier
 
Ah okay.
What date does it start?
 
Let me check
 
Is google talk broken for anybody else?
 
11:37 PM
Sept 19
 
Ah dang.
I fly back at the end of August. Don't think I could extend my trip that far :)
 
Well if you are able to, the definitely do it. It's a great party
Just have to budget the 200€ for lederhosen
Would be a shame to miss it by a couple weeks
 
When I was in Argentina I went hiking and stayed at one of the cabins up in the mountains. I met a Swiss couple and they told me the Alps have something similar and I had to check it out.
So that's what I based this trip around.
 
Yeah Vienna is a paradise
 
I was there a few years ago. I went to a club and saw Datsik perform. :D
 
11:57 PM
Do you speak any German?
 

« first day (1684 days earlier)      last day (3264 days later) »