Posts

javascript - I need to put text in a <h> that is in a Div that is in another Div that is with in another yet another div -

i need put text in <h3> in div in div in yet div. here looks like: <div id="loginmodal" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 193.8px;"><iframe hspace="0" src="/client/en_us/cntest/search/patronlogin/https:$002f$002farrowhead.ent.sirsi.net$002fclient$002fen_us$002fcntest$002fsearch$002faccount$003fdt$003dlist" name="dialog_iframecontent610" style="width:350px;height:215px;" frameborder="0"> </iframe></div> <iframe hspace="0" src="/client/en_us/cntest/search/patronlogin/https:$002f$002farrowhead.ent.sirsi.net$002fclient$002fen_us$002fcntest$002fsearch$002faccount$003fdt$003dlist" name="dialog_iframecontent610" style="width:350px;height:215px;" frameborder="0"> </iframe> #document <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "h...

node.js - How to test socket.io events being called with sinon.spy -

first of all, i'm trying test second time function being called returns correct value. more specific, i'm trying test second time event received socket.on() returns correct value. i know sinon.spy() can detect whether function being called or not. seems not working socket.io events. i'm trying test example, var socketio = io.connect(someurl); socketio.on(eventname, cb); if event 'connect' called. tried var spy = sinon.spy(socketio, 'on'); assert(spy.witharg(eventname).called); but says it's never being called. furthermore, if i'd test data in callback function right or not, example var socketio = io.connect(someurl); socketio.on(eventname, function(data) { data.should.equal(something); }); is possible test that?

c# - Access Denied!? I cant open a file from my install folder on the C Drive -

Image
what doing wrong? i have read/copy/write process access folder installed software. this worked great when testing build, once solution created stopped working. doing wrong? (breakdown of code) access pdf called ctw.pdf next create temp copy software fills in , flatted on completion, software saves new copy same directory new name (i add time , date file name) here's code: if (screenlock.text == "") { } else { string filenameexisting = @"c:\program files (x86)\compliance pro 2\ctw.pdf"; string filenamenew = @"c:\program files (x86)\compliance pro 2" + " ctw.pdf" + datetime.now.tostring("m/d/yyyy") + datetime.now.tostring("hh:mm:ss"); using (var existingfilestream = new filestream(filenameexisting, filemode.open)) using (var newfilestream = new filestream(filenamenew, filemode.create)) { // https://www.codeproject.com/tips/679606/filling-pdf-form-using-itext-pdf-library /...

c# - Playing .WAV file on Internet Explorer -

i trying play .wav file on internet explorer thru windows media player ( assuming default media player client machine ) view <a class="" href="@url.action("voicesample", "report", new { num = item.num })">play voice</a> report controller public filestreamresult voicesample(string num) { filestream fs = null; string sfilename = ""; string fnamewithfullpath = @"c:\test.wav"; fileinfo myfile = new fileinfo(fnamewithfullpath); if (myfile.exists) { fs = new filestream(fnamewithfullpath, filemode.open, fileaccess.read); sfilename = "test.wav"; } return file(fs, "audio/x-wav"); } this works when run localhost , doesn't when publish code server , run server , windows media player opens , throws below error:- "windows media player...

statistics - How to find Answer type using statistical methods nlp in java? -

i trying build simple question answering app using java. have used hardcoded rules answer type detection. arent enough (how can ever? ). wandering if there library uses pairs of (question, answer type) , deduces answer type other questions using statistical methods. i have tried stanford nlp not past dependencies, syntax errors , whatnot. know simple 1 can use? thanks in advance.

How to echo a variable that I don't know is set or not in an easy to read way in PHP -

just have simple question. think know answer hope not. i want able echo out variable don't know whether set or not. want default variable if not set , don't want have check if set first. so here example: i have $variable don't know whether set or not. then echo "this number: " . $variable; if $variable set 5, want print "this number: 5" , if not set, want print "this number: 0". i know this: echo "this number: " . ($variable? : 0); but still notice saying $variable undefined, though echo displays correctly. i this if (!isset($variable)) { $variable = 0); } echo "this number: " . $variable; but that's code if i'm doing lot. the null coalescing operator new best friend. echo "this number: " . ($variable ?? 0); the null coalescing operator available of php 7.0.0. alternative, use in older versions right php 5.3.0, use isset() , ternary operator ?: . echo ...

jquery - Froala Editor how save content to textarea before send form -

i use in project froala. textarea element in form sent server. add text froala , click submit form button. textarea field on server empty(null). think need call froala method prepare textarea before submitting form server, not know one. what problem? view @using (html.beginform("updatepost", "post", formmethod.post, new { id = "postform" })) { <textarea id="previewtext" name="previewtext"></textarea> <button class="btn btn-success w-100">save</button> } server [httppost] public jobject updatepost([fromform] post postform) { //... } javascript $('#previewtext').froalaeditor({ language: 'ru', imageuploadurl: '../uploadimage', imageuploadparams: { postid: tmigin.cms.posteditor.postid }, imagemanagerloadurl: '../loadimages', imagemanagerloadparams...