Posts

javascript - How to access res.locals on client-side -

i'm attempting pass req.user details client-side angular code using res.locals in express route: 'use strict'; var path = require('path'); var player = function(req, res) { res.locals.player = req.player; res.sendfile(path.join(__dirname, '../assets', 'index.html')); }; module.exports = { player: player }; the html renders expected, i'm not sure how access res.locals.player now.

c - I can't remove the spaces from a string -

i'm doing this challenge on reddit. now problem on bottom of program (unfinished), posted whole thing in case might have top of it. now i'm trying remove spaces string user supposed enter, putting non-space characters character array. however, every time print try print string supposed removed spaces, prints first word. i, however, want print words 1 single combined word. for example, when try convert hello world! , it's supposed give me helloworld! , it's giving me hello . i've tried different methods pointers , whatnot , every time face same problem. what's going on here? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main(void) { char stringtobepacked[100]; //this string user puts in char stringtobepackedwospaces[100]; //this gonna string without spaces int , o , p; //incrementers/counters double amtfchrsnstrng; //ask user sentence input: printf("please type...

pickadate - jQuery - getting text from attribute -

i'm using plugin called pickadate , i'm trying aria label text chosen date , apply onto div. im able retrieve value once if click on day date in #date doesn't update? http://jsfiddle.net/mg6fxqbe/ var $elements = { datepicker: $('.js-datepicker'), }; $elements.datepicker.pickadate(); $('.picker__day').on('click', function () { var date = $(this).attr('aria-label'); $('#date').empty().text(date); }); as described in docs datepicker plugin can use onset event retrieve current date has been set. the onset event callback passed context argument provides details properties being “set”. within scope of 6 of these events, this refers picker. $('.js-datepicker').pickadate({ onset: function() { $('#date').text(this.$node.val()); } }); #date{ font-weight:bold; font-size:40px; margin:20px 0; } <script src="https://ajax.googleapis.com/ajax/...

virtual machine - Moving VirtualBox vhd to another location causes issue with uuid issues with the vhd -

Image
i have installed 1 virtual machine disk on c: drive. got annoyingly full , had move vhd. location: c:\..\vms\vm1 f:\..\vms\vm2 then regenerated uuid hd (ran admin privileges): c:\..\virtualbox> .\vboxmanage.exe internalcommands sethduuid "f:\..\.vmdk" uuid changed to: 6d201451-721c-433b-98a3-6fef07e61feb however when try attach moved disk error (below). my vagrantbox.xml not contain uuid's specified in error. o have tried variations restart of whole here is: <?xml version="1.0"?> <!-- ** not edit file. ** if make changes file while virtualbox related application ** running, changes overwritten later, without taking effect. ** use vboxmanage or virtualbox manager gui make changes. --> <virtualbox xmlns="http://www.innotek.de/virtualbox-settings" version="1.12-windows"> <global> <extradata> <extradataitem name="gui/detailspageboxes" value="general,preview,system,...

c# - Refactor multiple goto statements from the loop body -

i struggling replicate following fortran 77 subroutine c# method. main problem trying rid of fortran's goto statements. the fortran c# conversion looks fine, still goto statements remained. there way of them can replaced conditionals or other ways? thank you. here fortran subroutine: c program temp subroutine temp (acl,adu,aeff,c,cair,cb,cbare, + cclo,count1,csum,di,ed,emcl,emsk,enbal, + enbal2,ere,erel,esw,eswdif,eswphy,eswpot, + evap,facl,fcl,fec,feff,food,h,hc,he,ht,htcl,icl,j, + mbody,p,po,r1,r2,rbare,rcl, + rclo,rclo2,rdcl,rdsk,rob,rsum,sex,sigm,sw,swf,swm, + ta,tbody,tcl,tcore,tmrt,tsk,v,vb,vb1,vb2, + vpa,vpts,wetsk,wd,wr,ws,wsum,xx) real acl,adu,aeff,c(0:10),cair,cb,cbare, + cclo,csum,di,ed,emcl,emsk,enbal, + enbal2,ere,erel,esw,eswdif,eswphy,eswpot, + evap,facl,fcl,fec,feff,food,h,hc,he,ht,htcl,icl, + mbody,p,po,r1,r2,rbare,rcl, + rclo,rclo2,rdcl,rdsk,rob,rsum,sigm,sw,swf,swm, ...

javascript - Jquery focus on next td element with an input child -

i have table tr , td elements so. <tr> <td><input type="text"></td> <td><input type="text"></td> <td></td> <td></td> <td><input type="text"></td> </tr> some tds have input elements , don't. using jquery, how focus next input while skipping td's without input fields? i have tried this: $(':focus').parent().next("td:has(input)").focus(); with no success. the end goal able use keybindings have created cycle forwards , backwards through inputs without using 'tab' key. .next checks element's immediate next sibling, not check of successive siblings. if want check of it's siblings, 1 solution first element of .nextall $(':focus').parent().nextall("td:has(input)").eq(0).focus();

windows - Why is command start with parameter /wait not working properly? -

ok racking brain!!! have 1 batch file start batch file every time run batch file open command window title being batch file located. here batch file that's preforming start /wait command: ::------------------------------ configure power settings --------------------------- @echo off start /wait "%~d0\setup_postop\01 configure power settings\always on.bat" ::------------------------------ programs , features ------------------------------ start /wait "%~d0\setup_postop\02 uninstall unwanted software\programs , features.bat" the above batch file supposed run "always on" batch file open command window. here "always on" batch file trying start: @echo off echo not close!!! %windir%\system32\powercfg.exe /import "%~d0\setup_postop\01 configure power settings\alwayson.pow" 2f5ac084-2edf-444a-b1b9-8de872cf798e %windir%\system32\powercfg.exe /setactive 2f5ac084-2edf-444a-b1b9-8de872cf798e start /wait %windir%\system32\power...