Posts

Showing posts from August, 2012

hadoop - Using krb5 API to get credential and use it to access secure HDFS -

so problem access kerberos secured hdfs, using c++, given keytab. somehow must use krb5 apis , keytab authenticate program , furthur access hdfs. so example, if use krb5_get_init_creds_keytab credentials, krb5_creds. use jni access hdfs. however, i didn't find way use krb5_creds access hdfs. what know far: usergroupinformation can read kerberos key cach on filesystem. don't want have key cash on file system. directly use krb5_creds function call i looked libhdfs -> hdfs.c -> hdfsbuilderconnect, don't see authenticate user using keytab. seems me libhdfs subset of api of hdfs. any suggestions?

JavaScript advanced function call -

i learning javascript , don't understand style of writting js code read. know "old" way didn't found manual explained style of create , calling js function. "new way": // object var dog = { color: 'brown', size: 'big' }; //function write dog size (function(dog) { return dog.size; })(dog); from javascript manual know (old way): function prinsize(dog) { return dog.size } console.log(prinsize(dog)); please send me link js doc, explained why in js code on start , end of function brackets why possible after declare of function write brackets .(dog) , call function argument dog . to understand better, consider alternative way write number 1 : (function() { return 1; })() what define function returns 1, executes () following it, whole thing evaluates number 1. of course, there no reason this, might write 1 . so 1+2 , write (function() { return 1; })() + function() { return 1; }() (i don't

ios - Swift - how to concatenate didSelectRow selections from UIPickerView -

i have 2 column picker (miles , tenths) picker seems work well, cannot seem work out how concatenate selections 2 columns i.e. if user selects 23 first column , 6 second column, want create answer of "23.6" at moment, either column selection overwrites previous selection. btw: don't think can append 2 strings because happens if user selects 10ths first? let resetpickerdata = [array(0...99), array(0...9)] // returns number of 'columns' display. func numberofcomponentsinpickerview(pickerview: uipickerview!) -> int{ return 2 } // returns # of rows in each component.. func pickerview(pickerview: uipickerview!, numberofrowsincomponent component: int) -> int{ return resetpickerdata[component].count } func pickerview(pickerview: uipickerview!, titleforrow row: int, forcomponent component: int) -> string! { return string(resetpickerdata[component][row]) } func pickerview(pickerview: uipickerview!, didselectrow row: int, incompone

Reveal / Hide Information Panel Using JQuery -

i trying display overlay panel additional information on top of image when button clicked. html looks below , there can unlimited amount of these sections. <div class="half"> <img src="https://upload.wikimedia.org/wikipedia/commons/c/c0/biyariver.jpg" alt=""> <div class="information""> <p>left image overlay information</p> </div> <!-- .information --> <div class="info-icon"></div><!-- .info-icon --> </div> <!-- .half --> the '.information' overlay set display: none in css , had jquery code below: $(".info-icon").click(function () { if( $(".information").is(":hidden") ) { $(this).css("background","url(https://cdn0.iconfinder.com/data/icons/very-basic-android-l-lollipop-icon-pack/24/close-128.png"); $(&q

javascript - Drag and drop sort table row without jQuery -

the table row drag , drop sort example on internet using jquery sortable. need example show me sort table row without using jquery @ all. please see below table setup. <table> <tr id="row-a"> <td> item a</td> </tr> <tr id="row-b"> <td> item b</td> </tr> </table>

c# - Property containing subset of related object -

i have entity post , in one-to-many relationship comment . i'd have property returns subset of them: public class post { public virtual icollection<comment> comments { get; set; } public virtual icollection<comment> toplevelcomments { { return comments.where(c => c.parentid == null).tolist(); } } } however, code throws argumentnullexception: value cannot null. parameter name: source this answer seems suggest that's because filter comments while it's still null . however, in action using method, eagerly load it: var post = await _context.post.include(m => m.author).include(m => m.comments).theninclude(m => m.author).singleordefaultasync(m => m.postid == id); how can work? correct approach? first thing, avoid kind of exception need initialize collection properties in empty entity's constructor: public post() { comment=new list<comment>(); } second t

amazon s3 - howto abort all incomplete multipart uploads for a bucket -

sometimes multipart uploads hang or don't complete reason. in case stuck orphaned parts tricky remove. can list them with: aws s3api list-multipart-uploads --bucket $bucketname i looking way abort them all. assuming have awscli setup , it'll output json can use jq project needed keys with: bucketname=<xxx> aws s3api list-multipart-uploads --bucket $bucketname \ | jq -r '.uploads[] | "--key \"\(.key)\" --upload-id \(.uploadid)"' \ | while read -r line; eval "aws s3api abort-multipart-upload --bucket $bucketname $line"; done

sqlite3 - How a process running SQLite knows that a particular page has been updated by another process? -

how 2 independent sqlite cache modules notified change in db. more specifically, how cache module know page has fetched disk, content has been updated in db other process. sqlite writes changed pages when transaction finishes; once connection allowed read, there no dirty pages. to detect changes made other connections, there file change counter in database header. however, not apply specific pages entire database.

go - Best way to bootstrap the Golang install with an existing homebrew install -

the go tool chain rewritten in go, requiring prior go compiler exist perform install. you can point existing compiler using goroot_bootstrap environment variable. in situation have go installed homebrew. going forward want compile source , not 'brew upgrade go'. want use homebrew install compile latest source, exists on system. the following throws error ("cannot find packages") cd $gopath/src/github.com/golang/go/src goroot_bootstrap=/usr/local/cellar/go/1.6.2 ./all.bash and ("cannot find /usr/local/cellar/go/1.6.2/go/bin/go") goroot_bootstrap=/usr/local/cellar/go/1.6.2/go ./all.bash but works (mostly, except me fails python _lldb.so plug-in error) goroot_bootstrap=/usr/local/cellar/go/1.6.2/libexec ./all.bash what "libexec" in context? , there better way install golang prior compiler being homebrew?

python - Compare 2 Pandas dataframes, row by row, cell by cell -

i have 2 dataframes, df1 , df2 , , want following, storing results in df3 : for each row in df1: each row in df2: create new row in df3 (called "df1-1, df2-1" or whatever) store results each cell(column) in df1: cell in df2 column name same cell in df1: compare cells (using comparing function func(a,b) ) and, depending on result of comparison, write result appropriate column of "df1-1, df2-1" row of df3) for example, like: df1 b c d foo bar foobar 7 gee whiz herp 10 df2 b c d zoo car foobar 8 df3 df1-df2 b c d foo-zoo func(foo,zoo) func(bar,car) func(foobar,foobar) func(7,8) gee-zoo func(gee,zoo) func(whiz,car) func(herp,foobar) func(10,8) i've started this: for r1 in df1.iterrows(): r2 in df2.iterrows(): c1 in r1: c2 in r2: but not sure it, , appreciate help.

