Posts

Showing posts from May, 2015

android - RecyclerView - CardViews overlap each other when scrolling (How to add multiple rows to a single CardView?) -

the entire layout set - recyclerview contains several card views, , each cardview can have multiple rows of linearlayouts of exact type (but different data). everything works okay, except when scroll down or up, cards begins overlap on other cards randomly. here's code: public class myadapter extends recyclerview.adapter<myadapter.viewholder> implements view.onclicklistener{ context context; public myadapter(context context) { this.context = context; } @override public int getitemcount() { return 20; } @override public void onbindviewholder(viewholder holder, int position) { try { linearlayout.layoutparams contentparams = new linearlayout.layoutparams(100, 100); layoutinflater inflater = layoutinflater.from(context); linearlayout ll_parent = (linearlayout) inflater.inflate(r.layout.parent_linearlayout, null, false); networkimageview networkimageview =

java - Threading Stopwatches -

i trying create 4 stopwatches run concurrently. start when program begins. i want user able use q,w,e,r keys speed stopwatches (from left right following keyboard pattern). i've established pretty wont let press other key r key speed 4th clock. i want implement threading allow this. how go it? heres code: public class stopwatches extends application { @override public void start(stage primarystage) { time time1 = new time(); time time2 = new time(); time time3 = new time(); time time4 = new time(); text text1 = new text("00:00:00"); text text2 = new text("00:00:00"); text text3 = new text("00:00:00"); text text4 = new text("00:00:00"); text1.setfont(font.font("times", 35)); text2.setfont(font.font("times", 35)); text3.setfont(font.font("times", 35)); text4.setfont(font.font("times"

linux - Compare md5 sums in bash script -

i'm trying use md5sum compare 2 files in bash script. the goal use .md5 of 1 file check md5sum of other file. google searches on how proper way isn't showing me how i'm doing this. firing off e-mail works you'd expect. i'm trying fire off e-mail on failure rather success. and maybe list result of received .md5 file , actual md5sum of corrupted file. i'll figure out, confusing since have tried figure out i'm going wrong here. shellcheck indicates code looks good, i'm not getting results i'm expecting get. a few stackoverflow links checked out see if worked: one two here's content of bash script, in original form: #!/bin/bash cd /home/example/public_html/exampledomain.com/billing/system/ || exit rm -rf geolitecity.dat curl -l https://geolite.maxmind.com/download/geoip/database/geolitecity.dat.gz | gunzip > geolitecity.dat curl -l https://geolite.maxmind.com/download/geoip/database/geolite2-city.mmdb.gz | gunzip > geoli

css selectors - What #id.class css means? -

this question has answer here: how combine class , id in css selector? 9 answers i saw in css declaration this: #nav.js { display:none; } can explain means? html code following <ul id="nav"> <li><a href="#">home3</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> #nav.js this selects element id set "nav" , has class containing "js" . for example, select of following elements: <figure id="nav" class="js"></figure> <figure id="nav" class="foo js"></figure> <figure id="nav" class="js bar"></figure> <figure id="nav" class="foo js bar"></fig

c++ - Why does my destructor only crash my code after it's called by its parent destructor? -

