Posts

Showing posts from August, 2011

javascript - Change HTML Page in Crossrider Popup -

i have popup called picker.html contains 2 options - either going options page (that crossrider doesnt natively support) or opening webpage. there more options. now, when "go options" button pressed want change popup go file options.html . i tried using appapi.browseraction.setpopup work after click on browser action making useless. window.location doesnt work crossrider uses background.html , there's no api path of resource file. you can use document.open , appapi.resources.get change whole html. need run crossridermain make sure used resources being loaded. see working example below. experience it's not possible change height of new popup / page, please edit answer if finds tested possibility (css doesn't appear working here). <!doctype html> <html> <head> <script type="text/javascript"> function crossridermain($) { appapi.resources.includecss('html/bootstra

canvas - Stop and Restart CreateJs animation -

i wondering how stop entire createjs canvas animation , how restart later. i'd save computing power , memory while canvas not visible user. does know how? thank in advance simply remove listener on ticker. example: createjs.ticker.removeeventlistener("tick", mystageortickfunction); // add later unpause: createjs.ticker.addeventlistener("tick", mystageortickfunction); if want reset entire animation exported flash, have couple of options: you can re-instantiate main timeline. you'll need take @ output code grab name of main timeline symbol, based on fla name (ex. fla named "test.fla" have main timeline symbol named "test"). stage.removechildat(0); stage.addchild(new lib.test()); you can use gotoandplay(0) . requires child movieclips set graphic instances though, because mcs play independently of parent. stage.getchildat(0).gotoandplay(0)

gyroscope framework - How can I test the low-resolution icons? -

Image
the newer versions of gyroscope has higher-resolution versions of icons (in toolbar_hd.gif) used when user's computer supports it. if testing machine has high resolution, how can force use low-resolution icons testing? starting 6.9 gyroscope uses newer version of nano.js includes function hdpromote loads separate css if both conditions met: the device has pixel ratio higher 1 the browser css correctly supports background-size in both index.php , iphone.php, right after nano.js included near footer, there's line "upgrades" icons higher resolution: <script> hdpromote('toolbar_hd.css'); </script> you may comment out line ignore high resolution display. conversely, if don't have hd screen want force load toolbar_hd.css, there 2 ways: you may modify line in nano.js pixel density ignored: if (typeof(document.documentelement.style.backgroundsize)=='string') in firefox, when zoom level 200%, browser reports pi

javascript - Passing parameters to Anonymous function inside click event -

var div_raw_id = 'acf-download-link'; var div_id = '#' + div_raw_id; var chapter_index = 1; var chapter = 'chapter-' + chapter_index; $('button[name=addnewchapter]').click(function(chapter, div_id ,div_raw_id){ $(div_id).append('<div class="acf-input-wrap"><input id="' + div_raw_id +'" class="text" name="fields[field_55951fb44c1d6][' + chapter + '][]" value="" placeholder="" type="text"><span class="remove_btn"></span></div>'); return false; }); the problem cannot pass div_id , chapter_index , chapter parameter anonymous function inside click event. used debugger , debugger represents them undefined values though defined in above code. seems there variable scope problem, however, cannot figure out other way pass defined variables parameter anonymous function inside click event. you don't need

osx - PHP 56 installation via Homebrew -

i've used php56 installation via homebrew on mac time , getting error when attempting run php: dyld: library not loaded: /usr/local/lib/libcrypto.1.0.0.dylib referenced from: /usr/local/bin/php reason: image not found [1] 97410 trace trap php -v everything i've searched online points openssl version difference shipped os x, said haven't run issue months (at least) until past day or 2. (also, forcing link on openssl via homebrew break warns? may seem solve issue). i've removed think may have interfered, (rbenv, rvm, wiped , reinstalled homebrew, etc). has run issue? why happening after everything's been running smoothly long? try rebuilding php source: brew reinstall php56 --build-from-source looks openssl upgraded @ same time , broke php.

azure webjobssdk - Get BrokeredMessage from within custom IJobActivator -

is possible @ underlying brokeredmessage in web job service bus trigger within ijobactivator? useful in multi-tenant scenario. i'm using custom ijobactivator unity instantiate jobs. within unityjobactivator class, i'd able @ underlying brokeredmessage , pull custom properties off of it, such "tenant", of messages have. allow me inject appropriate database connection, or configuration objects job class before executed. below example want inject itenantconfiguration job, have based on brokeredmessage custom property. if access brokeredmessage within unityjobactivator. public class customjob { private const string subscription = "subscription"; private const string topic = "topic"; private itenantconfiguration config; public customjob(itenantconfiguration config) { // configuration depends on tenant property of brokeredmessage this.config = config; } public void handle([servicebustrigger(topic,

jquery - On dataTable scroll data should load from server side and append to existing records -

using node js , bootstrap developing web application . have table implemented using data table . performing search , sort using server side code . fetching 50 records. these working fine. now want load data (next 50 records ) server side when scroll reached bottom. currently code , $('#table-goal').datatable({ "fninitcomplete" : function() { $('.datatables_scrollbody').mcustomscrollbar({ theme : "dark-3", callbacks : { whilescrolling : function() { //alert("scroll"); if (this.mcs.toppct == 100) { // need load data using same ajax , append data previous 50 records. } } } }); }, "scrolly" : "230px", "scrollcollapse" : true, "paging" : false,

php - How to call a function inside the bootstrap from a model in Zend? -

i have function on bootstrap.php like: function test() { echo "hello"; } i want call model. know can controller using $this->getfrontcontroller()->getparam('bootstrap')->test(); no clue on how model. help? i know it's not best have function on bootstrap , better have elsewhere, can't happen. you can front controller anywhere in application using zend.controller.front.methods.primary.getinstance $front = zend_controller_front::getinstance(); so think give result $front = zend_controller_front::getinstance(); $front->getparam('bootstrap')->test();

Check for URL variable in PHP -

i have php page takes date variable: mypage.php?date=2015-07-14 , displays output. how check if date= empty , if insert , refresh page current date? i've tried formulate small script @ top of page using _get date value not sure how handle reload of page? you can check input not empty using empty function, , create date (it default current, unless pass parameter), , passed parameter in header function same page. if(empty($_get['date'])) header('location:'.$_server['php_self'].'?date='.date('y-m-d'));

java - Read Field from another Thread -

i i'm creating textbased game while i'm learning java. i'm having issue when i'm trying read field thread. sleep class: package events; public class sleep implements runnable { public int sleep = 100; public void run() { while (true) { sleep--; system.out.println("sleep: " + sleep); try { thread.sleep(1000); } catch (interruptedexception e) { e.printstacktrace(); } if (sleep == 50) { system.out.println("you need eat"); } if (sleep == 25) { system.out.println("you realy need eat"); } if (sleep == 10) { system.out.println("you'r almoust dying go eat"); } if (sleep == 0) { system.out.println("you'r dead"); } } } public void printsleep() { system.out.println("sleep: " + sleep); } } then call method "print

Run Cucumber scenario outline by range on line numbers -

i know it's possible run specific examples in cucumber cucumber tests/features/my.feature:141 #just example 141 cucumber tests/features/my.feature:141:151 #just examples 141 & 151 what syntax run range of examples 141 151? cucumber tests/features/my.feature:141-151 #this not work if helps, here scenario outline snippet... assuming 'tc-44' on line 141 in file scenario outline: running scenario subset of examples given testing subset , scenario outline many examples can run subset providing range examples: | test-case | | tc-44 | | tc-45 | | tc-46 | | tc-47 | | tc-48 | | tc-49 | ... | tc-100 | from command line can run specific scenarios same feature file using colon between line numbers, this: cucumber tests/features/my.feature:37:52 if scenarios defined @ lines 37 , 52, both executed cucumber. you can likewise run specific examples referencing line number. in case, work: cucumber tests/features/my.feature:141:142:143:144:145:146:147:148:

python - scipy curve fitting negative value -

Image
i fit curve curve_fit , prevent becoming negative. unfortunately, code below not work. hints? lot! # imports scipy.optimize import curve_fit import numpy np import matplotlib.pyplot plt xdata = [0.0009824379203203417, 0.0011014182912933933, 0.0012433979929054324, 0.0014147106052612918, 0.0016240300315499524, 0.0018834904507916608, 0.002210485320720769, 0.002630660216394964, 0.0031830988618379067, 0.003929751681281367, 0.0049735919716217296, 0.0064961201261998095, 0.008841941282883075, 0.012732395447351627, 0.019894367886486918, 0.0353677651315323, 0.07957747154594767, 0.3183098861837907] ydata = [99.61973156923796, 91.79478510744039, 92.79302188621314, 84.32927272723863, 77.75060981602016, 75.62801782349504, 70.48026800610839, 72.21240551953743, 68.14019252499526, 55.23015406920851, 57.212682880377464, 50.777016257727176, 44.871140881319626, 40.544138806850846, 32.489105158795525, 25.65367127756607, 19.894206907130403, 13.057996247388862] def func(x,m,c,d): ''

eloquent - How to update specific rows using laravel -

i have table: id|user_id|group_id|subject |book_id|duplicate 1| 2 |3 |history |1 | 2| 4 |3 |history |1 | 3| 5 |3 |history |1 | i want resulting table this: id|user_id|group_id|subject |book_id|duplicate 1| 2 |3 |history |1 | 2| 4 |3 |history |1 |1 3| 5 |3 |history |1 |1 i want ascending ids after lowest id duplicate column updated 1. please note: ids dynamic , using ->where(id, '>', 1); not work in cases. so far have this $duplicates = db::table('table') ->where('subject', 'history') ->where('book_id', 1) ->skip(1)->take(1) ->update(['duplicate' => 1]); the code above not work because resulting table looks this: id|user_id|group_id|subject |book_id|duplicate 1| 2 |3 |history |1 | 1 2| 4 |3 |hi

javascript - Is throwing errors in constructors also prone to memory leaks? -

throwing exception in constructor can lead memory leaks: source 1 , source 2 . true oo languages c++, c#, java. wondering if javascript susceptible same memory-leak issue? to illustrate, have js code: widget = function(){ console.log("widget constructor"); }; foo = function(){ console.log("foo constructor"); this.w = new widget(); throw new error(); }; foo.prototype.dispose = function() { delete this.w; }; var f = new foo; f.dispose(); obviously i'll dispose() never called, in case curious fate of f.w object? remain in memory , cannot cleared in way (causing memory leaks)? or perhaps garbage collector smart enough , recognizes not referenced anywhere , disposes it? how handled different js engines? if true how avoid it?

ios - How do I put a UIActivityIndicatorView in a UIAlertController? -

Image
we're moving away mbprogresshud because it's glitchy in our app, , doesn't have features such blocking user input or providing cancel button. so, i've attempted implement swipesight's how display activity indicator in center of uialertcontroller? , , ran improper positioning of indicator: it green because our app's tint green. as can see, it's not in white rectangle part of controller, grey background. uses similar "@62shark" solution: // in implementation: @property (nonatomic, strong) uiactivityindicatorview *spinner; @property (nonatomic, strong) uialertcontroller *alertcontroller; // in init: _alertcontroller = [uialertcontroller alertcontrollerwithtitle: @"loading" message: nil preferredstyle: uialertcontrollerstylealert]; _spinner = [uiactivityindicatorview new]; _spinner.translatesautoresizingmaskintoco

java - How to modify pom.xml without regenerating the whole pom -

my job create mavenxpp3rewriter class same mavenxpp3writer rewriter shouldn't regenerate whole pom.xml update it. the mavenxpp3rewriter contains method: private void rewritemodel(model model, model oldmodel, string tagname, xmlserializer serializer) model: new maven model contains modifications oldmodel: old maven model before modification i have overwrite original pom.xml new model. problem if call writemodel method empties pom.xml , starting regenerate time in case of large number of poms. the question how can update specific parts of pom? 'specific parts' means difference between model , olmodel. i hope understand. help.

closures - what is shouldFail in groovy? -

how code within 'shouldfail?' block work? understand closure, code gets called regardless of whether or not call using signature. besides, what's deal "readonlypropertyexception" showing in parenthesis? if parameter, not setup listed in official documentation!! questions: 'shouldfail'? how should invoked? how handle exception purportedly thrown method/function/closure? void test02_readonlyfieldingroovybean() { // you've noticed how groovy automatically generates getters/setters you. if don't // want generate setter because it's read-only field? mark 'final'. groovy understand. // try modify ken's ssn. should readonlypropertyexception. def person = new groovyperson('ken', 'kousen', '7878') def failed = false shouldfail (readonlypropertyexception) { // ------------ start editing here ---------------------- system.out.println(" in should fail")

postgresql - AND/OR statements in SQL JOIN -

i have 2 tables: table1 , table2 . can join them using id1 or id2 . prefer use id1 , in rows id1 missing, have use id2 . following syntax correct: select * table1 left join table2 b on (a.id1 not null , a.id1 = b.id1) or (a.id2 not null , a.id2 = b.id2) it returns some results want sure if valid haven't seen used before. are there better ways this? looks have decent answer in comments, toss possibility ring, run both queries , union them. select * table1 left join table2 b on a.id1 = b.id1 union select * table1 left join table2 b on a.id2 = b.id2 the union eliminate duplicates between sets, , return records either condition true, or statement. performance wise, union little slower, gives easier control on sets. instance if want set 2 return results when id1 null, add clause. anyway hope helps.

C# Cannot implicitly convert type 'string' to 'bool' error -

i'm new c# i'm using microsoft visual studio express 2013 windows desktop edition , trying make quiz in ask question , user has answer so, here's code , error "cannot implicitly convert type 'string' 'bool'" , happens on 2 if statements, understand bool has either value true or false it's string why giving me error? should appreciated. ps: included part of code in i'm having problem , code in main class heres code: start: console.writeline(); console.writeline(); console.writeline("question 1: test? type yes or no: "); string answer1 = console.readline(); if (answer1 = "yes") { console.writeline(); console.writeline("question 2: test? type yes or no"); } else if (answer1 = "no") { console.writeline(); console.writeline("wrong, restarting program"); goto start

python - Is there an iter which accepts a complex sentinel? -

i use iter 2 arguments , wondering if there equivalent accept more complex sentinel? as example, in code below # returns digits 1 10 upon subsequently calling .create(), # returns 'end' each time afterwards class myclass: def __init__(self): self.counter = 0 def create(self): self.counter += 1 if self.counter > 10: return 'end' else: return self.counter c = myclass() in iter(c.create, 'end'): print(i) the iteration ends upon getting 'end' . have end after getting, say, total of 2 'end' (not 1 after other - code above generate 'end' after first ten calls 1 can imagine case interlaced other values). in essence, looking way use more complex sentinel. there such concept? i know can resort obvious-but-ugly code mentioned in previous question , hovewer @happyleapsecond answer elegant keep spirit (i went though itertools none of available methods seem job

c# - Exchange Web Service: BindToItems method returning error -

i have method pulls appointments exchange calendar. bindtoitems method, pulling appointment 6 months ago until 6 months in future, fails windows of time. pull appointments reports error (no more details given). there way see more details error, or see problems code (below). // set start , end time , number of appointments retrieve. microsoft.exchange.webservices.data.calendarview cview = new microsoft.exchange.webservices.data.calendarview(startdate, enddate, 1000); // limit properties returned appointment's subject, start time, , end time. cview.propertyset = new propertyset(basepropertyset.idonly); // retrieve collection of appointments using calendar view. finditemsresults<appointment> currapp = calendar.findappointments(cview); cview.propertyset = new propertyset(basepropertyset.firstclassproperties); cview.propertyset.requestedbodytype = bodytype.text; serviceresponsecollection<getitemresponse> apps = service.bindtoitems(currapp.select(r => r.id),

coldfusion - difference between pop3 and imap -

i new cold fusion. have read of articles regarding imap , pop. little confused ,can 1 me out difference between pop , imap precisely .if possible , working code appreciated. thank-you. pop3 , imap 2 different protocols (methods) used access email. of two, imap better options , recommended option when need check emails multiple devices, such work laptop, home computer, or tablet, smartphone, or other mobile device. tap synced (updated) account device imap. pop3 downloads email server single computer, deletes server. because messages downloaded single computer or device , deleted server, can appear mail missing or disappearing inbox if try check mail different computer.

for loop - How the get value returned and print out the list in javascript -

i create program function gets value text box , calculate pi nilakantha method. here codes html: <p><input type="text" class="textbox" placeholder="enter number of times want calculate" id="maximum" onchange="getvalue()"></p> <p><button class="button" onclick="calculation(n)">click see caculation procedure</button></p> <p><ul id="resultlist"></ul></p> javascript: function getvalue(){ var n = number(document.getelementbyid("maximum").value); if (isnan(n)){ alert("sorry should input number");} else {return n;} } var pi = 3; function calculation(n){ (var k=1;k<n; k++){ pi = pi + (math.pow((-1),(k+1))*4)/(2*k*(2*k+1)*(2*k+2)); document.getelementbyid('resultlist').innerhtml = '<li>' + pi + '</li>'; }} but not working @ all, value text bo

jquery - Hom to align error message in dropzone -

Image
i've got text, when upload file wrong type how can align under progress-bar? html code of element <div class="table table-striped files" id="logopreviews"> <div id="template" class="file-row"> <div> <span class="preview"><img data-dz-thumbnail /></span> </div> <div> <p class="name" data-dz-name></p> <strong class="error text-danger" data-dz-errormessage></strong> </div> <div> <p class="size" data-dz-size></p> <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">

php - update stripe plan with incorrect amount due -

i m using stripe payment. works fine exept 1 thing. i have 4 different plans : free(0€) / free + (4,90€) / premium (49€) / premium + (53,90€). the user can update subsciption, : // $plan variable ajax request $newplan = $plan; // find name of current user's plan in database $payment = $em->getrepository('cacpaymentbundle:payment')->findonebyuser($id); $customerid = $payment->getcustomerid(); // update user's stripe plan $cu = \stripe\customer::retrieve($customerid); $planid = $cu->subscriptions->data[0]->id; $subscription = $cu->subscriptions->retrieve($planid); $subscription->plan = $newplan; // update plan in database $subscription->save(); $payment->setplan($newplan); $em->persist($payment); $em->flush(); here probleme : in stripe office, user has right plan amount due not correct. when update free + premium extra, amount due 102€ , few cents i don't understand why amount not correct , plan correct any i

Asynchronous Timer Implementation in Python -

i need implement asyncronous timer 'watch' execution of list of functions, till timer expires. problem function execution blocking call , in case how can track timer if function take long comeback. functions = [func_1, func_2, func_3, func_n] timer = timer(30) # timer of 30 sec, example. while timer.expires(): func in functions: func() # if function runs min i avoid multithreading , multiprocessing far possible, if multiprocessing/threading way out please provide solutions also. what different ways in python in asynchronous behaviour can achieved. if functions call blocking due io, can use asyncio module turn them non blocking. @ point wrap them future , set timeout completion. keep in mind timeout considering io. if functions blocking due cpu bound jobs (while loops, long calculations) there no way achieve without using processes.

ruby on rails - bundle install not completing due to puma -

i'm new rails , using cloud9 ide till now. decided install rails locally on windows 8.1 system. installed rails using railsinstaller. installed aptana studio 3. cloned repository. worked fine till now. when give command bundle install following error - dl deprecated, please use fiddle fetching gem metadata https://rubygems.org/............ fetching additional metadata https://rubygems.org/.. resolving dependencies... using rake 10.4.2 using i18n 0.7.0 using json 1.8.3 using minitest 5.7.0 using thread_safe 0.3.5 using tzinfo 1.2.2 using activesupport 4.2.2 using builder 3.2.2 using erubis 2.7.0 using mini_portile 0.6.2 using nokogiri 1.6.6.2 using rails-deprecated_sanitizer 1.0.3 using rails-dom-testing 1.0.6 using loofah 2.0.2 using rails-html-sanitizer 1.0.2 using actionview 4.2.2 using rack 1.6.4 using rack-test 0.6.3 using actionpack 4.2.2 using globalid 0.3.5 using activejob 4.2.2 using mime-types 2.6.1 using mail 2.6.3 using actionmailer 4.2.2 using activemodel 4.2.2 u

angularjs - ui-select multiselect is very slow in displaying the choices -

i ran problem, , don't know how solve it. have used ui-select multiselect in page. first, http.get request made url gets data, ui-select choices populated. data big - length of data 2100. data shown choices. (the data fetched @ beginning during loading of page , stored in array) but problem each time click on multiselect select choice, takes 4-5 seconds populate list , page becomes slow. do reduce time? the choices data stored in array, datatype array of strings. <ui-select multiple ng-model="selectedfields.name" style="width: 100%;"> <ui-select-match placeholder="select fields...">{{$item}}</ui-select-match> <ui-select-choices repeat="fields in availablefields | filter:$select.search"> {{fields}} </ui-select-choices> </ui-select> in controller, $scope.selectedfields = {}; $scope.selectedfields.name = []; $scope.init = function() { $http.get(url) .success(

java - how to find the difference in dates stored in 2 columns of mysql of same row -

dtchkt=obj.next(); string ddf; rs=st.executequery("select datediff(dtchkt,dtchki) id="+id); while(rs.next()) { ddf=rs.getstring(1); system.out.println(ddf); } the above code not working finding difference between dates of 2 columns want code return no of days between 2 specified dates of column.please suggest possible solution. rs=st.executequery("select datediff(dtchkt,dtchki) `table_name` id="+id);

php - Wrong Redirection in Laravel 5 built in User Authentication -

i trying use laravel 5 user authentication. in regard url http://localhost/lara_project/public/auth/login before login. redirect user http://localhost/lara_project/public/home after successful login. redirect http://localhost/lara_project/public/ . tried routes below route::get('home',['middleware' => 'auth', 'uses' => 'welcomecontroller@index']); route::get('/', 'homecontroller@index'); route::controllers(['auth' => 'auth\authcontroller','password' => 'auth\passwordcontroller']); which resided in routes.php my problem afrer successful login user redirected http://localhost/lara_project/public/ , if browse http://localhost/lara_project/public/home after successfull login showing error this webpage has redirect loop err_too_many_redirects i tried editing redirectifauthenticated.php , compiled.php , authenticatesandregistersusers files. not satisfactory result.

How to design android widgets -

in android there widgets button etc., when define button in xml graphically, looks in form, grey colour black text , px's of curves. don't design , want change .how can that. please let me know steps. thank :) many visual aspects of android's built-in widgets can controlled via styles , themes described here in official documentation. if need more customization, can create own subclasses of existing widgets or create own view classes described here in official documentation.

navbar - Bootstrap- My bootstrap menu is not switching to collapsed menu once the screen size is reduced? -

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> <body id="<?php echo ($itemid ? 'itemid-' . $itemid : ''); ?>"> <div id="wrapper" class="container-fluid"> <!-- begin navbar--> <?php if ($this->countmodules('position-9')): ?> <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> <div class="row"> <div class="col-sm-2" <div> <img src="http://i57.tinypic.com/206d2l4.png"

php - Polymer iron-form post method not working $_POST variable empty -

Image
when use post method iron-form not work method works. here code: test.php: <script> document.addeventlistener("webcomponentsready",function() { document.queryselector("#form").addeventlistener('iron-form-submit',function(e){ }); document.queryselector("#form").addeventlistener('iron-form-response',function(e){ console.log(e); }); document.queryselector("#form").addeventlistener('iron-form-error',function(e,s,d){ console.log(e); alert('iron form error!'); }); }); </script> <body> <form is="iron-form" id="form" method="post" action="/user/put"> <input name="address" required> <input type="submit" value="submit" > </form> </body> index.php: <?php var_dump($_post);

javascript - Add specific class to child from parent -

i got list items child element. want each child of li class based on parents id class. elements getting id of first li. html <ul> <li class="test post-91 other"> <a class='link'></a> </li> <li class="test post-43 other"> <a class='link'></a> </li> </ul> jquery var id = $('.link').closest('li').attr("class").split(' ')[1]; id = id.replace(/[^0-9]/g, ''); id = "class-"+id; $('.link').addclass(id); i want elements number of "post-" parent li. https://jsfiddle.net/f5lqzzew/ one more solution : here li can taken in loop , find anchor inside , assign class it. $("ul li").each(function(){ var id = $(this).attr('class').split(' ')[1].replace(/[^0-9]/g, ''); $(this).find("a.link").text('class-' + id).addclass("class-&quo

performance - load testing by keep increasing the number of concurrent users -

Image
i have 500 users in csv file. doing load testing using jmeter. want run script first 100 hundred users. once execution 100 concurrent user/threads done want automatically increase size of concurrent users 200 , on. how can achieve ?? you can use constant throughput timer set throughput according test scenario. despite name doesn't have "constant", can put variable "target throughput" input you'll able modify concurrency on fly. another option easier / more flexible throughput shaping timer available via jmeter plugins

php - Trying to send star ratings from krajee bootstrap star rating to mysql database -

i using following plugin http://plugins.krajee.com/star-rating i'm trying send rating submitted database values not being recorded. require_once $doc_root . '/includes/act_initiate_article_xref.php'; $rating_value = (@$user_article_xref_row['rating'] > 0) ? $user_article_xref_row['rating'] . ' stars' : 'unrated'; $article_rating = '<span class="line-sep">rated:</span> ' . $rating_value; if ($_session['user_id'] == 1 || $_session['user_id'] == 41) { $rating_value_attr = (isset ($user_article_xref_row['rating'])) ? ' value="' . $user_article_xref_row['rating'] . '"' : ''; $article_rating .= '<span class="line-sep">your rating: </span> <input id="input-21d" type="number" class="rating"' . $rating_value_attr . ' data-min=0 data-max=5 step=0.5 data-size=&

ios - Incrementing Array Element By One In Swift -

i working on swift project in xcode, , i've encountered issue cannot increment array's 1 element through various endeavours. my viewcontroller.swift import uikit class failureviewcontroller: uiviewcontroller { @iboutlet weak var failfactlabel: uilabel! let failfact = failure() override func viewdidload() { super.viewdidload() failfactlabel.text = failfact.failarray[0] } @ibaction func showfunfact() { //this issue } } for function showfunfact have tried for var x = 0; x < failarray.cout; x++ { failfactlabel.text = failfact.failarray[x] } but encountered error: "use of unresolved identifier". putting aside, decided use for var x = 0; x < 10; { x+=1 } although not generate error however, see stops @ first element in array. tried +=5 , displays 5th element in array once, believe code runs through once. need consistently working piece continuously displays next element, stumped b

android - Gradle: change NDK build target independent from the SDK build target -

in past used eclipse ndk projects, android.mk file suited compiling ndk api level 9 while letting app (sdk) compile on api level 22. seems not possible when using experimental gradle build system (2.5) android studio 1.3 rc1. what can compile ndk on api level 9? my typical android.mk file looks this: app_platform := android-9 app_stl := stlport_static app_abi := # enable c++11 extentions in source code app_cppflags += -std=c++11 #enable optimalization in release mode app_optim := release my new gradle file looks this: apply plugin: 'com.android.model.application' model { android { compilesdkversion = 22 buildtoolsversion = "23.0.0 rc3" defaultconfig.with { applicationid = "com.example" minsdkversion.apilevel = 9 targetsdkversion.apilevel = 22 versioncode = 1 versionname = "1.0" } } android.ndk { modulename = "nativ

visual studio 2013 - SccProviderPackage package did not load correctly - VS2013 -

Image
description: not sure did 1 day visual studio professional 2013 stopped launching. unlike other similar questions asked, using vs2013 , app doesn't launch. dialog see: . also, here log file vs if helps. what i've tried: going through add or remove program , repairing related sql (as per question's answer) repairing vs2013 (did not help, have done twice now) clearing team foundation server cache c:\users\username\appdata\local\microsoft\team foundation\4.0\cache (and 5.0 , 6.0) running devenv.exe administrator what avoid: uninstalling , reinstalling vs2013 installed update 4 because realized hadn't yet , works now. don't know underlying issue updating fixed it.

javascript - Is there a way to remove the Marker from Routes in Leaflet-Routing-Machine? -

i using leaflet-routing-machne creating route between 2 existing markers, when 1 clicks them. problem is, adds marker star/end points. however want adding no markers. there way that? probably looking this: l.routing.control({ createmarker: function() { return null; } }); reference: https://github.com/perliedman/leaflet-routing-machine/issues/104

android - Error in retrofit GET request -

i using retrofit api calling in android app. in 1 of request url of request this: /v1/employee/1?employeeid=50124 my retrofit method is: @get("/v1/xyz/{employeeid}?companyid={companyid}") void getemployee(@path("employeeid")int employeeid, @path("companyid") int companyid, callback<list<model>> callback); but when call api throws error, please how append url in retrofit request. for dynamic query parameters use @query. try using below code: @get("/v1/xyz/{employeeid}") void getemployee(@path("employeeid")int employeeid, @query("companyid") int companyid, callback<list<model>> callback);

python - cannot find name in imported module -

my directory structure following: a/ - b/ - __init__.py - settings.py - mymain.py - settings.py a/settings.py #the common names es_hosts = ["localhost"] b/settings.py: from a.settings import * #the names specific b.settings b/main.py import settings print settings.es_hosts python tells me attributeerror: 'module' object has no attribute 'es_hosts' could tell me how debug problem? i don't think path work, going out of scope of pythons search. a.settings level above b.settings , won't looked @ ( python doesn't search level - , calling mymain.py , starting point within b ) - either move file has different name in same scope (so under either b or a , instead of different nesting levels). or change python path using sys.path.append(path_to_module) . an alternative split a , b separate non-nested folders on same level, , have mymain.py above them, so: my_proj/ - mymain.py - a/ - __init__.

python - In a no-coroutine function, how do you get a return value from coroutine function of Tornado TCP? -

i wrote 3 sections of code tornado tcp. i've encountered difficulties. my code following: client.py '''tcp client''' socket import socket, af_inet, sock_stream s = socket(af_inet, sock_stream) s.connect(('localhost', 20000)) resp = s.recv(8192) print('response:', resp) s.send(b'hello\n') s.close() server.py '''tcp server''' #! /usr/bin/env python #coding=utf-8 tornado.tcpserver import tcpserver tornado.ioloop import ioloop tornado.gen import * clientdict=dict() #save infomation of client class tcpconnection(object): def __init__(self,stream,address): self._stream=stream self._address=address self._stream.set_close_callback(self.on_close) @coroutine def send_messages(self): yield self.send_message(b'world \n') response = yield self.read_message() return response def read_message(self): return self._stre

Warrning in PHP email "It contains content that's typically used to steal personal information" -

after use email script, in email following warning appears: be careful message. contains content that's typically used steal personal information. learn more report suspicious message ignore, trust message $email_subject = $cnm ." |$cnm.com"; $email_message ="<html><body><table>"; $email_message .= "<tr><td> job descrption :".$jb_des ."</td></tr>"; $email_message .="<tr><td>employer name :".$frm_nm." </td></tr>" ; $email_message .="<tr><td>company name :".$cnm." </td></tr>"; $email_message .="<tr><td>message :".$msg." </td></tr>"; $email_message .="<tr><td>title of job opening :".$job_ti." </td></tr>" ; $email_message .="</table></body>&l

python - Plone not starting ValueError: unknown locale: UTF-8 -

this question has answer here: pelican 3.3 pelican-quickstart error “valueerror: unknown locale: utf-8” 5 answers i have installed plone using unified installer. i have tried starting plone using : plone@localhost [zeocluster]# ./bin/plonectl start zeoserver: . daemon process started, pid=6738 client1: . daemon process started, pid=6743 client2: . daemon process started, pid=6756 when check status getting below info: plone@localhost [zeocluster]# ./bin/plonectl start zeoserver: . daemon process started, pid=6738 client1: . daemon process started, pid=6743 client2: . daemon process started, pid=6756 when try run client1 in fg , getting below response. plone@localhost [zeocluster]# ./bin/client1 fg 2015-07-14 03:57:35 info zserver http server started @ tue jul 14 03:57:35 2015 hostname: 0.0.0.0 port: 8080 2015-07-14 03:57:35 info zope set effective us

collaborative filtering - Spark ALS with Sparse Implicit Dataset -

i trying run movieals example spark implicit dataset , receiving error: got 3856988 ratings 144250 users on 378937 movies. training: 3085522, test: 771466. 15/07/13 10:43:07 warn blas: failed load implementation from: com.github.fommil.netlib.nativesystemblas 15/07/13 10:43:07 warn blas: failed load implementation from: com.github.fommil.netlib.nativerefblas 15/07/13 10:43:10 warn tasksetmanager: lost task 3.0 in stage 29.0 (tid 192, 10.162.45.33): java.lang.assertionerror: assertion failed: lapack.dppsv returned 1. @ scala.predef$.assert(predef.scala:179) @ org.apache.spark.ml.recommendation.als$choleskysolver.solve(als.scala:386) @ org.apache.spark.ml.recommendation.als$$anonfun$org$apache$spark$ml$recommendation$als$$computefactors$1.apply(als.scala:1163) @ org.apache.spark.ml.recommendation.als$$anonfun$org$apache$spark$ml$recommendation$als$$computefactors$1.apply(als.scala:1124) @ org.apache.spark.rdd.pairrddfunctions$$anonfun$mapvalues$1$$anonfun$apply$41$$anonfun$apply$42