tsql - SQL Server - replace view with stored procedure -

i have closed source asp.net system calling expensive sql view: select top 100 percent * [v] [u] = 9999 order [id] i have access database, can change view - there no easy way make view faster. i programmatically change behaviour of view based on iis server performing request. is possible? e.g. create stored procedure called view, , stored procedure return table mimics current view, if called particular iis server return different. is possible modify view call stored procedure asp.net code doesn't need modifications? i can see other stack overflow articles how call stored procedure view, how can access clause inside stored procedure? given asp.net code presumably has select * [view] code embedded in , cannot change that, have following hurdles: you need create multi-statement table-valued function can detect iis instance you're querying without tailored inputs application (e.g., @ user or service account, ip address). benefit of using multi-sta

Updater for Python Application -

i'm developing small tool that's supposed let players of particular game customize game way quicker thn browsing through game files, making changes each , .ini file. not matter. i'd function going update application within there have function download .zip recent version of application , unzip onto app's directory. however need sort of checkig mechanism determine rather there's new version of app or not. matter, i've uploaded both .html aswell .txt 0 in changed 1 , uploaded web server in case there's update. so question how you'd go through in how read text of .txt file example , determine rather it's 0 or 1 in if result 1, it'll go on downloading newest version. any input welcome, best regards,

ruby on rails - How to use factorygirl to associate user_id -

i learning tests using rails testing tools, mainly: rspec, factory_girl, shoulda, , faker gems. i want test has_one , belongs_to associations. have user.rb (with name ) , address.rb (with street , city , , user_id ) models. i trying figure out how create fake associations using fakers. want create fake street , associate fake user, can't figure out how on spec/factories/addresses.rb this have: factorygirl.define factory :address street {faker::address.street_address} city {faker::address.city} #creates fake user , use user's id user_id)# user = build(:user, name: "joe", id: 2) user_id {user.id} end end this spec/models/address_spec.rb require 'rails_helper' rspec.describe address, type: :model "has valid factory" address = build(:address) expect(address).to be_valid end {should belong_to(:user)} end when run it, shows add_attribute': wrong number of arguments (given 3, expect

R + ztable: what are lcl and ucl? (logistic regression) -

ztable produces nice zebra (alternating striped) tables, useful presenting dataframes , model objects (lm, glm, etc). it's not clear me lcl , ucl are. documentation says ‘ztable()’ shows odds ratio(or) , 95% confidence interval but googling indicates lcl/ucl lower/upper control limits, seem confidence intervals constructed +/- 3 standard deviations mean. most confusingly, lcl/ucl constructed ztable don't contain coefficient estimate: ztable(glm(factor(am) ~ disp, family = binomial(link = "logit"), data = mtcars)) so lcl/ucl mean? from examining source code ztable.glm (thanks @user2957945), answer seems simply: ‘ztable()’ shows odds ratio(or) , 95% confidence interval (lcl, ucl) of odds ratio the odds ratio exponentiated coefficient (which logit or log odds), , lcl/ucl obtained exponentiating confidence interval of coefficient.

