« first day (1945 days earlier)      last day (3020 days later) » 

4:00 PM
I have a bunch of rows and I want to select the row with the highest price for a given name. How do I do this in sql server?
 
my.api.add("query", data)
@kush select top 1 * from table where name = 'me' order by price desc
 
@Wardy thank you but I was unclear. I don't have the input parameter. I want all distinct names
oh wait
 
you mean you want to group rows by name and take the top row from each set ?
 
yes
 
@Wardy Hello
 
4:03 PM
@CodeMaster hey
 
@Wardy do you have time now?
 
select dbo.PriceETL.StockSymbol, dbo.PriceETL.ClosingDate, dbo.PriceETL.ClosingPrice from dbo.PriceETL where dbo.PriceETL.ClosingDate >= '2014-03-01' and dbo.PriceETL.ClosingDate < '2014-04-01';
 
@CodeMaster whats up?
 
so this is the query that gives me all records between two dates. however, I need the highest price for each day,
 
@Wardy I added object.cshtml inside Views>Shared>DisplayTemplates. Do I need to use UIHint inside ViewModel to map it to object?
 
4:04 PM
@kush group the rows by date then order the rows by date then by price
then select the top row from each group
@CodeMaster nope ... thats a template for rendering objects
there are (if you look at the MVC source) 2 folders you can use
~/Views/DisplayTemplates
~/Views/EditorTemplates
 
@Wardy wow thank you
 
@kush np
 
@Wardy right
 
so if you have a template called "object.cshtml" in each of those folders you can do something like ...
@Html.EditorFor(m => m)
@Html.DisplayFor(m => m)
for any view model
then when you write your view models put data annotations on them
so lets say you have a model like this ...
class foo {
   public int Id { get;set; }
   public string Bar { get;set; }
}
you could give the object template a whole foo object
and it should handle calling Displayfor / EditorFor its children
rendering mvc is a heirarchical thing
model > child > grand child
each template can call DisplayFor(m => someChild) / EditorFor ...
 
@Wardy This is where I don't get it.
 
4:10 PM
If you go back to those DisplayTemplates / EditorTemplates folder you can then add a template for int and for string
or for "bar" and then put [UIHint("bar")] on a property on any model
class foo {
   public int Id { get;set; }
   [UIHint("bar")]
   public string Bar { get;set; }
}
by default it would use a string template for bar
but we now say to mvc "use a bar template"
 
correct
 
so when we do @DisplayFor(m => m.Bar)
it'll look at metadata and go ... ah ok you mean use "~/Views/DisplayTemplates/Bar.cshtml"
you with me?
 
so we need to do this on model level not the viewmodel, right?
 
you can do it at any level
 
it depends whether I call @model my model or viewmodel inside view right?
 
4:13 PM
basically do the generic bit up front and leverage the framework is all im saying
in other words
think about it like this ...
if I write a template that lets me render out a bunch of child templates for any object by looking through their properties
I can now template out anything
@Html.DisplayFor(m => ANYTHING)
 
is template same as scaffolding?
 
yeh basically
try it yourself ... define any viewmodel you like then create a new view and in it do this ...
@Html.EditorFor(m => m)
 
javascript: 2%3 ===2 :D
happpppy
 
before my chat today, I tried @Html.EditorFor(m => m) without object.cshtml, the page rendered all of my fields inside ViewModel
 
you should get a form or at least a collection of property editing fields
@CodeMaster defining that template gives us control of how we render any object
 
4:16 PM
@Wardy Thanks.
 
@Greg np glad I could help
 
@Wardy I am stuck
select dbo.PriceETL.ClosingDate, MAX(dbo.PriceETL.ClosingPrice) AS x from dbo.PriceETL where dbo.PriceETL.ClosingDate > '2014-02-28' and dbo.PriceETL.ClosingDate < '2014-04-01' group by dbo.PriceETL.ClosingDate order by dbo.PriceETL.ClosingDate asc;
 
wish we could get rep in chat lol
 
@Wardy Yeah, that'd be nice.
 
might suggest it on meta
 
4:18 PM
I got lost where you said:
you could give the object template a whole foo object
 
