I often speak very highly of LINQ and also LINQPad. This morning, I was struggling with some sql that would let me do a count by DateTime while stripping out the time portion. That is, I just want to know how many entries are in the table for each Date (regardless of what time). I tried lots of solutions I got from search, and they all gave not correct results, usually involving Casting and other non fun sql programming constructs.
(more…)
I have not blogged a lot about Silicon Valley Code Camp this year, not because a lot has not been going on, but actually, because a lot has been going on and I have not had much free time to blog. Tonight, we have reached one of our critical milestones which is we are publishing the schedule! 6 Tracks, 148 Sessions, and so far, 1265 attendees registered. Last year we got about 400 more registered in the last week, so I’m expecting a busy week when people start seeing the schedule on line.
I thought in this post, I’d talk a little about how we actually do the scheduling. Many people have asked over the past 4 years if we have some automated neuron network doing heuristic processing of all the constraints kind of like an airline reservation and scheduling system. Well, the answer is I wish we did. What we do have is a large room at our house with a wood floor, plenty of light, a nice paper cutter and a small group of us to fight over where everything should go.
(more…)
I’ve done a bunch of Lat/Long type mapping programs over the years and one of the problems always ends up around performance. A common problem is that you keep redrawing the same line over and over and over. The pixels you are drawing don’t get any darker so all you are doing is wasting time. In my current project, we were drawing approximately 1500 lines when we really only had about 150 unique lines. I’ve always known how to solve this problem with a bunch of thrown together hacked up code, but now, LINQ gives me a very clean way to do it.
So, the problem is you have a record that looks like this:
public class LoadSegmentInfoFlat
{
public double? OriginLattitude { get; set; }
public double? OriginLongitude { get; set; }
public double? DestinationLattitude { get; set; }
public double? DestinationLongitude { get; set; }
public string Color { get; set; }
}
(more…)
So, this is kind of embarrassing, that it took me a while to figure this out. I have not been doing pure asp.net server control programming for a while, but I figure since it took me a while, maybe there is someone else in the same boat.
So, you have a GridView or DetailsView that has standard “Edit” “Update” “New” type command buttons on them. The way they get there is by having the declaration something like this:
(more…)
So, I’m really enjoying using LINQ and specifically LINQ2SQL. I’ve got a current problem where I want to get from a long list of loads (potentially hundreds per day), a short list of days in reverse order, that have a certain number or more of loads.
(more…)