node.js - Express with Browser-Sync -

i want integrate browsersync express. i want pull url db , use proxy. setup i've come initializes new browsersync server each request. is there way accomplish without initializing new browsersync server every time? or should using approach? var bs = require("browser-sync"); var express = require("express"); var router = express.router(); var app = express(); router.get("/", function(req, res){ bs.create("bs1").init({ notify: false, open: false, ui: false, port: 10000, proxy: 'http://example.com' }); res.send(); }); app.use(router); app.listen(8080, function(){ console.log('listening on *:8080'); }); so turns out cant done ease. i ended using express-http-proxy instead , express-vhost subdomains. app = require('express')(); vhost = require('vhost'); proxy = require('express-http-proxy'); app.use(vhost('

java - How to deploy Swagger generated JAXRS server code in Websphere -

Image
i generated jax-rs server code uber api example in swagger. default json can found opening http://editor.swagger.io/#/ now tried deploy in websphere see below message: error 404: javax.servlet.servletexception: java.io.filenotfoundexception: srve0190e: file not found: /v1/swagger.json when access url: http://localhost:9080/swagger-jaxrs-server/v1/swagger.json i didn't make changes auto generated code. i using wlp-javaee7-8.5.5.9 this how server.xml file looks like: <server description="new server"> <!-- enable features --> <featuremanager> <feature>javaee-7.0</feature> <feature>localconnector-1.0</feature> <feature>apidiscovery-1.0</feature> </featuremanager> <basicregistry id="basic" realm="basicrealm"> <!-- <user name="yourusername" password="" /> --> </basicregistry> <!-- access server remote client a

javascript - Code splitting with typescript and webpack -

i use code splitting feature provided webpack in order create several bundles of app, developed using typescript, , load them on demand. have been searching solution on line while , closest answer have found one: https://github.com/typestrong/ts-loader/blob/master/test/execution-tests/babel-codesplitting/require.d.ts this example directly taken form official ts-loader documentation , shows how rely on require.ensure in order create split point. the thing bugs me there no straightforward way in typescript that. require.ensure function must directly invoked in typescript. following declaration file needs provided allow typescript silently digest call: declare var require: { <t>(path: string): t; (paths: string[], callback: (...modules: any[]) => void): void; ensure: (paths: string[], callback: (require: <t>(path: string) => t) => void) => void; }; is there more elegant way achieve same result? is there more elegant way achieve

python - beautifulsoup could not find class -

Image
i tried use bs4 table 1 nba stat site. the website seems did not use javascript. the soup.prettify print result looks normal, not use soup.find_all table want. here's code i'm using: import requests bs4 import beautifulsoup url = 'http://stats.nba.com/team/#!/1610612738/stats/' page = requests.get(url) html = page.content soup = beautifulsoup(html, 'html.parser') tables = soup.find_all('table') the website loads data ajax , , data not available getting page contents beautifulsoup. however, don't need beautifulsoup @ all. if you're using chrome, visit website , go browser's dev tools, click on network tab, click xhr filter, reload page. you'll see list of requests made: click on , see ones you're interested in. once find 1 like, copy url, , data requests library (you included in code): r = requests.get('http://stats.nba.com/stats/commonallplayers?isonlycurrentseason=0&leagueid=00&season=2016

c++ - Using my own String class with the << operator -

i looking way use ostream custom string class , overload operator << stream buffer can flush anywhere want (in case gonna printed in window) i'm reasonably new inner workings of iostream's understanding method i've seen of making std::stringbuf base of custom stringstream not work because stringbuf deals std::string. in essence want able (or similar): mystringclass string myoutput << "hello" << string << "world" << std::endl; where myoutput can changed print anywhere want. thank you. not problem. define class, , within it's definition add ostream& operator<<(const string&); . inside operator, can code whatever handling want (look @ std::string inspiration)

angularjs - Angular - Loop through unique items from REST data -

Image
i trying iterate through unique "modules" received through rest services. there multiple href's associated single module. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type="text/javascript"> var moduleserviceurl = _sppagecontextinfo.webabsoluteurl + "/_api/lists/getbytitle('pages')/items?$select=id,title,fileref,modules"; var appvar = angular.module('listapp', []); appvar.controller('controller1', function ($scope, $http) { $http({ method: 'get', url: moduleserviceurl, headers: { "accept": "application/json;odata=verbose" } }).success(function (data, status, headers, config) { $scope.items = data.d.results; }); }) </script> </head>

Maxima: suppress `linenum` in both input and output prompt -

