Posts

Chunk patch uploading to online GitHub then push online for low-speed networks -

i on low-speed network. how can push large git commits kind of resume capability? like, can upload chunks of patch files combine them on git server, push them master? usually i'd recommend git such purposes, since compresses , transmits quite efficiently. anywho -- have branch you'd cherry-pick 1 commit @ time , push them individually, say. btw, smaller commits way go! ;-) also, create patches, of course, , upload them somehow else (scp, ...) might resumable way, , apply them on git server. doubt, more efficient, using git.

ldapjs - node.js synchronous function call for authentication -

i newbie in node.js, , trying learn how works. know default node.js function calls asynchronous. need ldap authentication in application need wait server response check whether user credentials right or wrong.the ldap part working fine not sure on how return data function call in synchronous way. below part of code. router.js var express = require('express'); var router = express.router(); var tools = require('./authenticateuser'); router.post('/authenticateuser', function(req, res) { // in below line calling method // should return userdn (a string) tools.searchuser(req.body.user, req.body.passwd); res.render('home.jade'); }); authenticateuser.js module.exports = { searchuser : function (username, password) { admindn = *************; adminpassword = '*********'; basedn = '***'; var ldap = require('ldapjs'); process.env.node_tls_reject_unauthorized = "0"; ...

c# - 'MediaElement.SetSource()' isn't updating consistently -

my program should play video when user presses 'play' button. while this, first time press 'play' button nothing happen. i have traced bug following code, sets mediaelement 'videoplayer': public void playvideo_tapped(object sender, tappedroutedeventargs e) { setupvideo(); videoplayer.play(); } public async void setupvideo() { if(vm == null) return; storagefile videofile = vm.videofile; if (videofile == null || !videofile.contenttype.equals("video/mp4")) return; using (irandomaccessstream filestream = await videofile.openasync(fileaccessmode.read)) { videoplayer.setsource(filestream, videofile.contenttype); } } the culprit seems 'setsource()' method @ end. variable changes first click of 'play' next variable 'videoplayer.playtosource', changed null real value. (as side note, variable 'videoplayer.currentstate' changes 'closed' 'opening' resets 'closed' bef...

android - Handle programmaticaly created spinners and locate them to bottom -

i developing app, can fill school shedule(with auth etc.) in dialog class create new spinner + textview. how allocate them in mainactivity , how set content view bottom of list? know there's layoutparams thing, can't understand it. also great if can me remove items dialog window after choosing. code: public class othersubjectsdialog extends dialogfragment implements view.onclicklistener { public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { getdialog().settitle("title!"); view v = inflater.inflate(r.layout.dialog_layout, null); v.findviewbyid(r.id.btn_inf).setonclicklistener(this); v.findviewbyid(r.id.btn_phys).setonclicklistener(this); v.findviewbyid(r.id.btn_soc).setonclicklistener(this); v.findviewbyid(r.id.btn_chem).setonclicklistener(this); v.findviewbyid(r.id.btn_biol).setonclicklistener(this); return v; } @targetapi(build.version_codes.m) public v...

marshalling - Calling C DLL from C# caused Attempted to read or write protected memory -

i'm trying use zabbix_sender function in c# program. here c# code: [structlayout(layoutkind.sequential, charset = charset.ansi)] public struct zabbix_sender_value_t { [marshalas(unmanagedtype.lpstr)] public string host; [marshalas(unmanagedtype.lpstr)] public string key; [marshalas(unmanagedtype.lpstr)] public string value; } [dllimport("zabbix_sender.dll", charset = charset.ansi)] [return: marshalas(unmanagedtype.u4)] public static extern int zabbix_sender_send_values( [param: marshalas(unmanagedtype.lpstr)] string address, [param: marshalas(unmanagedtype.u2)] ushort port, [param: marshalas(unmanagedtype.lpstr)] string source, [param: marshalas(unmanagedtype.struct)] zabbix_sender_value_t values, [param: marshalas(unmanagedtype.u4)] int count, [param: marshalas(unmanagedtype.lpstr)] string result ); static void main() { zabbix_sender_value_t values; values.host = "some_hostname"; values.key = "ag...

javascript - How to keep selected value after submit form - JQuery -

i have form: <form id="new_user" class="simple_form new_user" method="post" accept-charset="utf-8" action="/admin/stats" novalidate="novalidate"> <div class="col-lg-4"> <h2>stats by:</h2> <div class="col-md-10 col-sm-10"> <div class="form-group country optional user_country"> <select id="user_country" class="country optional wabi-form-control select form-control" name="user[country]"> </div> </div> <div class="col-md-10 col-sm-10"> <input class="btn btn-wabi btn-block" type="submit" value="show stats" name="commit"> </div> </div> </form>' ho keep selected value user_country after show stats button click? with php, p...

python - pandas: Parametric statistic test for two proportions (with H0: p1=p2). How to use scipy.stats? -

based on source data, create dataframe aggregated counts per share looks like: share count_cm total_cm count_pm total_pm 117 395 309 1176 b 38 395 158 1176 c 4 395 22 1176 d 4 395 9 1176 e 8 395 19 1176 f 44 395 175 1176 g 37 395 110 1176 h 35 395 111 1176 11 395 21 1176 j 39 395 92 1176 k 16 395 48 1176 l 31 395 72 1176 m 11 395 30 1176 in order run proportion tests between current month , previous month, calculate z score using following function: import numpy np def z_prop(c1,c2,n1,n2): numerator = c1/n1 - c2/n2 p = (c1+c2...