Posts

Showing posts from April, 2010

vue.js - Laravel 5.4 + vue2 click Event Handling not working -

i have problem event handling in vue2 laravel 5.4 - nothing happen when use click event on button. no error or else. my html (in fact header.blade.php ): <div id="example"> <button v-on:click="exclick">super btn</button> </div> my js ( app.js in resources/assets folder ) require('./bootstrap'); new vue({ el: '#example', methods: { exclick: function (event) { alert("log 1"); if (event) { alert("log 2"); } } } }); const app = new vue({ el: '#app' }); js compiled gulp please help!

node.js - PHP to NodeJS REST API -

i'm working on converting made php utility nodejs code takes longer execute appropriate in php (causing time outs, etc.). part of utility has connect rest api of ipboard forum software. in php so: $data = array( "hidden" => "0", "sortdir" => "desc" ); $curl = curl_init( "http://pw-phoenix.com/forum/api/index.php?/forums/topics/". $intid . "&" . http_build_query($data) ); curl_setopt_array( $curl, array( curlopt_returntransfer => true, curlopt_httpauth => curlauth_basic, curlopt_userpwd => "---api key---", ) ); $lstresponse = json_decode( curl_exec( $curl ) ); return $lstresponse->results[0]->date; now trying turn nodejs. found npm package "request" ( https://github.com/request/request ) , attempting use that. unfortunately, knowledge of apis , authentification limited cannot figure out equivalent of above authentification in nodejs , how

Using os.system in python to open a new cmd, change its directory and then run some code in the new cmd -

i trying use os.system .py file open new cmd, change directory , run separate commands in new cmd. after changing directory, command enter using '&&' in o.system runs in first cmd , not new one. know should use 'subprocess' module in place of 'os' both have same limitation. here snippet of similar code feel easy understand. os.system('start /wait cmd /k cd c:/users/fenild/desktop/python/python 2.7 && echo "hello"') here 'hello' prints in old cmd running file contains os.system command. any ideas how can 'hello' print in new cmd?

Nexus 3 docker proxy to a v1 proxy not working (using v2 api calls) -

i have nexus 3 docker proxy repository created proxying old v1 repository have. no matter do, nexus proxy attempting make /v2 api calls proxy. have v1 support on nexus 3 proxy enabled. the following logged: 2017-07-27 19:52:47,956+0000 warn [qtp1927946838-333] awang org.sonatype.nexus.repository.docker.internal.dockerproxyfacetimpl - not parse error response unexpected character ('<' (code 60)): expected valid value (number, string, array, object, 'true', 'false' or 'null') @ [source: org.apache.http.conn.eofsensorinputstream@4462b3e0; line: 1, column: 2] 2017-07-27 19:52:47,957+0000 warn [qtp1927946838-333] org.sonatype.nexus.repository.docker.internal.v2handlers - remote url valid docker endpoint? remote host https:/// path /v2//manifests/ did not return expected response. error message: unknown looking @ logs on docker registry server see v2 requests. is supposed work or not supported? also, trying self-troubleshoot , do

c++ - If you include const in a function, is & redundant? -