the maxima documentation reads: maxima automatically constructs label each computed expression concatenating outchar , linenum . http://maxima.sourceforge.net/docs/manual/maxima_4.html#outchar it describes how customize inchar , outchar , there line number included. know useful referencing expressions later, when putting post on e.g. stackoverflow, line numbers aren't important, want omit them. (also, purely cosmetic, makes inputs misalign little.) instead of this: (%i9) 1 + 1; (%o9) 2 (%i10) 2 + 2; (%o10) 4 i want this: (%i) 1 + 1; (%o) 2 (%i) 2 + 2; (%o) 4 how can customize maxima prompt suppress line number?

html - jQuery change <span> into <label> and add for="" with previous <input> id -

i have jquery turn selected spans labels. the problem have need add in for="" works button (i'm using radio buttons input hidden it's box - therefore label needs have id of input in order work). know need create variable i'm not sure how write it. what need (and correct me if i'm wrong) variable creates <label> tag + for="" id of previous input within "". now these radio buttons brought in module though cms i'm using can't target id name different every time , generated cms. js needs target 'previous/parent' input tag. so need final code after js has run: <div class="wrapper"> <input type="radio" id="radio1" name="radios" value="sml"> <label for="radio1">small</label> <input type="radio" id="radio2" name="radios" value="med"> <label for="radio2">meduim<

angularjs - Angular, Karma, tsify, woes -