@CodeMaster imagine you are crawling a filesystem
 
@Wardy there is a third column I need but I don't know how to get to it. Is there something like max for unique?
 
think of the object template like a way of templating a directory
 
select MAX(dbo.PriceETL.StockSymbol) as y, dbo.PriceETL.ClosingDate, MAX(dbo.PriceETL.ClosingPrice) AS x from dbo.PriceETL where dbo.PriceETL.ClosingDate > '2014-02-28' and dbo.PriceETL.ClosingDate < '2014-04-01' group by dbo.PriceETL.ClosingDate order by dbo.PriceETL.ClosingDate asc;
doesn't look right
 
how does the whole foo class understands that object.cshtml exists?
 
4:20 PM
I'd like the value of y the same as Max(ClosingPrice)
 
because the templating/scaffolding should go via object.cshtml, right?
 
Winforms need to die in a fire.
 
something like this
select (select StockSymbol from dbo.PriceETL where ClosingPrice == x), dbo.PriceETL.ClosingDate, MAX(dbo.PriceETL.ClosingPrice) AS x from dbo.PriceETL where dbo.PriceETL.ClosingDate > '2014-02-28' and dbo.PriceETL.ClosingDate < '2014-04-01' group by dbo.PriceETL.ClosingDate order by dbo.PriceETL.ClosingDate asc;
 
/s/winforms/js
 
@kush uh ...
 
4:24 PM
Shitty idea of the day: Winforms implemented in JavaScript
 
@CodeMaster it doesnt mvc is using the template not the foo class
@mikeTheLiar WTF .... kill that guy
@kush can't remember how to do group by off the top of my head
 
@Wardy by default? so folder name DisplayTemplates or EditorTemplates are static?
 
Hahaha this poor bastard: codeproject.com/Tips/127356/…
> I'be been working on application that needs to load page and display it in WebBrowser control. Second requirement was to allow interaction between WinForms application and web page.
 
@kush you need something like ...
select ... from ... group by date order by date, price desc
@CodeMaster they are commonly known folders by the default routing engine code in MVC
bit like how it knows that it should get all templates from ~/views by default
 
@Wardy problem is stocksymbol and closing price don't exist yet
 
user47589
4:27 PM
you can create your own VirtualPathProvider (IIRC) that lets you customize the folders if you really want to.
 
what do you guys use for drag and drop files?
 
or rather there are multiple options for a given date
 
dropzone?
 
user47589
i let my secretary handle dragging and dropping.
 
@kush you probably need to use a projection first then
select from (select ... ) group by date, order by date, price desc
 
user47589
4:28 PM
my therapist tells me i need to project less
 
@Failsafe whatever fancy component happens to be about at the time
 
@Wardy good to know, because I was thinking that I need to map it to object.cshtml.
 
@Wardy so Dropzonejs
 
there's a great html editor component that I like called redactor
contains a file upload bit too
 
@Amy maybe consider splitting your repo into separate projects
 
user47589
4:29 PM
have you heard of JicamaJS, @Failsafe?
 
@Amy do you usually say my doctor or the doctor?
 
@Amy That revolutionary new frameork? No, tell me more!
 
jicamaJS does all the things
 
@Wardy I will play with it and understand the concept. I'm currently 10% unsure about some parts but I won't bug you anymore with questions. Thank you
 
@CodeMaster its hard to explain without putting an example up .. but the long and short of it is that if you do MVC right you can get most of it sorted generically
 
4:30 PM
@Failsafe I should put on my resume that I contributed to it! You'll vouch for me yes?
 
user47589
@kush, make a pull request and no vouching will be necessary.
 
user47589
JicamaJS needs good contributors.
 
@CodeMaster to really mess your head ... I have a Controller<T> in my codebase
 
Any decent resume these days will have github integration, surely?
 
lets me do really nutty stuff
 
4:31 PM
@Wardy I agree.
 
@Wardy well the problem is that I know there is only one stock symbol for a given price (prices are distinct) but sql server doesn't know that
 
@Wardy with three 'l's?
you psycho
 
@CharlieBrown are you available for an EF question?
 
@Squiggle oops
 
