Posts

Showing posts from May, 2011

php - array_sum() to values within an array -

how can add array_sum string in loop without making foreach loop it? trying combine of numbers instead of having multi dimensional array , have value , see array_sum wont add them because inside of array. ideas? $hours_arr = array(); foreach($proj_time $item){ $hours_arr [$item['project_id']]['item_value'] = $item['item_value']; $hours_arr [$item['project_id']]['hours'][] = $item['hours']; } //output array (size=3) 4 => array (size=2) 'item_value' => string 'coaching' (length=8) 'hours' => array (size=1) 0 => string '999.99' (length=6) 1487 => array (size=2) 'item_value' => string 'standby' (length=7) 'hours' => array (size=1) 0 => string '15.00' (length=5) 1488 => array (size=2) 'item_value' => string 'standby' (length=7)

javascript - Avoid the form submission when user press f5 to refresh (no redirect) -

i see several post mine little different. i send form same page , stuff on beginning of page , then, if it's ok, display "it's ok". if(isset($_post['solo'])){ $j1 = $_session['u_pseudo']; $pt1 = getpost_variable('pt1'); $j2 = getpost_variable('j2'); $pt2 = getpost_variable('pt2'); unset($_post); //trying avoid refresh if($pt1 == $pt2){ $type = 0; $error = 'scores need same !'; } elseif($pt1 != 10 && $pt2 != 10){ $type = 0; $error = 'one of both score need @ 10 !'; } else { $type = 1; $error = 'success !; add_match_solo($j1,$pt1,$j2,$pt2); } and use var $type , $error display error. so need avoid refresh keep variable $error , $type thanks in advance^^ edit: avoid $_get when using redirect if it's choice... you can jquery . code below disable ctrl+r , f5 not prev

javascript - Why won't my file download with nodejs? -

i send xmlhttprequest webpage nodejs router so: var name = $(this).find('td:eq(0)').html(); var docnum = $('#docnum').val(); //alert("filename=" + name + "&docnum=" + docnum); xhttp = new xmlhttprequest(); xhttp.onreadystatechange = function() { if (xhttp.readystate == 4 && xhttp.status == 200) { isunique = xhttp.responsetext; if(isunique == "false"){ alert("id not unique please pick document id "); }else{ $("form#docform").submit(); } } }; xhttp.open("post", "/downloaddocument", true); xhttp.setrequestheader("content-type", "application/x-www-form-urlencoded"); var params = "filename=" + name + "&docnum=" + docnum; xhttp.send(params); and wo

Send and receive packet to and from nodes using pycore library in python script -

#!/usr/bin/python core import pycore import logging logging.getlogger("scapy.runtime").setlevel(logging.error) scapy.all import * session = pycore.session(persistent=true) node1 = session.addobj(cls=pycore.nodes.corenode, name="node1") node2 = session.addobj(cls=pycore.nodes.corenode, name="node2") hub1 = session.addobj(cls=pycore.nodes.hubnode, name="hub") node1.newnetif(hub1, ["10.0.0.1/24"]) node2.newnetif(hub1, ["10.0.0.2/24"]) packet = ip(src="10.0.0.1",dst="10.0.0.2")/icmp()/"hello world" here have created 2 nodes i.e node1 , node2 connected hub named hub1 . node2 pingable node1 want send packet (i made in last line of code) node1 node2 , process packet after receiving @ node2 . kindly me out! to send file on network can use netcat on linux. , in core, can send shell commands these nodes. hence can following. node1.shcmd("nc -l 4444 > download.txt") no

reactjs - Alternate row in list view react native -