i'm trying set tests, using angular 1.5, tsify, , karma. i'm very, close, i'm running issue haven't quite got right: i'm following setup described here: https://github.com/cmlenz/tsify-test (this example doesn't include angular) i error angular-mocks: "cannot set property 'mock' of undefined" that has either timing thing or scope thing -- either angular-mocks loading soon, or browserify wrapping scope of angular variable, , mocks can't see it. no idea. here pertinent parts of karma.conf.js file: frameworks: ['browserify', 'jasmine'], files: [ 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', './node_modules/angular-mocks/angular-mocks.js', './modules/**/*.spec.ts' ], exclude: [], preprocessors: { '**/*.ts': 'browserify' }, browserify: { debug: true, plugin: [ [

html - How to make an almost invisible image on a page that looks okay when zoomed in a lot? -

i have really weird question. possible have image on page looks insanely small when browsing , don't notice it, when zoom in lot, can see what's there. example smiley face when browsing appears small dot, when zoom in lot can see it. got question , not answer it, out of curiosity decided ask here. friend of mine told me may possible using svg. yes! make effect using svg, the demo ! animation made using code: var tl = new timelinemax(); tl.from("svg", 15, { // start animation from... through 15 seconds! scale: 0, // 0 scale! transformorigin: '50% 50%', ease: back.easeout }) </script> it concept! make using tool (aka svg)

javascript - How do I use Semantic UI with React and Express? -

i'm new semantic/react/express. how include stylesheet semantic in react? need html file directly links semantic css/javascript files? right now, i'm not using html files. my main page, dashboard.jsx : var react = require('react'); var layout = require('./layout'); class dashboard extends react.component { render() { return ( <layout title={this.props.title}> <h1>{this.props.title}</h1> <div class="ui 3 item menu"> <a class="active item">editorials</a> <a class="item">reviews</a> <a class="item">upcoming events</a> </div> </layout> ); } } dashboard.proptypes = { title: react.proptypes.string }; module.exports = dashboard; use classname instead of class in react components. and use classes import css file in html file. react renders code html in end,

java - How to detect end of Input Stream from Socket using BufferedInputStream? -

i'm trying read , input socket in java , proccess calling function. must read byte , not text because reading text give erros because of requests coming client. decided use class bufferedinputstream . problem end of request not being detected. guess because stream not ending being hanged or something... according documentation , read() function returns byte read stream or -1 if stream has ended. so, code reads byte byte, joins in string, , then, when stream has ended, sends string proccessed (or @ least, supposed this). here code: bufferedinputstream reader = new bufferedinputstream(socket.getinputstream()); int dt; string cmd = ""; while( (dt = reader.read()) >= 0){ cmd += (char)dt == '\n' || (char)dt == '\r' ? ' ' : (char)dt; // add each byte read string system.out.println(cmd); } processainput(cmd); the problem function processainput never being called if program stuck in loop. more stranger is not stuck on loop becaus

Calling Host Method from Workflow -

i want call method resides on host executable using execute workflow workflowinvoker.invoke. i have found examples of via interface using [externaldataexchange], of these examples workflow 3.5, nothing 4 or 4.5. appears externaldataexchange has been deprecated on 4+. does have example of doing in wf 4.5? your host needs register extensions doing like: yourwfapp.extensions.add<isomeinterface>( () => { return anobjectthatimplmentsisomeinterface;}); then, activities can use extension doing: isomeinterface hostinterface = activitycontext.getextension<isomeinterface>(); hostinterface.callthehost();

OpenCV Android UnsatisfiedLinkError while finding the Moments of Contour -

my app installs correctly crashes while finding moments of contour. here error: no implementation found double[] org.opencv.imgproc.imgproc.moments_1(long) (tried java_org_opencv_imgproc_imgproc_moments_11 , java_org_opencv_imgproc_imgproc_moments_11__j)

excel - VBA Help. Delete Rows based on multiple criteria -

i looking vba clean worksheet deleting rows of data not need , keeping rows of data based on multiple criteria. i want able keep row equals "subtotal:" in column , row contains number in column c while deleting other rows not match criteria. before cleanup desired result requested i wrote function should able job done. so can call function sub , pass column number want test (1 "a"), value test ("" blank), name of worksheet test. final argument boolean value , if true delete on matching value in criteria, if not delete on else. function deletecol(icol integer, strcriteria string, strwsname string, bpositive boolean) dim ilastcol integer dim wsused worksheet set wsused = thisworkbook.worksheets(strwsname) ilastrow = wsused.cells(rows.count, icol).end(xlup).row = ilastrow 1 step -1 wsused.cells(i, icol) if bpositive if .value = strcriteria .entirerow.delete else if .value <> strcrite

Unexplained MySQL behavior using C libmysqlclient -

i have written processing engine in c extracts 40k records table, processes data , writes results different table. when print out processed data screen, looks perfect of variables holding right values. need write data table has 3 columns primary key. create table this: create table halfcomp ( marketcode varchar(20) not null, trznum varchar(20) not null, origtrznum varchar(20) not null, primary key (marketcode, trznum, origtrznum) ) engine=innodb default charset=utf8; when c program writes database, results trash. repeating values shouldn't, results out of order, columns switched in places, etc. have been playing couple of days , think has primary key. the reason think because made table auto-incrementing integer primary key freed other values plain old table values. created table this: create table halfcomp ( ind int(11) auto_increment not null, marketcode varchar(20) default null, trznum varchar(20) default null, origtrznum varchar(20)

node.js - moongose subschema not working -

var commentschema = new schema({ rating: { type: number, min: 1, max: 5, required: true }, comment: { type: string, required: true }, postedby: { type: mongoose.schema.types.objectid, ref: 'user', index:true } },{ timestamps: true }); var postschema = new schema({ title:{ type:string, required:true }, image:{ type:string, required:true }, meta:{ type:string, required:true }, story:{ type:string, required:true }, likes:{ type:number, min:0, required:true }, postedby: { type: mongoose.schema.types.objectid, ref: 'user', index:true }, comments:[commentschema] }, { timestamps: true }); this schema design .get(function(req,res,next){ posts.find({}) .populate('postedby') .populate('comments.postedby') .exec(function (err, post) { if (err) throw err; res.json(post); }); user schema var user = new schema({ user

javascript - React.js: Stacked MultiBarChart of nvd3.js doesn't order layers correctly -

Image
i'd use multibarchart , stacked option, haven't succeeded far. modules use: nvd3 of version 1.8.2 react-nvd3 of version 0.5.3 here's relevant code. var props = { type: "multibarchart", datum: [{ key: "num", values: [{ x: "a0", y: "5" },{ x: "a1", y: "5" },{ x: "a2", y: "5" },{ x: "a3", y: "5" }] },{ key: "num2", values: [{ x: "a0", y: "1" },{ x: "a1", y: "1" },{ x: "a2", y: "1" },{ x: "a3", y: "1" }] },{ key: "num3", values: [{ x: "a0", y: "2" },{ x: "a1", y: "2" },{ x: "a2", y: "2" },{ x: "a3", y: "2" }] }], containerstyle: { width: 500, height: 300 } }; ... return (<div><nvd3chart {...props}/></div>); it works fi

conv neural network - How to understand the convolution parameters in tensorflow? -

when reading chapter of "deep mnist expert" in tensorflow tutorial. there give below function weight of first layer. can't understand why patch size 5*5 , why features number 32, random numbers can pick or rules must followed? , whether features number "32" “convolution kernel”? w_conv1 = weight_variable([5, 5, 1, 32]) first convolutional layer we can implement our first layer. consist of convolution, followed max pooling. convolutional compute 32 features each 5x5 patch. weight tensor have shape of [5, 5, 1, 32]. first 2 dimensions patch size, next number of input channels, , last number of output channels. have bias vector component each output channel. the patch size , number of features network hyper-parameters, therefore arbitrary. there rules of thumb, way, follow in order define working , performing network. kernel size should small, due equivalence between application of multiple small kernels , lower number

voip - Send events from AppService to main Project -

i implementing voip application. use sample voip sample . when call changes status, want send event app service main project in order update ui, can not find way it, can send message main project app service , receive response. so can show me way send message app service main project ?

How to add Hibernate jar to Liberty Sample application in Bluemix? -

i created sample application in bluemix using liberty profile. works. editing code in bluemix, changed output , worked. now want add libraries. there no put jar file? what folder structure need create? guess need edit pom.xml configure build. anyone done before? you can add jars lib folder under webcontent directory accessible once packaged server deployed. once deployed, you'll find jars in following directory: /home/vcap/app/wlp/usr/servers/defaultserver/apps/myapp.war/web-inf/lib/hello.jar

javascript - Node.js connect ECONNREFUSED 127.0.0.1:8000 DynamoDB Local Error -

i'm using npm plugin handle creating local dynamodb local server within node app. reason gives me following error. can't figure out why seems happen when running tests during specific section of tests. it doesn't happen every time. maybe 50% or so. strange. i have read error means starting dynamodb local server failed. have no idea why since doesn't give more details. dynamodb local failed start code 1 { error: connect econnrefused 127.0.0.1:8000 @ object.exports._errnoexception (util.js:1012:11) @ exports._exceptionwithhostport (util.js:1035:20) @ tcpconnectwrap.afterconnect [as oncomplete] (net.js:1080:14) message: 'connect econnrefused 127.0.0.1:8000', code: 'networkingerror', errno: 'econnrefused', syscall: 'connect', address: '127.0.0.1', port: 8000, region: 'us-west-2', hostname: 'localhost', retryable: true, time: 2016-09-13t03:26:05.804z } oh , here code create s

excel - Export-CSV only gets the "Length" -

when try export csv list, number "length" .count property until split point reached, split csv array new file new name used point on. might issue? $rootfolder = get-content "c:\drivers\myfile.txt" foreach ($arrayofpaths in $rootfolder){ $csv = $arrayofpaths -replace '^\\\\[^\\]+\\([^\\]+)\\([^\\]+).*', 'c:\output\company_name_${1}_${2}.csv' $csvindex = 1 $maxrows = 1000000 $rowsleft = $maxrows get-childitem $arrayofpaths -recurse | where-object {$_.mode -match "d"} | foreach-object { #$csv = $_.fullname -replace '^\\\\[^\\]+\\([^\\]+)\\([^\\]+).*', 'c:\output\company_name_${1}_${2}.csv'# <- construct csv path here $path = $_.fullname $thiscsv = get-acl $path | select-object -expand access | select-object @{n='path';e={$path}}, identityreference, accesscontroltype, filesystemrights | convertto-csv if ($thiscsv.count -lt $rowsleft) { $thiscsv | export-csv $c

upgrading to python3.5.2 still gives me python 3.4 -

installed python 3.5.2 tarball python.org osx when input python3 result is: python 3.4.3 (v3.4.3:9b73f1c3e601, feb 23 2015, 02:52:03) tried: conda install python=3.5 but got: the following specifications found in conflict: - enum34 -> python 2.6*|2.7*|3.3* - python 3.5* then tried: conda remove -n testa enum34 still getting 3.4 install when input python3 edit: resolved! updated /.bash_profile , removed 3.4 paths

ios - iTunes connect rejects my App after uploading because of missing privacy-access descriptions -

i want upload app itunes connect after uploading error message mail itunes, after scan description variables missing. this app attempts access privacy-sensitive data without usage description. app's info.plist must contain nsphotolibraryusagedescription key string value explaining user how app uses data. this app attempts access privacy-sensitive data without usage description. app's info.plist must contain nscamerausagedescription key string value explaining user how app uses data. i using both features, that's ok, but: added variables localized infoplist.strings . , these seems work, because in simulator , iphone, both strings displayed correctly in system dialogs. didn't add strings plist.info file, because specified them in localized file, should ok. plist.info , localized file both packaged in app, head using finder. is there else must add? still need add them plist.info file, although in localized file? additional info: using latest xcode 8

Webpack loader: inline or embed the required, omit a final jsonp functions -

let's suppose next files: a.html <span>a</span> b.js module.exports = function(){}; wrap.js module.exports = { html: require('./a.html'), // inlined class: require('wrap-class'), // not exists func: require('./b'), }; main.js require('./wrap'); let's suppose next loader: wrap-loader.js module.exports = function (source){ // loaded contents // specific childs or dynamically loaded // require('./a.html') -> inlined or embedded // require('class-exists') -> resolve depending on // source code `source` , contents of html (`a.html`) return source; // modify source } and finally, have when requiring main.js bundle: jsonp(...,[ /* 0 */ /* ./main.js */ function(module, exports, __webpack_require__){ __webpack_require__(/*! ./wrap.js */ 1); }, /* 1 */ /* ./wrap.js */ function(module, exports, __webpack_require__){ module.exports = { html: '<

mysql - zabbix server cannot connect to database -

Image
first, zabbix web gui can work, zabbix server stutus 'not running' it means mysql works correctly, because zabbix web can connect it. next, checked zabbix server /var/log/zabbix/zabbix_server.log, here details: 14329:20160913:145134.438 database down: reconnecting in 10 seconds 14329:20160913:145144.439 [z3001] connection database 'zabbix' failed: [0] not connect server: connection refused server running on host "localhost" (::1) , accepting tcp/ip connections on port 3306? received invalid response ssl negotiation: r anyone can help? solved. both zabbix-mysql , zabbix-postgresql installed. seems there conflicts. remove zabbix-postgresql, works.

javascript - Ionic2 - Native Scroll -

ionic1 can use native scroll improve performance of app using code $ionicconfigprovider.scrolling.jsscrolling(false); how can same in ionic2? just can find here happy ionic 2 100% native scrolling since day 1

c++ - Why functionss work perfectly good without return at the end -

this question has answer here: why flowing off end of non-void function without returning value not produce compiler error? 8 answers what happens when function returns object ends without return statement 3 answers i have question related function without return statement @ end of definition. how works? can return becouse value return allocated on stack random number when call func? check example below: #include <iostream> using namespace std; int fun1(){ cout << "fun1" << endl; } char fun2(){ cout << "fun2" << endl; } short fun3(){ cout << "fun3" << endl; } float fun4(){ cout << "fun4" << endl; } double fun5(){ cout << "fun5" << endl;

javascript - Exporting multiple divisions in html file to PDF using JSPDF -

i working on requirement need export html file pdf on button click. html file having multiple divisions , have export selected divisions pdf after converting them canvas-image. bit new jspdf , html2canvas libraries, below code working fine single division. please suggest changes in order handle multiple div export pdf. <button id="btn">generate pdf</button> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="//cdn.rawgit.com/mrrio/jspdf/master/dist/jspdf.min.js"></script> <script type="text/javascript" src="//cdn.rawgit.com/niklasvh/html2canvas/0.5.0-alpha2/dist/html2canvas.min.js"></script> <script type="text/javascript" > (function(){ var form = $('.test'), cache_width = form.width(), a4 =[ 595.28, 841.89]; // a4 size paper width , height $('

c++ - Supporting Polish language without compiling with unicode character set -

i have legacy c++ application not compiled unicode character set. application able support european languages such german, portuguese etc. there requirement support polish language. understanding these characters wont fit in ascii character range , there no way support other migrating application use unicode character sets. understanding correct? there alternatives? german won't fit in ascii either (and suspect same applies portugese.). suspect you're using cp1252. polish windows install running cp1250 instead. gives missing characters.

c# - Convert (System.Data.SqlClient) to Entity -

i want run multi select 1 trying , i find 1 way sqlcommand , works, looking way entity , please me finding way entity or convert code want . string commandtext = @"select id, contactid dbo.subscriptions; select id, [name] dbo.contacts;"; list<subscription> subscriptions = new list<subscription>(); list<contact> contacts = new list<contact>(); using (sqlconnection dbconnection = new sqlconnection(@"data source=server;database=database;integrated security=true;")) using (sqlcommand dbcommand = new sqlcommand(commandtext, dbconnection)) { dbcommand.commandtype = commandtype.text; dbconnection.open(); sqldatareader reader = dbcommand.executereader(); while (reader.read()) { subscriptions.add( new subscription() { id = (int)reader["id"], contactid = (int)reader["contactid"] }); } reader.nextresult(); while

javascript - How to read the image type from an URL? -

Image
i encountered strange: as see second last picture has jpg format it's being displayed png type. (this network panel in chrome.) how can png file type javascript? (how can it's mime type)? you check content-type response header. appropriate value listed in chrome network debugger. alternatively, can on 1 of many lists on internet. assuming using jquery $.ajax({ url: "[image url]", success: function(response, status, xhr){ var contenttype = xhr.getresponseheader("content-type") || ""; if (contenttype === "image/jpeg") { // jpg } if (contenttype === "image/png") { // png } } }); if using plain javascript use xmlhttprequest.getresponseheader() in stead.

javascript - Notifications - Alternate to Object.observe? -

trying build small component sends notifications via notifications object on small web app. so, once private message has been received in group, if value of field has incremented or changed, display notification. this works fine if refresh page not running asynchronously. with object.observe() being deprecated, please explain how implement this? don't quite understand how proxies. thanks lot!! shortened brevity var mygroup = 0; var notificationcount = []; notificationcount.push({'mygroup': mygroup}); localstorage.setitem('notificationcount', json.stringify(notificationcount)); var storedcounts = json.parse(localstorage.getitem("notificationcount"); settimeout(function() { var newcountmygroup = parseint($('.mygroup .wrapper').text()); if(newcountmygroup > 0 && storedcounts[0].mygroup !== newcountmygroup) { notify('new post in groups', 'linkhere') } }, 800); function notify(alertmessa

ruby - Unknown argument when call a function in another function -

in module, defined 2 functions have same name different number of arguments . module mymod def self.dotask(name:, age:) dotask(name: "john", age: 30, career: "teacher") end def self.dotask(name:, age:, career:) puts "name:#{name}, age:#{age}, career:#{career}" end end as see above, in dotask , call dotask . in ruby file, call dotask by: mymod.dotask(name:"kate", age: 28) but runtime error: unknown keyword: career (argumenterror) why? ruby not have method overloading. can not have multiple methods same name. one solution use 3 argument version of method , add default value :career argument. module mymod def self.dotask(name:, age:, career: "teacher") puts "name:#{name}, age:#{age}, career:#{career}" end end mymod.dotask(name:"kate", age: 28) mymod.dotask(name:"kate", age: 28, career: 'teacher') mymod.dotask(name:"kate", age: 28, career:

ssas - Next available Date -

Image
i have tubular model has standard star schema on dim date table there column flags uk holidays not included date if key chooses date has been flagged next availble date don't have access database build function ive seen others could suggest dax or method of doing thanks in advance sample you can create calculated column next working datekey if date flagged non working date. in case date not flagged column contains datekey value. use dax expression in calculated column: = if ( [isdefaultcalendarnonworkingday] = 1, calculate ( min ( [datekey] ), filter ( dimdate, [datekey] > earlier ( [datekey] ) && [isdefaultcalendarnonworkingday] = 0 ) ), [datekey] ) i've recreated dimdate table sample data: let me know if helps.

android - Get File Uri from Document Id in Storage Access Framework -

i using directory selection described in google sample . provide file name , mime type of children of selected directory. can document id of file too, if use column_document_id on cursor query. interested in file uri of children instead. when use action_open_document instead of action_open_document_tree , child uri obtained adding %2fchildfile.extention (%2f forward slash). tried child file uri using following code - uri = uri.parse(docuri.tostring()+"%2f"+filename); i got file name, when run exists() method on (by converting documentfile), returns false. means, either don't have permission of file or it's not correct way children uri. am missing here or there other way can select folder , file uri of of it's children easily. ps: checking in marshamallow. after reading doc , trying out examples, got following way single file uri selected docuri/treeuri uri = documentscontract.builddocumenturiusingtree(docuri,docid); and can convert an

c# - OutOfMemoryException: using DbContext in Task -

this following setup i'm dealing with: i got sql-table ~1.000.000 entries need update the update takes place in seperate thread (started task) as memory limited in thread, process list in batches of 1000 entries per batch (when running in test-project in mainthread/without task, there no oom exception) the updatelist() function either updates fields of list or creates new record or other tables in dbcontext in process_failure() function, have single context instance entire list in process_success() function, moved while -loop outside of context private void process_success() { var totalprocessedcounter = 0; while( true ) { using( var context = new mydbcontext() ) { var list = context.myclass.orderby( x => x.id ) .skip( totalprocessedcounter ).take( 1000 ) .tolist(); if( !list.any() ) break; updatelist( list ); totalprocessedcount

performance - Insert within FORALL loop in PL/SQL -

is possible in pl/sql bulk insert using forall ? type c_type1 record ( column1 table1.column1%type, column2 table1.column2%type, client table2.client%type ); type1 c_type1; cursor cur_t select * bulk collect recs table3 ; begin recs in cur_t loop select * type1 (select a.column1, a.column2,imm.client ... table1 a, table2 imm a.column1 = recs.column1 ) rownum=1; insert table2 values (recs.column1,type1.column2); ... p.s : there more 80 columns inserted. your question not pretty clear looking @ code have following. check if looking for. declare cursor cur_t select t3.column1 , t1.column2 table3 t3 inner join table1 t1 on t3.column1 = t1.column1; type var_cur table of cur_t%rowtype; var var_cur; begin open cur_t; loop fetch cur_t bulk collect var limit 100; exit when cur_t%notfound; forall in 1 .. var.count save exceptions inse

android - Renamed file does not shows up in RecyclerView, crashes the app instead -

i using recyclerview first time, trying rename file in view. file gets renamed recycler not updates itself. implemented mediascanner crashes app, after restart list gets updated renamed file. there way update list without calling media scanner? specific renaming code: holder.renamebutton.setonclicklistener(new view.onclicklistener(){ @override public void onclick(view v) { alertdialog.builder builder = new alertdialog.builder(mcontext); builder.settitle("title"); // set input final edittext input = new edittext(mcontext); // specify type of input expected; this, example, sets input password, , mask text input.setinputtype(inputtype.type_class_text ); builder.setview(input); // set buttons builder.setpositivebutton("ok", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { m_text = input.gettext().tostring();