Posts

html - Sort table with unknown number of headers using jQuery Table Sort, then only sort on 2 headers -

the scenario i have table on web page dynamically generated using jsp. number of columns/headers variable (could 6 or 40+). i'm using jquery tablesorter sort table. table should sort on header elements 5 , 6 moment. the question using tablesorter allows set header elements false , disabling them sort options. since number of headers variable need way of inverting options can set sorter option true , rest disabled default. either that, or need way total number of header elements , run through loop set them false. the syntax little tricky me i'm not sure how loop through following: $(document).ready(function() { $("table").tablesorter({ headers: { 0: { sorter: false }, 1: { sorter: false } . . . } }); }); so 2 want sort on in example "primary di...

c# - Hosting a Form's content inside of another Form? -

i need host windows form inside form, iframe in html. however, using multi-document interface causes form's window controls rendered well. need only content of form rendered. how this? i have application this. for contained form, set .toplevel = false, formborderstyle none , set dock property fill. in parent form, have split panel , add contained form the panel want in. i don't remember why didn't want go usercontrols more, years ago. seem recall having reason though. of contained forms use usercontrols.

webkit - webkitgtk how to control resource loading depends on the type of the resource? -

i want control resource downloading depending on type of resource css, script, img, etc. i testing thing loads html loacl , manipulate dom webkitgtk. load html local file via webkitgtk. but know, there resource download img, css or script. don't want download @ all. img , script, setting webkitwebsettings ( of webkitgtk ). but there not way block css in webkitwebsettings. tried hooking "resource-request-starting" signal. static void loadstatuscb(webkitwebview *web_view, gparamspec *pspec, void* context); i block network requests hooking. don't want block resource downloading. want block depends on type ( css, script, img, ... ) for example, if test_file request came <link type="text/css" rel="stylesheet" href="http://test.com/test_file"> i block. because css. but from <script type="text/javascript" src="http://test.com/test_file"></script> i not block. i tried information ...

asynchronous - Async.TryCancelled doesn't work with Async.RunSynchronously -

i try create agent updates ui based on user interaction. if user clicks on button, gui should refreshed. preparation of model takes long time, desirable if user clicks on other button, preparation cancelled , new 1 started. what have far: open system.threading type private refreshmsg = | refreshmsg of asyncreplychannel<cancellationtokensource> type refresheragent() = let mutable cancel : cancellationtokensource = null let dosomemodelcomputation = async { printfn "start %a" do! async.sleep(1000) printfn "middle %a" do! async.sleep(1000) printfn "end %a" } let mbox = mailboxprocessor.start(fun mbx -> let rec loop () = async { let! msg = mbx.receive() match msg | refreshmsg(chnl) -> let cancelsrc = new cancellationtokensource() chnl.reply(cancels...

linux - Custom stdin for Node.js child process -

is possible execute child process in node.js custom stdin under linux? the documention refers stdinstream internal use only: there several internal options. in particular stdinstream, stdoutstream, stderrstream. internal use only. undocumented apis in node, should not used. why it's internal use only? tried give custom readablestream it, yielded nasty v8 exception. no surprise after using internal api... some background: need execute git commit after node.js process has closed stdin (this cannot workaround currently). issue git gets angry @ if try commit closed stdin . update: issue originates a node.js bug , i'll keep question here since think i'm not 1 wondering this. rather using stdinstream , think should use customfds instead. same documentation: there deprecated option called customfds allows 1 specify specific file descriptors stdio of child process. api not portable platforms , therefore removed. customfds possible hook new ...

c# - datatable as an itemsource for datagrid in wpf -

how can set datagrid control values datatable ? i use source public static readonly dependencyproperty objdatatabledefaultviewproperty = dependencyproperty.register("objdatatabledefaultview", typeof(system.data.dataview), typeof(window1), new frameworkpropertymetadata()); public system.data.dataview objdatatabledefaultview { { return (system.data.dataview)getvalue(objdatatabledefaultviewproperty); } set { setvalue(objdatatabledefaultviewproperty, value); } } private void createobjdatatable() { try { objdatatabledefaultview = table.defaultview; } catch (exception ex) { messagebox.show(ex.message); } } but has got error message , program stops, a first chance exception of type 'system.windows.markup.xamlparseexception' occurred in presentationframework.dll additional information: cannot create instance of 'window1' define...

html - How to randomly assign a color on hover effect -

i've never seen hover effect before, , i'm trying understand how it's achieved. you'll notice in example, when user hovers on link, color link turns can any 1 one of 5 colors assigned within style sheet (see below) @ random. how create hover effect? can done purely css? a:hover { color:#1ace84; text-decoration: none; padding-bottom: 2px; border: 0; background-image: none; } a.green:hover { color: #1ace84; } a.purple:hover { color: #a262c0; } a.teal:hover { color: #4ac0aa; } a.violet:hover { color: #8c78ba; } a.pink:hover { color: #d529cd; } since random factor introduced, don't think there's way of doing purely css. here's simple approach problem, using jquery. you can see working example here: http://jsfiddle.net/gngjz/1/ $(document).ready(function() { $("a").hover(function(e) { var randomclass = getrandomclass(); $(e.target).attr("class", randomclass); }); }); function ge...