Posts

javascript - nodejs bootstrap project works local only -

ive been trying out different things, , looking various ways solve it, i'm in need of hints make work. i have working nodejs bootstrap project gulp. website functions locally. so in project have fiollowing files (among other folders) : gulpfile.js index.html package.json when locally run project via 'gulp dev' seems perfect. on heroku after deploying gives me error: npm err! missing script: start this makes sense, because indeed package.json doesn't have start script. how can work on local? any leads? thanks node.js file name index.js first before start move current files new folder called public in parent folder above public create file index.js once in parent folder above public run in command line directory created index.js file npm express --save this install mini framework node.js , save project.json config for index.js file content /// start var express = require('express'); var path = require('path') v...

javascript - facebook social plug-in not showing up when added dynamically -

i adding facebook social plug in webpage when manually add : <div class="fb-comments" data-href="http://website.com/z" data-width="700" data-numposts="7" data-colorscheme="light"></div> it works , , when javascript code add , doesn't any ideas ? the js sdk goes through document once when initialized, such elements parse social plugins. if want parse content add document later, need call fb.xfbml.parse() . https://developers.facebook.com/docs/reference/javascript/fb.xfbml.parse/

PostgreSQL replication locale issues (Ubuntu master, Windows slave) -

master ubuntu 14.04, slave windows 2008 r2 server, both running postgresql 9.6.5 (64-bits). able setup , start replication per this guide . psql can confirm changes being replicated, pgadmin4 not let me connect due following error message: fatal: database locale incompatible operating system detail: database initialized lc_collate "en_ca.utf-8", not recognized setlocale(). hint: recreate database locale or install missing locale. it understanding locale "en_ca.utf-8" on linux , "english_canada.1252" on windows , not equivalent. pgadmin defect or did forget something? try on windows 2012 now.

Shutting down namenode hadoop cluster -

i'm trying setup hadoop cluster , following error:- $hadoop_prefix/bin/hdfs namenode -format re-format filesystem in storage directory /var/hadoop/hadoop-namenode ? (y or n) y 17/09/11 19:41:55 info namenode.fsimage: allocated new blockpoolid: bp-448039548-10.211.55.101-1505158915421 17/09/11 19:41:55 info common.storage: storage directory /var/hadoop/hadoop-namenode has been formatted. 17/09/11 19:41:55 info namenode.nnstorageretentionmanager: going retain 1 images txid >= 0 17/09/11 19:41:55 info util.exitutil: exiting status 0 17/09/11 19:41:55 info namenode.namenode: shutdown_msg: /************************************************************ shutdown_msg: shutting down namenode @ node1/10.211.55.101 im trying follow tutorial setup cluster. https://github.com/vangj/vagrant-hadoop-2.4.1-spark-1.0.1 this not error. before can start hdfs, need format namenode. similar before can run linux/windows need format disk.

Migrating from Solace 8.4 to 8.5 - error at Docker startup -

just installed , tried start solace 8.5 community edition in docker. had been running 8.4 weeks. 8.5 attempts start , dies following error: 2017-09-11t18:55:36+0000 ip-10-97-56-158 root[178]: /usr/sw adcmndisktrans.cpp:150 (admanager - 0x00000001) main(0)@dataplane(11) fatal file /usr/sw/internalspool/softadb/backingstore actual size(536870912) != expected size(805306368) rolling 8.4 runs fine. docker command is: docker run -v /data/vmr/adb:/usr/sw/adb -v /data/vmr/internalspool/softadb:/usr/sw/internalspool/softadb -v /data/vmr/jail:/usr/sw/jail -v /data/vmr/var:/usr/sw/var -v /data/vmr/internalspool:/usr/sw/internalspool -v /data/vmr/diags:/var/lib/solace/diags -d --network=host --uts=host --shm-size=4g --ulimit core=-1 --ulimit memlock=-1 --ulimit nofile=2448:38048 --cap-add=ipc_lock --cap-add=sys_nice --env 'username_admin_globalaccesslevel=admin' --env 'username_admin_password=admin' --name=solace8...

c++ - Avoid memory allocation with std::function and member function -

this code illustrating question. #include <functional> struct mycallback { void fire() { } }; int main() { mycallback cb; std::function<void(void)> func = std::bind(&mycallback::fire, &cb); } experiments valgrind shows line assigning func dynamically allocates 24 bytes gcc 7.1.1 on linux. in real code, have few handfuls of different structs void(void) member function gets stored in ~10 million std::function<void(void)> . is there way can avoid memory being dynamically allocated when doing std::function<void(void)> func = std::bind(&mycallback::fire, &cb); ? (or otherwise assigning these member function std::function ) unfortunately, allocators std::function has been dropped in c++17. now accepted solution avoid dynamic allocations inside std::function use lambdas instead of std::bind . work, @ least in gcc - has enough static space store lambda in case, not enough space store binder object. std::fun...

c# - Close button relaycommand binding -

i trying make command binding close menu item. found called relaycommand. understand reusable. i have following done: the contructor of main window: public mainwindow() { initializecomponent(); datacontext = new classmainformbtnviewmodel(); } the viewmodelclass: namespace qbox_0000.viewmodel { public class classmainformbtnviewmodel { public relaycommand closeapplicatiecommand { get; private set; } public classmainformbtnviewmodel() { closeapplicatiecommand = new relaycommand(closeapplicatie, canuse); } private void closeapplicatie(object parameter) { //application.current.shutdown(); messagebox.show("test"); } public bool canuse(object parameter) { return true; } } } the relaycommandclass: namespace qbox_0000 { public class relaycommand { readonly action<object> _execute; readon...