Posts

Showing posts from March, 2012

java - Comparing two Integers 'Unnecessary unboxing' warning -

i try compare integers next way (for case, it's good): public void comparemaynull(integer a, integer b) { if ((a == null ? -1 : a.intvalue()) == b.intvalue()) system.out.println("true"); } intellij idea gives me warning 'unnecessary unboxing' on a.intvalue() , b.intvalue() , recommend me simplify code this: public void comparemaynull(integer a, integer b) { if ((a == null ? -1 : a) == b) system.out.println("true"); } but i'm little confused, because references compared if a != null not best practice know. code should use? because have -1 literal int type, a auto-unboxed , (if , if a == null false else expression not evaluated) in evaluation of ternary conditional a == null ? -1 : a; then since expression of type int , b auto-unboxed . therefore can write if ((a == null ? -1 : a) == b) , safe in knowledge java auto-unbox both a , b . explicit unboxing via calls intvalue() superfluous , id

tsql - Is CROSS APPLY the best way or possibly WHEN EXISTS or a subquery? -

i relatively inexperienced when comes sql. wondering if using cross apply best option in sql below? i think duplicating work. works , takes few minutes feeling can done better. the 3 main tables i'm looking @ quite large , on own looking @ couple of million rows each. individual insert statements pulling around 7-15k rows each. declare @master table ( heyno nvarchar(12), postcodestartdttm date, postcodeenddttm date, lzohistorypostcode nvarchar(25), biactivitypostcode nvarchar(25), activityenddttm date ); insert @master select p.pasid, par.startdttm, par.enddttm, pa.postcode lzohistorypostcode, t.postcode biactivitypostcode, t.admitdate healthbi.dbo.[lzo_patientaddressrole] par inner join healthbi.dbo.[lzo_patientaddress] pa on par.[addressoid] = pa.[oid] , pa.[status] = 'a' inner join healthbi.dbo.lzo_patient p

xquery - MarkLogic can't find my xml documents -

Image
i new marklogic , studying xquery. problem documents can't found marklogic server. when execute gives me your query returned empty sequence . can me? there few things may going wrong here. first, let's confirm have loaded content. in query console (which you're using), click explore button. if all's well, should see list of document uris in results section. copy , paste 1 of uris fn:doc-available() command, , should true. if explore didn't show anything, perhaps accidentally loaded content different database. try changing content source "documents", click explore. there? if not, can check other databases have. if you're still not seeing data, connected query console "admin" user? if not, it's possible user connected doesn't have permission see documents. if it's not of above, document load didn't work. how did load content database? edit: comment below leads me think no data has been loaded datab

python - Bokeh TableData on_change selected event called twice -

i have bokeh ui select, datatable , button. select allows go directly given line in datatable button allows go next line in datatable datatable allows direct single line selection (hence updates select). datatable keeps tracking on selection change event through: self.__table_data.on_change('selected',self.table_selection_change) when button clicked, change selected attribute of datatable source new dict structure seen here : self.__table_data.selected = {'2d': {'indices': []}, '1d': {'indices': [my_new_index]}, '0d': {'indices': [], 'glyph': none}} problem is, when did update, callback (table_selection_change) called twice while expect 1 call. problem whole dict should not updated. relevant keys must updated. replacing self.__table_data.selected = {'2d': {'indices': []}, '1d': {'indices': [my_new_index]}, '0d': {'indices': [], 'glyph'

python - Getting data from csv -

i getting data frommy csv fields "('value',)". how can remove value. searching yesterday nothing worked me. please me. in advance. my model from django.db import models # create models here. class csvreader(models.model): run = models.charfield(max_length=100, null=true, blank=true) model = models.charfield(max_length=100, null=true, blank=true) name = models.charfield(max_length=100, null=true, blank=true) odometer = models.charfield(max_length=100, null=true, blank=true) vin = models.charfield(max_length=100, null=true, blank=true) bidtype = models.charfield(max_length=100, null=true, blank=true) ammount = models.charfield(max_length=100, null=true, blank=true) buyername = models.charfield(max_length=100, null=true, blank=true) class uploadfile(models.model): upload = models.filefield(upload_to='csv_files') my view # -*- coding: utf-8 -*- import os, re import csv import string django.shortcuts impor

cloudfoundry - Use package manager in a Cloud Foundry instance -

can use apt-get or other package managers in cloud foundry buildpacks or .profile scripts come apps; , if can, how it? expect same way in dockerfile, doesn't work or without sudo in case. can use apt-get or other package managers in cloud foundry buildpacks or .profile scripts come apps; , if can, how it? no. running apt-get or package manager typically require root access , not root access when build pack runs or when application runs (this difference w/docker). that said, can doesn't require root access, if found package manager installed in vcap user's home directory , didn't need root use that. it depends on you're trying install, in cases can work around downloading .deb or .rpm file , manually extracting binaries. typically works ok things shared libraries. download precompiled binary matches stack ( cflinuxfs2 == ubuntu trusty). other things, can build own binaries source. build pack's do, see binary-builder . hope help

mysql - i want to select and display two coluomns ,i.e itemcode and transdate in the subquery -

select itemcode,description,location,stocklevel,wtavg_cost,dddvalue hms_pha_stock c c.stocklevel>0 , itemcode not in ( select itemcode hms_pha_tranheader a, hms_pha_transaction b a.refno = b.refno , a.trantype = b.trantype , a.trantype in ('pto','pis') , b.location ='cph' , a.transdate between '2016-11-01' , '2016-11-08' ) , c.location ='cph' group itemcode you have used subquery in where clause . there can select 1 column satisfy clause condition. below have modified query according requirement select c.itemcode, description, location, stocklevel, wtavg_cost, dddvalue hms_pha_stock c left join (select itemcode, transdate hms_pha_tranheader a, hms_pha_transaction b a.refno = b.refno , a.trantype = b.trantype

python - How do I disable flymake error for one line? -

i using python flymake emacs, , want turn off warnings per line. hoping like apa(**kwdargs) # ignore=w0142 does exist? if you're using pylint flymake , syntax # pylint: disable=w0142 or # pylint: disable=star-args . recommend using human readable version. if install pylint package (in melpa), command pylint-insert-ignore-comment , makes easy insert such comments. finally, newer versions of pylint have removed star-args warning, might want upgrade.

How to do refund in Stripe PHP -

i'm trying make refund in stripe. \stripe\stripe::setapikey("sk_test_mhsahbkatvieiwsdsvc7qfwj"); $re = \stripe\refund::create(array( "charge" => "ch_19dvsliagnbxqsqzfjhop8jq" )); but did not work. 1 guide me wrong doing. i'm getting error: fatal error: class 'stripe_apiresource' not found thanks folks you can refund below \stripe\stripe::setapikey("sk_test_mhsahbkatvieiwsdsvc7qfwj"); $refund = \stripe\refund::create([ 'charge' => 'ch_19dvsliagnbxqsqzfjhop8jq', 'amount' => 1000, // 10 $ 'reason' => 'refund' ]); $balancetransaction = \stripe\balancetransaction::retrieve($refund->balance_transaction);

xml - XSLT - split string using specific character -

i have xml this, <doc> <para>a brief 23 spell* of hea#vy rain* forc^%ed early+ lunch* 98@with nine</para> </doc> i need break text string each * present in text.. so expected output should be, <doc> <para>a brief 23 spell</para> <para>of hea#vy rain</para> <para>forc^%ed early+ lunch</para> <para>98@with nine</para> </doc> i've written following logic that, i have written following xslt that, <xsl:template match="para"> <xsl:analyze-string select="text()" regex="[a-za-z0-9_.]\*"> <xsl:matching-substring> <para> <xsl:value-of select="."/> </para> </xsl:matching-substring> </xsl:analyze-string> </xsl:template> can suggest me how can using xslt? personal preference

extjs - Evaluate A function in itemTpl in a list -

i created store contains data , in view created list connected store show store data, works fine until point want call function instead of show values directly make make operations on value before rendered, how can accomplish inside itemtpl config. view => declaration.js ext.define('alnadeebapp.view.declaration.declaration', { extend: 'ext.panel.panel', xtype: 'declaration', requires: [ 'alnadeebapp.view.declaration.declarationcontroller', 'alnadeebapp.view.declaration.declarationitems', 'alnadeebapp.view.declaration.declarationmodel' ], fullscreen: 'true', getprocessingmsg: function (msg) { return getdeclarationprocessingstatus(msg); }, title: "البيانات", layout: 'fit', cls: 'declarations', scrollable: 'y', controller: 'declaration', viewmodel: 'declarationmodel',

excel - VBA Run Time Error 1004 AutoFilter method of Range class Failed -

i hope can help. getting error run time error 1004 autofilter method of range class failed when run code public sub testthis() , funny thing works itself, when put other code , call it, gives error run time error 1004 autofilter method of range class failed the error happening on line .range("a:k").autofilter field:=11, criteria1:="<>", operator:=xlfiltervalues like said when not called , run no problem when called bugs. appreciated. my code below. sub open_workbook_dialog() dim my_filename variant dim my_workbook workbook msgbox "pick cro file" '<--| txt box prompt pick file my_filename = application.getopenfilename(filefilter:="excel files,*.xl*;*.xm*") '<--| opens file window allow selection if my_filename <> false set my_workbook = workbooks.open(filename:=my_filename) call testthis call filter(my_workbook) '<--|calls filter code , executes end if end sub public sub

swift3 - Value of "String" has no member 'indices' - moving to Swift 3.0 -

i'm moving swift 2 (probably, 2.3) 3.0 , have hard time correcting following code : now, know string not collection anymore. how correct particular code? let separator = anyword.indexof("-")! anyword.substring(with: (anyword.indices.suffix(from: anyword.index(anyword.startindex, offsetby: separator + 1)))) as possible improvement @dfri's first solution , use upperbound of string 's range(of:) method (which bridged nsstring ) – give index after (first occurrence of the) dash in string. import foundation let anyword = "foo-bar" if let separator = anyword.range(of: "-")?.upperbound { let bar = anyword.substring(from: separator) print(bar) // bar } or compacted crazy single binding using optional 's map(_:) method: if let bar = (anyword.range(of: "-")?.upperbound).map(anyword.substring(from:)) { print(bar) // bar } although note general solution problem of 'string not being collection anymo

I'm looking for a way to convert char to bin array in C# -

i'm trying find way convert char bit array, mess bit , convert back. answers string byte. do mean bitarray ? if so: char c = 'x'; byte[] bytes = bitconverter.getbytes(c); bitarray bits = new bitarray(bytes);

javascript - Is it possible to replace an image with another one selected by the user on the fly via jQuery alone? -

i'm having user select image , want change 1 shown on fly without having rely on server-side scripts php? basically, have html has following: <input type="file" id="file" name="file" /> <img id="imagedisplay" src="http://path/to/some/image.jpg" /> then on jquery side have following: $('#file').change(function(e){ alert($(this).val()); }); i hoping replace imagedisplay 's src 1 user selects referenced locally system $(this).val() displays file name won't able reference source. you can use filereader api. the filereader object lets web applications asynchronously read contents of files (or raw data buffers) stored on user's computer. its method filereader.readasdataurl() the readasdataurl method used read contents of specified blob or file. note: works in modern browsers $(document).ready(function() { $('#file').change(function(e) {

javascript - InfoBubble not defines from google maps v3 api -

i trying use infobubbles google api v3 mobile application. code copied https://github.com/googlemaps/js-info-bubble and these js files var map = null, airboxobjects = {}, locationobjects = {}, lastmeasurements = {}; var infobubble = new infobubble({ minheight: 200, minwidth: 200, maxwidth: 300, disableautopan: true }); function getqueryvariable(key) { var query = window.location.search.substring(1); var vars = query.split("&"); (var i=0; i<vars.length; i++) { var pair = vars[i].split("="); if(pair[0] == key) { // key found, return value return pair[1]; } } // key not found, return null return null; } ..... and html <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css"> <meta charset="

c++ - which new operator will be called new or new[]? -

in below program overloaded operator new [] getting called. if comment function overloaded operator new getting called. shouldn't called default new [] operator? #include <iostream> #include <stdlib.h> using namespace std; void *operator new (size_t os) { cout<<"size : "<<os<<endl; void *t; t=malloc(os); if (t==null) {} return (t); } //! comment below function void* operator new[](size_t size){ void* p; cout << "in overloaded new[]" << endl; p = malloc(size); cout << "size :" << size << endl; if(!p){ } return p; } void operator delete(void *ss) {free(ss);} int main () { int *t=new int[10]; delete t; } looking @ the reference , see: void* operator new ( std::size_t count ); called non-array new-expressions allocate storage required single object. […] void* operator new[]( std::size_t count ); ca

c++ - std::set, how do lower_bound and upper_bound work? -

i have simple piece of code: #include <iostream> #include <set> using std::set; int main(int argc, char argv) { set<int> myset; set<int>::iterator it_l, it_u; myset.insert(10); it_l = myset.lower_bound(11); it_u = myset.upper_bound(9); std::cout << *it_l << " " << *it_u << std::endl; } this prints 1 lower bound 11, , 10 upper bound 9. i don't understand why 1 printed. hoping use these 2 methods range of values given upper bound / lower bound. from cppreference.com on std::set::lower_bound : return value iterator pointing first element not less key. if no such element found, past-the-end iterator (see end() ) returned. in case, since have no elements in set not less (i.e. greater or equal) 11, past-the-end iterator returned , assigned it_l . in line: std::cout << *it_l << " " << *it_u << std::endl; you're deferencing past-the-end

c# - JSON, getting information using HttpPost -

i'm recreating old cordova app in xamarin forms pcl , need access method that's on server, providing username , password , storing information comes back: [httpget] public jsonresult loginuser(string username, string password) { bool responseresult = false; iebuser user = null; string errmsg = string.empty; try { if (string.isnullorempty(username)) { throw new exception("username empty"); } else if (string.isnullorempty(password)) { throw new exception("username password"); } // connect db , find user if can user = selfservicemembership.getuserbyusername(username); // if no suer user wasn't found or db errored if (user == null) { throw new exception("username not found"); } // decrypt pw , see if match username's account passwordhash ph = new passwordhash();

javascript - Include external code into Wordpress Plugin -

i'm using code import external html file in plugin: <?php ... function showcalendar() { include 'index.html'; } add_shortcode( 'calendar', 'showcalendar' ); ?> but html have of javascript code this: <head> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript" src="js/jquery-ui-1.11.1.js"></script> <script type="text/javascript" src="jquery-ui.mycode.js"></script> </head> <body> <div class="box"> <script> /*some code*/ </script> </div> </body> wordpress not executing part. how can fix that? thx! use full path javascript files in .html file.

java - Extend JFreeChart series x-values to be equal to other series -

i experimenting jfreechart , have problem. use timeseries chart 2 different series have different x-values. now want jfreechart let both graphs start @ same x-value , end @ same x-value, depending on of series starts earlier or ends later. both graphs have same length. is possible or have manipulate series? greetings flofri

powershell - Start-Job scriptblock passing of variable -

i got powershell script starts script , passes parameters it. start-job not want wait until second script finished: scripta: start-job -name enableautounlock -scriptblock {invoke-command -script { c:\windows\system32\windowspowershell\v1.0\powershell.exe "\\path\to\script\enableautounlock.ps1" $volumedriveletter }} scriptb: [cmdletbinding()] param ( [parameter(position=0)] [string]$drive ) <do stuff $drive here> $volumedriveletter drive letter gets processed i.e. "c:" unfortunately passing of parameter variable not work although $volumedriveletter has expected value typing work correctly. works: start-job -name enableautounlock -scriptblock {invoke-command -script { c:\windows\system32\windowspowershell\v1.0\powershell.exe "\\path\to\script\enableautounlock.ps1" c: }} does not work $volumedriveletter = "c:" start-job -name enableautounlock -scriptblock {invoke-command -script { c:\windows\system32\wi

netlogo - Creating a random turtle within a shapefile polygon -

i starting netlogo , ask suggestions best way create random turtle within boundaries of shapefile. please have initial direction? trying set x random-pxcor , set y random-pycor cannot limit coordinates strictly within shapefile. thank lot

How to solve problems in pom.xml maven in eclipse -

i imported project in eclipse maven got errors in pom.xml file report here: `errors occurred during build. errors running builder 'maven project builder' on project 'phonebook'. not calculate build plan: plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.6 plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.6 not calculate build plan: plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.6 plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.6` i installed ecli

laravel - Disabled user / Validation Email -

i've added column (is_activated) in user db add verification email in registration process. i follow tutorial: tutorial it works user not activated can bypass login function using reset password form. how can resolve problem? you should create middleware , redirect not activated users home page, example: public function handle($request, closure $next) { if (!auth()->user()->is_activated) { return redirect('/'); } return $next($request); } then register middleware , apply non public routes route::group()

javascript - Angular js bootstrap modal is not scrollable at the lower version of bootstrap -

i using bootstrap css version v2.2.2 , older version of bootsrap.js . bootstrap modal pop not scroll instead background content does. modal gets cut in responsive view. not able view content. try change background attribute (position) of modal fixed absolute in bootstrap.css. or try use bootstrap angularjs: https://angular-ui.github.io/bootstrap/ cheers

Jenkins Console Output -

Image
how remove jenkins console output these comments? email triggered for: always sending email trigger: always

PHP COOKIE subdomain to domain not working -

i have used following code cookie not working domain. setcookie('cookiename', 'value', time() + 3600,"/",'.domain.com'); setcookie('cookiename', 'value', time() + 3600,"/",'subdomain.domain.com'); setcookie('cookiename', 'value', time() + 3600,"/"); header("set-cookie: cookiename=cookievalue; expires=tue, 06-jan-2019 23:39:49 gmt; path=/; domain=subdomain.example.net"); all above 4 examples not working cookie subdomain domain. please help.

Defining administrator messages from MobileFirst Operations Console -

hi defining administrator messages mobilefirst operations console access disabled in mobilefirst 8.0. is there way change header of message alert box can change message? "application disabled". want change this. see documentation topic: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/translation/#cordova-applications you should able find corresponding variable header of dialog in messages.json file. file available after application has been built. android: [cordova-project]\platforms\android\assets\www\plugins\cordova-plugin-mfp\worklight\messages ios, windows: [cordova-project]\platforms[ios or windows]\www\plugins\cordova-plugin-mfp\worklight\messages the variable this: "applicationdenied" : "application disabled", you need override in applicative code. example: wl.clienmessages.applicationdenied = "sorry!"; should work...

node.js - Multer file upload error Error: Unexpected field -

i trying upload file on nodejs using multer gives error of error: unexpected field . i following tutorial http://code.runnable.com/vnx-t8fdt5y4x-mv/fileupload-for-node-js-and-hello-world . here code: var express=require("express"); var multer = require('multer'); var app=express(); var done=false; /*configure multer.*/ //app.use(); /*handling routes.*/ app.get('/',function(req,res){ res.sendfile("./index.html"); }); app.post('/',multer({ dest: './uploads/'}).single('upl'),function(req,res){ if(done==true){ console.log(req.files); res.status(204).end(); } }); /*run server.*/ app.listen(3000,function(){ console.log("working on port 3000"); }); on html error facing error: unexpected field @ makeerror (c:\users\abhishek\desktop\ospl_energy\node js\node_modules\multer\lib\make-error.js:12:13) @ wrappedfilefilter

vba - Forms: How to implement a conditional tab-keystroke between 2 controls -

i have 2 controls (control1, control2; combo boxes) second combo box conditional on value contained in first one. the rules set of given values in control1; control2 not enabled. set of other values in control1; control2 enabled. i trying implement behaviour: focus on control1, when user pressing tab evaluate if control2 must enabled or disabled, if control2 enabled gets focus, if control2 not enabled, control3 gets focus. i've attempted use various events on control1 , control2 seems miss beat... using control1_exit don't seem able prevent jumping control3 if control2 should enabled (i've tried force focus control2 cursor lands on control3 anyway, seems when exit triggered cursor in transit control3). i scratching head problem few hours though should simple one, , searching se or web not seem lead solution... appreciated. thanks in advance chris i suggest set control2.enabled in on change event of control1. plus on form_current , set correctly exis

javascript - What is the location of x and y -

what location of x , y in array: var = [ [1,2], [x], [3, [y]] ]; i'm bit confused syntax here. be: a[1] = x , a[2][1] = y? or introduction of new set of square brackets mean instead have: a[1][0] = x , a[2][1][0] = y? let's find out ;) var = [ [1,2], [x], [3,[y]]]; if write line line: var = [ [1,2], // new array index 0 containing 1 , 2 => a[0][0] = 1 , a[0][1] = 2 [x], // new array index 1 containing x => a[1][0] = x [3,[y]] // new array index 2 containing 3 , array containing y a[2][0] = 3 a[2][1][0] = y ]; in other words, x = a[1][0]

AngularJS Validation on ng-show not working on when select2 is added -

this question has answer here: select default value dropdown not working using 'track by' in angualrjs 2 answers i using select2 of bootstrap have search dropdown menu problem validation not working. working without select2 not working , message shown always. <div class="form-group" ng-class="{ 'has-error' : addemployee.formadd.pos.$invalid && !addemployee.formadd.pos.$pristine }"> <label>position</label> <select name="pos" id="pos" ng-model="addemployee.employee.employee_positionid" class="form-control select2" required> <option ng-repeat="option in addemployee.position" value="{{option.position_id}}">{{option.position_name}}</option> </select> <p ng-show="addemployee.formadd.pos.$invalid

javascript - Transparent png border in fabric.js/canvas -

i'm working on map engine , decided use fabric.js. worked great in terms of drawing, encountered problem multiple (100-1000) objects. redrawing scene took long animations , parsing svg. decided change map nodes svg png efficiency. however, while using svg files setting element border through code. equivalent have use png files, setting border not simple. is there way set solid border partially transparent png images in fabric.js?

dataframe - R padding time series with grouping -

i have data frame columns action, type, project_id, week, events_in_time i want run analysis on each subgroup defined action, type. have problem padding time series (column week). projects don't have entry given week. how can add 0 values in events_in_time missing weeks in projects? i tried merging described here: https://bocoup.com/weblog/padding-time-series-with-r generating weeks , merging nothing happens. understand need generate projects can't find how it. did: all.week.frame=data.frame(week=seq(0,12)) # fills first 12 weeks merged=merge(data, all.week.frame, all=t) example data: http://pastebin.com/au3efbga save file , load with data= read.table("merged.csv", header = true, sep = ",") update : found using complete(data_filtered, nesting(type,action, project_id), week, fill = list(events_in_time = 0)) solves it i think complete tidyr looking for. takes data.frame, followed columns complete (things make sure match up

regex - Replace text without HTML tag, into HTML -

i have trouble itext...when have html sample: http://regexr.com/3ejom when try generate pdf file, result not appear "lorem ipsum" text. think because without html tag! i use line convert: xmlworkerhelper.getinstance().parsexhtml(writer, document, new bufferedreader(new stringreader(htmltext))) in summary..i want use regex search text without html tag, , put p tag... ps: realy try search on google....sooooooo

r - Rmarkdown with pdf output and plain LaTeX code block -

how plain code block rmarkdown when code block contains tex code , 1 wants pdf output ? for example, not work: --- title: "untitled" output: pdf_document: keep_tex: yes --- hello ! ``` \begin{verbatim} verbatim text \end{verbatim} ``` this generated error: ! latex error: \begin{document} ended \end{verbatim}. of course, can do: ```{r, eval=false} \begin{verbatim} verbatim text \end{verbatim} ``` but problem when doing that, code block in output can highlighted r highlighting colors (not example above, occur in cases). you use pandoc's verbatim fenced code block syntax: ~~~latex \begin{verbatim} verbatim text \end{verbatim} ~~~ or also: ```latex \begin{verbatim} verbatim text \end{verbatim} ```

How to use the 'Total Row' style option in Word using Python docx -

Image
i using python along python-docx pandas copy dataframe microsoft word. i have managed copy data on table , apply style contained within word file, cannot figure out how apply total row style option final row in table applies styles used totals rows (see screenshot word below). i have tried looking through table styles , latent styles contained in python-docx can't identify way of picking total row option. any appreciated! i have since found out current version of module doesn't support modifying these style options. have requested functionality added in future version.

python - Efficient byte by float multiplication -

on input have signed array of bytes barr (usually little endian, doesn't matter) , float f multiply barr with. my approach convert barr integer val (using int.from_bytes function), multiply it, perform overflow checks , "crop" multiplied val if needed, convert array of bytes. def multiply(barr, f): val = int.from_bytes(barr, byteorder='little', signed=true) val *= f val = int (val) val = cropint(val, bitlen = barr.__len__()*8) barr = val.to_bytes(barr.__len__(), byteorder='little', signed=true) return barr def cropint(integer, bitlen, signed = true): maxvalue = (2**(bitlen-1)-1) if signed else (2**(bitlen)-1) minvalue = -maxvalue-1 if signed else 0 if integer > maxvalue: integer = maxvalue if integer < minvalue: integer = minvalue return integer however process extremely slow when processing large amount of data. there bet

c# - Make a static class in Visual studio -

Image
i working on sitecore project, whereby want use global configuration variables enable me make changes in 1 file supposed everywhere in application if values happen change. have made static intermediary class, called plhelper. plhelper has access system configured variables. reason plhelper keeps returning null value, when know there exists value. i think problem way made static class. appreciated thanks.

Odoo Mobile for iOS app -

i want build ios app using odoo mobile. a saw app , more... https://itunes.apple.com/us/app/myodoo/id890388033?mt=8 but in github found odoo mobile framwork android till now https://github.com/odoo-mobile/framework if so, how many apps in app store using odoo mobile? please if have clue.

redhat - proxy_fcgi:error and Broken pipe in application using Apache server 2.4 -

i getting following error in apache 2.4: ue nov 08 15:12:58.103678 2016] [proxy_fcgi:error] [pid 137426:tid 140022873229056] (32)broken pipe: [client 10.139.229.125:51237] ah01075: error dispatching request : (passing brigade output filters), referer: http://10.115.254.213/view_file?&per_page=25 [tue nov 08 15:14:48.979307 2016] [proxy_fcgi:error] [pid 118790:tid 140022883718912] (70007)the timeout specified has expired: [client 10.139.229.107:53200] ah01075: error dispatching request : (polling), referer: http://10.115.254.213/efile/37560 we using redhat server apache 2.4 server

How make one event handler that applies to multiple controls in C#? -

in visual basic knew how it, i'm new c#, can guys tell me how make "private void" mouse hover applies same event multiple controls? there's example: private void button1, button2, button3, button4_mousehover(object sender, eventargs e) { btn.image = pic } just declare 1 event handler , point each button @ it: private void common_mousehover(object sender, eventargs e) { button btn = sender button; if (btn != null) btn.image = pic } then in code or designer: button1.mousehover += common_mousehover; button2.mousehover += common_mousehover; .. etc

python - Retrieve character' images from text line image -

Image
i trying extract character' images text line image, can feed these images k-nearest neighbor classification (i building own ocr system). i have retrieve text line image, , wonder how should proceed extract characters. my first attempt use horizontal projection cut images (from binary image): my second attempt retrieve contours connected components , , tread them separated characters. attempt results, example letter 'i' cannot retrieved because of 2 disconnected contours. both these attempt failed when 2 characters too close (or collapsed) on each other. do have suggestions? i'm trying way combine 2 of them still unsuccessful. note: learning purposes. that's why don't want use existing solutions, except using opencv normal image processing. k-nearest neighbor mandatory, since it's main part of ocr system.

vbscript - Create one local user on multiple remote machines without AD -

i new stackoverflow. registered after looking many hours right solution. i have environment of ~20 pcs , on pcs regularly new user needed identical on every mashine. have same administrative account on every mashine. no windows server ad/ldap here, workgroup. i researched web vbscript parts solve problem. see below, have far. (may there other alternatives, none found me fitting) i can not test right now, because not @ environment script used. however, pretty sure, using wrong method, connection remote computer adding local account, since researches regarding "opendsobject" leading scripts using ldap. if try run script local pc only, says (translated german) "the given directorypath invalid". seems can not use netbios-names here. do know right way want do? may vbscript ok , missing tiny bit of information? i have never scripted vbscript before, please kind :-) kind regards, sairai option explicit ' deklarationen dim strtitle = "remouser

javascript - Change fixed image when scrolling -

i'm trying have fixed image change when scroll on 3 particular rows. image phone interface should match normal text, scroll new text seen , phones interface should change accordingly! i managed modify jsfiddle found in thread trick text div's can't seam implement on site have images urls source. here's jsfiddle: http://jsfiddle.net/db7ef/25/ here's js seams trick in jsfiddle: $("#image1").fadein(1000); $(document).scroll(function() { var pos = $(document).scrolltop(); if (pos < 200) { hideall("image1"); $("#image1").fadein(1000); } if (pos > 200 && pos < 600) { hideall("image2"); $("#image2").fadein(1000); } if (pos > 600 && pos < 1000) { hideall("image3"); $("#image3").fadein(1000); } }); function hideall(exceptme) { $(".image").each(function(i) { if ($(this).attr("id") == exceptme) retur

docker - How to make the external host IP address assigned to container hostname? -

except --net=host, there method make container's hostname bind external host ip address? my projects need feature of port-forwarding lot, , quite containers on same node. --net=host doesn't meed requirements. the -p hostport:containerport option made purpose. if want use same host ip in same port different applications apache virtual hosts. recommend using apache or nginx container reverse proxy using hostnames regards

azure - Is There any way to stop tracking "Page Load" in application insights using java script -

i have .net webapps on using applicationinsights web sdk, want stop tracking "page load" in application insights, there way can stop using java script. in advance. tracking "page load" done adding application insights javascript sdk snippet in web pages. simplest way stop tracking them removing script. the part need removed can found here (the explenation in documentation how add it). hope helps, asaf

go - Golang web scraper NTLM authentication -

a golang web scraper needs extract information webpage ntlm-authenticated. having valid username & password, how can web scraper perform ntlm 4-way handshake server in order gain access protected webpage behind? url, username, password := "http://www.some-website.com", "admin", "12345" client := &http.client{} req, _ := http.newrequest("get", url, nil) req.header.set("authorization", "ntlm") res, _ := client.do(req) you can use package azure/go-ntlmssp authenticate before start scraping. url, username, password := "http://www.some-website.com", "admin", "12345" client := &http.client{ transport: ntlmssp.negotiator{ roundtripper:&http.transport{}, }, } req, _ := http.newrequest("get", url, nil) req.setbasicauth(username, password) res, _ := client.do(req)

CONNECTION ERROR when try to get transactions by account ethereum -

i getting error: connection error: couldn't connect node http://localhost:8545 when try transactions account looping through many blocks. error occur when looping reach 502 blocks. code gettransactionsbyaccount same this

Django invalid form when using modelchoicefield -

i new django , have been struggling selected value of forms.modelchoicefield in views. form (post) not valid , noticed request.post returns possible values in modelchoicefield. how model selected user? thank in advance help. model i have sensor model measurements model... class sensor(models.model): # contains information sensor, type, location, , other type = models.charfield(max_length=16) ... class measurement(models.model): #this contains measurements of sensors @ given date sensor = models.foreignkey('sensor') date = models.datefield() temperature = models.floatfield() pressure = models.floatfield() ... class meta: unique_together = ('sensor', 'date') form ... , form allows user choose sensor , date: class measurementform(forms.modelform): #the user allowed choose sensor related measurement table sensor = forms.modelchoicefield(queryset=sensor.objects.exclude(measurement=none)) da

Android studio appear lost of warning messages -

i facing warning messages during building process application in android studio.if know warning please me out. i using following configuration developing: android studio 2.2 , jre 1.8.0_76 , classpath 'com.android.tools.build:gradle:2.2.0' information:gradle tasks [:app:assembledebug] error:warning: ignoring innerclasses attribute anonymous inner class error:(org.apache.commons.collections.beanmap$1) doesn't come error:associated enclosingmethod attribute. class produced error:compiler did not target modern .class file format. recommended error:solution recompile class source, using up-to-date compiler error:and without specifying "-target" type options. consequence of ignoring error:this warning reflective operations on class incorrectly error:indicate *not* inner class. error:warning: ignoring innerclasses attribute anonymous inner class error:(org.apache.commons.collections.beanmap$10) doesn't come error:associated enclosingmethod attribute. clas