i trying show alternate colors in list view not happening.i have researched , tried various options available in internet unfortunately did not success. can tell me wrong? 'use strict'; import react, {component} 'react' import{ stylesheet, image, navigator, text, view, listview, }from 'react-native'; var menu_drawer_list_item = [{title:'deluxe room', description:'double bed, tv, ac, wi-fi...', image:require('../icons/images/rest.jpg')}, {title:'premier room', description:'double bed, tv, ac, wi-fi...', image:require('../icons/images/rest.jpg')}, {title:'suite room', description:'double bed, tv, ac, wi-fi...', image:require('../icons/images/rest.jpg')},]; class room extends component{ constructor(props){ super(props); this.state = { datasource: new listview.datasource({ rowhascha

Daala - Implementing intra_paint.c as a video encoder -

i've been looking @ rendering visual effects lately , stumbled across this: https://people.xiph.org/~jm/daala/paint_demo/ it's effect , i'd implement command line tool can pass in video (in .ogv or .y4m format per examples in git or other format honest). so i've cloned: https://github.com/jmvalin/daala/commits/exp_paint_deringing4 , extracted , understand need looking @ intra_paint.c , intra_paint_enc.c files i'm not sure how implement them command line tool similar encoder_example.c file in examples directory. imagine pretty simple i'm pretty new , can't see how it. could point me in right direction should attempting utilise this?

Calling coroutine from coroutine in python -

i came across issue today , i'm not quite why works this: def outside(): print 'before' inside() print 'after' yield 'world' def inside(): print 'inside' yield 'hello' n in outside(): print n (naive) expectation of output: before inside hello after world actual output: before after world is not possible call coroutine inside coroutine? articles read on coroutines , yield didn't elaborate on issue , i'm quite lost here. shed light on behaviour please? in advance! it totally possible. when call inside() creates coroutine. in order yield result, need initialize coroutine , yield follows: def outside(): print 'before' in inside(): yield print 'after' yield 'world' and result expected: before inside hello after world

javascript - How to Add "custom Class name" to bing Map Infobox -

i creating infoboxes on map, , want change/add default class name. way creating infoboxes. infoboxoptions = new microsoft.maps.infobox(point,{ class:'new-class-name' title: 'title', description: address, visible: true, offset: new microsoft.maps.point(0, 15), showclosebutton: false, }); so can add "class:'new-class-name'" class name infobox to need create custom html includes class name , pass htmlcontent property of infobox. can find example on how create custom infobox using html here: https://msdn.microsoft.com/en-us/library/mt750271.aspx

php curl login basic athentication fail -

i have problem login rompage server , if login self , refresh code , code work fine , after logout , refresh again , code doesn't work. think problem cookie or that before login : login form after login : request ok and code : $snrhandler = curl_init('azin:775533@10.150.25.3/rpdslperfdetail_curr.html?2,3'); curl_setopt ($snrhandler, curlopt_returntransfer, 1); curl_setopt($snrhandler, curlopt_cookiesession, 1); curl_setopt($snrhandler, curlopt_cookiefile, 'cookie.txt'); curl_setopt($snrhandler, curlopt_cookiejar, 'cookie.txt'); curl_setopt($snrhandler, curlopt_encoding, 1); $snrhtml = curl_exec($snrhandler);

selenium ide - Why "clickAt" does not work on Vaadin tables? -

i want test vaadin (v7.6.6) tables. when use selenium ide (2.9.1) in firefox (47.0), clickat event on table entry not working (when click on entry, color should change). my command reads follows: clickat | //*[@id=…']/div[2]/div[1]/table/tbody/tr[1]/td[1] so target entry (1,1) of table’s body. in firebug entry want click @ reads follows: <td class="v-table-cell-content" style="width: 140px;"> <div class="v-table-cell-wrapper" style="text-align: left; width: 140px; background-color: transparent;">2005</div> </td> when click on button “find”, shows me correct table entry. additionally manual click event works fine. can me issue? something found useful when click event doesn't work use fire event command click in value , using target css=div.v-table-cell-wrapper

android - Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState -

i show dialogfragment inside button onclick event below: public void onbuttonclick() { mydialogfragment.show(getsupportfragmentmanager(), "dialog"); } why cause illegalstateexception, may called after onsaveinstancestate? here log: fatal exception: java.lang.illegalstateexception: can not perform action after onsaveinstancestate @ android.support.v4.app.fragmentmanagerimpl.checkstateloss(fragmentmanager.java:1377) @ android.support.v4.app.fragmentmanagerimpl.enqueueaction(fragmentmanager.java:1395) @ android.support.v4.app.backstackrecord.commitinternal(backstackrecord.java:637) @ android.support.v4.app.backstackrecord.commit(backstackrecord.java:616) @ android.support.v4.app.dialogfragment.show(dialogfragment.java:139) @ com.a.b.afragment.editsex(afragment.java:226) @ com.a.b.afragment.access$200(afragment.java:46) @ com.a.b.afragment$3.onbuttonclick(afragment.java:134) inside show method call fragmenttransaction.commitallowi

Laravel 5.1 Queue - How to avoid Queue:work command to fetch the in progress job -

1 queue database drivar.my queue:work command run on everyminute. i want execute job max 2 attempts , working. issue queue:work cron runs on every minute , if earlier job in progress attempts same job. how can avoid queue:work command run in-progress job. thanks queue:work not try perform job being performed since gets reserved flag @ start of process. might experiencing fact job failing before next time cron executes, tries same job again forever. you can use --tries everytime invoke queue:work limit amount of attempts job have. if run php artisan queue:work --tries=2 , job attempted execute 3 times and, if fails 3 times, gets added failed_jobs table. make sure have prepared environment (database migration) php artisan queue:failed-table .

python - Fabric counter to display how many host are done -

i'm trying create counter able display "host 5/100 done" @ end of task. have counter classe : class threadcounter(object): def __init__(self, initval=0): self.val =int(initval) self.lock = threading.lock() def increment(self): self.lock: self.val += 1 def value(self): self.lock: return self.val i tried few things make work : in main function, call task giving counter argument def main(): my_counter = threadcounter(0) execute(the_task,my_counter) @parallel def the_task(counter): try: do---my--stuff : my_counter.increment() print my_counter.value() the counter @ "1" when displayed. feel counter wasn't shared. i tried declare counter global same result. last try giving lock the_task , in the_task : with lock : counter += 1 print counter what should share counter between same fabric tasks ? i'm new threads in python. (i use python 2.6 (not willingly)) you

html - Javascript Dont Change The Background -

this question has answer here: what queryselectorall, getelementsbyclassname , other getelementsby* methods return? 8 answers i want change list background wont work my code : change(num, element){ var text if (num == 1){ ... } else if (num == 2) { ... } else { ... } document.getelementbyid('text').innerhtml = text; document.getelementbyclass("left").style.backgroundcolor = "black"; //<------ element.style.backgroundcolor = "white"; //<------ } and html : <ul> <li><a class="left" href="#" onclick="change(1,this)>first</a></li> <li><a class="left" href="#" onclick="change(2,this)>second</a></li> <li><a class="left" href="#" onclick="change(3,

ruby - Scope of modules using Puppet in a Vagrant multi machine environment -

i have projekt setup multi machine environment vagrant. had fix problems, caused redirect issue https, solving these lead other errors, fixed in projects except 1 now, uses multi machine feature of vagrant. so have folder structure: /vagrantfile /puppet/box_1/puppetfile /puppet/box_1/manifests/site.pp this code snippet, define provision directories: config.vm.provision :puppet |puppet| puppet.manifests_path = "puppet/box_1/manifests" puppet.manifest_file = "site.pp" end my puppetfile looks this: forge "https://forgeapi.puppetlabs.com" mod 'tpl0ch/composer' mod 'puppetlabs/apt' mod 'puppetlabs/apache' mod 'puppetlabs/firewall' in site.pp try include apt , error message: error: evaluation error: error while evaluating function call, not find class ::apt project.local @ /tmp/vagrant-puppet/manifests-f2b1fd0ac42b51938ed6ae7e6917367e/site.pp:1:1 on node project.local when rearange puppet files

php - How to Delete a row of a table with using Psedo-Class in MySQL -

i have created database table , table 1 column of varchar datatype. now want delete rows without using delete songs_list songs_name = 'shakira waka waka' this because cannot write name of checkbox spaces. example: <?php ($printedsno=1; $printedsno <$noio+1 ; $printedsno++){?> <?php while($row = mysqli_fetch_assoc($query7) ):?> <input type="checkbox" name="<?php echo "cb".$row['songs_name'];?>"/> <?php echo $printedsno?> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <?php echo $row['songs_name']?></br> <?php break; endwhile; } ?> here can not write checkbox name <?php echo "cb".$row['songs_name'];?> why want use psudo-column. psudo-column can not able use clause beacause column does'nt exist. i want delete row table column. <?php include 'database.php'; $noofsongs = "select * songs_list"; $query

python - Find similar words for bigrams using nltk.similar -

i want find similar words corpus of text using nltk.similar function. function not work bigrams angular momentum . can not use other similarity metrics wup_similarity etc. how can find similar words bigrams? note - nltk.similar uses context of given word (previous + next words) find similar words.

How set maximum date in datepicker dialog in android? -

in application using date picker set date.i want set date picker maximum date today date according system date.i don't know how set date picker maximum date today date.can 1 know me solve problem. my date picker coding is: private int pyear; private int pmonth; private int pday; static final int date_dialog_id = 0; final calendar c = calendar.getinstance(); pyear = c.get(calendar.year); pmonth = c.get(calendar.month); pday = c.get(calendar.day_of_month); // date picker public dialog oncreatedialog(int id) { switch (id) { case date_dialog_id: datepickerdialog.ondatesetlistener pdatesetlistener = new datepickerdialog.ondatesetlistener() { public void ondateset(datepicker view, int year, int monthofyear, int dayofmonth) { pyear = year; pmonth = monthofyear; pday = dayofmonth; e_dob.settext(new stringbuilder() // set date in editext

How to add Text to speech on retrieved Listview from sqlite in android java -

i retrieved data sqlite , need add tts (text speech) on each retrieved row not work when prees on listview read listview items retrieved in sqlite, please me. my java activity : public class favorites extends activity implements adapterview.onitemclicklistener, texttospeech.oninitlistener { listview lv; private texttospeech tts; private sqlitedatabase db; cursor mcursor; simplecursoradapter madapter; databasehelper mhelper; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.favorite); tts = new texttospeech(this, this); tts.setlanguage(locale.english); tts.setpitch(0.8f); tts.setspeechrate(1.5f); lv = (listview) findviewbyid(r.id.list); lv.setonitemclicklistener(this); mhelper = new databasehelper(this); } @override public void onresume() { super.onresume(); db = mhelper.getwritabledatabase(); final string[] columns = new string[] {"_id", databas

sql server - Update and Insert When Condition is Matched in TSQL-Merge -

i have been trying write stored procedure can perform upsert using merge following condition if record present change enddate of target yesterday's day i.e., present day - 1 if record not present insert new record here table tblemployee used in sp create table tblemployee ( [employeeid] [int] identity(1,1) not null, [name] [varchar](10) not null, [startdate] [date] not null, [enddate] [date] not null ) here sp takes udtt input parameter create procedure [dbo].[usp_upsertemployees] @typeemployee typeemployee readonly -- has same column tblemployye except employeeid begin set nocount on; merge tblemployee target using @typeemployee source on target.name = source.name when matched , target.startdate < source.startdate --first update existing record enddate previous date shown below update set target.enddate = dateadd(day, -1, convert(date, source.startdate)) --

java - I am using android studio 2.1.My default hello world app is running (emulator),but it is crashing when launching on a jelly bean device -

apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.3" defaultconfig { applicationid "com.example.aman.myapplication" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' }

javascript - Tracker.autorun() not running on every update of a ReactiveVar -

i have meteor reactivevar , used update trigger in data store. tracker not run every time reactive var set. it seems when state set in quick succession, tracker doesn't run. this code store: const mystore = { states = { ... }, updatetrigger = new reactivevar({ name: null, timestamp: null }), setstate({ name, value }) { this.states[name] = value; console.log('set state', name); this.updatetrigger.set({ name, timestamp: new date().gettime() }); }, }; and tracker: tracker.autorun(() => { const updatetrigger = mystore.updatetrigger.get(); console.log('tracker', updatetrigger.name); if (updatetrigger.name === state-two) myfunction(); }); the console logs this: 'set state state-one' // update state-one 'tracker state-one' 'set state state-two' // update state-two 'set state state-one' // update state-one 'tracker state-one' 'set state state-th

Should I split a data class from its' java swing gui? -

hello people of internet. i'm in situation need create gui create objects of various classes , want in generic way. more specific, whole concept create various products shop. example, product categories notebooks , pens. after selecting product category list, form jframe window appear user prompted give more specifics product. however, not products require same data. let's assume have notebook class requiring page number integer, , pen class requiring pen color string. obviously, need handle creation of window differently each product type. so question is, should handle creation of window? ok create method in each data class creates complete jframe of form required, or should handle gui seperately data classes? thanks in advance! you not want have guis interwoven classes. idea @ mvc. model-view-controller . the idea gui seperated model, controller inbetween of them deals moving data , gui. there 2 common variants of this, either let model notify view has ne

ssl - SSLHandshakeException Below Android 6.0 (marshmallow) -

error log. sslhandshakeexception error log only in marshmallow it's working fine else not working. i getting sslhandshakeexception in android version work fine in marshmallow. public defaulthttpclient getnewhttpclient() { try { keystore truststore = keystore.getinstance(keystore .getdefaulttype()); truststore.load(null, null); sslsocketfactory sf = new mysslsocketfactory(truststore); sf.sethostnameverifier(sslsocketfactory.allow_all_hostname_verifier); httpparams params = new basichttpparams(); httpconnectionparams.setconnectiontimeout(params, http_connection_timeout); httpconnectionparams.setsotimeout(params, http_so_timeout); httpprotocolparams.setversion(params, httpversion.http_1_1); httpprotocolparams.setcontentcharset(params, http.utf_8); schemeregistry registry = new schemeregistry(); registry.register(new scheme("http", plains

controller - java.util.MissingFormatArgumentException: Format specifier '%s' -

i'm missing don't know what... it's stupid how little things make go crazy more complicate ones... this controller's code: @requestmapping(value = "/getclientenomecognome", method = requestmethod.get) public responseentity<list<object>> getclientenomecognome(@requestparam("nomecliente") string nomecliente, @requestparam("cognomecliente") string cognomecliente) { list<object> listarisultati = new arraylist<object>(); try { listarisultati = servizidocumentaleservice.getclientenomecognome(nomecliente, cognomecliente); } catch (exception e) { logger.warn(string.format("errore inatteso sulla chiamata del servizio: [%s]", e.tostring())); } logger.info(string.format("avvio ricerca cliente con nome: %s, cognome: %s)", nomecliente, cognomecliente)); return new responseentity<list<object>>(listarisultati, httpstatus.ok); } and getcl

html - How to make red color input box of error when no content is entered in box but the cursor is still in box using angular js? -

i trying add validation in form using angular js. want whole color of input box red color when there error. issue in form after getting error when removing text , cursor inside box , color of box blue , border of red color, want total box color should red of border well.currently when clicking outside box showing red , need if no text there in box still cursor inside box should showing error whole box red color. using below styling- .registration-form .has-error .form-control, .registration-form .has-error .form-control:focus, .registration-form .has-error .form-control:hover, .registration-form .has-error .form-control:active{ border-color: red; box-shadow: none !important; background-color: red !important; } .registration-form label{ font-weight: normal; } .registration-form .form-group input[type="text"]:focus{ background-color:#18b6d6 !important; } can me how can achieve that? have created plunker here- https://plnkr.co/edit/ffyhrmi

visual studio - BizTalk solution created in VS 2013 not opening in VS 2015 -

we have created biztalk solution in vs 2013 premium version. have upgraded visual studio version vs 2015 enterprise version. when opening in vs 2015 says biztalk project incompatible. went through this msdn article . says biztalk server projects not compatible visual studio 2015 or visual studio 2013. we used biztalk server 2013 r2 developing biztalk solution. need reinstall biztalk solving issue? each version of biztalk specific version of visual studio needs. see visual studio versions needed each release of biztalk for biztalk 2013 r2 need visual studio 2013. cannot use visual studio 2015 biztalk 2013 r2. you can use visual studio 2015 biztalk 2016 @ time in community technology preview 2 , ga later year

php - Course catalog of course era using rest api -

i using open api given course era. problem giving list of 100 courses,i checked on website there 1294 courses listed.then why giving 100 courses on request. my code <?php $url = "https://api.coursera.org/api/courses.v1"; $result = file_get_contents($url); print_r($result); ?> what should fetch whole course catalog , store in mysql db from docs: https://building.coursera.org/app-platform/catalog/ to paginate through result set, use integer start , limit query parameters. curl "https://api.coursera.org/api/courses.v1?start=300&limit=10" so use start , limit pagination

c++11 - c++ pass string as refrence in header and cpp -

how pass string reference in constructor in header , cpp using cin line in text file. execute command prompt: program < test.txt text.txt aaa bbb ccc main.cpp include "read.h" include <iostream> include <string> using namespace std; int main() { string output; read read(line); while (getline(cin, line)) { read.run(); ... ... } read.cpp include "read.h" include <iostream> using namespace std; read::read(string& input) : currentline(input) { } void read::run() { cout << "currentline:" << currentline << "\r\n"; } read.h class read{ public: std::string currentline; parser(std::string& s); void advance(); } when execute program in cmd: program < test.txt currentline not have value string output; read read(line); while (getline(cin, line)) { read.run(); ... ... } you set read.currentline input (in construc

angularjs - Angular 2 bootsrap app component without template/template is served with html -

i used build applicaitons angular1, there possible have directives on allready loaded dom elements, have main component (app), wich build loaded html , inside can load directives ether loaded html or load url. howewer in angular2 seems bootsrap application have use component requires me have template/templateurl, think not nessesery since don't want load seperatly menues , other common stuff, rather on server level laoding seperatly. knows how achive in angular2? in angular2 need bootstrap component , component needs have view. directives can't bootstrapped. directives can't added or removed dynamically, applied static html in components view matches selector. to me sounds use case angular1 better fit.

java - calling a swing from a menu item not working -

i'm having menu item displayed part of windows icon item = new menuitem("update options"); item.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { login("update"); } }); popup.add(item); trayicon.setpopupmenu(popup); if click on menu item , supposed call login method below , show me jframe panel added public void login(string operation){ final jframe frame=new jframe(); jpanel panel = new jpanel(); jbutton blogin = new jbutton("start"); blogin.setbounds(110,150,80,20); panel.add(blogin); panel.setsize(300,220); panel.setlocation(500,280); panel.setlayout (null); frame.setsize(300,220); frame.setlocation(500,280); frame.setlayout(new borderlayout()); frame.add(panel, borderlayout.center); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setvisible(true); blogin.addactionlistener(new actionlistener() { public void

C# - TreeView Comparing Nodes -

i want create treeview list squares found in image along colors in each quadrant. if sees same colored square add anyway because image processing each frame. my problem need compare if color of child node exists in treeview. if exists, dont add node. if (quadrado_detetado == 1) { tv_lista_quadrados.nodes.add("quadrado detetado " + increamenta_listagem_quadrados); if (tv_lista_quadrados.nodes.count > 1) { //compare current child node child nodes in treeview ?? if(//doesnt exist) //add tv_lista_quadrados.nodes[increamenta_listagem_quadrados].nodes.add ("cores: " + cores_dos_pontos_medios[0] + " " + cores_dos_pontos_medios[1] + " " + cores_dos_pontos_medios[2] + " " +

c# - Universal windows app to send data from one page to another -

i had partitioned mainpage.xaml in 2 parts. left part has buttons give command change right part new page. created 3 right pages ex. rightpage1 , rightpage2 , rightpage3 . problem that, want show data on left part after operations done on rightpage1 , 2 or 3. should follow pattern fulfill approach? or can directly in code behind? all researched giving me solution navigate page , send data in parameter. don't want open page again, because it's opened on left side of mainpage . please me solve situation. in rightpage 1, on submit click event want show message in mainpage.xaml 's left part in textblock lblclassname. homepage.xaml <grid> <grid.columndefinitions> <columndefinition width="5*"/> <columndefinition width="3*"/> </grid.columndefinitions> <relativepanel> <button x:name="btn1" content="button 1" height="50

maven - How to integrate rest api test using soapui with selenium using junit framework -

i want integrate selenium-webdriver framework written using junit soapui rest api test suites, there way it? thanks in advance based on comments, here how need change tests, that, able run both kinds of tests within soapui i.e., rest , ui . i not sure, if happened create soapui project. if not, create project, import .wadl or swagger definition of rest api . then create test suite, , test cases required. now test case should having steps defined: rest request step (one or multiple steps) : contains rest api calls groovy script : whatever test code have in junit test, needs come here. groovy should able run of java code. but, if familiar, can add groovy code itself. so, able same run eclipse ide. bringing test steps soapui test case have added advantage can share data (in form of variables ) across rest , ui well. you can execute tests using soapui's commandline utility testrunner.bat/.sh of soapui_home/bin directory. it possible define applicatio

php - Can not retrieve multiple records from the database in CakePHP -

i working 2.6.1 version of cakephp. have created 1 controller named androidcontroller.php , looks like <?php class androidcontroller extends appcontroller { public function survey_question() { configure::write('debug', '2'); $survey_id = $_request['survey_id']; $this->layout = ""; //$condition = "question.survey_id = '".$survey_id."'"; $info = $this->question->find('all', array( 'conditions' => array( "question.survey_id" => $survey_id /*dont use array() */ ) )); echo json_encode($info); exit; } } ?> so, gives error error: action admin_survey_question not defined in controller androidcontroller error:create androidcontroller::admin_survey_question() in file: app/controller/androidcontroller.php. note :my website url http://navyon.com/dev/mt/admin/android/survey_question?sur

upload multiple documents with PHP Codeigniter -

i working on user registration form in user required upload profile image , document verification purposes. these 2 different fields in form. code works fine problem uploads profile image , stores in verification documents folder. not upload verification document. works fine if remove or comment 1 of field. below controller function. /** upload profile image **/ $prof_pic = $_files['profile_pic']['name']; $config = array ('upload_path' => './images/tutors/', 'allowed_types' => "jpeg|jpg|png", 'overwrite' => true ); $this->load->library('upload', $config); $this->upload->do_upload('profile_pic'); /** upload verification document **/ $tut_ver_docs = $_files['tut_ver_docs']['name']; $new_config = array ('upload_path' => './emp_verification_documents/',

jquery - How to change the url being called by javascript without access to the javascript -

i have jquery('#frame').animate360 script on page , calls file called profile.xml settings etc. problem profile.xml on azure blob , in uppercase (profile.xml). means 404 file not found error. i can't change filename(profile.xml) on azure. the piece of js calls profile.xml seems encrypted in library (html5loader.js) i.e. text 'profile.xml' not appear in file , can found chrome debugger in unnamed file. my instinct use application_beginrequest etc catch 'call' https://storageblabla.blob.core.windows.net/uploads/alpha/3dimages/1.010659/profile.xml , change ...../profile.xml it's late @ stage. knows 404. there must access, code, point remote url being called can intercepted. rekon 1 line fix can't find right term search on.

ios9 - Check and open app from browser -

i have been researching while if there concrete way has come through user can open of 3 apps browser. here trying explain: user opens link on browser has button user clicks on button web page business login search 3 apps: yelp, google+ , facebook. if yelp found on device, opens if not google+ opens , if google+ not installed, facebook opens , if 3 not installed page redirects webpage. while searching solution found can done javascript's window.location timer not solution, somewhere found video , doing same thing want: https://www.youtube.com/watch?v=k7jtlgx7uqu i observed ios 9.2's universal link can helpful in approach not found suitable article how use universal link on webpage, found articles related how implement universal link in app i greatful helps me.

android - Troubles positioning layouts to tic tac toe app - falling off screen -

Image
i new android development . took begginer course in udacity last month. i'm having troubles positioning layouts cause there not shown ot screen , on diferent devices looking different altough im not using particular dimentions @ all. tic-tac-toe game, used buttons 9 fields crosses , circles. i've tried these layouts , need cause have ready project till 11th of july. thank you. here whole code because think problem can't solved otherwise. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:theme="@style/purpletheme" android:background="@drawable/background_1a" tools:context="com.example.android.tictactoe.mainactivity" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightsum="7"> <linearlayout android:id="@+id/general_layout"

javascript - Local hosted embeded video auto starting -

i have been given few videos embed in page using joomla not familiar format. need these not auto play! tried autostart:"0" autoplay:"0", tried false. appreciated! code below: <a id='cnwebinarlink' href='http://cnpg.comparenetworks.com/187573-discovering-volatile-biomarkers-using-gc-gc-tofms-detecting-and-phenotyping-infections-directly-from-lung-samples/' data-keywords=‘dr. heather d. bean discusses discovering volatile biomarkers using gc×gc-tofms , detecting , phenotyping infections directly lung samples'>webinar permalink</a><script src='http://cnpg.comparenetworks.com/media/29/js/z.webinaranalytics.js' type='text/javascript'></script><iframe width='985' height='675' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://cnpg.comparenetworks.com/187573-discovering-volatile-biomarkers-using-gc-gc-tofms-detecting-and-phenotyp

node.js - Joi.array().includes is not a function error -

i validating payload data of api joi validation. have made 1 schema this: 'use strict'; let mongoose = require('mongoose'); let schema = mongoose.schema; let tokenschema = new schema({ level : {type : number}, tokenvalues : [{ level : {type : number}, amount : {type : number} }] }); module.exports = mongoose.model('tokens',tokenschema,'tokens'); i have written joi validation: validate: { payload: { level: joi.number().required(), tokensvalues: joi.array().includes({ level : joi.number().required(), amount : joi.number().required() }) } } this above code giving error : typeerror: joi.array(...).includes not function please suggest other method if wrong practice. i got solution : validate: { payload: { level: joi.number().required(), tokensvalu

haskell - Why is there a limit on the length of a regex pattern in Text.Regex.Posix? -

i'm seeing odd arbitrary limit on length of regular expression pattern where, after string of 30 characters, funny things start happen. simple ghci example: > import text.regex.posix > "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz0123" :: string "abcdefghijklmnopqrstuvwxyz0123" > "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234" :: string "" the difference addition of 4 @ end of last pattern. it's valid regex , should match gives me empty string. it gets weirder if add few more valid characters pattern: > "abcdefghijklmnopqrstuvwxyz0123456789" =~ "abcdefghijklmnopqrstuvwxyz01234567" :: string "ab" it tells me matches ab when that's wrong. my environment: stack version 1.1.2 (resolver lts-6.7) ghc version 7.10.3 os: windows 10 regex-posix-0.95.2 a complete uninstall , reinstall of stack , package