Posts

sql server 2008 - SQL - Select Record High For Each Day of the Week -

it returns rows sorted countofrecords desc. i'd have 7 rows here, showing highest value ever specified day. each day of week should occur once , once. possible without lot of pain? select count(*) countofrecords, cast(floor(cast([visit].[datetimeentered] float)) smalldatetime) dateentered, datepart(dw, visit.datetimeentered) dayoftheweek visit inner join useragent on useragent.useragentid = visit.useragentid useragent.isbot = 0 group cast(floor(cast([visit].[datetimeentered] float)) smalldatetime), datepart(dw, visit.datetimeentered) order countofrecords desc edit1: think both answers getting @ same thing. i've accepted 1 posted first. i'm going mention worked right off bat while other did not. i'm getting following errors when run marc_s's query: msg 207, level 16, state 1, line 29 invalid column name 'rownum'. msg 207, level 16, state 1, line 25 invalid column name 'countofrecords'. msg 207, level 16, state 1, line 26...

How to build a jar file from clojure source code on Windows XP -

could please tell how build jar file clojure source code on window xp, wihout using maven or such software? clojure , windows xp without tool, you're bound quirky steps manually. have clojure.jar in current directory, along target folder compilation named classes , clojure source file in src/awesome.clj following code: (ns awesome) (defn life-universe-and-everything [] (println "42")) in order compile issue following commands on command line: edit: use semicolon instead of colon separate classpath elements in windows environments java -cp clojure.jar;classes;src clojure.main clojure 1.3.0 user=> (compile 'awesome) this produce compiled classes classes folder. please note if code depends on library, need adapt -cp parameter values when starting jvm. than, create jar file using: jar cvf awesome.jar -c classes . finally, call function: java -cp clojure.jar;awesome.jar clojure.main -e "(use 'awesome) (life-universe-and-ev...

c# - Getting control value when switching a view as part of a multiview -

i have following code in aspx page: <asp:button id="display_button" runat="server" text="display" onclick="button1_click" /> &nbsp; <asp:button id="edit_button" runat="server" text="edit" onclick="button2_click" /> &nbsp; <asp:button id="save_button" runat="server" text="save" onclick="button3_click" visible="false" /> &nbsp; <asp:multiview id="multiview1" runat="server" activeviewindex="0"> <asp:view id="view1" runat="server"> <asp:formview id="view_program" runat="server"> <itemtemplate> <%# eval("status").tostring().trim() %> </itemtemplate> </asp:formview> </asp:view> <asp:view id="view2" runat="server"> ...

ASP.Net MVC: Can you use Data Annotations / Validation with an AJAX / jQuery call? -

can use data annotations / validation ajax / jquery call? if so, please provide example or post shows example. basically have seen example of how use data annotations, full post back. there way ajax / jquery call? not sure how since not sure how construct model object on client side. (i assume have do.) someone told me can done, don't understand how can be. thanks help. if use html.ajaxform (instead of html.beginform) validate using ajax. however don't think can validate using jquery. microsoft has it's own ajax libraries , call/maintain themselves. don't think can hook own code in between.

c# - How to replace a page by date -

there way replace page @ date&time ? example: want @ friday default.aspx down, , other page turn default.aspx... , @ sunday first default.aspx return. someone have idea? maybe better change display of default.aspx. need replace screen "we down while" or that. i mean button that... using c#. asp.net well, create second page users go when page down, , call applicationdown. then, program redirect page friday's , saturday's only. if ((datetime.now.dayofweek == dayofweek.friday && datetime.now.hour >= 17) || datetime.now.dayofweek == dayofweek.saturday) { response.redirect("applicationdown.aspx"); } seems odd way of doing things, work if put @ top of default.aspx's page load.

javascript - Is it possible to invoke a JS function from a different thread? -

i'm trying make 2 different browsers communicate each other through native code host (c++) using js window.external. the syntax like: on destination.js: window.external.register("dest", eventcallbak); function eventcallback(senderid, data) { alert("message recieved " + senderid + " data of " + data); } on source.js: window.external.sendmsg("source", "dest", "hello dest! source..."); i've managed synchronously, saving eventcallback parameter, save idispatch , invoke when asked (all in same thread). no problems there. the troubles begin when trying asynchronously, meaning - saving eventcallback idispatch on 1 thread, , invoke later on in thread, causes invoke method fail hresult of e_unexpected . any ideas? thanks, two browser instances use different instances of js vm. cannot in general take 1 object 1 vm/heap , pass vm/heap. so need invent kind of marshaling here. ...

javascript - jQuery $.inArray() returns 0 -

if have array ('a', 'b') , check $.inarray('a', thearray); index, 0, , false. need check result further , it's annoying... is there quick method trough can true/false, , not indexes? basically have string in html5 data attribute: data-options="a,b,c" , 3 a, b, c variables in javascript must take true/false values based on what's inside data-options... you can achieve invoking binary not operator. if( ~$.inarray('a', thearray) ) { } explained in detail here: typeofnan.blogspot.com/2011/04/did-you-know-episode-ii.html