Posts

Showing posts from January, 2015

python 2.7 - Google App Engine error: NeedIndexError: no matching index found -

i'm having trouble google's app engine indexes. when running app via googleappenginelauncher, app working fine. when deploying app, following error: needindexerror: no matching index found. suggested index query is: - kind: bar ancestor: yes properties: - name: rating direction: desc the error generated after line of code: bars = bar_query.fetch(10) before above line of code, reads: bar_query = bar.query(ancestor=guestbook_key(guestbook_name)).order(-bar.rating) my index.yaml file contains exact "suggested" index below # autogenerated: - kind: bar ancestor: yes properties: - name: rating direction: desc am maybe missing something? removed index.yaml file , deployed app again (via command-line) , 1 less file uploaded - index.yaml file there. everything working fine locally. i'm working on latest mac osx. command used deployment was: appcfg.py -a app-name --oauth2 update app the datastore implemented loosely based on gu...

java - Exit strategy doesn't work -

i'm trying make exit strategy in small game. when enter yes runs te script again when finish script doesn't ask: do want try again but starts again without using exit strategy. how need make exit strategy working when it's running second time? package steenpapierschaar1; public class steenpapierschaar1 { public static void main(string[] args) { final int rock = 1 ; // waarde van rock final int paper = 2; // waarde van paper final int scissor = 3;// waarde van scissor scanner keyboard = new scanner (system.in);// naam scanner input random rand = new random(); boolean playing = true; boolean ans = false; string ans0 = ""; while(playing == true){ int ai = rand.nextint((3 - 1) +1) + 1;// maakt int ai een random getal nog niet af moet een range in komen system.out.println("choose 1 rock, 2 paper , 3 scissor"); // string met keuze voo...

java - A button does not move -

when run code, controls button appears on top. want change size of button , place of button. tried use setbounds() method doesn't change anything. import javax.swing.*; import java.awt.*; public class gameframe { public jframe gameframe; public jpanel panel; public jbutton b1; public jlabel lab; public gameframe() { gui(); } public void gui() { gameframe = new jframe("poop man"); gameframe.setvisible(true); gameframe.setsize(800, 900); gameframe.setdefaultcloseoperation(jframe.exit_on_close); panel = new jpanel(); panel.setbackground(color.yellow); b1 = new jbutton("controls"); b1.setbounds( 300,70,590,300); //b1.setsize(new rectan panel.add(b1); gameframe.add(panel); } public static void main(string[] args) { new gameframe(); } } after change position or text ...

python - Numpy - constructing matrix of Jaro (or Levenshtein) distances using numpy.fromfunction -