Image
i have doubly threaded linked list made of winery elements, winery being class own data fields. problem having winery 's destructor: winery::~winery() { delete[] name; delete[] location; } i received "double free or corruption (out): 0x0000000000402940" error in linux, , received error in windows visual studio: so put breakpoint on winery 's destructor , found being called every time referenced winery object. strangely, time error thrown when winery 's destructor called because list 's destructor had been called, if winery had been called 2 or 3 times. know why code didn't crash second time winery 's destructor called when wasn't called parent destructor. as side note/question: able solve issue of memory leakage removing winery 's destructor , putting calls in parent destructor this: list::~list() { (node* next; headbyname; headbyname = next) { next = headbyname->nextbyname; delet

installing android SDK on removable media -

what pros/cons of installing android sdk windows on removable media storage (sd cards)? will there massive performance hit? i'm in process of installing takes forever finish. i'm wondering if it's not going usable have sdk on sd card , cancel rightaway. thanks response

leiningen - Using exiftool java library from clojure -

i'm trying include exiftool java in leiningen based clojure project. library not available @ central, have included :repository tag in project.clj file. project.clj: (defproject clojure-mongo "0.1.0-snapshot" :description "fixme: write description" :url "http://example.com/fixme" :license {:name "eclipse public license" :url "http://www.eclipse.org/legal/epl-v10.html"} :repositories {"the buzz media maven repository" "http://maven.thebuzzmedia.com"} :dependencies [[org.clojure/clojure "1.7.0"] [com.novemberain/monger "3.0.1"] [com.thebuzzmedia/exiftool-lib "1.1"]]) exiftool java not provide checksum , site warns of this: "note: @ time not providing checksums files on our repository, see '[warning] checksum validation failed' messages maven, can safely ignored." sure enough, lein deps gives me erro

c# - An exception was thrown in a call to a WSDL export extension - WCF -

i trying connect webservice windows form application, when try open link webservice browser error message: an exceptiondetail, created includeexceptiondetailinfaults=true, value is: system.invalidoperationexception: exception thrown in call wsdl export extension: system.servicemodel.description.datacontractserializeroperationbehavior contract: http://tempuri.org/:imobilews ----> system.invalidoperationexception: request in operation uploadfile stream operation must have single parameter type stream. @ system.servicemodel.dispatcher.streamformatter.validateandgetstreampart(messagedescription messagedescription, boolean isrequest, string operationname) @ system.servicemodel.dispatcher.streamformatter.create(messagedescription messagedescription, string operationname, boolean isrequest) @ system.servicemodel.description.messagecontractexporter.exportmessage(int32 messageindex, object state) @ system.servicemodel.description.messagecontractexporter.exportmessagecontra

multithreading - C: fgets error during multiple pthread -

my overall goal of program read data (float or letter) file , change global constant using mutex. (i have not applied until now) but before that, thought of creating basic program read entire content of file , print screen. currently, program unable so. reads first character of file , exits file. providing code , error. assistance helpful. #include <stdio.h> #include <pthread.h> #include <string.h> pthread_mutex_t mutex = pthread_mutex_initializer; char *files[] = {"one.in", "two.in", "three.in", "four.in", "five.in"}; void* thread( void * arg ) { char * file = (char *) arg; // open file , read content file *fp = fopen(file,"r"); char line[1024]; int len; printf("thread id %s enter\n",file); if( !fp) { printf("%s file open failed\n", file); return 0; } else printf("%s file open success %p %d\n", file, fp

ajax - Restful URL After Insert -

i new restful urls , have general question. let's have url use retrieve student records: somesite.com/students/123 retrieves details student id 123. i following load empty form adding students: somesite.com/students/0 0 indicates want display empty student detail form (or somesite.com/students/new ). the question have after add student record new id. however, if add record using ajax without submitting , refreshing page, url still shows somesite.com/students/0 . if user clicks refresh empty form displayed again rather new student record. how should handled? it's not server can't respond ajax requests, right? need send newly generated id, , then: use window.location = 'new_url' redirect user or better, use history.pushstate() (if available) change url without redirection (and reloading) happening @ all one thing seems off, though, use of get page/students/0 "empty record", or, understand it, "template" new records.

Django Rest Framework IntegrityError when tried use unique_together -

this question seems similar aiming error integrityerror column username_id not unique what looking having these fields unique when together. meaning same roomid , username can seen in database once when together. however, user can seen roomid . point avoid multiple submissions of same user , same roomid . the error above occurs when try submit requst same username roomid . here model class active(models.model): username = models.foreignkey(profile) roomid = models.foreignkey(room) activeid = models.uuidfield(primary_key=true, default=uuid.uuid4, editable=false) class meta: unique_together=(('username', 'roomid',)) i using sqlite and. i thought unique_together constraint did doesn't seem it. what's proper approach? edit i ended overriding perform_create , verify no row contains both keys before saving in link . def perform_create(self, serializer): queryset = active.objects.filter(u

javascript - Disabling CSRF in my web app or a safer approach -

i'm creating web app in laravel, csrf killing ajax functionality. the submission of token ajax works fine, using ajaxsetup can attach token every request, no problem part. but every time user leaves browser window long (perhaps couple hours or more) ajax requests start returning error 500 (token mismatch) - perhaps server updates token , client keeps old one, forcing user refresh page keep functional, don't want do. so thinking of creating sort of ajax timer updated csrf token server every once in while.. seems bit of hackish solution, , maybe useless? (if i'm serving token, can request , still csrf attack, right?) to solve issue once , all, have more risky, disabling csrf ajax calls. question is: hurt security bad? i've seen many people recommending turn off, seems big deal if can cross-request sensitive actions on user account (such delete account or this) what guys recommend? issue keeping me awake night :/ i have on option in mind now...

php - Modifying URL in javascript -

i have following script: $( document ).ready(function() { $.getscript("http://www.anrdoezrs.net/am/7825092/include/allcj/generate/onload/am.js", function(){ settimeout(function(){ window.location = $('#cjlink').attr('href'); }, 500); }); }); which supposed redirect link generated am.js. modify link generated am.js replace domain34.com/us or domain34.com/ domain34.com/uk i tried htaccess not find way rewrite outgoing urls need method via php or js. as mentioned in ajax.getscript documentation, should pass data argument, add js replace [insert adresse here] wich redirected. as asked op. not tested code thou, js file not loaded reason: $(document).ready(function(){ $.getscript("http://www.anrdoezrs.net/am/7825092/include/allcj/generate/onload/am.js", function(data){ data = data.replace('domain34.com/us', 'domain34.com/uk'); data = data.replace('

java - Behavior of bitwise xor using binary literals -

i'm curious know happens on bitwise comparison using binary literals. came across following thing: byte b1 = (new byte("1")).bytevalue(); // check bit representation system.out.println(string.format("%8s", integer.tobinarystring(b1 & 0xff)).replace(' ', '0')); // output: 00000001 system.out.println(b1 ^ 0b00000001); // output: 0 so behaves expected, xor comparison equals 0 . when trying same negative number won't work: byte b2 = (new byte("-1")).bytevalue(); // check bit representation system.out.println(string.format("%8s", integer.tobinarystring(b2 & 0xff)).replace(' ', '0')); // output: 11111111 system.out.println(b2 ^ 0b11111111); // output: -256 i have expected last xor comparison equals 0 . case if explicit cast of binary literal byte : byte b2 = (new byte("-1")).bytevalue(); // check bit representation system.out.println(string.format("%8s", integer.to

docusignapi - Using docusign to sign a batch of PDFs -

we want following: 1) upload 2 100 or pdfs per day 2) have 2 people digitally sign each individual pdf 2a) first signature needs "certifying signature" - certifying rights allowing 1 additional signature in pdf from simple test of system, appears process - via ui: 1) upload pdfs via browser 1a) browser ui "place" signatures (position etc.) in pdfs (can 100) 2a) first person signs batch of pdfs , sends batch recipient. 2b) recipient signs , "sends them back" manually putting in signature fields in 100 pdf documents per day quite task. out pdfs can generated signature form fields. can docusign system find specific form fields , use specific users - fill in digital signature? possible/and better done api? there example or document describes somewhere? i'm new system, this/these question(s) might naive. same underlying document being sent (eg order form) if pdfs different versions of same form or document use template . eg,

MongoDB finding all subdocuments where subDocument _ids like "string" -

sample document structure like: { "_id" : "https://docs.mongodb.org/manual", "collection" : { "_id" : "collection", "urls" : [ "https://docs.mongodb.org/manual/c1", "https://docs.mongodb.org/manual/c2" ] }, "collectionnew" : { "_id" : "collection1", "urls" : [ "https://docs.mongodb.org/manual/c1new", "https://docs.mongodb.org/manual/c2new" ] }, "log" : { "_id" : "log", "urls" : [ "https://docs.mongodb.org/manual/l1", "https://docs.mongodb.org/manual/l2" ] } } i have multiple such documents in collection. after finding document db.autosearch.find({"_id": "https://docs.mongodb.org/manual&quo

android - Get images from instagram from given hashtag -

i know how images instagram given hashtag. i've registered client , got client_id , client_secret . read instagram api, , found need access_token search images. means need user give authorization app infos. there other work around ? because, want search images given hashtag, didn't have user's information. , persuade user have provide access looking @ images, that're not theirs, not persuade. and, in case have authorization client, should put in redirecturl ? fill random url instagram, because don't have server. run on local phone. thanks advice. you may images hashtag tag endpoint without access_token . add client_id query. example: https://api.instagram.com/v1/tags/sometag/media/recent?client_id=client_id quote instagram api : you're best off using access_token authenticated user each endpoint, though endpoints don't require it. in cases access_token give more access information (ex: user_has_liked ), , in cases, means opera

how to include php in javascript for retriving data from database to form a paper with MCQ questions -

<?php $server = "localhost"; $username = ""; $password = ""; $db = "test"; $conn = new mysqli($server,$username,$password,$db); if($conn->error){ die("error :- ". $conn->error); } $query = "select * mcq_questions"; $result = $conn->query($query); ?> <script type="text/javascript"> var n = <?php echo $result->num_rows ?>; var i; for(i = 0; < n; i++){ var question = ""; question = '<?php $row = $result->fetch_assoc(); echo $row['question']; ?>'; document.write(question); } </script> i wanted print mcq questions present in databa

function - How to stop two visitors hitting a PHP script at the same second -

hi have had issue 2 visitors have hit php function within second of each other. function sends them 1 time use code pool of codes , sent both people same code. what methods can use in script check if else being processed , either delay or wait other person finish? i know seems general question hard explain mean! can help! what methods can use in script check if else being processed , either delay or wait other person finish? that call "mutex", short mutually exclusive . notice without knowing how php run on server, it's hard know whether php's built-in mutex routines work. php bad language when comes multithreading.

Azure Media Services consumption statistics -

using azure media services , azure media player azure cdn, there way collect statistics on number of seconds/minutes video has been played? and if user skips or forward? let's video length 5 minutes user skips forward 2 minutes , viewing total of 3 minutes out of 5, can real viewed time? yes can done, @rnrneverdies recommends can build plugin send data analytics aggregator/server. key here determining how backend use. since azure media player allows listen events, can send data depending on end of choice. one type of solution include sending data through azure service bus (event hubs) using azure stream analytics view raw data in blob or table storage, or can push data power bi viewing. single example, , many such analytics services exist allowing create plugin amp. there several ways determine exact time viewed, depends on exact metric viewing. example, looking total time watched, or total unique time watched (which doesn't include overlaps). example here

html - Css for child elements -

i have few pages have different structure inside parent div <div class="post-formatting"> <p>some text <em> <a href="http://example.com">click here</a> </em> </p> </div> <div class="post-formatting"> <p>some text <a href="http://example-2.com">click here</a> </p> <div> <a href="http://example-3.com">click here</a> </div> </div> <div class="post-formatting"> <a href="http://example-4.com">click here</a> </div> i need set common css rule <a> tags within <div class="post-formatting"> , dependless whether it's first child or not. there way that? thnx yes. basic css. can achieve quite with: .post-formatting { /* style declarations here. */ }

c# - Unity3D Physics2D.OverlapAreaNonAlloc strange (bug?) behaviours with layers -

i have encountered strange bug physics2d.overlapareanonalloc , created test project confirm it. scene : 2 cube on top of each other, rigidbody2d , box collider, bottom 1 kinematic. top 1 "player". i wanted use physics2d.overlapareanonalloc enemy detection used code looks this, attached player : using unityengine; using system.collections; public class test : monobehaviour { vector2 pointa; vector2 pointb; collider2d[] enemies = new collider2d[2]; void update () { //enemy detection pointa = (vector2)gameobject.transform.position - new vector2(0.1f, 0f); pointb = (vector2)gameobject.transform.position + new vector2(0.1f, 0.1f); if (physics2d.overlapareanonalloc(pointa, pointb, enemies, 9) > 0) { debug.log("first enemy :" + enemies[0].name); } } } 9 layer number of enemies layer. there no enemies in scene previous code should never display in console. sadly... when run

python - Find keys for values that appear more than once -

i have dictionary follows: mydict ={1:'apple',2:'banana',3:'banana',4:'apple',5:'mango'} i want compute list contains keys values appear more once: mylist = [1,2,3,4] value 'mango' appears once, , therefore key 5 not present in mylist . how can achieve this? you can use counter this: >>> collections import counter >>> c = counter(mydict.values()) >>> [k k, v in mydict.items() if c[v] > 1] [1, 2, 3, 4]

javascript - How do i make a <nav> toggle from underneath a div? -

i nav (inside header) attached bottom of div .menu_bar when nav toggled slide down directly underneath. nav not inside div , div isn't inside nav, separate in html. can't nav slide down div , when works screen size , breaks again when change width of screen. <header> <nav> <ul> <li><a href="#">home</a></li> <li class="submenu" > <a href="#">nielsen products<span class="icon-arrow-down2"></span><span class="caret"></span></a> <ul class="children"> <li><a href="#">exterior cleaning<span class="icon-dot-single"></span></a></li> <li><a href="#">interior cleaning<span class="icon-dot-single"></span></a></li>

event viewer - Issue selecting specific levels of windows application logs in NXLog -

i'm trying pass warning / error / critical level application logs through nxlog elk stack. when have configuration <input eventlog_in> module im_msvistalog # kinda works me, put * query <querylist>\ <query id="0">\ <select path="application">*</select>\ </query>\ </querylist> exec to_json(); </input> everything works fine, , i'm collecting levels of application logs. tried putting in parameter on <select path> line <select path="application">*[application/level=1]</select>\ and craps , nothing. nxlog isn't reporting issue, , i'm not seeing on logstash side of things. i got information event viewer querying thread , adapted use case: https://serverfault.com/questions/543494/query-specific-logs-from-event-log-using-nxlog figured out. apparently refer

java - How to drag and drop the image above to the below image where if 1st image on top is touch with the 1st image below will provide value to be recorded -

Image
package project; import java.awt.color; import java.awt.component;`` import java.awt.point; import java.awt.toolkit; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.net.malformedurlexception; import java.net.url; import java.util.random; import javax.swing.imageicon; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jlayeredpane; import javax.swing.swingutilities; public class dragimage { private jlayeredpane contentpane; jlabel[] draggableimage= new jlabel[11]; imageicon[] image = new imageicon[11]; imageicon imagebox = new imageicon(); jlabel[] box = new jlabel[11]; public dragimage() throws malformedurlexception { jframe frame = new jframe(dragimage.class.getsimplename()); frame.setdefaultcloseoperation(jframe.exit_on_close); contentpane = new jlayeredpane(); contentpane.setbackground(color.white); contentpane.setopaque(true); frame.setcontentpane

javascript - color picker plugin script import cause unexpected token -

i'm trying import color picker plugin (http://www.eyecon.ro/colorpicker/) backend of easyappointments.org , follow plugin documentation , example page, strange reason when insert script head of backend page error: uncaught syntaxerror: unexpected token < jquery.js:1 this structure of import: <script type="text/javascript" src="application/third_party/js/jquery.js"></script> if want see complete code check this link . the code long, sorry if not pasted here. how can figure out causing problem? bit 'rusty js , problem stopping me little' update jquery content: http://pastebin.com/ee01ifzh edit: after detailed discussion of problem, found correct solution: the inclusion of css , javascript files wrong. css , js files need placed in js folder in project root, third_party folder for php extensions only . inclusion order important. when including javascript, make sure include basic s

Native way to return path of currently running R binary -

is there native method show full path of current running r binary (e.g. returning /usr/bin/r string)? as @sebastian points out in comments, component argument of r.home() function can used return string full path of r binary: r.home("bin") other values can used show different paths related r installation.

node.js - Loop of console.log in nodejs -

my mcve following var = 0; for(;;) console.log(i++) when this, @ moment, nodejs stops printing stuff, giving me output looks this [...] 684665 684666 684667 and then, got : <--- last few gcs ---> 69097 ms: scavenge 1397.2 (1456.7) -> 1397.2 (1456.7) mb, 0.8 / 0 ms (+ 1.7 ms in 1 steps since last gc) [allocation failure] [incremental marking delaying mark-sweep]. 70462 ms: mark-sweep 1397.2 (1456.7) -> 1396.0 (1456.7) mb, 1364.9 / 0 ms (+ 2.8 ms in 2 steps since start of marking, biggest step 1.7 ms) [last resort gc]. 71833 ms: mark-sweep 1396.0 (1456.7) -> 1397.1 (1456.7) mb, 1370.2 / 0 ms [last resort gc]. <--- js stacktrace ---> ==== js stack trace ========================================= security context: 0xcdf79d37399 <js object> 1: formatprimitive(aka formatprimitive) [util.js:~411] [pc=0x634d9f4113f] (this=0xcdf79d04131 <undefined>,ctx=0x17b18f4d561 <an object map 0x32fd25043ef9>,value=16248021) 2: f

How to Scale images to imageview perfectly with fixed width and height without distorting the image in Android -

iam creating app access images gallery or camera. have imageview 280/280dp dimension. how scale images camera/gallery(which bigger images) below imageview having fixed width , height without distorting image in android: <imageview android:layout_width="280dp" android:layout_height="280dp" android:id="@+id/mainimage" android:background="@drawable/profile_settings_main_image" android:layout_margintop="19dp" android:layout_below="@+id/container_toolbar" android:layout_centerhorizontal="true" android:focusable="false" android:adjustviewbounds="true" /> activity_main.xml(full layout) <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="in.abc.

excel vba - Check if MS Access is Installed -

i looking way check if ms access installed , if not exit sub or finish running rest of module. came across bit of code, unsure of how adapt suit needs. function applicationisavailable(applicationclassname string) boolean ' returns true if application available ' example: if not applicationisavailable("outlook.application") exit sub dim anyapp object on error resume next set anyapp = createobject(applicationclassname) applicationisavailable = not anyapp nothing set anyapp = nothing on error goto 0 end function thank in advance if able assist. i ended getting work not long after posted question. in case curious, used above code declare function , within module running used bit of code determine if available. if applicationisavailable("access.application") = false msgbox ("you must have microsoft access installed use function") exit sub end if

python 2.7 - time data does not match format when it can -

i got error particularly strange. code i'll give run, time time, our server (using apache2) hit error: valueerror: time data '7:00 pm' not match format '%i:%m %p' strangely, code works, valueerror says otherwise...: print datetime.strptime('7:00 pm', '%i:%m %p') to fix issue, time time, reload our apache2 server , up, goes away! can't figure out what's going on. i'm thinking maybe there encoding issue text , log hiding us, i'm programmatically unable force error :) any ideas?

php - Whose temporary directory an upload script uses? -

i building upload feature on project.i have done other validation on exist,size , type there little more validation needed.i found out mime validation no matter file extension user upload checks real file type.below code did work me.now whenever user try upload .php file .png/jpg/jpeg or other fake extension name code catches malicious file type.but have question when user upload file @ first goes on temporary directory.is temporary directory used client pc or our server?if our server malicious fake extension file can dangerous or not? $imageinfo = getimagesize($_files['file']['tmp_name']); if ($imageinfo['mime'] == ("image/png") || $imageinfo['mime'] == ("image/jpeg") || $imageinfo['mime'] == ("image/jpg")) { from manual : files will, default stored in server's default temporary directory, unless location has been given upload_tmp_dir directive in php.ini . server's defa

Android cant access play store after installing app from outside the play store -

i have rooted android phone install app outside play store. , cant access play store anymore. search solution , found this. can't edit host file. use es file explorer edit. in host file. 127.0.0.1 localhost 127.124.218.80 android.clients.google.com mtalk.google.com my questions is how edit host file? can delete host file?(what lines apart default in host file?) i don't know why people vote down question. anyway ask same question on comunity , got solution. i'am posting answer has same problem. original answer steps: go es file explorer click menu on right. scroll down root explorer , turn on, click again on root explorer open new menu. click mount r/w open new menu. turn on rw option on /system . go host file /system/etc/hosts , edit file, saved.

php - Check if a row exists in database and if not display a message -

hi guys can't manage check if row exists in database , if not display message. code bellow. need little help. thx <?php $result = mysqli_query($mysqli, "select client_cv formular_client id = '$id'"); if (mysqli_num_rows($result) > 0){ echo "<a href='../cv/" . $rows['client_cv'] . "' target='_blank' class='btn btn-lg btn-primary'><span class='glyphicon glyphicon-download-alt'></span> descarca cv</a>"; } else { echo "<a href='#' target='_blank' class='btn btn-lg btn-primary'><span class='glyphicon glyphicon-download-alt'></span> fara cv</a>"; } ?> if want show different links based on if client_cv has value or not, try this <?php $result = mysqli_query($mysqli, "select client_cv formular_client id = '$id'"); if (mysqli_num_rows($resul

java - SpEL expression to utilize "contains()" string method -

i trying utilize string.contains() in order dynamically create value field based upon name of file stored in jobexecutioncontext. key/value (file=>nameoffile.txt) pair exists in context because utilizing in other places. i trying folllowing spel expression: <property name="subject" value="#{((string)jobexecutioncontext['file']).contains('monk') ? 'monkey' : 'banana'} kind of file" /> however i'm getting error: expression parsing failed; nested exception org.springframework.expression.spel.spelparseexception: el1043e:(pos 9): unexpected token. expected 'rparen())' 'identifier' the exception because "(string)",you can this: <util:map id="fruit"> <entry key="banana" value="#{89.7}"/> <entry key="apple" value="efg"/> <entry key="orange" value="lmn"/> </util:map> <

PHP multidimension array key search -

so, have multidimensional array (for example): array[1][22]['name'] array[1][33]['name'] array[2][44]['name'] array[3][55]['name'] i know last array key(it's id) (for example - [44]), how can find value of [name] known key? in guess need array_search, key , in multidimensional array... here's simple way php >= 5.5.0. assumes there 1 key 44 in array: echo array_column($array, 44)[0]['name']; // or echo current(array_column($array, 44))['name']; earlier versions: foreach($array $k => $v) { if(isset($v[44])) echo $v[44]['name']; }

javascript - How to loop through a shrinking array -

suppose have array this: myarray = ["a","b","c","d","e"] and want loop through find specific values , remove them. for(var i=0;i<myarray.length;i++){ if(myarray[i] == "b") myarray.splice(i,1) } the problem being, splice removes item array, , items in front of removed one, shift down index number, myarray.length instantiated 5 after splice myarray has length of 4 , for loop fails since myarray[4] throws typeof match error in framework. i'm using framework works way, that's why i'm utilizing such item removal technique, question how go doing right way? framework uses splice method, i'm using for loop, assume there's correct way go this? reverse loop: for(var i=myarray.length-1;i>=0;i--){ if(myarray[i] == "b") myarray.splice(i,1) }

ios - error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller] -

info: welcome appium v1.4.8 (rev c8179bd8352d3c62d98fa58b324491230df9342a) info: appium rest http interface listener started on 0.0.0.0:4723 info: [debug] non-default server args: {"app":"in.bsb.wynkmusic.inhouse","udid":"edf98902-fb17-4b7f-afa4-070a017aa238","nativeinstrumentslib":true,"devicename":"iphone 6","platformname":"ios","platformversion":"8.4","showioslog":true,"defaultcommandtimeout":7200,"debuglogspacing":true} info: console loglevel: debug info: --> /wd/hub/status {} info: [debug] responding client success: {"status":0,"value":{"build":{"version":"1.4.8","revision":"c8179bd8352d3c62d98fa58b324491230df9342a"}}} info: <-- /wd/hub/status 200 8.472 ms - 104 {"status":0,"value":{"build":{"version":"1.4.8&