Posts

angularjs - Angular UI datepicker popup with type-in returns one date earlier than typed in protractor -

this bit complicated, i've verified both angular scenario tester , protractor, , in user interface. set twitter bootstrap 3.x (i'm using latest had 3.0.3 before) - bower boostrap install set angular ui built-in templates (i'm using angular-ui-bootstrap-bower library bower) set datepicker-popup field in angular-ui this: <label for='due_date'>due date</label> <input id='due_date' class='form-control' type='text' datepicker-options="dateoptions" datepicker-popup='yyyy-mm-dd' ng-model="task.duedate"> add button , controller method inspect variable. testing: click on date field, , type in date: 2013-01-05 hit escape or click on field close popup dialog (i.e. don't click done) submit form you'll find date 1 day behind. interestingly, if click on actual date in date picker, correct. including 'today'. if remove ui datepicker, w...

ruby on rails - strong parameters doesn't allow to create nested attributes with json. ActiveRecord::AssociationTypeMismatch error -

i have 2 models: conference , talks. conference has_many talks , accepts_nested_attributes_for :talks, :allow_destroy => true params posting looks that: {"id"=>"2", "name"=>"rails4444", "tags"=>"ruby, rails, backbone, javascript", "date"=>"2014-02-22", "organizer"=>"backbonemeetupgroup", "description"=>"conference cool speakers", "talks"=>{"title"=>"fdsf", "video_url"=>"fdsf"}, where setting talks should created in database. my html looks that: <input type="text" name="talks[title]" placeholder="talk title" /> <input type="text" name="talks[video_url]" placeholder="url" /> and when updating conference model talks gives me error: activerecord::associationtypemismatch (talk(#70154003251480) expected,...

How do I write javascript cookies from a form and then print the info in an alert or hidden div? -

how use javascript write cookies form fields, , print info in alert or hidden div? here example of have tried far..... <script type="text/javascript"> function cookieform() { document.cookie = "name_first" + encodeuricomponent(document.forms[0].name_first.value); } function printcustomerinfo() { var querydata = decodeuricomponent(document.cookie); var queryarray = querydata.split(";"); if (document.cookie) { window.alert("your info. is:" + queryarray[0]); window.alert[0].name_last.value = queryarray[1].substring(queryarray[1].lastindexof("=") + 1); } } </script> <input type="submit" value="submit" onclick="cookieform(), printcustomerinfo()"/> first, you're missing "=" in cookie string: document.cookie = "name_first=" + encodeuricomponent(document.forms[0].name_first.value); second, querydata has no ";" split by, , no last na...

javascript - How can I use the File Writer object in steroids js to write to the local JSON file? -

i'm building application steroids js , i'd able overwrite contents of local json file app gets data upon app's launch. think file writer object need accomplish task i'm not quite of i'm not quite of how can write local json file under www/myapp.json it. information on file writer : http://docs.appgyver.com/en/edge/cordova_file_file.md.html#filewriter details the filewriter object offers way write utf-8 encoded files device file system. applications respond writestart, progress, write, writeend, error, , abort events. each filewriter corresponds single file, data can written many times. filewriter maintains file's position , length attributes, allow app seek , write anywhere in file. default, filewriter writes beginning of file, overwriting existing data. set optional append boolean true in filewriter's constructor write end of file. text data supported platforms listed below. text encoded utf-8 before being written filesystem. platforms support...

audio - Change the «voice» played with a button in iOS app -

i have soundboard app says phrases, want able change male/female voice, thing have no idea how make this. appreciated. i'm using avfoundation/avaudioplayer play sounds. thank you! can bit hard ! you need change pitch of voices, if raise have higher pitch (can defined female), if decrease pitch give low sound (can defined male)! the simplest way playing áudio in different sample rate, change speed of audio :-( the hard , right way build pitch shift algorithm, can done in time domain (psola, sola, wsola) or in frequency domain (phase vocoder) ! some of these techniques can disfigure original voice (can change phase , envelope) looking artificial, can especific question methods in https://dsp.stackexchange.com/ more detailed answer !

asp.net - Is It Possible to stop a server request manually while the request is being processed by the server -

i using asp.net , ajax functionalities make requests server via web services search functionality. on click of search button, making screen inactive displaying loading image on it. issue searches takes longer time, , user forced wait till results fetched. there way search can cancelled manually, button click while search being performed server. any or alternates appreciated. one thing can try set timeout on ajax call, take here: asp-net-page-webmethod-ajax-call-request-timed-out another thing use javascript settimeout display user message after few seconds saying "its taking long. wait results or abort?" "abort" link refreshes page.

shell - How to print out pdf file with script generated highlighted output? -

Image
i've been used pidcat jakewharton see log of app: $ pidcat [org.test.myapp] and redirect file: $ pidcat [org.test.myapp] > ~/dev/myapp_log the pidcat generate pretty highlighted content try keep in pdf file. i've tried: $ cupsfilter ~/dev/myapp_log ~/dev/myapp_log.pdf but generate plain white text pdf. how keep beautiful highlight format in pdf file? p.s. it's long log. can't print screen.. this how original output like: and here's partial pidcat output opened default text editor on mac: [107m [0m process created broadcast com.nortek.app/org.videolan.vlc.phonestatereceiver [107m [0m pid: 9718 uid: 10157 gids: {50157, 3003, 1028, 1015} [101m [0m process 9718 ended [107m [0m process created activity com.nortek.app/.ui.activity.dummymainactivity [107m [0m pid: 2840 uid: 10157 gids: {50157, 3003, 1028, 1015...