i doing text analysis right , part of need matrix of jaro distances between of words in specific list (so pairwise distance matrix) one: │cheese chores geese gloves ───────┼─────────────────────────── cheese │ 0 0.222 0.177 0.444 chores │0.222 0 0.422 0.333 geese │0.177 0.422 0 0.300 gloves │0.444 0.333 0.300 0 so, tried construct using numpy.fromfunction . per documentation , examples passes coordinates function, gets results, constructs matrix of results. i tried below approach: from jellyfish import jaro_distance def distance(i, j): return 1 - jaro_distance(feature_dict[i], feature_dict[j]) feature_dict = 'cheese chores geese gloves'.split() distance_matrix = np.fromfunction(distance, shape=(len(feature_dict),len(feature_dict))) notice: jaro_distance accepts 2 strings , returns float. and got error: file "<pyshell#26>", line 4, in distance return 1 - jaro_distance(feature_dict[i], featur...

javascript - Form $setValidity back to true not working -

i set form validate on server side onblur event. server-side validation working fine , returning errors expected. however, once set validity false field, setting true not removing $error messages. isn't $setvalidity true supposed remove errors form? this controller: angular.module('artists').controller('artistscontroller', ['$scope', '$stateparams', '$location', 'authentication', 'artists', function($scope, $stateparams, $location, authentication, artists) { $scope.authentication = authentication; $scope.processform = function(val){ var artist = new artists({ name: $scope.artistform.name.$viewvalue, quote: $scope.artistform.quote.$viewvalue }); artist.$save(function(response) { $scope.artistform.$setvalidity(val,true); }, function(errorresponse) { if(val in errorresponse.data){ $scope.artistform.$setvalidity(val,false,...

ant - Using a configuration intersection in ivy -

i thankful help. we use ant\ivy manage our dependencies. , want download minimum quantity of modules: needed build. try use configuration intersection, got not expecting ivy behavior. https://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html since 2.1 possible define dependencies on configurations intersection. configuration intersection defined using '+' sign separate configuration (eg 'a+b' means intersection of configuration 'a' , 'b'). in case artifacts , dependencies defined in both configurations in dependency part of master configuration defining dependency on configuration intersection. configuration intersections can used when specifying confs resolve. build.xml file: <project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:e="http://ant.apache.org/ivy/extra" name="test" default="get"> <target name="get" description="-->downloads artifact...

ruby on rails - Can't read a config value in development.rb -

i have this: # config/setting1.yml var1: 11 var2: 12 # config/initializers/setting1.rb rails.configuration.setting1 = yaml.load_file(rails.root.join('config', 'setting1.yml'))[rails.env] # config/environments/development.rb //doing rails.configuration.setting1 // rails.configuration.setting1['var1'] for reason, error in development.rb undefined method setting1' #<rails::application::configuration:0x0000010543f1b0> (nomethoderror) why that? doesn't development.rb loaded after initializers/setting1.rb has been loaded? initializers loaded after config/environments/development.rb . can see more on rails guides: http://guides.rubyonrails.org/initialization.html

c - Printing (Char*)(Void*) works in main program but not function -

Image
i have array of structures called node s. each node contains field of void pointer. in function take specific node , assign void pointer string, string containing result of decimal has been converted binary. the issue accessing , printing void pointer cast char* works fine in function assign void* new char* , prints fine when returning main function. not print when try print in separate function take node[] , index of array arguments. to illuminate confusion simplified version of program: #include <stdio.h> #include <stdlib.h> #include <string.h> #define listsize 100 typedef struct node { union{ void *dataptr; int countr; }dataitem; int link; }node; void loaddata(node*); void printfunc(node[], int); void main() { struct node stack[listsize]; loaddata(&stack[0]); //this prints fine char * temp; temp = (char*)(stack[0].dataitem.dataptr); printf("\nmain(): stack[empty].dataitem.dataptr = %s\...

angularjs - How to insert username password into sqlite on login If not exists? -

i want insert username , password sqlite on login if not exists, because want keep registration , login db separately. how can check , insert? you can update table schema following , push insert query. create table tbllogin (id integer primary key autoincrement, username varchar, password varchar, unique(username) on conflict ignore) on conflict ignore ignore insert query if username still exist in table. just make clear, last_insert_rowid() still return valid id if insert query ignored , database connection same invoked function. reference here . hope helps.

swifty json - What is this success method? (Swift Closure) -

so copy pasted code ray wenderlich's swifty json tutorial , haven't been able understand of calls making. i've scanned through swiftyjson library, looked @ nsurl description on developer site , checked out swift guide either can't find or bunch of miscellania back. what these success calls mean? func getindexwithsuccess(success: ((indexdata: nsdata!) -> void)) { loaddatafromurl(nsurl(string: url)!, completion:{(data, error) -> void in if let urldata = data { /* here */ success(indexdata: urldata) } }) } func loaddatafromurl(url: nsurl, completion:(data: nsdata?, error: nserror?) -> void) { var session = nsurlsession.sharedsession() let loaddatatask = session.datataskwithurl(url, completionhandler: { (data: nsdata!, response: nsurlresponse!, error: nserror!) -> void in if let responseerror = error { completion(data: nil, ...

powershell - Appending data at the end of an existing MS Word Document (.doc and .docx) -

i have 500 word documents (some in .doc , others in .docx) need add signature line bottom of each document. these documents saved on sharepoint. looking way automate process. prefer doing in batch or powershell script or through inbuilt functionality within sharepoint. ideas helpful. thanks! this might not fastest way able it. you create bat file opens word files starts wsf file targets word window , sends keys saves it. the wsf this. <package> <job id="vbs"> <script language="vbscript"> set wshshell = wscript.createobject("wscript.shell") wshshell.appactivate "word.exe" wscript.sleep 100 wshshell.sendkeys "^{end}" wscript.sleep 500 wshshell.sendkeys "{enter}" wscript.sleep 500 wshshell.sendkeys "name" wscript.sleep 500 wshshell.sendkeys "{enter}" wscript.sleep 500 wshshell.sendkeys "phone number...

How can I add a xml file from /res/values to my gitignore in my Android project? -

i added separate xml file /res/values folder contains secret api key app uses. api_key.xml <?xml version="1.0" encoding="utf-8"?> <resources> <item name="api_key" type="string">my_key</item> </resources> now exclude git. how can that? i added line .gitignore file in project root /app/src/main/res/values/api_key.xml but not work. file still appears on github after pushing project content. git's ignore system applies files aren't yet tracked. because you've committed file, ignoring won't anything. first, , importantly, invalidate api secret key. you've published it, , there nothing can make key secure again. generate new key use going forward. do not skip step. there bots purpose in life leaked api keys on github. remove file git, using git rm --cached app/src/main/res/values/api_key.xml root of repository. remove file local repository, leave in local working co...

Parsing nodes on JSON with Scala - -

i've been asked parse json file buses on specified speed inputed user. the json file can downloaded here it's this: { "columns": [ "datahora", "ordem", "linha", "latitude", "longitude", "velocidade" ], "data": [ [ "04-16-2015 00:00:55", "b63099", "", -22.7931, -43.2943, 0 ], [ "04-16-2015 00:01:02", "c44503", 781, -22.853649, -43.37616, 25 ], [ "04-16-2015 00:11:40", "b63067", "", -22.7925, -43.2945, 0 ], ] } the thing is: i'm new scala , have never worked json before (shame on me). need "ordem", "linha" , "velocidade" data node. i created case class enclousure data later on specified ...

r - Fast linear regression by group -

i have 500k users , need compute linear regression (with intercept) each of them. each user has around 30 records. i tried dplyr , lm , way slow. around 2 sec user. df%>% group_by(user_id, add = false) %>% do(lm = lm(y ~ x, data = .)) %>% mutate(lm_b0 = summary(lm)$coeff[1], lm_b1 = summary(lm)$coeff[2]) %>% select(user_id, lm_b0, lm_b1) %>% ungroup() ) i tried use lm.fit known faster doesn't seem compatible dplyr . is there fast way linear regression group? you can use basic formulas calculating slope , regression. lm lot of unnecessary things if care 2 numbers. here use data.table aggregation, in base r (or dplyr ): system.time( res <- dt[, { ux <- mean(x) uy <- mean(y) slope <- sum((x - ux) * (y - uy)) / sum((x - ux) ^ 2) list(slope=slope, intercept=uy - slope * ux) }, by=user.id ] ) produces 500k users ~30 ...

c# - WebClient Timeout solution doesn't work (subclassing to set Timeout) -

i trying use commonly accepted solution setting timeouts weblclient calls. in test case of requesting url offline machine: consistently 20 second timeouts when set @ 1 second. public class timeoutwebclient : webclient { public timeoutwebclient(timespan timeout) { _timeout = timeout; } private timespan _timeout; protected override webrequest getwebrequest(uri address) { webrequest request = base.getwebrequest(address); request.timeout = (int)_timeout.totalmilliseconds; return request; } } server based timeouts can't matter in scenario. missing? i did find snippet set both httpwebrequest.readwritetimeout , httpwebrequest.servicepoint.maxidletime . setting these timeout value still didn't make difference , still getting ~20 second timeouts. any other thoughts of cause behavior? any chance using async download method? from msdn: the timeout property affects synchronous requests made getresponse method....

Delete some informations in a json variable with php -

my problem parsing xml file , file contain information don't want exporting json data. in case want function return json data first '[' caratere php code: <?php class xmltojsonconverter { public function parsexml ($url) { $filecontents= file_get_contents($url); // remove tabs, newline, whitespaces in content array $filecontents = str_replace(array("\n", "\r", "\t"), '', $filecontents); $filecontents = trim(str_replace('"', "'", $filecontents)); $myxml = simplexml_load_string($filecontents); $json = json_encode($myxml); return $json; } } //path of xml file $url= 'http://www.lequipe.fr/rss/actu_rss_football.xml'; //create object of class $jsonobj = new xmltojsonconverter(); //pass xml document class function $myjson = $jsonobj->parsexml($url); print_r ($myjson); ?> this part of json result : {"@attributes...

ode - Error in RK4 algorithm in Python -

i solving nonlinear schrodinger (nls) equation: (1): i*u_t + 0.5*u_xx + abs(u)^2 * u = 0 after applying fourier transform, becomes: (2): uhat_t = -0.5*i*k^2 * uhat + * fft(abs(u)^2 * u) where uhat fourier transform of u . equation (2) above pretty stated ivp, can solved 4th oder runge-kutta method. here code solving equation (2): import numpy np import math matplotlib import pyplot plt matplotlib import animation #----- numerical integration of ode via fixed-step classical runge-kutta ----- def rk4(timespan,uhat0,nt): h = float(timespan[1]-timespan[0])/nt print h t = np.empty(nt+1) print np.size(t) # nt+1 vector w = np.empty(t.shape+uhat0.shape,dtype=uhat0.dtype) print np.shape(w) # nt+1 nx matrix t[0] = timespan[0] w[0,:] = uhat0 # enter initial conditions in w in range(nt): t[i+1] = t[i]+h w[i+1,:] = rk4step(t[i], w[i,:],h) return w def rk4step(t,w,h): k1 = h * uhatprime(t...

php - Corrupted data using UTF-8 and mb_substr -

Image
i'm data mysql db, varchar(255) utf8_general_ci field , try write text pdf php. need determine string length in pdf limit output of text in table. noticed output of mb_substr / substr strange. for example: mb_internal_encoding("utf-8"); $_tmpstr = $vfrow['title']; $_tmpstrlen = mb_strlen($vfrow['title']); for($i=$_tmpstrlen; $i >= 0; $i--){ file_put_contents('cutoffattributes.txt',$vfrow['field']." ".$_tmpstr."\n",file_append); file_put_contents('cutoffattributes.txt',$vfrow['field']." ".mb_substr($_tmpstr, 0, $i)."\n",file_append); } outputs this: npp file link database: my question character come from? you need ensure you're getting data database in utf-8 encoding setting connection encoding appropriately. depends on database adapter, see utf-8 way through details. you need tell mb_ functions data in utf-8 can treat correctly. eith...

android - Reference to a background thread Handler in the UI thread -

this question has answer here: run handler messages in background thread 4 answers i know when create new background thread can give new thread reference ui thread's handler can send updates main thread(provided constructor in thread class has handler parameter). example in ui go this: handler mainhandler; backgroundthread mynewthread = new backgroundthread(mainhandler); mynewthread.start(); here's question: how can give ui thread reference handler create on background thread, can move data ui thread background thread??? handlers thread safe. can use them convey messages between threads, works cross process (e.g. communication between remote service , ui). there 1 trick tough, doing right. here example how right: link

In Python, access variable defined in main from another module -

i'm writing python program in main script initializes several variables common data command line, config file, etc. want rest of program able access them globals: def abc() : global xyz _someoptionvalue = xyz['someoptionname'] ... it doesn't work. think because global defined in main.py (for example) , function references defined in abc.py (for example). consequently function's global namespace different main script's namespace. i think should able @ global variable qualifying name name of main script's namespace, namespace's name? context: pass these variables parameters, , know many programmers consider cleaner solution. in case not because variables set once, read throughout whole program. in judgement strongest possible case (and justified case) using global variables. if think shouldn't it, respect opinion, don't share it; please respect mine! create globals module contains shared information, , have ever...

Python Instagram API - API requests fail -

i learning how use instagram api through python-instagram package. have setup clients, have client id , client secret. have gotten access token using get_access_token.py script in python-instagram, reason getting error: traceback (most recent call last): file "<ipython-input-38-6440f86cbefd>", line 1, in <module> runfile('f:/pythonprojects/minefield/instagram test.py', wdir='f:/pythonprojects/minefield') file "c:\anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 580, in runfile execfile(filename, namespace) file "f:/pythonprojects/minefield/instagram test.py", line 13, in <module> api.user_search(q='samsungmobile') file "c:\anaconda\lib\site-packages\instagram\bind.py", line 196, in _call return method.execute() file "c:\anaconda\lib\site-packages\instagram\bind.py", line 182, in execute include_secret=self.include_secret)...

SQL query taking a long time depending on the option -

i'm working on stored proc , thing 1 of options take 5 minutes run, of others takes 5 seconds. declare @rpttype varchar(75) set @rpttype = 'audits' select clt.[cltnum] [client number] ,clt.[clteng] [engagement] ,clt.[cltname] [client name] , clt.[csplname] [assurance partner], clt.[cmglname], e.[ddeventdesc] [project type], budget.[cbudprojectdesc] [project description], due.[cdtargetamount] [budget], min(wip.[wdate]) [1st date], cast(sum(wip.[wrate]*wip.[whours]) decimal(34,2)) [billable wip], cast( sum(ar.[arprogress])as decimal(34,2)) [progress], cast((sum(wip.[wrate]*wip.[whours]) - sum(ar.[arprogress]))as decimal(34,2)) [net wip], cast(sum(bucket.[cinvar])as decimal(34,2)) [ar balence], max(inv.[invdate]) [last invoicedate], due.[cddatedelivered] [project otd date]from [sab].[dbo].[wip] wip join [sab].[dbo].clients clt on wip.[wcltid] = clt.[id] join [sab].[dbo].[cltdue] due on due.[cdid] = wip.[wdue] join [sab].[dbo].[ddevents] e ...

C++, Can't instantiate abstract class error -

the compiler gives error cannot instantiate abstract class due following members: how sort this? 'double payoff::operator ()(const double &) const' : abstract this abstract class class payoff { public: virtual ~payoff() {} virtual double operator()(const double& spot) const = 0; virtual std::shared_ptr<payoff> clone() const = 0; }; derived class class asiangeometric: public payoff{ private: double strike; public: asiangeometric(const double& strike); virtual ~asiangeometric(){}; virtual double asianpay()(const std::vector<double>& spot_prices) const; virtual std::shared_ptr<payoff> clone()const; }; asiangeometric::asiangeometric(const double& strike){ this-> strike = strike; } double asiangeometric::asianpay(const std::vector<double>& spot_prices) const{ unsigned num_times = spot_prices.size(); double log_sum = 0.0; (unsigned int i=0; i<spot_prices.size();...

cassandra - Comparing two uuids in Node.js -

i have question not able find answer research on web. work on web application in node.js , cassandra. i'm working on notification system , have compare 2 uuids make sure don't send notification people make original action ( provoke notification ). the problem that, when compare 2 uuids supposed equals, false value. here example of code i'm working on : console.log('user_id :', user_id.user_id); console.log("user id of current user :", this.user_id); console.log(user_id.user_id == this.user_id); console.log(user_id.user_id === this.user_id); and here display of result : user_id : uuid: 29f1227d-58dd-4ddb-b0fa-19b7fc02fbe8 user id of current user : uuid: 29f1227d-58dd-4ddb-b0fa-19b7fc02fbe8 false false user_id : uuid: c8f9c196-2d63-4cf0-b388-f11bfb1a476b user id of current user : uuid: 29f1227d-58dd-4ddb-b0fa-19b7fc02fbe8 false false as can see, first uuids supposed same. generated uuid library inside nodejs cassandra driver. don't unde...

html - External JavaScript file not working with master page -

i have external javascript file looks this: function badcharcheck(name) { var badchar = "!@#$%^&*()_+|-=\[]{};':<>?,./"; (var = 0; < badchar.length; i++) { (var j = 0; j < name.length; j++) { if (badchar[i] == name[j]) { alert("bad characters in form"); return false; } } } return true; } function samesame(pass1, pass2) { if (pass1 != pass2) { alert("passwords not same"); return false; } return true; } function checklength(str, length) { if (str.legnth =< length) { alert("username must @ least 5 characters, password must @ least 8"); return false; } return true; } function checkemail(email) { if ((email.tostring().indexof("@") == -1) || (email.tostring().indexof(".") == -1)) { alert("incorrect email address!"); return false; } return true; } function validate() { document.write("here"); var ok = true;...

sql - How do I select rows where CONTAINS looks for value of a column, not a string -

i figured have been asked, couldn't find on stack overflow. i have sql server table called datatable 2 columns name , message . want select rows "message" contains same value in name column. insert datatable values ('frank','this frank's message'); insert datatable values ('jill','this not frank's message'); i want return first row, because value in [name] column ("frank") in column [message] select [name],[message] datatable contains([message],[name]) this throws error : incorrect syntax near 'name'". how write correctly? you can try like , in case [name] can contained part of [message] : select [name],[message] datatable [message] '%' + [name] + '%' or can use = operator in case [name] should equal [message] .

mysql - PHP - get value from database and display known value -

i've been searching while now.. it's simple can't seem right. my website uses file translations. every translation has it's own variable. like: $_text_login (which translates to: login or aanmelden or derp). i've made menu table within database. 1 of menu items has text: $_text_login obviously, when menu information, doesn't show set value of variable, shows $_text_login . i've tried eval() doesn't work.. can help? i not recommend approach , santize variable name, sounds of it, achieve saying with: echo eval('return '. $item . ';'); where $item result database.

java - Hibernate Multi-table Bulk Operations always try to create the temporary table -

i have entities using join-inheritance , i'm doing bulk operations on them. explained in multi-table bulk operations hibernate uses temporary table execute bulk operations. as understand temporary tables data in them temporary (deleted @ end of transaction or session) table permanent. see hibernate tries create temporary table every time such query executed. in case more 35.000 times per hour. create table statement fails every time, because table name exists. unnecessary , hurts performance, dbas not happy... is there way hibernate remembers created temporary table? if not, there workarounds? idea use single-table-inheritance instead avoid using temporary tables completely. hibernate version 4.2.8, db oracle 11g. i think bug in temporarytablebulkidstrategy , because when using oracle8idialect says temporary tables shouldn't deleted: @override public boolean droptemporarytableafteruse() { return false; } but check made when deleting table: prote...

javascript - How to open website at specific point on page in HTML? -

beginner programmer apologies if obvious! how can website open @ specific point on page (in html)? i can't find called anywhere! not anchor etc . website wider , longer screens. i want screen/viewport open @ centre of 2500x2500 pixel background . i working in dreamweaver cc on mac os x 10 thanks in advance!! p.s no code post, first port of call in putting together you can client's screen $(window).width() & $(window).height() , it's jquery code you'll have add balise script jquery lib on web page. can tell me more want ? have trouble understanding. don't want anchor want ? apoligies not understanding.

javascript - Parse React - Observe Objects created by Parse.User.current() -

i'm using excellent parse-react library parse , reactjs work nicely (n.b i've been playing around few hours apologies if i've misunderstood of basics of reactjs). going until wanted query table objects created current user (parse.user.current()) the observe method works correctly on load , view rendered correct objects (the objects created current user). if mutate data , add new object view doesn't re-render. abstracted code: module.exports = react.createclass({ mixins: [parsereact.mixin], getinitialstate: function() { return { selected: null }; }, observe: function() { return { places: (new parse.query('place')) .equalto('user', parse.user.current()) .descending('createdat') }; }, clickhandler: function(event) { var id = event.target.id; if (id === 'new') { parsereact.muta...

php - Sending data to server with AJAX? -

i need update table new values in mysql when image clicked. $("#image1").click(function(){ here's example of query: mysqli_query($conn,"update photos set rating='$ratingnew1' link='$img1link'"); how execute query when image clicked? $("#image1").click(function(){ $.ajax({url: "update.php", data: {img1link : 'image link', ratingnew1: 'rating'}); }); and update.php file <?php mysqli_query($conn,"update photos set rating='$ratingnew1' link='$img1link'") ?>

git - Gitlab push problems -

i have difficult struggle pushing project gitlab . when try push on http, have * requested url returned error: 502 bad gateway * closing connection 3 error: frpc failed; result=22, http code = 502 fatal: remote end hung unexpectedly when try push on ssh, have ssh: connect host localhost port 22: bad file number fatal: not read remote repository. please make sure have correct access rights , repository exists. what doing wrong?

Stop JMeter test execution only after n assertion errors -

Image
problem i modelling stress tests in jmeter 2.13. idea of stop test after response time cap reached, test duration assertion node. i not want, however, stop test execution after first such fail - single event in otherwise stable situation. execution fail after n such assertion errors, can relatively sure system got stressed , average response should around defined cap, want stop whole thing. what tried i using stepping thread group jmeter plugins. there use checkbox stop test after error, on first occasion. found no other node in documentation model it, i'm guessing there's workaround i'm not seeing right now. close not you're asking for: auto-stop jmeter plugin. see documentation here . can configure stop test if there n% failures in amount of time. if want specific number of errors, can use test-action sampler, combined if-controller - if (errorcount = n) test-action stop test

android - How to set redirect_uri in google developer console? -

Image
i got client id , api key registering project developer console. , while running authentication process error 400. that’s error. error: redirect_uri_mismatch redirect uri in request: http://localhost:8080/ did not match registered redirect uri. i have not registered redirect uri. can fix or tell me how set redirect uri.i not find redirect url while registering. the redirect uri object used web applications doing oauth2 authentication; so, when create new client id, choose "web application" id type , there text area enter of allowed redirect uris (these web pages coded you, , need perform function of doing oauth2 ticket verification). if app not web application, choose "installed application" type , you'll key can used in android/ios/desktop app. however, key not useable, @ all, in web application. if web application doesn't need write data or upload files, can create public api key include parameter requests. service accounts (which yo...

html - PHP foreach outputs everything four times (mysql, sql, database administration) -

i have code here have feeling can made more efficient. have been building library catalogue database, , looking way store multiple columns (with multiple entries) extracted sql database 1 php array. mean 1 foreach loop required in 'view' code print results out , store them in table. of guys have useful ideas? :) my code in current state below: model code: $matches["loandates"] = array(); $matches["loanduedates"] = array(); $matches["itemnames"] = array(); $matches["itemauthors"] = array(); try { // if find item, run query against database list of current loans. $results = $db->prepare(" select il.loan_date, il.loan_duedate, i.item_name, i.item_author itemloan il inner join libraryitem li on il.libraryitem_id = li.libraryitem_id inner join item on li.item_id = i.item_id ...

vba - Error converting Excel range to Jpeg and inserting into Outlook -

Image
i have code convert range in excel 2010 jpeg , insert outlook 2010. code converts range chart , creates jpeg. jpeg corrupted , show chart in background behind range attempting show. here example: here code this: sub mail_as_pic() dim tempfilepath string dim outapp outlook.application dim outmail outlook.mailitem on error resume next kill tempfilepath & "quota.jpg" dim sh worksheet set sh = sheets("strategic") 'create new microsoft outlook session set outapp = createobject("outlook.application") 'create new message set outmail = outapp.createitem(olmailitem) outmail .sentonbehalfofname = "me@me.com" .display .subject = "strategic sales" .to = "me@me.com" call createjpg("strategic", "a1:f11", "quota") 'this runs macro below , creates jpeg tempfilepath = environ$("temp") & ...

c++ - When is std::chrono epoch? -

std::chrono::time_point::time_since_epoch() returns duration , referred time_point in past. when such time_point ? depends on c++ implementation or it's defined c++ standard? or de facto standard set epoch 1 january 1970 utc? it function of both specific clock time_point refers to, , implementation of clock . standard specifies 3 different clocks: system_clock steady_clock high_resolution_clock and standard not specify epoch of these clocks. programmers (you) can author own clocks, may or may not specify epoch. there de-facto (unofficial) standard std::chrono::system_clock::time_point has epoch consistent unix time . defined time duration has elapsed since 00:00:00 coordinated universal time (utc), thursday, 1 january 1970, not counting leap seconds. fwiw, here date/time library takes advantage of de-facto standard. there no de-facto standard other 2 std-specified clocks. additionally high_resolution_clock permitted type alias either system_cl...

php - How to use global variable in symfony twig file? -

i have done setting in app/config/config.yml twig: globals: mandatory_note: %mandatory_note% parameter set in config.yml file parameters: mandatory_note: "note: * marked fields mandatory" and in twig file have accessed variable {{ mandatory_note }} but still gets error. ie. mandatory_note variable doesnot exists. this config.yml file imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } framework: #esi: ~ translator: { fallbacks: ["%locale%"] } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~ csrf_protection: ~ validation: { enable_annotations: true } templating: engines: ['twig'] #assets_version: someversionscheme default_locale: "%locale%" trusted_hosts: ~ trusted_proxi...

jquery - Cannot get text value of a clicked link -

i'm trying text value of clicked link , keeps being displayed id value. i searched web , believe using correct method. tried 1 "target.text". can please inform me have wrong following jsfiddle? html <form name="form" id="form" action="" method="post"> <input type="text" id="startdate"> <input type="text" id="enddate"> <input type="hidden" id="id" value="0"> <input type="hidden" id="idtext" value=""> <button type="submit" value "change" name="change">change</button> <br> <a href="1">palprd</a> <br> <a href="3">paltst</a> <br> <a href="2">eyebal</a> <br> <br> <button type="submit" value "back...

c++ - Issues when compiling a TCL-DLL wrapper -

i working project trying read data oculus rift sensors in tcl-module using project found @ github (it tcl-dll wrapper): link: https://github.com/myzb/oculusvr-cmdll i have never compiled dll-file before , having issues when try compile project in visual studio 2013. these errors shows up: c2491: 'tclovr_init' : definition of dllimport function not allowed c2491: 'tclovr_unload' : definition of dllimport function not allowed do have idea of might have missed? thanks in advance! sincerely, marcus those 2 functions need both exported dll , have c linkage (so have name in dll tcl load command implementation expects). defining oculusvrcmdll_exports preprocessor symbol when building? changes declarations being dllimport dllexport …

android - Videoview in samsung tablet 2 show black background -

i can play video using videoview widget in phone , it's work no error reported me.when going test same build run in samsung tablet 2 os 4.1 it's not render video in top of view , unable watch video . i settled text on videoview watch @ run time , able watch text on video not video :(. can give case of possiblity happen , wrong tablet .thanks in advance.

asp.net mvc - How to use ValidationSummary only for messages that are not listed in the ValidationMessageFor blocks in ASP .NET MVC -

i wana show validation warnings validationmessagefor , in validationsummary show other global warnings (wrong password instance). input validation warnings displaying in validationsumary too, user can see same warnings on 2 places. how solve it? use @html.validationsummary(true)

wpf - Find Editor inside Active cell (XamDataGrid) infragistics -

how find cellvaluepresenter based on activerecord or activecell in infragistics xamdatagrid? i tried below code giving null in cell value presenter. private void grdgrid_recordactivated(object sender,recordactivatedeventargs e) { (grdgrid.activerecord datarecord).cells["flddescription"].isactive = true; cell selectedcell = grdgrid.activecell; cellvaluepresenter cvp = cellvaluepresenter.fromcell(selectedcell); cvp.editor.starteditmode(); } this binding <igdp:unboundfield name="flddescription" label="description" bindingpath="taskitemaction.description" bindingmode="twoway"> <igdp:field.settings> <igdp:fieldsettings cellclickaction="entereditmodeifallowed" editorstyle="{staticresource textstylekey}" editortype...

arrays - PHP An iterator cannot be used with foreach by reference -

i have object implements iterator , holds 2 arrays: "entries" , "pages". whenever loop through object, want modify entries array error an iterator cannot used foreach reference see started in php 5.2 . my question is, how can use iterator class change value of looped object while using foreach on it? my code: //$flavors = instance of class: class paginatedresultset implements \iterator { private $position = 0; public $entries = array(); public $pages = array(); //...iterator methods... } //looping //throws error here foreach ($flavors &$flavor) { $flavor = $flavor->stdclassforapi(); } the reason $flavors not instance of class , instead simple array. want able modify array regardless of type is. i tried creating iterator used: public function &current() { $element = &$this->array[$this->position]; return $element; } but still did not work. the best can recommend implement \arrayacces...

sql - How to Update last 3 columns of a temp table -

reqid respid name part type base ---------------------------------------------------------------------------- 674508621df6 d5830288f5c2 00000233a null null null c356c1e03784 d5830288f5c2 00000233a null null null when running following query out stored procedure part getting above result. want update sp using return values sp. declare @temptable table( reqid varchar(255), respid varchar(255), name varchar(255), part bit, type bit, base bit) insert @temptable (reqid ,respid ,name) select * distributessystemsview dsv join mydomain md with(nolock) on md.mydomainid = dsv.mydomainid dsv.lotoperationsegmentresponseid=@lotopsegrespid stored procedure part should able update part,type , base columns using following sp takes md.domainid parameter above join statement insert @temptable(part,type,base) execute [soadb].[dbo].[splocal_anotherspl] md.mydomainid select * @temptable if understand problem cor...