will 2 function specifications below compile same thing? can't see copy needed if you're using const. if aren't same, why? void(const int y); void(const int& y); not same. if argument changes after it's passed (e.g. because it's changed thread), first version unaffected because has copy. in second variant, function called may not change argument itself, affected changes y . threads, might mean requires mutex lock.

java - Fortify marks try-with-resources as Medium severity Issue -

i have generated fortify code review , got medium severity closing filestream(in try-with-resources block) , file.delete in finally. how remove these issues? category detail location severity poor error handling : throw inside finallyblock classa.java:108 medium poor error handling : throw inside finallyblock classb.java:87 medium classa.java: 108 try (outputstream recordsfileout = new fileoutputstream(downloadfile.tofile()); outputstream rejectedfileout = new fileoutputstream(rejectedrecordsfile.tofile())) { ...... } classb.java: 87 try { } catch(ioexception ex) { } { outputfile.tofile().delete(); } from code showing can deduce outputfile.tofile() must throw catchable exception. cause .delete() bypassed , must fortify complaing about. see this page more details.

excel formula - Count rows with "x" in at least one of the previous 4 cells -

Image
i want count number of rows region (d1) , manager (f1) have @ least 1 x in previous 4 cells specified month (b1). here code have been able put adds x's in specified rows. data table in data sheet, formula , parameters (b1,d1,f1) in separate sheet. =sumproduct(subtotal(3,offset(data!$a$3,row(indirect("1:" & match("zzz",data!$a:$a)-3)),match(b1,data!$3:$3,0)-1,1,-4))*(data!$a$4:index(data!$a:$a,match("zzz",data!$a:$a))=d1)*(data!$a$4:index(data!$b:$b,match("zzz",data!$b:$b))=f1)) this formula works me: =sumproduct((data!$a$4:$a$99=d1)*(data!$b$4:$b$99=f1)* (0<countif(offset(data!$a$1,row($4:$99)-1,match(b1,data!$3:$3,0)-5,1,4),"x")))

javascript - Difference between ref() & http.get() in terms of performance while querying data from specific location from firebase database? -

i have access data specific location, directly, without searching or sorting firebase database. the database nested down suppose 3-levels (root -> child -> child's child) , have access child's child directly key value (no searching or sorting required). while accessing data http.get(), particular data want (checked on console). but whole data of root? , gives needed among them? ref() on other hand have child() function, means access data directly without bothering other children in root. is accessing data in firebase ref() has kind of performance advantage on simple http.get() method, on vuejs? http.get() simple vue-resource. then, why should use vuefire(need setup & connection db) on vue-resource (simple direct acess)? are there other advantages vuefire has on get() method of vue-resource?

postgresql - Does Postgres provide an XA compliant resource manager? -

i know if possible use postgres database backend transaction monitors oracle tuxedo or microfocus enterprise server on linux. this can possible if postgres provides xa compilant ressource manager... i have searched on postgres website couldn't find relevant information such support. thanks in advance. psqlodbc provides xa resource manager.

c# - Method update C # connection error -

this question has answer here: the name 'sr' doesn't exist in current context 3 answers i made method called update updates data in database,which calls method named getupdatecommand has method database update command,i created variable cn receives connection string bank,but when trying open connection , surround try catch, not find variable cn connection, because can not find variable public sqlcommand getupdatecommand() { //faz o em que vai percorrer, traga somente os campos com o atributo customizado tipo dataobjectfieldattribute sqlcommand retorno = new sqlcommand(); retorno.commandtext = "update {0} set {1} {2}"; string tabela = typeof(t).name; string campos = ""; string chave = ""; foreach (propertyinfo pro in typeof(t).getproperties().tolist().where(p =&

c++ - Testing for alignment with floating point -

this physics engine: when object collides on slope, speed adjust accordingly parallel said slope. to check if object moving towards or away slope, use dot product between slope's normal , velocity of object. the problem arises due floating point math. sometimes, velocity of object parallel slope, not -perfectly- parallel, causing detected collision. in cases, incorrect, velocity readjusted parallel, checked again , detected once more. is there way avoid behavior without having store variables? (i add copy of slope check hit, result in lot more checks every single object) you can set minimum deviation slope leads collision detection check. i.e. if slopes verry similar, don't check collision. e.g. deviation less 0.01° should seen parallel.

javascript - Else statement not working -

i trying return longest word in array using foreach loop , return "00" when there no word. able part of returning longest word work correctly, when introduce else statement doesn't work anymore: function findlongestword(input) { var arrwords = input.split(' '); var wordlength = 0; var word = ''; arrwords.foreach(function(wrd) { if (wordlength < wrd.length && wrd.length % 2 == 0) { wordlength = wrd.length; word = wrd; } else { return "00"; } }); return word; } your return "00" statement returns inner function , not findlongestword(input) function. you can initialize word "00". return "00" if not set inside foreach. function findlongestword(input) { var arrwords = input.split(' '); var wordlength = 0; var word = '00'; arrwords.foreach(function(wrd) { if (wordlength < wrd.length && wrd.length % 2 == 0) { wordle

html - IMG for devices -

does have code how website can load size of picture automatically device? picture size: width: 1920 height: 900px my code: <div class="item active"> <img src="img_20170603_161151.jpg" class="img- responsive" alt="ozean" style="width: 100%; height: 900px;" > <div class="carousel-caption"> </div> </div> img files loaded directly dom. therefor cannot change image while loading. there 2 options: adding correct src javascript based on screen width. don't use background image set correct media query in css.

wordpress - Gravity Forms List, output fields in a row as a group, not by column -

i trying "loop" through list in gravity forms using merge tags, however, answers each column in comma separated list instead of entire "row" of answers, , next row of answers. for example, let's have multi-column list asks age, weight, height, , eye color. put in first 4 answers, hit plus button add row. if input 3 rows so: group/row 1: 25, 180, 75, blue group/row 2: 32, 190, 72, brown group/row 3: 48, 210, 68, green what want 3 sentences : "your age 25 , weigh 180 , stand 75 inches tall , have blue eyes". "your age 32 , weigh 190 , stand 72 inches tall , have brown eyes". "your age 48 , weigh 210 , stand 68 inches tall , have reeng eyes". however getting is .... "your age 25, 32, 48 , weigh 180, 190, 210 , stand 75, 72, 68 inches tall , have blue, brown, green eyes." my current merge tag on confirmation page looks this: your age {age:20} , weigh {weight:21} , stand {height:22} inches tall , have {eye

elasticsearch - Invoking elastic search with Query string in Apache Camel -

apache camel documentation mentions query string operation: search message body: map or searchrequest description: camel 2.15: search content map of query string. anybody has example perform search query string in apache camel?

Angular 4 router: direct browser navigation restarts app -

when use browser directly navigate route app re-bootstraps , takes me correct page/component. when navigate through button example takes me there directly without re-bootstrapping app. is expected behavior? how can prevent this? the problem use identity server our authentication. requires callback url, treated direct browser navigation , app re-bootstraps. our app-routing.module looks this: const routes: routes = [ { path: '', redirectto: '/dashboard', pathmatch: 'full' }, { path: 'dashboard', component: dashboardcomponent, canactivate: [routeguardservice] }, { path: 'users', component: usersmaincomponent}, { path: 'vendors', component: vendormaincomponent}, { path: 'invoices', component: invoicesmaincomponent}, { path: 'offers' , component: esdmaincomponent}, { path: 'settings' , component: settingsmaincomponent}, { path: 'callback' , component: callbackcomponent}, { path: 

php - Pick day or date that comes first -

i trying pick either friday / saturday or 3rd, 18th, 30th, 31st... ever comes first. real example: current date tuesday, january 10th, 2017. options: friday, january 13th 2017 wednesday, january 18th 2017 my code should pick friday, january 13th 2017. php $dayofweekarray = ['friday', 'saturday']; $dayofmontharray = [3, 18, 30, 31]; foreach ($dayofweekarray $dayofweek) { $nextdaydate = new datetime("next $dayofweek"); foreach ($dayofmontharray $dayofmonth) { # continue if $nextdaydate before, or equals, whichever date $dayofmonth turns out be. # otherwise, determine comes first, $nextdaydate or $dayofmonth } } question: how can turn $dayofmonth date? i use dateperiod loop through days @ interval of 1 day until formatted date matches 1 of values looking — $start = new \datetime("2017-01-10"); // can math determine minimum number needed here // php version 7.1.5 // $end = (clone $sta

reactjs - react-vr component stops showing in state change -

component stops showing in state change text component score, stops showing, score saved in state. not updating in view. text component show when initial state set. when button clicks state correctly updates , component stops showing. behavior changed before fontsize , stops showing. oninstrumentclicked(index) { console.log('oninstrumentclicked'); this.state.winsounds.foreach(function(e) { e.playerstate.pause(); }); this.state.winsounds[index].playerstate.play(); this.setstate( (prevstate, props) => { console.log('selected sound', index); console.log('correct sound', this.state.correct_sound); console.log('score', prevstate.score); console.log('props', props); return { score: index === this.state.correct_sound ? number(prevstate.score) + 1000 : number(prevstate.score) - 1000 }; }, () => { console.log(this.state.score);

Java LZW Compresss & Decompress with Image -

i've checked many sources lzw compression didn't work image file. here resources have checked far: https://www.codemiles.com/java/lzw-data-compression-decompression-algorithm-java-code-t99.html this 1 compress file bigger original file https://codereview.stackexchange.com/questions/122080/simplifying-lzw-compression-decompression could please give resource work image compression? thanks!!! compressing compressed image not idea, because first compression removes statistical hints second compressor can use. that's @ least true contemporary compression algorithms, used in jpeg, png, gif, tiff, , webp image formats. typically, compressed file, viewed in hex editor, looks quite stream of random bytes, , random data (or non-random data statistical properties similar random data) cannot compressed. result bigger original, due overhead in storage format. clever compressors detect condition , revert storing original data, rather compressing it. so if think i

wordpress - Laravel response returns protected data -

i have 2 applications, first 1 built using laravel , second 1 built using wordpress. i'm trying download file first app. here's api route in laravel : route::get("/lp/downloadall", function(){ $headers = ['content-type' => 'application/zip']; return response()->download('lp/archives/file-1.zip', 'file-1.zip', $headers); }); and here's code within wordpress : $url = 'http://localhost:8000/api/lp/downloadall'; $args = array(); $response = wp_remote_get( $url, $args ); $response_headers = wp_remote_retrieve_headers( $response ); when printed out response object using print_r function , here how looked : requests_utility_caseinsensitivedictionary object ( [data:protected] => array ( [host] => localhost:8000 [x-powered-by] => php/5.6.11 [content-type] => application/zip [cache-control] => public [date] => fri,

tensorflow - Test accuracy keeps changing for the same data set -

i'm importing pre-trained model , using classify data. normal predicted values/ final accuracy keeps changing every time run model same data set? i printed softmax values of final layer well. probabilities keep changing. i encounter same issue recently, , found root cause dropout layer in model, hope helps.

c# - uwp programmatically scroll WebView up and down -

Image
i'm creating simple news feed, , user can open webview see details of news, reason want user can use buttons control webview scroll , down instead of using scrollviewer, have creat webview show details don't know how scroll , down using buttons for reason want user can use buttons control webview scroll , down instead of using scrollviewer. for requirement, use invokescriptasync method notify javascrip invoke custom scroll method. more please refer interacting webview content. , have created sample achieve simple page scrolling. please refer following code: htmlpage <body> <div id="test" style="width: 600px;height: 400px;padding: 10px;margin: 10px;border: 1px solid black;overflow:scroll;font-size:15px;line-height:200px;"> content </div> <script type="text/javascript"> function scrolldownbtn() { test.scrolltop += 10; } function scrollupbtn() {

php - how to tell $_GET parameters are equal to or not equal to -

i'm trying make dynamic page $_get vars(params) , have working if var equal something, display content. if var doesn't equal something, either displays content still, or doesn't display error; or displays error , content @ same time <?php if(!isset($_get['type'])){ header("location: ?type=login"); } else { $type = trim(strip_tags(stripslashes(mysql_real_escape_string($_get['type'])))); } if($type != 'login' || $type != 'register'){ ?> <h1>what looking can't found!</h1> <?php } if($type == 'login'){ ?> <h1>login page:</h1> <?php } if($type == 'register'){ ?> <h1>register page:</h1> <?php } ?> you have 2 problems in code: your check error needs use && , not || . want see if login and register both not used. you need use if/else if statements make sure 1 condition ever present.

java - CUBA-Platform + EmailInfo - How to specify FTL template path under WEB-INF? -

i have email.ftl under modules/portal/web/web-inf/templates/email/ (a subfolder created). in controller code, have emailinfo declaration, , want specify path email.ftl. looking @ this tutorial , see emailinfo declaration this: emailinfo emailinfo = new emailinfo( "john.doe@company.com,jane.roe@company.com", newsitem.getcaption(), null, "com/company/demo/templates/news_item.txt", collections.singletonmap("newsitem", newsitem) ); i notice relative path leading news_item.txt starts com/ leads me believe root of path starts "src" folder of module controller in (my controller in app-portal, in case, portal/src ). since template under web/ , not src/ , specified path so: emailinfo emailinfo = new emailinfo("email@email.com", "email template", null, "../web/web-inf/templates/email/email.ftl", null, null);[/pre] however, didn't work, error

php - OpenCart: How to add link to images -

my download.php page uses href send user custom script made, , script display images on folder user download. however, in custom script, added: class controlleraccountdownload extends controller { public function index() { so can use $this pointer, error comes saying script can't find class "controller" i have strong suspicion solution go controller script , add in custom script. can me this? tldr: how allow custom script work controller there controlleraccountdownload class in catalog/controller/account/download.php, why not modify it?

ios - Generate most efficient route with hundreds of waypoints -

i'm developing project (ipad) generates route around town origin , destination being same point (home base). this route must go along multiple (potentially hundreds) of waypoints, latitude/longitude coordinates (which determined street addresses). usually route generation, specify origin , destination , figures out route you. can have tweaking waypoints, google maps api allows maximum of 23 waypoints along way - won't suitable. apple maps / mapkit allows hundreds of requests api, must know origin , destination be. @ moment i'm doing following: origin -> pointa pointa -> pointb pointb -> pointc pointc -> destination (which same origin) but that, have know optimum route linking waypoints manually. my question is: there service out there suitable i'm attempting develop? if not, how can go generating efficient route knowing collection of coordinates , having origin , destination same. thanks in advance hope made sense. please ask if unclear.

java - How Can i Use The Values Of The Int in The Scanner -

int cmc = 279; int bdm = 326; int cp = 177; int cb = 228; int cr = 190; int pc = 43; int ccs = 24; int ce = 26; int fm = 20; int originalpricebake ; scanner bakeorder1 = new scanner(system.in); int order1; system.out.print("\nenter 1st item order:"); order1 = bakeorder1.nextint(); scanner bakeorder2 = new scanner(system.in); int order2; system.out.print("\nenter 2nd item order:"); order2 = bakeorder2.nextint(); scanner bakeorder3 = new scanner(system.in); int order3; system.out.print("\nenter 3rd item order:"); order3 = bakeorder3.nextint(); scanner bakeorder4 = new scanner(system.in); int order4; system.

bluetooth - Android BluetoothAdapter.CancelDiscovery doesn't cancel discovery -

i have discovery status hooked broadcast receiver. can start scan , let stop after default timeout of 12 seconds, , i'll both discoverystarted , discoveryfinished actions. running code _bluetoothadapter.canceldiscovery(); does not anything. 12 seconds later, discoveryfinished action after times out. how can force thing stop scanning? slowing down bluetooth connection process. here broadcast receiver subscription: filter.addaction(bluetoothdevice.actionfound); filter.addaction(bluetoothdevice.actionbondstatechanged); filter.addaction(bluetoothadapter.actiondiscoverystarted); filter.addaction(bluetoothadapter.actiondiscoveryfinished); context.registerreceiver(_bluetoothdevicereceiver, filter); and handler: public override void onreceive(context context, intent intent) { string action = intent.action; if (action == bluetoothdevice.actionfound) { bluetoothdevice newdevice = (bluetoothdevice)intent.getparcelableextra(bluetoothdevi

python - ansible 2.3.1.0 install only from files -

i need install ansible-2.3.1.0 files copy firewalled host. internally-supported pip install grabs ansible 1.x, can't use that. the default python on online host 2.7.12, , offline host 2.7.6. here's did # on separate host can access internet ... ssh online_host mkdir ~/ansible cd ~/ansible # download ansible , first-level requirements dependency tarballs pip install --download . ansible tar xvf ansible-2.3.1.0.tar.gz pip install --download . -r ansible-2.3.1.0/requirements.txt # gave me these tarballs ansible-2.3.1.0.tar.gz jinja2-2.9.6.tar.gz paramiko-2.2.1.tar.gz pycrypto-2.6.1.tar.gz pyyaml-3.12.tar.gz # install on offline host ssh offline_host # tarballs above copied here cd ~/ansible # unpack , offline install sudo pip install ansible-2.3.1.0.tar.gz --no-index --find-links file://`pwd` but when try run ansible, give me this: ansible traceback (most recent call last): file "/usr/bin/ansible", line 25, in <module> ansible.runner import r

hadoop - Does sqoop import/export create java classes? If it does so, what is the location of these classes? -

does sqoop import/export create java classes? if so, can see these generated classes. location of these class files? does sqoop import/export create java classes? yes if so, can see these generated classes. location of these class files? it automatically generates java file of same table name in current path of local system. you can use --outdir provide own path. updated per comment you can use codegen command this: sqoop codegen \ --connect jdbc:mysql://localhost/databasename\ --username username\ --password password\ --table tablename after command executed there path @ end can see java files.

amazon cloudwatchlogs - Set expiration of CloudWatch Log Group for Lambda Function -

by default when create lambda function, cloudwatch log group set never expire. possible set expiration (saying 14 days) don't have set manually console after creation? if creating lambda through console, not possible set log retention accordingly. not possible set default retention cloudwatch logs. the way can influence log retention through cloudformation. in case, need deploy lambda through cloudformation , can define matching loggroup custom retention within template.

Use Heroku config vars in PHP? -

Image
i trying heroku variable in php.i have been defined variable in heroku.but problem not able access variable. i have checked variable in web , console..the variable there.but in php shows empty.anything need in composer or vendor? in views file tried like: getenv('video'); but empty.please help. i checked these links: use heroku config vars php? https://devcenter.heroku.com/articles/deploying-php there procfile in vendor/bin/heroku-php-apache2 ..if file there config var function works. $config_var = getenv('config_var'); sorry checking in localhost after clone heroku.in localhost procfile file not there.that why did not work.in heroku application file exist.it works in heroku app.

python - sk-learn saved model to disk, but get only array -

when storing fitted_clf sk-learn classifier like: joblib.dump(fitted_clf, some_path) most of time when loading memory like: joblib.load(some_path) only array of array(['col1', 'col2], dtype=object) returned instead of loading fitted pipeline. however, real pipeline, not understand why not consistent behavior. edit i think has different joblib verisions i.e. sklearn.externals import joblib works, when using regular joblib array confirmed. using sklearn.externals import joblib fixing have consistent behavior.

multisite - Is it possible to create more then 500 subsite in Wordpress? -

is possible create more 500 site in wordpress ? wordpress create new tables each subsite increase database load. if it's possible it's effect on site performance? anyone please give proper idea or solution how manage 500 subsite. thanks it effect overloading mysql database. the first-level of “defense” on overloading database use mysql query cache. the query cache nifty little feature in mysql, stores — in dedicated within main memory — results of query table has not changes. check out following article: https://premium.wpmudev.org/blog/scaling-wordpress-wpmu-buddypress-like-edublogs/

c# - asp.net: RequiredFieldValidator in TemplateFiled for DetailsView does not work at run time -

i'm trying add validator template in detailsview control, @ run time encounter error: server error in '/' application. webforms unobtrusivevalidationmode requires scriptresourcemapping 'jquery'. please add scriptresourcemapping named jquery(case-sensitive). description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidoperationexception: webforms unobtrusivevalidationmode requires scriptresourcemapping 'jquery'. please add scriptresourcemapping named jquery(case-sensitive). source error: an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. below, program in visual studio 2017. <%@ page language="c#" autoeventwireup="true" codebehind="inserttitlebytemplate.aspx.cs&q

angular - How to auto scroll to top for material2 angular2 dialog box? -

i using https://material.angular.io , dialog box ( https://material.angular.io/components/dialog/overview ). problem when position dialog box using config = {'width':'200px', 'height':'400px', position: {'top':'150px', 'left':'400px'}} i notice when click button show dialog box, scrolls way down... there way make when click button show dialog box, stays @ top/scrolls top? add code in style.css file. .md-dialog-container { height: 100vh !important; top: 0 !important; position: fixed !important; } another way:- you can adjust position of dialog component using updateposition() method of mddialogref. use code in dialog component:- import { mddialog, mddialogconfig, mddialogref } '@angular/material'; constructor(public dialmodalref: mddialogref<any>) { } changeposition() { this.dialmodalref.updateposition({ top: '50px', left: '50px' }); } read more here:- https://mat

parameters - How to assign bunch of data to each virtual users in load runner [Vugen] -

i have 30k data , wanted distribute among 3 different roles [ 100 set each 3 users], problem : want assign 100 data [one set of data each users ], upon each new iteration data picked unique assigned bunch each virtual user. for single user can placing parameter unique iteration setting, not sure how assign 100 bunch of data each 3 user , ensure upon each iteration, specific users pick data bunch via single script. can tell us, how can via load runner ? regards, perftest

android - How to use background camera and foreground camera simultaneously? -

my new application requirement client wants create spy camera record video in background. whenever phone lock , user not present in absens of user try use phone start video recording in background recording. have done thing , works charm no issue this. now problem when service start video recording in background , @ time open default camera app , won't allow me use camera application obvious because service using camera in background. so question can use both background camera , foreground camera simultaneously? afaik not possible use background camera , foreground camera. as searched on stack overflow said samsung s4 default application can capture front , , have s4 , default application thing when installed , use app raise same issue. right planning stop video recording when default camera application open. other way apart stop recording?

iOS Audio not working during call answered when phone is locked. WebRTC used for calling -

i facing problem audio when using callkit webrtc voip call, while answering call lock screen. general functionality : my app activates audiosession when it's launched. incoming call, sdp offer & answer generated , exchanged. peer connection set up. both audio , video streams generated, whether it's audio call or video call. call reported callkit using following code: callprovider.reportnewincomingcall(with: currentcalluuid!, update: update) { error in } if app in foreground, works fine. but, when phone locked, , user answers call lock screen, streams exchanged no audio comes on either end until user enters app himself. as user enters app, audio becomes active on both ends. all background settings , capabilities set properly. i have referred following work around provided apple staff. not work. https://forums.developer.apple.com/thread/64544 as mentioned, using webrtc calling. if exchange media streams after user answers call( still on lock scree

c# - Get value of data grid view first cell with context menu -

i have data grid view populated values. want right click item in data grid view, context menu pop up, there should select menu item first cell of selected row. managed make context menu , item, i'm there. need somehow value of first row while selecting said item. tried use cell click method , works, have no clue how implement menu item click. string value = ((datagridview)sender).rows[e.rowindex].cells[0].value.tostring(); okay managed play around problem , solve that: got value needed mouse down method , stored in global variable this: private void datagridview1_mousedown(object sender, mouseeventargs e) { datagridview.hittestinfo hit = datagridview1.hittest(e.x, e.y); if(hit.rowindex >= 0) { finalvalue = ((datagridview)sender).rows[hit.rowindex].cells[0].value.tostring(); } } after click menu item can manage variable want. not exact solution problem described, hey , long works right? hope someone.

php - Wordpress. How to rewrite the permalink of a custom hierarchy depending on its slug -

i need generate links like: /author/m/marie-curie or /author/n/nananana in more general form /author/{letter}/{author} {letter} first letter of {author} farthest i've come change hierarchy slug like: register_taxonomy('author', 'book', array( 'alltheargs' => blah, 'rewrite' => array( 'slug' => 'author/x' ) ) ); this works, gives me links like: /author/x/marie. there way change taxonomy slug depending on hierarchy?

ping - How to check if my device (iOS) have internet connection via bash -

in linux using line of code easy: if ping -c 4 google.com ; echo ok ; else echo ko ; fi but in ios, ping command not available. workaround? or can access system plist file in ios connectivity status?

unity3d - Unity 2d script does not work when I clone the object -

i have object whith attached scrypt. public gameobject scoreinfo; static int currentscore = 0; void onmousedown() //кнопка мыши нажата { currentscore++; scoreinfo.getcomponent<text>().text = currentscore.tostring(); } i clone in unity 2d. gameobject tmpobj = gameobject.instantiate(spritetoduplicate, worldvector, quaternion.identity) gameobject; inspector showes script attached every clone , real 1 ( Изображение ), when click clone not work, click real 1 work finley. understood. when cloning, z axis -10. thays why click did not pass. tmpobj.transform.position = new vector3(tmpobj.transform.position.x, tmpobj.transform.position.y, 0);

interceptor - HttpInterceptor in Angular 4.3: Intercepting 400 error responses -

i to intercept 401 , other errors in order react accordingly. interceptor: import { loggingservice } './../logging/logging.service'; import { injectable } '@angular/core'; import { httpinterceptor, httphandler, httprequest, httpevent, httpresponse, httperrorresponse } '@angular/common/http'; import { observable } 'rxjs/observable'; import 'rxjs/add/operator/do'; @injectable() export class twshttpinterceptor implements httpinterceptor { constructor(private logger: loggingservice) { } intercept(request: httprequest<any>, next: httphandler): observable<httpevent<any>> { this.logger.logdebug(request); return next.handle(request) .do(event => { if (event instanceof httpresponse) { this.logger.logdebug(event); } }); } } while works 200 requests, it not intercept error respsonses all see in chrome's dev cons

arm - Benchmarks on baremetal systems -

i using lpc43xx series, has cortex-m4/m0. bare-metal system. new bare metal programming , want make small benchmark programs performance evaluation. non-cache system. how can ? or should try profiling. as know there 3 ways measure code execution time in case: timers (init timer on frequency want, read timer value before , after code execution) gpio (or similar thing) set 1 before , 0 after code execution, use oscillograph measure time performance counter embedded cpu, in case think 1 relevant: cycle counter on arm cortex m4 (or m3)?

caching - Cache error in iframe on samsung PM32F SmartTV -

going try , explain best can. we have website caches couple of images use of cache manifest , displays them in loop. trying make app samsungs tizen smarttv pm32f display webpage made super simple test app try index.html looked this. <!doctype html> <html> <head> <title>title</title> </head> <body> <iframe src="urltoourpage" sandbox="allow-same-origin allow-top-navigation allow-forms allow-scripts allow-popups"></iframe> </body> </html> and config.xml looked this <?xml version="1.0" encoding="utf-8"?> <widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/dinbil" version="3.0.0" viewmodes="maximized"> <access origin="*" subdomains="true"></access> <tizen:application id="53s0fefmsk.dinbil" package=&q

wireshark - Receive TCP RST packet from unreachable computer -

i had opportunity work wireshark. i installed wireshark on vmware , made tests on it, found interesting thing. i sent http request non-existing computer , captured packet flow wireshark. the first packet syn packet, second 1 re-transmission packet.(the system hadn't received response targeted computer). but surprisingly, rst packet target computer reached. i couldn't understand packet came from, tested 2 target computers, , in both cases, had rst packet. so there can tell me suspicious rst packets? thanks reading. regards. https://ask.wireshark.org/upfiles/img2_fpjsr9b.png https://ask.wireshark.org/upfiles/img3_rxmvejp.png

c++ - How to keep track of multiple object instances? -

i made base class object track instances of objects. want log in file so: object name: number of instances here base class: template <class t> class countedobj { public: countedobj() { // write name of derived class , counter log } countedobj(const countedobj& obj) { // write name of derived class , counter log } ~countedobj() { // write name of derived class , counter log } private: int counter; mylogger log; }; my problem want print name of class inherit countedobj , can't use typeid inside constructor. is there alternative log object allocated , deallocated ? you didn't specified how use countedobj . assume this: class foo: public countedobj<foo> { }; if derive further foo , counter unable differentiate between foo, , derived classes, suppose want print "foo" name derived classes. if want differentiate between these classes, different solution needed (i'll dele

webrtc - Audio recording remove noise -

this question has answer here: webrtc acoustic echo cancelation 2 answers i have problem audio recording in javascript. working, when computers far away, when approach each other, voice coming out of speaker heard on other side's loudspeaker , sound begins jump in closed cycle. there noise @ turn of time, turns unbearable loophole. the server written in node.js. why need move computers close each other. kind of application working with. if really need it, echo cancellation module add pipeline. loose degree of quality anyway. to knwo webrtc echo cancellation, can start here: webrtc acoustic echo cancelation

Spark installation (Wehere to install in a cluster) -

i have 2 cassandra nodes running right , let spark work on them. have read installation guides talk installing spark in standalone machine. shoudl install spark in every cassandra node , configure each node how? thanks in advance.

android - After Animation JSON load -

i new in android development. i developing app in have add intro slides after animation end problem is, have data(image , title) json , show in slides. getting data unable update slides. i have tried call json class animationend() getting null object reference. please me. thankfull. here code. mainactivity public class mainactivity extends appcompatactivity implements animation.animationlistener { imageview img; animation animfadein; stringbuffer finalstring = new stringbuffer(); private textview title1, title2, title3; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); img = (imageview) findviewbyid(r.id.imageview); animfadein = animationutils.loadanimation(getapplicationcontext(), r.anim.fade_

wordpress - Contact Form 7 Plugin Hookup -

i have 2 emial address, depends upon message content deciding emial message should go. using contact form 7. purpose creating plug-in named email filteration. created 1 folder inside plugin folder created php file email-filter.php on have written code due contact form 7 not submitting. code listed below <?php add_action("wpcf7_before_send_mail", "check_message_type"); function check_message_type($cf7){ $submission = wpcf7_submission::get_instance(); if ( $submission ) { $submited = array(); $submited['title'] = $wpcf7->title(); $submited['posted_data'] = $submission->get_posted_data(); } print_r($submited); /*$array_message=explode(" ",$message); $words=array("seo", "developer", "web-sites", "web-service", "responsive", "error", "google-analytics", "search-engine", "search engine");

java - Sync between error Listener and Test execution in WebDriver -

i trying implement javascript error listener on selenium tests built in java project. in order detect console java script errors, implemented script in javascript project push console error messages @ bottom of body, element containing specific id , error message. the error listener coded looks like: public class errorlistener implements runnable{ webdriver driver = null; public errorlistener (webdriver driver) { this.driver = driver; } private void listen () { try { while(!driver.tostring().contains("null")) //chrome alive { list<webelement> list = driver.findelements(by.xpath("//div[@id='jserror']")); if(list.size() != 0) { webelement error = list.get(0); string errormsg = error.gettext(); if(errormsg != null) {

sql - Update one from two of duplicates in Firebird – more rows -

how update 1 2 or more duplicate rows? want keep 1 , update others new value. simple example tables: from one|two|three ---------- 1|milk|water 1|milk|water to one|two|three ---------- 1|milk|water 1|milk|sugar http://www.ibexpert.net/ibe/index.php?n=doc.themysteryofrdbdbkey select *, rdb$db_key myexampletable; then update myexampletable set column=value rdb$db_key=xxxxx; another approach using stored procedure (or execute block) , use sql cursor variables. require careful loop management, skip 1 row , change 2nd, third , on. https://www.firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-psql-coding.html#fblangref25-psql-tbl-declare-cursor also see examples update ... current of ... @ https://www.firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-dml-update.html#fblangref25-dml-tbl-update but proper way add unique primary key column table , use unique numeric id

how to I create new product using catalogProductCreate method in Magento -

how create new product using catalogproductcreate method in magento? how pass parameters used in method when call method wsdl class? below example code documentation link $client = new soapclient('http://magentohost/api/v2_soap/?wsdl'); // if stuff requires api authentification, // session token $session = $client->login('apiuser', 'apikey'); // attribute set $attributesets = $client->catalogproductattributesetlist($session); $attributeset = current($attributesets); $result = $client->catalogproductcreate($session, 'simple', $attributeset->set_id, 'product_sku', array( 'categories' => array(2), 'websites' => array(1), 'name' => 'product name', 'description' => 'product description', 'short_description' => 'product short description', 'weight' => '10', 'status' => '1', &

windows - Compiling GSL library using MSYS and using it with MinGW (nuwen) -

i'm trying build newest version of gsl library windows, able use mingw distro nuwen.net (for one, it's bundled boost, , want that). unfortunately, gsl relies on configure script, figured need msys2 . using ./configure --prefix=/gsl/gsl-2.4-build --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 make -j 4 make install i able compile gsl under msys2 (it took long time). wasn't sure on host, build , target options, understand msys use different gcc ( g++ (gcc) 6.3.0 ) , nuwen distro built using same stuff above options (?). anyway, wanted sure resulting libs can used under mingw on windows (i.e. not depending on msys2 anymore). now when trying compile , link simplest gsl program using nuwen mingw distro ( g++ (gcc) 7.1.0 , get: test_gsl_boost>mingw32-make compiling main.cpp... g++ -c main.cpp -o main.o -wall -o3 -i"c:\mingw\include" -i"d:\gsl\gsl-2.4-build\include" linking main... g++ main.o -o main.exe -l"

ruby on rails - Authenticating to Pinterest with 'omniauth-pinterest' gem -

i tried integrate authenticating pinterest 'omniauth-pinterest' gem in porject. getting error message @ time of authentication {"status": "failure", "message": "you not permitted access resource.", "code": 7, "data": "the provided redirect_uri http://localhost:3000/auth/pinterest/callback not match of registered redirect uris."} please give me guidance missing in integration. thanks & regards pankaj

html - Make Div of Content Center of the page -

i'm trying replicate page: http://www.jamieoliver.com/recipes/eggs-recipes/spanish-tortilla/ i cant find way make page content stay around center of page site has. can explain me how can this? there tool find out css variables used? my test page html <!doctype html> /*-------------------------recipes---------------------------*/ .recipe-header-left{ float:left; position: relative; padding-left: 25px; padding-right: 25px; } .recipe-ingredients { float:left; } body { padding-left: 25px; padding-right: 25px; } <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <!-- jquery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jqu