Posts

git - Nodegit Remote Push with --force -

i'm using single github repo ci work. app receives zip file, create repo locally, commit files master branch, add origin remote , try push github. since files exist in github repo, error, "[error: cannot push because reference trying update on remote contains commits not present locally.]" does nodegit support pushing remote --force flag overwrite everything? i've looked through docs , can't find it. thanks! jeff nodegit supports passing refspecs remote. force push master adding + front of refspec. example: remote.push('+refs/heads/master:remotes/origin/master', null, mysignature, mymessage)

vba - Find "carriage return" in a mail.body -

i have mails : hello, please note did ... @ 16h15 actions done: rebuilding etc sincerely mr. the actions change in every mail , want insert action in excel. problem don't know how "carriage return" (idk if right name, traduction gave me). find in internet vblfchr(10) "carriage return". tried find beginning : technicposition= instr(1, .body, "actions done: ") technicaction= mid(.body, technicposition, 14) ' first char action but can't last char (first "carriage return" technicaction). tried many things : instr(technicposition, .body, vbcrlf) my question : how sentence begin word "carriage return" (the first comes after beginning word) ? the carriage return in email body vbnewline this how it sub sample() dim sbody string dim myar dim long ' '~~> rest of code ' sbody = omail.body '~~> testing purpose 'sb...

JSF Primefaces Datatable ActionLink problems -

Image
prerequisites: glasfish 3.1 jsf 2.1 primefaces 5.2 user story: i want implement delete row function on primefaces datatable, delete function has displayed within table. implementation: datatable header <p:datatable value="#{a.list}" var="var"> delete <p:column headertext="delete"> <p:commandlink value="-" action="#{a.delete(var)}" /> </p:column> delete method in bean public void delete(something sth) { model.getlist().remove(sth); } outcome: when hovering on commandlink showing me uniform resource locator localhost/applicationname/# eclipse giving me facelet validator warning marker syntax error on expressionlanguage code #{a.delete(var)} question: what missing in order delete row? solution: i have changed commandlink jsf (not primefaces) , got error, method shouldnt void, string after changing , returning null works... public string d...

Randomly Assign Integers in R within groups without replacement -

i running experiment 2 experiments: experiment_1 , experiment_2. each experiment has 5 different treatments (i.e. 1, 2, 3, 4, 5). trying randomly assign treatments within groups. we via sampling without replacement iteratively within each group. want insure balanced sample possible in treatment (e.g. don't want end 4 subjects in group 1 getting assigned treatment 2 , no 1 getting treatment 1). if group has 23 subjects, want split respondent 4 subgroups of 5, , 1 subgroup of 3. want randomly sample without replacement across first subgroup of 5, gets assigned 1 of treatments, same things the second, third , 4th subgroup of 5, , final subgroup of 3 randomly sample without replacement. guarantee every treatment assigned @ least 4 subjects, , 3 assigned 5 subjects within group. groups in experiment , both treatments. resultant output this... group experiment_1 experiment_2 [1,] 1 5 3 [2,] 1 3 2 [3,] ...

multithreading - C++ Inheritance : Calling virtual method when it has been overridden -

i trying build service object can run (i.e. execute it's run() function) in separate thread. service object #include <boost/noncopyable.hpp> #include <atomic> #include <thread> #include <iostream> class service : public boost::noncopyable { public: service() : stop_(false), started_(false) { } virtual ~service() { stop(); if (thread_.joinable()) { thread_.join(); } } virtual void stop() { stop_ = true; } virtual void start() { if (started_.load() == false) { started_ = true; thread_ = std::thread([&] () { run(); }); } } protected: virtual void run() = 0; std::atomic<bool> stop_; std::atomic<bool> started_; std::thread thread_; }; i creating test class inherits abstract class , called in main() function class test : public service { public: test() : service() { std::cout<< "ctor" << std::endl; start(); } ~test()...

android - Issue in writing NDEF message to NFC tag -

i trying write ndef message nfc tag. have code write ndef message in onnewintent(). control not going onnewintent(). after onresume(), hanging. pls find below code. public class mainactivity extends activity { private bluetoothadapter mbluetoothadapter; private nfcadapter mnfcadapter; static final byte[] type_bt_oob = "application/vnd.bluetooth.ep.oob". getbytes(charset.forname("us_ascii")); private ndefmessage mndefmessage; string mlocalbluetoothaddress; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toast.maketext(this, "inside oncreate", toast.length_long).show(); mnfcadapter = nfcadapter.getdefaultadapter(this); if (mnfcadapter == null) { // stop here, need nfc toast.maketext(this, "this device doesn't support nfc.", toast.length_long).sho...

Managing network interfaces from node.js -

i developing node.js/express server application on debian platform. need allow users view and, importantly, change basic network settings: static/ip vs. auto/dhcp. suppose use (and write supporting code for): cp.exec('ifconfig', function (err, ifconfigout, stderr) but wondering best practices doing , if there recommended npm module (didn't seem find active ones)? short answer, given lack of responses , googling: there appears no 'de facto' node module provides necessary services managing network interfaces. did find 2 had promise incomplete: https://github.com/fgribreau/network-config , https://www.npmjs.com/package/ife . edit: of course can use https://nodejs.org/api/os.html#os_os_networkinterfaces view existing interfaces, if want change anything, core node not appear have functionality.