Posts

Showing posts from April, 2015

c# - RethinkDB - When I'm runned GetAll() method throw error -

i'm new start using rethinkdb i'm successed insert process don't give record getall method because i'm runned getall method give me message. the sequence finished. there no more items iterate over. below rethinkdb codes using system.collections.generic; using rethinkdb.driver; using rethinkdb.driver.model; using rethinkdb.driver.net; namespace mhg.projectmanager.service { public class repository<t> { private connection connection; public repository() { connection = rethinkdb.r.connection().db("projectmanager").connect(); } public ilist<t> getlist() { var type = typeof(t); var list = new list<t>(); // throw error line var connections = rethinkdb.r.table(type.name).getall("").run<t>(connection); foreach (t connection in connections) list.add(connection); return l

javascript - Why when trying to use JQuery on a previously initialized html element variable it returns undefined? -

i read on jquery docs ( https://learn.jquery.com/using-jquery-core/faq/how-do-i-select-elements-when-i-already-have-a-dom-element/ ) use initialized element writing variable name selectors: $(element) but whenever try function call @ press of button returns 'undefined'. this example code did test out in more controlled environment: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="container-fluid"> <div class="row"> <div class="col-md-6"> <button class="btn btn-block btn-primary" onclick="jquery(this)">jquery</button> </div> <div class="col-md-6"> <button class="btn btn-block btn-info" onclick="normaljs(this)">normaljs</button> </div> </div> <div class="row"

android - Get Intent from intent-filter with WebIntent Native Plugin -

i’m working ionic native plugin web intent, , want android intent , use media file or local url in app. androidmanifest.xml it’s ok, , can see myapp option share or pick image. <action android:name="android.intent.action.pick"/> <action android:name="android.intent.action.send"/> <action android:name="android.intent.action.send_multiple"/> <category android:name="android.intent.category.default"/> <data android:mimetype="image/*"/> but i’m locked trying intent in app. i try use [ https://ionicframework.com/docs/native/web-intent/] native plugin, i’m getting response error “plugin_not_installed”. constructor(private _platform: platform, private _webintent: webintent ) { } ... ionviewdidload() { this._platform.ready().then(() => { this._webintent.getintent().then((data: any) => { // use data intent }).catch((error:any) => c

python - Invalid Directory Name -

i receiving error: file "c:/users/am/pycharmprojects/booyah/first.py", line 5, in main directory = os.chdir(input('enter directory of file want read')) notadirectoryerror: [winerror 267] directory name invalid: 'c:\\users\\am\\desktop\\sad.txt' here code: import os def main(): answer = input('would read, write, create, or quit?') if(answer == 'read'): directory = os.chdir(input('enter directory of file want read')) w = open(directory, 'r') contents = w.read() print(contents) w.close() the directory copy leads text file on desktop. help! it's bit ambiguous want achieve here, here's quick example of how parse read command, chdir directory specified, , print out lines of file. i have hardcoded file name in example: import os answer = input('would read, write, create, or quit?: ') file_name = 'sad.txt' if(answer == 'read'):

php - SQL - Data not being inserted, no error -

this question has answer here: how mysqli error in different environments? 1 answer reference - error mean in php? 29 answers i have sql table table taking care of members list of website. however, when registering new user, data not inserted in table. no error being shown either check them few times throughout code. if (empty($error_msg)) { // create hashed password using password_hash function. // function salts random salt , can verified // password_verify function. $password = password_hash($password, password_bcrypt); // insert new user database if ($insert_stmt = $mysqli->prepare("insert members (username, email, password) values (?, ?, ?)")) { $insert_stmt->bind_param('sss', $usernam

Docker swarm stop spin up containers at 250 -

tldr: docker wont spin more 250 containers. i'm deploying cluster of 3 docker services swarm 2 nodes. 2 of services need contain 1 container (have replicas: 1 in docker-compose file), , third service need have 300 containers (have replicas: 300 setting). the problem it's spin 3 services, first 2 1 container each (work should), , third service spin 248 containers out of 300 (i see when docker service ls ). try search if there limit of service or swarm couldn't find any. i appreciate can get. if it's matter, each node 30gb ram , 8 cores, , use 1/3 of ram. i don't think can spin more 250 1 service, due fact of them sitting on same network mean using 250+ ip addresses. unless define custom ipv6 network , try that, you're better off adding network swarm, spin new identical service on swarm on other network tl; dr; define 2 networks , add them service, see if can spin more 250 replicas

C++ code: letters to PGM -

i need write c++ code converts upper case letters pgms. need map upper case letters grid of standard size. e.g. = . . . ..... . . is there library can use provide me co-ordinates each dot needed form letter?

reactjs - How to get on the key of the parent from his child in Javascript? -

Image
i want take name of parent highlight yellow let postref = fire.database().ref('users/').orderbykey().limittolast(100); postref.on('child_added', snapshot => { snapshot.foreach(childsnapshot => { let author = snapshot.key; childsnapshot.foreach(result => { let finaly = {text: result.val(), key: result.key , author: tostring(author)} this.setstate({posts: [finaly].concat(this.state.posts)}) }) }) }) postref.on('child_changed', snapshot => { snapshot.foreach(childsnapshot => { let author = snapshot.key; childsnapshot.foreach(result => { let finaly = {text: result.val(), key: result.key , author: tostring(author) } this.setstate({posts: [finaly].concat(this.state.posts)}) }) }) }) this show item database , posts.author show object undefined <item.group&

animate.css - Skillbar not loading Error message: Cannot read property 'top' of undefined -

i trying animate 'skillbar' using html, css, js, , animate.css. getting error: error feedback: uncaught typeerror: cannot read property 'top' of undefined. i using grid system rather bootstrap var skillbartoppos = jquery('.skillbar').position().top; jquery(document).scroll(function(){ var scrolled_val = $(document).scrolltop().valueof(); if(scrolled_val>skillbartoppos-250) startanimation(); }); function startanimation(){ jquery('.skillbar').each(function(){ jquery(this).find('.skillbar-bar').animate({ width:jquery(this).attr('data-percent') },6000); }); };

jquery .prop() on checkbox not working -

currently beating head against wall wondering why can't seem set checked property of checkbox based on the value of variable. i'm trying make page editable. when user chooses edit page, current values stored in sessionstorage , recalled in order replace changed values original value if user cancels. i've stored original checked values (true or false) in session storage , i'm trying use values populate checked state on cancel (this occurs in each loop triggered button click). below code simplified include feel "problem" bits. var value = sessionstorage.getitem(key); console.log(key + ' = ' + value); //produces correct key/value pair $('input[name="' + key +'"]').prop('checked') === value; the checkboxes revert whatever current value is. here's i've tried: $('input[name="' + key +'"]').prop('checked', value); $('input[name="' + key +'"]').

Send a matrix as a proc argument in Chapel -

i'm getting error when try send matrix proc. i'm pretty sure i'm doing wrong, can't figure out. use linearalgebra; proc main() { var = matrix( [0.0, 0.8, 1.1, 0.0, 2.0] ,[0.8, 0.0, 1.3, 1.0, 0.0] ,[1.1, 1.3, 0.0, 0.5, 1.7] ,[0.0, 1.0, 0.5, 0.0, 1.5] ,[2.0, 0.0, 1.7, 1.5, 0.0] ); check_dims(a); } proc check_dims(a: matrix) { var t: bool = false; if (a.domain.dim(1) == a.domain.dim(2)){ t = true; } return t; } gives me mad.chpl:3: in function 'main': mad.chpl:14: error: unresolved call 'check_dims([domain(2,int(64),false)] real(64))' mad.chpl:17: note: candidates are: check_dims(a: matrix) i'm using chpl version 1.15.0 linear algebra objects (like matrices , vectors) represented arrays in chapel. therefore, changing matrix (a type not exist) [] (the syntax array-type) should work expected: use linearalgebra; proc main() { var = matrix( [0.0, 0.8, 1.1, 0

c - Why are these function names in parenthesis? -

this question has answer here: how function pointers in c work? 11 answers c function pointer syntax 4 answers i've been meaning ask question while now. what's going on these functions? why names in parenthesis? void (*think)(gentity_t *self); void (*reached)(gentity_t *self); // movers call when hitting endpoint void (*blocked)(gentity_t *self, gentity_t *other); void (*touch)(gentity_t *self, gentity_t *other, trace_t *trace); in examples, parenthesis in function name means variable of pointing function address. if don't use parenthesis void * think(gentity_t *self);// equal (void *) think(gentity_t *self); it means definition of function name:think, return: void *, parameter: gentity_t *self; these variable of point

javascript - Fetch POST Request doesn't return response sent using res.send('sampletext'); -

i have cloud function triggered using fetch post request client browser, response fetch call doesn't contain response text cloud function(res.send("sampletext")) cloud function: const functions = require('firebase-functions'); const cors = require('cors')({ origin: true }) exports.unlock = functions.https.onrequest((req, res) => { cors(req, res, () => { res.send('bsdasda'); }) }) fetch post request on client browser fetch("https://us-central1-closing-ratio-32360.cloudfunctions.net/unlock", { method: "post", mode: "cors" }).then((response) => { console.log(response) }); this fetch response on client browser response {type: "cors", url: "https://us-central1-closing-ratio-32360.cloudfunctions.net/unlock", redirected: false, status: 200, ok: true, …} body : (...) bodyused : false headers : headers {} ok : true redirected : false status : 200 statustext :

SQL Server 2012 Columns to Single Row Seperated by Comma -

Image
i have table sortorder , diagnosiscodes. i need see diagnosiscodes in 1 row each different set of sortorders. use xml path declare @diagnosis table (id int, diagnosiscode varchar(10)) insert @diagnosis values (1,'d50.9'), (1,'m10.9'), (1,'z79.82'), (2,'m81.0'), (2,'z85.3'), (2,'z90.710'), (3,'m81.0'), (3,'z85.3'), (3,'z17.0') select t.id, stuff(( select ', ' + diagnosiscode @diagnosis id = t.id xml path(''),type) .value('.','nvarchar(max)'),1,2,'') alldiagnosiscodes @diagnosis t group t.id order t.id result id alldiagnosiscodes 1 d50.9, m10.9, z79.82 2 m81.0, z85.3, z90.710 3 m81.0, z85.3, z17.0

ionic3 - With Ionic 3 How to make the slides start at the end? -

if have 3 slides, when view loads, see slide number 3 first. start end, not slide 1. i tried: ionviewdidload() { this.slides.slideto(3) } but throws error: cannot read property 'length' of undefined there initialslide input property [ref] https://ionicframework.com/docs/api/components/slides/slides/#input properties in view can add <ion-slides initialslide="2"> <ion-slide> <h1>slide 1</h1> </ion-slide> <ion-slide> <h1>slide 2</h1> </ion-slide> <ion-slide> <h1>slide 3</h1> </ion-slide> </ion-slides>

Is it worthwhile to explicitly write Integers as bits in Swift? -

i learned how binary numbering system works (how write integers in bits), , wondering if worthwhile thing include in software. performance big me, , know writing integers in bits faster not. i'm wondering how faster. i'm not asking number on scale, want know if subtle difference, maybe 0.1 second quicker calculation, or if more noticeable, such 1 second quicker. just thinking readability , safety of code explicitly written integers in bits sounds mess waiting happen, want know if tradeoff worth me. i know bit of loose question have stated, let me try , improve here: will performance have noticeable change if store integers explicitly using bits? (i consider "noticeable change" on 0.5 seconds quicker) i'd have thought came '70s (like me) when "performance" equated "paging", "core memory", "megahertz", , like. prefaced things "i learned...". here's should matter you: what ios/macos vers

python - iGraph: selecting vertices connected to -

suppose have following graph: g = ig.graph([(0,1), (0,2), (2,3), (3,4), (4,2), (2,5), (5,0), (6,3), (5,6)], directed=false) g.vs["name"] = ["alice", "bob", "claire", "dennis", "esther", "frank", "george"] and wish see bob connected to. bob connected 1 person alice. if try find edge : g.es.select(_source=1) >>> <igraph.edgeseq @ 0x7f15ece78050> i above response. how infer vertex index above. or if isn't possible, how find vertices connected bob? this seems work. keyword arguments consist of property, e.g _source , _target , , operator e.g eq (=). , seems need check both source , target of edges (even it's undirected graph), after filtering edges, can use list comprehension loop through edges , extract source or target : connected_from_bob = [edge.target edge in g.es.select(_source_eq=1)] connected_to_bob = [edge.source edge in g.es.select(_target_eq=1)] conne

Exponential method in dafny: invariant might not be maintained -

i started learning dafny , learned invariants. i've got code: function pot(m:int, n:nat): int { if n==0 1 else if n==1 m else if m==0 0 else pot(m,n-1) * m } method pot(m:int, n:nat) returns (x:int) ensures x == pot(m,n) { x:=1; var i:=0; if n==0 {x:=1;} while i<=n invariant i<=n; { x:=m*x; i:=i+1; } } and given error following: "this loop invariant might not maintained loop." think might need invariant, think code correct other (i guess). appreciated. in advance. a loop invariant must hold whenever loop branch condition evaluated. on last iteration of loop, i n+1 , loop invariant not true then. changing loop invariant i <= n + 1 or changing loop branch condition i < n fix particular problem. after that, still have work finish proving method correct. feel free ask further questions if stuck.

How to segment users in facebook analytics without a user id? -

i want run ab test tracked facebook analytics. wanted use user property segment results, testing our registration flow , user id not exist @ point. user properties cannot saved until user id has been set. it seems have use event + parameter segment users. however, since event, potentially generated multiple times. alternatively, set random user id @ startup. since i've been setting user ids match our backend's user ids think cause our data invalidated. am missing options how work around issue?

angular - import file from ionic2-calendar directly into ionic page to use a method -

i trying import part of ionic2-calendar (or whole thing) directly ionic page. d.ts file trying import looks this: ...npm_modules/ionic2-calendar/monthview.d.ts : import { oninit, onchanges, eventemitter, simplechanges, templateref } '@angular/core'; import { slides } 'ionic-angular'; import { icalendarcomponent, ievent, imonthview, imonthviewrow, itimeselected, irange, calendarmode, idateformatter } './calendar'; import { calendarservice } './calendar.service'; import { imonthviewdisplayeventtemplatecontext } "./calendar"; export declare class monthviewcomponent implements icalendarcomponent, oninit, onchanges { private calendarservice; slider: slides; monthviewdisplayeventtemplate: templateref<imonthviewdisplayeventtemplatecontext>; monthviewinactivedisplayeventtemplate: templateref<imonthviewdisplayeventtemplatecontext>; monthvieweventdetailtemplate: templateref<imonthviewdisplayeventtemplatecontex

powershell - Unable to get WindowsUpdateLog in Windows 2016 -

while trying run get-windowsupdatelog error below. come across blog copy symsrv.dll file on server. doesn't make sense had troubleshoot across many servers. isn't there way read windows update log in windows 2016 ? copy-item : cannot find path 'c:\program files\windows defender\symsrv.dll' because not exist.

java - Android : How to load an activity faster when calling it from another activity, even while loading several contents in the second activity -

i'm new java , android asking these kind of questions here understand how should work. i have 2 activities in app viz welcome_activity.java , content_activity.java the first activity work smoothly problem comes when content_activity(second activity) called welcome_activity(first activity) in oncreate of second activity , think contents many cause activity load slow. how solve issue? example : @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_puzzle_game); q1_tv = (textview) findviewbyid(r.id.q1_tv); q2_tv = (textview) findviewbyid(r.id.q2_tv); q3_tv = (textview) findviewbyid(r.id.q3_tv); q4_tv = (textview) findviewbyid(r.id.q4_tv); q5_tv = (textview) findviewbyid(r.id.q5_tv); q6_tv = (textview) findviewbyid(r.id.q6_tv); q7_tv = (textview) findviewbyid(r.id.q7_tv); q8_tv = (textview) findviewbyid(r.id.q8_tv); q9_tv = (textview) findviewby

statistics - R logistic regression model.matrix -

i new r , trying understand solution of logistic regression. done far remove unused variables, split data train , test datasets. trying t understand part of talks model.matrix. getting r , statistics , not sure of model.matrix , contracts. here code: ## create design matrix; indicators categorical variables (factors) xdel <- model.matrix(delay~.,data=datafd_new)[,-1] xtrain <- xdel[train,] xnew <- xdel[-train,] ytrain <- del$delay[train] ynew <- del$delay[-train] m1=glm(delay~.,family=binomial,data=data.frame(delay=ytrain,xtrain)) summary(m1) can please tell me usage of model.matrix? why cant directly create dummy variables of categorical variables , put them in glm? confused. usage of model.matrix? marius' comment explains how - below code gives example (which felt helpful since poster still confused). # create example dataset. 'catvar' represents categorical variable despite being coded numbers. x = data.frame("catvar" = sample

java - How to define a many to one mapping in hibernate (XML based) based on non-primary key columns -

scenario: two tables user , usergroup sample user table desc below name null type ------------- -------- ------------- id varchar2(12) usergroup varchar2(32) role_id not null number(5) sample usergroup table desc below name null type ------------------- -------- ------------- id varchar2(12) name varchar2(32) role_id not null number(5) from above tables, usergroup + role_id in user table linked name + role_id in usergroup i need write 1 many mapping above relation, can usergroup object user object. have defined below relation in user.hbm not working. <join table="usr_group" fetch="join" optional="true"> <key property-ref="nonprimary"> <column name="name" /> </key> <many-to-one name

jquery - Is there way to identify connected div by clicking connection line ? connections js -

i'm using connections js connect components in web app. want delete connection line when double click on line. want identify connected components. please me fix issue. [jsfiddle link][1] [1]: https://jsfiddle.net/sl_mahasona/3sv4t3es i've changed following code achieve wanted results udara $(document).ready(function() { $(".draggable").draggable(); $('#draggable3').connections({ to: '#draggable4', 'class': 'demo' }); $.repeat().add('connection').each($).connections('update').wait(0); }); $(document).ready(function() { $(".draggable").draggable(); $('#draggable3').connections({ to: '#draggable4', 'class': 'demo', 'data-from': '#draggable3', 'data-to': '#draggable4' }); $.repeat().add('connection').each($).connections('update').wait(0); $(document).on("dblclick&q

visual studio - NuGet error. "Package restore failedd.Rolling back changes for ...", no matter what package I try to install -

Image
i have problem nuget, tried everything, wouldn't work. whenever create new project, wouldn't work, can't install, update, delete, anything. leave here nuget.config file, maybe can help... <?xml version="1.0" encoding="utf-8"?> <configuration> <activepackagesource> <add key="nuget.org" value="https://www.nuget.org/api/v2/" /> </activepackagesource> <packagesources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolversion="3" /> <add key="telerik.com" value="https://nuget.telerik.com/nuget" /> </packagesources> </configuration> nuget error. “package restore failedd.rolling changes …”, no matter package try install if understand correct, can not install package microsoft.aspnetcore.nodeservices project more. right? if yes, should notice author of package mic

python - (502 Bad Gateway) Handle load on uwsgi_server + flask + nginx -

we serving flask using uwsgi. seems work fine till tried load test on site. on increased load site went down , started giving 502 - bad gateway. errors: 2017/08/17 15:22:57 [error] 1209#1209: *2394 connect() unix:/home/ubuntu/opt/myproject/app/myproject.sock failed (11: resource temporarily unavailable) while connecting upstream, client: ip_address_here, server: ads.myproject.co, request: "get /app_wall?aff_id=2&google_aid=&ios_ifa_md5=&ios_ifa=&mac_address=&device_id=&device_os_version=4.1&device_os=android&device_model=gt-i9082&device_brand=samsung&country_code=mu&city=port louis&referer=&user_agent=dalvik%2f1.6.0+%28linux%3b+u%3b+android+4.1.2%3b+gt-i9082+build%2fjzo54k%29&ip=105.235.159.208&datetime=2017-08-17+15%3a22%3a57&affiliate_sub5=15343&affiliate_sub4=&affiliate_sub3=&affiliate_sub2=56292544&affiliate_sub1=6ac48ae370ec4e30b942aac4c7d1e127&affiliate_source=1252_15343&creativ

YouTube API-get Trending and most popular videos of multiple region -

is there way trending , popular videos youtube of multiple regions? https://www.googleapis.com/youtube/v3/videos?part=contentdetails&chart=mostpopular&regioncode=us&key={api_key} this api give me popular videos of only, if had show poplar videos of both , gb? there way 1 api trick?

php - INSERT INTO SELECT with VALUES in one query -

Image
bit new mysql , php - have following code create new record in multiple tables have setup need merge following code somehow creates separate rows instead of 1 record $sql .=("insert orders (customer_id) select customer_id customer_details;"); foreach($result $item){ $mysql_desc = $item['product_description']; $mysql_mode = $item['delivery_mode']; $mysql_cost = $item['course_cost']; $sql .=("insert orders(product_description, delivery_mode, course_cost) values('$mysql_desc', '$mysql_mode', '$mysql_cost');"); } the result i'm getting: based on data assume want insert customer id , values php same record. in case need combine them same insert ... select ... statement: $sql .=("insert orders(customer_id, product_description, delivery_mode, course_cost) select customer_id, '$mysql_desc', '$mysql_mode', '$mysql_cost' customer_details;"); couple of things not

groovy - Geb test intermittent failure firefox - org.openqa.selenium.WebDriverException: Element is not clickable at point -

i getting following error intermittently @ component click in geb ui tests on firefox 45.0.1, selenium 2.53.1 , following jars: geb-spock-1.1.1.jar geb-core-1.1.1.jar geb-ast-1.1.1.jar geb-waiting-1.1.1.jar geb-implicit-assertions-1.1.1.jar geb-exceptions-1.1.1.jar geb-test-common-1.1.1.jar spock-spring-1.0-groovy-2.4.jar spock-core-1.0-groovy-2.4.jar org.openqa.selenium.webdriverexception: element not clickable @ point (499.95001220703125, 375.6000061035156). other element receive click: the tests fail intermittently. adding sleep of 200 ms before component click viz. sleep(200) not want use sleep() such fix time values sake of practice. waitfor() not either: mybutton(wait:true) {$('#mybtn')} waitfor { mybutton.isdisplayed() } mybutton.click() launching tests in full screen not make things better: def setupspec() { getdriver().manage().window().maximize() } its element displayed before clickable have seen behaviour

http status code 404 - Azure App Service Diagnostics Logs Application Logging Blob Storage URL Not Found 404 -

Image
in azure app service, enabled diagnostics logs > application logging (blob) , pointed blob storage account. below. and enabled application insight logging in same app service. but, in application insight logging, seeing error. looks below. it seems, writing data app service azure blob storage failed because can't find url, hence sends 404. actual request / command showed in image is: https://myqalogs.blob.core.windows.net:443/my-qa-api-applogs/my-qa-api/2017/08/18/04/fc0efb-4524.applicationlog.csv?se=2037-08-16t11%3a32%3a01z&sp=rwdl&sr=c&sv=2015-04-05&sig=qgsajcdke6pszbqyizwjdcruk2v37jk2da0v49hibrs%3d&api-version=2014-02-14&comp=blocklist&blocklisttype=committed but, content there. i not sure check , how solve these errors. highly appreciated. i have created test demo on side. have reproduced issue. i guess related how azure diagnostics logs works. if azure diagnostics logs wants log azure blob. it firstly send reque

git - How to get diffs for Gerrit IDs? -

in development forum (rockbox firmware), contributor referenced numbers g#1552, g#1557, g#1558 , said these related gerrit , can used 'requisite patches' build. 1 supposed put these numbers actual patches? not familiar gerrit, know, used push changes, , not pull diffs repository. do following: access gerrit ui using internet browser ( https://gerrit-server ) paste change number (only number, without "g#") @ search field click on search button you'll change page information (author, date, branch, commit log, changed files, etc). if want bring change local repository following: click on download button click on copy clipboard button (right side) of checkout option execute command on local repository

visual c++ - C++ display address of a function in a MessageBox -

i trying display memory address of function in messagebox, doesn't display want. i want pass function address of callback function function, tried address. i looked @ this example , tried show in messagebox first instead printing console, before using it. how tried it: char ** fun() { static char * z = (char*)"merry christmas :)"; return &z; } int main() { char ** ptr = null; char ** (*fun_ptr)(); //declaration of pointer function fun_ptr = &fun; ptr = fun(); char c[256]; snprintf(c, sizeof(c), "\n %s \n address of function: [%p]", *ptr, fun_ptr); messageboxa(nullptr, c, "hello world!", mb_iconinformation); snprintf(c, sizeof(c), "\n address of first variable created in fun() = [%p]", (void*)ptr); messageboxa(nullptr, c, "hello world!", mb_iconinformation); return 0; } but, these messageboxes display large numbers , seems null. i display them in messagebo

executorservice - How is an executor terminated in my Java program? -

this question related previous question : why speed of java process inside multiple loops slows down goes? in order find problem of question, looked closely @ code , found executors in app not terminated, since i'm in process of learning how use executors, copied online sample codes , used them in app, , i'm not sure if i'm using them correctly. what's difference between following 2 approaches of using executors ? [1] executor executor=executors.newfixedthreadpool(30); countdownlatch donesignal=new countdownlatch(280); (int n=0;n<280;n++) { ... executor.execute(new samplecountrunner(donesignal,...)); } try { donesignal.await(); } catch (exception e) { e.printstacktrace(); } [2] executorservice executor=executors.newfixedthreadpool(30); (int i=0;i<60;i++) { ... executor.execute(new xyzrunner(...)); } executor.shutdown(); while (!executor.isterminated()) { } it seems me after 1st 1 done, executor still has active pool of thread

Auth0 JWT as access token comes in only on second login -

i have issue , i'm not sure whether "bug" or fault somewhere. all of sap on asp.net core angular accessing auth0 on hosted page. i have updated hosted page auth0lock object on hosted page inculde params object specified audience var lock = new auth0lock(config.clientid, config.auth0domain, { auth: { redirecturl: config.callbackurl, responsetype: 'token', params: { "audience": "https://api.webatom.com" } }, assetsurl: config.assetsurl, allowedconnections: connection ? [connection] : null, rememberlastlogin: !prompt, language: language, languagedictionary: languagedictionary, theme: { //logo: 'your logo here', //primarycolor: 'green' }, prefill: loginhint ? { email: loginhint, username: loginhint } : null, closable: false, // uncomment if want small buttons social providers // socialbuttonstyle: 'small' }); during first login usual auth resu

angular - Simple search query in Angular2/4 with Firebase -

i have project in angular4, database i'm using firebase. have table of users , need search bar filters users according name. in sql like '%name%' , don't see similar options firebase. how can make simple search bar users? thanks. this code i'm using retrieve data database: import { angularfiredatabase, firebaselistobservable, firebaseobjectobservable } 'angularfire2/database'; export class usercomponent implements oninit { constructor(public af: angularfiredatabase) { this.users = af.list('/users', { query: { limittolast: 15 orderbychild: 'name', equalto: "i don't know put here" } }); } }

wordpress - Show discount price on changing product quantity - Woocommerce Dynamic Pricing plugin -

i using woocommerce dynamic pricing plugin , facing issue show discounted price on product detail page. i have 3 user roles , set pricing rules minimum , maximum product quantity on fixed price. when logged in specific role (stockist), it's not showing me discount price. if add product cart shows me discounted price in cart. is there way can change price on changing product quantity. i have pricing rule as: 1) product quantity in between 4-16 price $40 2) product quantity in between 17-50 price $39 3) product quantity in between 51 , more price $35 i found code not working dynamic pricing rules: add_action( 'woocommerce_single_product_summary', 'woocommerce_total_product_price', 31 ); function woocommerce_total_product_price() { global $woocommerce, $product; // let's setup our divs echo sprintf('<div id="product_total_price" style="margin-bottom:20px;display:none">%s %s</div>',__('pro

javascript - How to make my pop up disappear after 3 seconds -

i new this, can tell me how can make popup disappear in 3 seconds instead of clicking on x right now. i have tried putting close_popup anywhere , still didn't work. jquery(document).ready(function($) { "use strict"; var popup = $('#yith-wacp-popup'), overlay = popup.find( '.yith-wacp-overlay'), close = popup.find( '.yith-wacp-close'), wrapper = popup.find( '.yith-wacp-wrapper'), wrapper_w = wrapper.width(), wrapper_h = wrapper.height(), close_popup = function(){ // remove class open popup.removeclass( 'open' ); // after 2 sec remove content settimeout(function () { popup.find('.yith-wacp-content').html(''); }, 2000); $(document).trigger( 'yith_wacp_popup_after_closing' ); }, // center popup function center_popup

c# FileStream Read having problems with StreamReader EndOfStream -

as title says found problem. little story first: have file.txt looking this: aaaabb ccccddd eeeefffffff there many ways read text line-by-line, 1 of this: streamreader sr = new streamreader("file.txt"); while(!sr.endofstream) { string s = sr.readline(); } sr.close(); works. s gets each line. need first 4 letters bytes , rest string. after looking things , experimenting little, found easiest way this: filestream fs = new filestream("file.txt", filemode.open); streamreader sr = new streamreader(fs); byte[] arr = new byte[4]; fs.read(arr, 0, 4); string s = sr.readline(); sr.close(); fs.close(); works. arr contains first 4 letters bytes , rest of line saved in s . single line. if add while : filestream fs = new filestream("file.txt", filemode.open); streamreader sr = new streamreader(fs); while(!sr.endofstream) { byte[] arr = new byte[4]; fs.read(arr, 0, 4); string s = sr.readline(); } sr.close(); fs.close(); now there&

python - while connecting to mysqldb with pycharm i am getting error -

/md /w3 /gs- /dndebug -dversion_info=(1,2,5,'final',1) -d__version__=1.2.5 "-ic:\program files (x86)\mysql\mysql connector c 6.0.2\include" -ic:\python27\include -ic:\python27\pc /tc_mysql.c /fobuild\temp.win-amd64-2.7\release_mysql.obj /zl _mysql.c _mysql.c(42) : fatal error c1083: cannot open include file: 'config-win.h': no such file or directory error: command 'c:\users\bseel\appdata\local\programs\common\microsoft\visual c++ python\9.0\vc\bin\amd64\cl.exe' failed exit status 2

Why DeleteByQuery - ElasticSearch v2.4 java api does not work? -

i have problem, need delete elasticsearch using field _source . for can delete es using _id in case need delete field _source . this code: public void removedocument(string index, string type, string id) { esclient.preparedelete(index, type, id).execute().actionget(); } and tried doesn't work: public void removedocumentbyfield(string index, string type, string field, string value){ querybuilder querybuilder = new matchquerybuilder(field, value); new deletebyqueryrequestbuilder(esclient, deletebyqueryaction.instance) .setindices(index) .settypes(type) .setquery(querybuilder) .execute() .actionget(); }

cordova - telerik ios add share extension for url -

i developing hybrid social media app in telerik , want share url app spotify app need enable share extension feature in telerik app ios in android, can achieve feature adding intent plugin in ios, there no direct plugin i added following info.plist <key>nsextension</key> <dict> <key>nsextensionattributes</key> <dict> <key>nsextensionjavascriptpreprocessingfile</key> <string>action</string> <key>nsextensionactivationrule</key> <dict> <key>nsextensionactivationsupportstext</key> <true/> <key>nsextensionactivationsupportsweburlwithmaxcount</key> <integer>1</integer> </dict> </dict> <key>nsextensionmainstoryboard</key> <string>maininterface</string> <key>nsextensionpointidentifier</key> &l

imageresizer - How to configure cache folder for SourceDiskCache? -

i understand documentation sourcediskcache folder cannot configured using xml configuration file , available "through code installation". can't figure out how! i need configure custom folder. have tried few different things, different results (both in application_start): this doesn't throw error, uses default folder (/cache) var sourcediskcacheplugin = new sourcediskcacheplugin {virtualcachedir = "~/app_data/cache"}; config.current.plugins.getorinstall(sourcediskcacheplugin); this (and other variations have tried) throws error "sourcediskcache settings may not adjusted after started." new sourcediskcacheplugin().install(config.current); config.current.plugins.get<sourcediskcacheplugin>().virtualcachedir = "~/app_data/cache"; how can configure this? also, documentation states sourcediskcache in beta - still case, , xml configuration ever available? this normal way configure , install it: var plugin = ne

linux - C++:parsing regular expression Pss and its value from /proc/$pid/smaps using file operations without using awk or grep -

c++:parsing regular expression pss , value /proc/$pid/smaps using file operations without using awk or grep. have pss values corresponding given pid , sum using file operations in c++. tried fscanf cannot read regular expression. me write c++ code perform function?

liquibase - Setting time zone of hsqldb by using url -

is there way set database timezone using url properties? seems utc+2hours in test utc, tests fail because of time difference (im inserting 00:00 during verification hour fetched db 02:00). know can done set time zone dont have script initializing db in tests, liquibase file same production code. you need set jvm time zone, answered here: how set jvm timezone properly now if need test against database running in utc program not running in utc, need start hsqldb server in separate process running in utc.

ios - Is it possible to create some sort of hash/key from the user's fingerprint? -

i create app, uses hash or key touchid id or password, , put hash/key own database. so if user log in app device, login credentials , fingerprint, still recognize them. in short, apple doesn't provide access fingerprint data. and can't used match against other fingerprint databases. read more in an apple support article on touchid. also see: is possible touchid information , compare fingerprint database?

java - Apache DBUtils QueryRunner returning ids from wrong column in insert -

i using apache dbutils long rowid = queryrunner.insert(sql, new scalarhandler<long>(), params); my table schema create table abc ( userid bigint, api_key text, key_id integer not null default nextval('api_keys_key_id_seq'::regclass), constraint api_keys_pkey primary key (key_id), constraint userid_fkey foreign key (userid) references public.users (userid) match simple on update no action on delete no action ) problem rowid coming userid column primary key of table key_id , want returning id of insert query key_id column. the solution followed create table again key_id first column. in way key_id returned in response insert query. there may option configure unable find. i know creating table again not approach found answer please share.

c++ - How to register a DB failover callback in SOCI? -

i connect database using soci library , want obtain database fail-over events logging purposes. i'm not sure interface implement , how callback registration. there such support in soci? the failover notifications supported soci connections. the failover_callback interface can used callback channel notifications of events automatically processed when session forcibly closed due connectivity problems. see interface details @ https://github.com/soci/soci/blob/master/docs/connections.md

angular - 'npm update' command is not working to update dependencies in Angular2 -

i want update outdated dependencies in angular 2. when run npm outdated , displayed outdated dependencies when try update them npm update command not working me. npm version 5.3.0 . "private": true, "dependencies": { "@angular/animations": "^4.3.4", "@angular/cdk": "^2.0.0-beta.8", "@angular/common": "^4.3.4", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.3.4", "@angular/http": "^4.0.0", "@angular/material": "^2.0.0-beta.8", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "@ngui/tab": "^0.5.0", "angular-route": "^1.6.5", "angular2-jwt": "^0.2.3", "angular2-social-login": &quo

r - Obtain inverse function analytically instead of numerically -

i implemented > inverse = function (f, lower = -100, upper = 100) { function (y) uniroot((function (x) f(x) - y), lower = lower, upper = upper)[1] } > square_inverse = inverse(function (x) x^2, 0.1, 100) > square_inverse(4) [1] 1.999976 from solving inverse of function in r , happy worked :) despite visible in origin solution unfortunately not analytic one. there way exact solution or @ least improve approximation of above code?

Updating a label from an entry field on button push with tkinter in Python 3.5.2 -

Image
i trying create window line label, entry field, current value label, , "update value" button. here example: this have far. can entered value print console, can't seem work out how entered value , change currentvalue label reflect value pressing button: from tkinter import* main=tk() #stringvar currentvalue in r0c2 currentvalue = stringvar(main, "0") #called setvalues button, looks content in entry box , updates "current" label def setvalues(): content = entry.get() print(content) #this kills program def exitprogram(): exit() #title , window size main.title("title") main.geometry("350x200") #descriptions on far left label(main, text="duration (min): ").grid(row=0, column=0) #entry boxes values amidship entry=entry(main, width=10) entry.grid(row=0, column=1) #displays value set to. currentvalue = label(textvariable=currentvalue) currentvalue.grid(row=0,column=2) #takes inputted va

Batch Script to find a files inside all Sub Folders -

i have multiple images in sub folder, don't know how many folders there. want batch script find listed names in folders , copy images destination folder. tried below script getting file not found error. @echo off rem find files , copy files setlocal enableextensions enabledelayedexpansion set "sourcebasefolder=d:\system backup\picture batch file\test\15oct2015" set "targetbasefolder=c:\outputfolder" if not exist "%sourcebasefolder%\*" ( echo %~nx0: there no folder %sourcebasefolder% set "errorcount=1" goto haltonerror ) cd /d "%sourcebasefolder%" if not exist "filenames.txt" ( echo %~nx0: there no file %sourcebasefolder%\filenames.txt set "errorcount=1" goto haltonerror ) set "errorcount=0" /f "usebackq delims=" %%n in ("filenames.txt") ( /r %%j in ("%%n*") ( set "filepath=%%~dpj" if "!filepath:%targetb

VB.net Check if Process has started in a loop -

so want connect tool jump server, should automaticly connect server then. so first start process rx.exe after that, should check if rx.exe started, because takes 15 seconds start rx.exe , execute sendkeys. process.start("c:\program files\attachmate\reflection\rx.exe", "-nm -c \desktop\ssh.rxc") 'connect server 'check if process running (rx.exe) sendkeys.send("./skript") 'jump antoher server sendkeys.send("{enter}") sendkeys.send("2") sendkeys.send("{enter}") sendkeys.send(server.text) sendkeys.send("{enter}")

php - Sending Email with Godaddy server -

i have php script can send email in local test environment. using google smtp server that. when use same code send email godaddy server, not getting email. this php code using if (empty($errormessage)) { function smtpmailer($to, $from, $from_name, $subject, $body) { global $error; $mail = new phpmailer(); // create new object $mail->issmtp(); // enable smtp $mail->smtpdebug = 2; // debugging: 1 = errors , messages, 2 = messages $mail->smtpauth = true; // authentication enabled $mail->smtpsecure = 'ssl'; // secure transfer enabled required gmail $mail->smtpautotls = false; $mail->dkim_domain = '127.0.0.1'; $mail->debugoutput = 'html'; $mail->host = 'localhost'; $mail->port = 465; $mail->username = guser; $mail->password = gpwd; $m