4:32 PM
@Squiggle we have a typo in one of our namespaces
 
@Squiggle there we go
 
@Amy I just added some text to the readme file o.O
 
It's apparently been there for years
 
@Wardy you just did :D
 
user47589
4:33 PM
ah that was you, got it.
 
user47589
yes we have you registered as one of our core contributors.
 
It is the same gravatar :D
 
@Amy @kush the trick is to just be the project owner and accept merge requests
<--
that way no effort required
 
@Failsafe hey maybe we can make a grocery list in git and have the person in charge of budget accept or deny pull requests github.com/9034725985/grocery
 
@CharlieBrown okay.. thinking things through before I ask something stupid
 
4:36 PM
so sort of like a dictatorship but people can write comments on the pull request why they need that item the next week
speaking of which... comments on pull requests are not a part of git, are they?
 
any good books on assemblies, dlls, etc.. for how C# project in VS comes together?
 
hehehe
 
@SteveG no
 
i'll cut you
 
@CharlieBrown okay, I've got a little mess here with how I have things set up, with my context. I have this code here: https://gist.github.com/mikey32230/da01f896f903c922529b

I realize the context is disposed after it generates the list. I then pass that list to a DGV on a seperate form.. It works fine as long as I dont need to do something that requires the context to be available. (it just so happens that I added a Display property to a Class that iterates through a virtual List property during the DGV display, to create a CSV string from that list to display in the DGV).
 
4:40 PM
@SteveG too late, beat you to it
 
you cut yourself?
 
lmao
right
 
!!googleimages hi
 
@kush That didn't make much sense. Use the !!/help command to learn more.
 
4:41 PM
@Michael didnt we solve this last week?
 
is there a query for the bot to search google images and embed the top result?
 
no, thank god
imagine how much trouble people could get in
 
!!urban chicken dinner
 
@kush [chicken dinner](http://chicken-dinner.urbanup.com/5269962) Deriving from - "winner winner, chicken dinner"

Someone has eaten (or should eat) a chicken dinner if they are deemed to be a winner.

Someone achieving success in any form, will be worth of consuming chicken for their dinner.
 
@CharlieBrown yes, you explained setting up a view model. (i figured that might be the answer here) let me double check on some of that code again real quick.
 
4:42 PM
@SteveG but then we could write !!images emo people
 
lol yeah, then trollers could google image bbc
 
@kush I think there used to be
 
:o
 
it was... dramatic
 
realllly
 
4:44 PM
@KendallFrey !!youtube dramatic look
I screwed it up, didn't I?
!!youtube dramatic look beaver
 
it's a prairie dog dammit
 
!!urban praire dogging
 
@kush Praire dogging When you really need to take a shit and the turd is poking its head out your "Praire dogging"
 
lol
 
4:45 PM
and that is why we don't talk about praire dogging
 
what movie is that off of
rat race?
 
!!youtube mitchell webb touching cloth
 
lmao, i really want to youtube breast feeding and see if it shows up
 
<3 that show
 
4:47 PM
!!youtube something inappropriate
 
a | b |c
apple 1 2012
ball 1 2013


I have a query so far that will select 1, and 2013 and now I need something to give me ball which is what corresponds to 2013. How do I do this?

select dbo.PriceETL.ClosingDate, (dbo.PriceETL.ClosingPrice) AS x from dbo.PriceETL where dbo.PriceETL.ClosingDate > '2014-02-28' and dbo.PriceETL.ClosingDate < '2014-04-01' group by dbo.PriceETL.ClosingDate order by dbo.PriceETL.ClosingDate asc, x desc;
!!urban touching cloth
 
@kush touching cloth when the turtle head of ones faeces pretudes to the extent that it touches the cloth which comprises ones underwear. A crude expression with a mighty impact.
 
huh
gross
 
hah
 
4:55 PM
!!youtube What do you get a Heroin Addict for Christmas?
 
@kush Impossible
 
it's such an English term
 
watch this one
 
it's 6pm on Friday. Can I go home yet?
 
4:59 PM
@Squiggle where are you?
 

« first day (1945 days earlier)      last day (3020 days later) »