Posts

Showing posts from April, 2012

javascript - Why does this Js code (using userAgents) not work on my iphone 4? -

sorry ask such vague question can't pinpoint why code works on pc , on android phone not iphone 4 safari or chrome? checked browser compatibility .includes , navigator.useragent , .getelementbyid .. missing? html: <p id="demo"></p> <button onclick="go()">click me</button> js: var devices = ["android","iphone","ipod","ipad","blackberry","chrome"]; var useragents = navigator.useragent; function detectdevice() { (var = 0; < devices.length; i++) { if (useragents.includes(devices[i])){ return devices[i]; } } } function go(){ var str = detectdevice(); document.getelementbyid("demo").innerhtml = str; } any appreciated.

sql - How can I normalize the capitalization of a group-by column? -

on sql server configured case-insensitive, group by can have interesting results when [n][var]char column not first group by column. essentially, looks whatever row encounters "first" (where "first" undefined in absence of order): wins grouping. example: select x.[day], x.[name], count(1) [count] ( select 1 [day], 'a' [name] union select 1, 'a' union select 2, 'a' union select 2, 'a' ) x group x.[day], x.[name] which returns, me: day name count ----------- ---- ----------- 1 2 2 2 using min(x.[name]) has no effect, since grouping happened. i can't add order by before group by , illegal; , adding order by after group by defines output order after grouping - still gives a , a . so: there sane way of doing capitalization @ least consistent groupings? (i'll leave day problem of being consistent separate runs) desired output, either: day nam

ios - How to pay for something using my phone/sim credit? -

i developing iphone application( swift 2.0 ) targets metro bus system. person pay ticket using 2 ways: bank account phone credit i.e phone credit of user deducted every time pays ticket using phone credit. now, not sure how achieve #2 . how can make user pay ticket using phone credit. i new here, sorry ambiguities in question. hope understand want ask. i need ideas , clear explanations achieve #2 . thanks in advance answers.

android - Quickblox 2.6.1 webrtc: missing org.webrtc.videocapturerandroid$nativeobserver -

i getting missing class error when trying load libjingle_peerconnection_so.so. using quickblox 2.6.1 video webrtc. have idea whats going on? ##---------------begin: proguard configuration gson ---------- # gson uses generic type information stored in class file when working fields. proguard # removes such information default, configure keep of it. -keepattributes signature # using gson @expose annotation -keepattributes *annotation* # gson specific classes -keep class sun.misc.unsafe { *; } #-keep class com.google.gson.stream.** { *; } # application classes serialized/deserialized on gson -keep class com.quickblox.core.account.model.** { *; } ##---------------end: proguard configuration gson ---------- ##---------------begin: proguard configuration quickblox ---------- #quickblox core module -keep class com.quickblox.auth.parsers.** { *; } -keep class com.quickblox.auth.model.** { *; } -keep class com.quickblox.core.parser.** { *; } -keep class com.quickblox

php - Print query in while loop, print some fields once, print some field many times -

i wonder how should if wanna print $sta , $stb once, print $test aslong find them in database, $sta , $stb unique key, there many $test in every sta , stb <?php //establish connection database $host = "*****"; $conn = *******; $query = " select * p100f left outer join ***** test **** p100sta = 1 , p100stb = 1 //execute query $queryexe = db2_exec($conn, $query) ; //fetch results while(db2_fetch_row($queryexe)) { $sta = db2_result($queryexe, 'p100sta'); $stb = db2_result($queryexe, 'p100stb'); $test = ****test****** print("<div class='text-center'> <h2>$sta , $stb</h2> <---------- 1 want print once $test <------------------- 1 want repeat aslong find them in database </div>"); now when have both in while loop printing this. $sta $stb $test $sta $stb $test $sta $stb $test $sta $stb

mysql - How to escape single-quote (apostrophe) in string using php -

Image
i have sql query this:- $stmt = $pdo->prepare( "select * `products_keywords` `product_type` = '" . $product_type . "' "); i don't know value in $product_type variable. now, getting men's shirt in $product_type variable causing syntax error in sql query. sure error due single quote in men's shirt value. how escape value according query? , how check if there single quote in $product_type variable , escape according query. in advance. the answer don't need to. proper way use pdo's prepare this: $stmt = $pdo->prepare( "select * `products_keywords` `product_type` = ?"); this whole point of using prepared statement. bind parameter follows: $stmt->bindparam(1, $product_type) proof, schema: create table `products_keywords` ( `id` int not null, `products_keywords` varchar(1000) not null, `product_type` varchar(100) not null ); insert `products_keywords` (`id`,`products_keyword

java - Camel: xsl transformation doesn't indent xml -

i have started use camel spring boot , xsl new project. have following example: students.xml <?xml version="1.0" encoding="utf-8"?> <class> <student rollno="393"> <firstname>dinkar</firstname> <lastname>kad</lastname> <nickname>dinkar</nickname> <marks>85</marks> </student> <student rollno="493"> <firstname>vaneet</firstname> <lastname>gupta</lastname> <nickname>vinni</nickname> <marks>95</marks> </student> <student rollno="593"> <firstname>jasvir</firstname> <lastname>singh</lastname> <nickname>jazz</nickname> <marks>90</marks> </student> </class> which transformed following xsl(ignore comments;new xsl): students.xsl <?xml version="

All pictures aren't displayed in Prestashop 1.5.3.1 -

can please me? pictures in prestashop 1.5.3.1 not displayed , don't know why. when click on picture vie chrome console , want open picture in new window - go 404 error page. i have these source code pictures in htaccess # images rewritecond %{http_host} ^eshop.sofiaqua.cz$ rewriterule ^([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$1$2$3.jpg [l] rewritecond %{http_host} ^eshop.sofiaqua.cz$ rewriterule ^([0-9])([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$2/$1$2$3$4.jpg [l] rewritecond %{http_host} ^eshop.sofiaqua.cz$ rewriterule ^([0-9])([0-9])([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$2/$3/$1$2$3$4$5.jpg [l] rewritecond %{http_host} ^eshop.sofiaqua.cz$ rewriterule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-za-z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{env:rewritebase}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [l] rewritecond %{http_host} ^eshop.sofiaqua.cz$ rewriterule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-z

sql server - MSSQL started working very slow without any reason -

maybe after updates in windows 10 , mssql server started work slow not turning on, on windows start, think maybe windows defender delay/issue after turning off windows defender nothing changes. does have same issue, when mssql starting work bad no reason. running windows 10 64bit, visual studio 2015, , pc started work slow, startup, logon. system configuration os name microsoft windows 10 pro version 10.0.14393 build 14393 other os description not available os manufacturer microsoft corporation system name desktop-buc72j8 system manufacturer acer system model travelmate 5760g system type x64-based pc system sku huronriver_crb processor intel(r) core(tm) i5-2450m cpu @ 2.50ghz, 2501 mhz, 2 core(s), 4 logical processor(s) bios version/date insyde v1.18, 10/17/2011 smbios version 2.7 embedded controller version 255.255 bios mode legacy baseboard manufacturer acer baseboard model not available baseboard name base board platform role mobile secure boot state

Make Jenkins run docker without sudo -

i run docker shell commands on jenkins like: docker ps is possible out using plugins? since jenkins isn't user , a service account how can add docker group ? following approach worked me run docker commands without plugins rather adding jenkins user docker group, allowed jenkins user run sudo commands out prompting password , created alias avoid sudo in dockerfile jenkins slave. had install docker client in container connects daemon running in host machine. ## allowing jenkins user run sudo commands run echo "jenkins all=(all) nopasswd: all" >> /etc/sudoers ## avoid typing sudo in command line run echo "alias docker='sudo docker '" >> /home/jenkins/.bashrc

perl - Compare two hash of arrays -

i have 2 arrays , hash holds these arrays array 1: $group = "west" @{ $my_big_hash{$group} } = (1534,2341,2322,3345,689,3333,4444,5533,3334,5666,6676,3435); array 2 : $element = "location" ; $group = "west" ; @{ $my_tiny_hash{$element}{$group} } = (153,333,667,343); now want compare @{ $my_tiny_hash{$element}{$group} } with @{ $my_big_hash{$group} } and check whether elements of tiny hash array part of big_hash array . can see tiny hash has 3 digit elements , these elements matching big hash if compare first 3 digits if first 3 digits/letters match , available in big array, matching or have print unmatched elements its array array comparison. how achieve it. ps : without array utils , how achieve it the solution using array utils simple my @minus = array_minus( @{ $my_tiny_hash{$element}{$group} } , @{ $my_big_hash{$group} } ); but compares digits , want match first 3 digits hope clear tha

oracle - Web API OData custom query issue -

i new web api, entity framework , odata. asked similar question in forum haven't gotten relevant response. we have odata compliant web api service use in salesforce. have custom complex query in oracle need expose. i not sure how use custom query want allow odata parameter filtering occur? ($filter, $top, $skip, etc) example, when $filter used want apply filter custom query , send database have return result set. how can this? the issue seem have can see parameters come in not translating query being passed oracle. seems fire query returning full result set , apply parameters. slow result set large. i hoping 2 figure out 2 things 1. how can use custom sql , apply odata parameters underlying query? 2. when using ef or custom query, how can apply odata parameters query when query sent database $filter parameter, example, included in query? don't want full result returned apply filter. can give me pointers on how make happen? private static odatavalidatio

database - How do I install caching module in my php website -

i'm relatively new php (just starting away one-click install thing in wordpress).. fact wordpress has wasted of time in learning basic programming level languages php, js etc.. probably, i'd have learnt custom program myself lot (by now) if never introduced wordpress or other cms.. yes, wordpress/cms starters can become developers think that's bad start wanting developers in future. it's indirect way of learning code, guess. ignore above phrases, wordpress guys :). now, real i'm seeking stackoverflow community - want install php fast cache in custom built php website.. of hiring developers , myself, i'm able build basic community website has chat system enabled can generate lots of database queries, found phpfastcache promises bring down thousands of db queries 1 single query has potential of decreasing page loads substantially.. i've downloaded file github , uploaded file server root directory. now there not of documentations in website, i'm n

loops - PHP: Wrap every 3 in array then place remaining -

i have loop of posts splits list item after every 4 posts. however, not want list item have less 3 , no more 4. here loop: echo '<li class="match">'; while ( $player_query->have_posts() ) { $player_query->the_post(); $i3++; $i5++; echo '<span class="team team-' . ( $i5 - 1 ) . '"><span class="team-name">' . get_the_title() . '</span>'; echo $select . '</span>'; if ( $i4 === 2 && $count == $i5 && checknum( $count ) === true && needbye( $count ) === true ) { echo '</li><li class="match bye">'; } elseif ( 0 == $i3%$i4 && $count != ( $i5 - 1 ) ) { echo '</li><li class="match">'; } else { echo ''; } } echo '</li>'; example of have 10 posts: <li> post 1 post 2 post 3 post 4 </li> <li> p

sql - MSSQL query to combine information in a new table -

my table: servername: | factname: | factvalue: server01 | cpucores | 2 server01 | memory | 64gb server01 | hdd01size | 50gb server01 | hdd02size | 60gb server01 | hdd03size | 70gb server02 | cpucores | 4 server02 | memory | 32gb server02 | hdd01size | 50gb server02 | hdd02size | 60gb server02 | os | windows 2012 r2 what try create mssql query new table following output: servername:|cpucores:|memory:|hdd01size:|hdd02size:|hdd03size:|os: server01 |2 |64gb |50gb |60gb |70gb | - server02 |4 |32gb |50gb |60gb | - |windows 2012 r2 the columns need dynamically created during fetching of data. column names are: select distinct [factname] [table] ...with addition of column "servername". i can't figure out best way accomplish this. this referred table pivoting. here's 1 option using conditional aggregation : select servername, max(case w

angularjs - Exception when exposing $window.print on angular scope -

i'm exposing $window.print() on scope so: $scope.print = $window.print; however, results in exception: angular.js:13642 exception message: illegal invocation i need call print thru separate function, make work: $scope.print = printfn; function printfn() { $window.print(); } any ideas why can't use first alternative? running angular 1.5.5 it safe assume every object method depends on this unless proven otherwise, method should bound context before assigned object's method. window.print native method, in chrome throws illegal invocation instead of complaining on inappropriate this context. instead of wrapper function, may be $scope.print = $window.print.bind($window); or $scope.print = angular.bind($window, $window.print);

jsf - Initialize autocomplete with text on primefaces -

when run form need initialize autocomplete text , code not working me. error point? the code autocomplete primefaces. <h:outputlabel for="chamadodescricao" value="chamado" /> <p:autocomplete id="chamadodescricao" value="#{ordemservicoservicosbean.chamado}" completemethod="#{agendamentobean.autocompletechamado}" converter="entityconverter" var="auto" itemlabel="#{auto.chamado} - #{auto.tituloproblema.trim()}" itemvalue="#{auto}" size="50" label="chamado"> <h:outputtext value="#{auto.agendamentobean.selected.chamado.chamado} #{auto.agendamentobean.selected.chamado.tituloproblema}"/> </p:autocomplete> <h:outputlabel value="chamado"/>

eclipse - Free and Legal SAP ERP and ABAP IDE for SAP ERP on local computer -

i real newbie when comes trying learn sap erp abap programming. i student computer programming background. i've never registered sap course( since there quite expensive :), , don't plan in future. therefore, don't have s-user account sap. however, have signed account on sap community ( http://scn.sap.com/docs/doc-45882 ) i know there books out there people want learn abap programming. however, want install free version of sap erp on local computer can practice abap programming. here information local computer: intel(r) core(tm) i5-62000u cpu @2.30ghz installed memory (ram): 16.0 gb system type: 64-bit operating system windows 10 home here information software development environment: -eclipse java ee ide web developers.(version: neon release (4.6.0)) (build id: 20160613-1800) -java se dev kit 8u102 -jre 1.8.0_102 -trial version sap hana cloud platform cockpit 1) please tell me can free & legal version of sap erp can use learning purpos

c - What precautions should I take to make a memory pool that does not invoke undefined behavior? -

my initial problem have, on project, several objects share lifetime (i.e., once free 1 of them, i'll free them all), wanted allocate single block of memory. have arrays of 3 different object types, struct foo , void * , , char . @ first wanted malloc() block this: // +---------------+---------+-----------+---------+---------+ // | struct foo[n] | padding | void *[m] | padding | char[o] | // +---------------+---------+-----------+---------+---------+ but then... how accomplish without invoking undefined behavior? i.e., respecting type aliasing rules, aligment... how calculate memory block size, declare memory block (with effective type), , how pointers 3 sections within portably? (i understand malloc() 3 blocks, result in 3 free() , i'd know how single block while still well-behaved.) i'd extend problem more general question: precautions should 1 take implement memory pool objects arbitrary sizes , alignment while keeping program well-behaved? ( assuming possi

javascript - Vuzix M100 and Webrtc Error: connect failed: EHOSTUNREACH (No route to host) -

here szenario want reach: i want develop 2 way remote video conference vuzix m100 (android api 15) , google chrome browser / alternatively firefox. in order reach connection i'm using webrtc , node.js server websockets enable lookup of 2 clients. the problem i'm facing if connect 2 chrome browser clients in detail android device (sony xperia z 3 compact) , deskop pc works perfect. if try connect vuzix on browser i'm getting error there no route host. node.js server: var fs = require('fs'); var https = require('https'); var privatekey = fs.readfilesync('server.key', 'utf8'); var certificate = fs.readfilesync('server.crt', 'utf8'); var credentials = {key: privatekey, cert: certificate}; var express = require('express'); var app = express(); //require our websocket library var websocketserver = require('ws').server; var httpsserver = https.createserver(credentials, app); httpsserver.listen(909

php - Notice: unserialize(): Error at offset | data trimmed in MySQL -

i'm working symfony 2, have entity contains array, in mysql database array column generated longtext utf8_unicode_ci column comment dc2type:array . when querying database entity error : notice: unserialize(): error @ offset 894 of 902 bytes 500 internal server error - contexterrorexception i searched same error on so, found problem comes column in database, appears array wasn't entirely stored , trimmed although longtext type of columns can store 4 gigabytes of data. is there way prevent array being trimmed ? , thanx advance. thanx tried found problem's origin, had within array random generated token : $commande['token'] = random_bytes(10); when tried var_dump on it, weird random string special caracters searched symfony2 docs , found : the random_bytes() function returns binary string may contain \0 character. can cause trouble in several common scenarios, such storing value in database or including part of url. solution e

Scala Implicits compilation error -

i wrote code case class foo(x: int) case class bar(y: int) object foo { implicit def tobar(f: foo) : bar = { bar(f.x) } implicit def tobarlist(fl: list[foo]) : list[bar] = {fl.map{x: bar => x}} the tobarlist function doesn't compile. <console>:17: error: type mismatch; found : bar => bar required: foo => ? implicit def tobarlist(fl : list[foo]) : list[bar] = { fl.map{x : bar => x}} however shouldn't implicits system kick in here? meaning compiler should detect there error function expects bar passing foo. there implicit function in scope converts foo bar, should used , things should work. so why did not compile? map ordinary method takes function argument, , map on list[foo] requires function foo . you've provided function bar —specifically bar => bar —but having implicit conversion foo bar doesn't mean have 1 bar => bar foo => bar (which method needs). if want work you'll either need prov

c# - RTB now showing everyhting -

Image
i have wpf richtextbox associated flowdocument. supposing number lines in flowdocument 1..60 richtextbox not tall enough show numbers. but that's fine since can scroll through mouse wheel. problem procedure doesn't scroll enough can see in following picture: you may see here merely gets line 50 instead line 60. it's not problem of overlapping other elements. thank in advance help. patrick ---add--- here's xaml <grid name="grdreport_rtf" visibility="hidden"> <richtextbox x:name="rtbreport_rtf" margin="10" borderbrush="gray" background="white" foreground="black" isenabled="true" padding="10" style="{dynamicresource rtbstyledoclocal}" /> </grid> with <style x:key="rtbstyledoclocal" targettype="{x:type richtextbox}"> <style.resources> <style x:key="{x:type flowdo

python - Find the row indexes of several values in a numpy array -

i have array x: x = np.array([[4, 2], [9, 3], [8, 5], [3, 3], [5, 6]]) and wish find index of row of several values in array: searched_values = np.array([[4, 2], [3, 3], [5, 6]]) for example result like: [0,3,4] i have code doing this, think overly complicated: x = np.array([[4, 2], [9, 3], [8, 5], [3, 3], [5, 6]]) searched_values = np.array([[4, 2], [3, 3], [5, 6]]) result = [] s in searched_values: idx = np.argwhere([np.all((x-s)==0, axis=1)])[0][1] result.append(idx) print(result) i found this answer similar question works 1d arrays. is there way want in simpler way? approach #1 one approach use numpy broadcasting , - np.where((x==searched_values[:,none]).all(-1))[1] approach #2 a memory efficient appr

vba - Reference Outlook Account by email address -

i have found following vba, i'm using in excel vba, return each outlook account item , account number. sub which_account_number() dim outapp outlook.application dim long set outapp = createobject("outlook.application") = 1 outapp.session.accounts.count msgbox outapp.session.accounts.item(i) & " : account number " & next end sub i want select account number associated specific email address, instead of returning them 1 after another. you need set directly sub which_account_number() dim outapp outlook.application dim desiredaccount outlook.account set outapp = createobject("outlook.application") set desiredaccount = outapp.session.accounts.item("desiredemail@domain.com") msgbox desiredaccount.displayname set desiredaccount = nothing set outapp = nothing end sub probably this , this may helpful later on.

sql - Convert String to Datetime Error -

Image
this question has answer here: sql - conversion of varchar data type datetime data type resulted in out-of-range value 15 answers i writing query poll 1 of our devices , report status our solarwinds server. semi-advanced sql query, results come out correct error message: msg 242, level 16, state 3, line 1 conversion of nvarchar data type datetime data type resulted in out-of-range value. i new sql i'm not sure resolve. code block below: select tbl2.load [source], tbl3.destination [destination], tbl1.status [status], tbl4.status [timestamp], convert(datetime, substring (tbl4.status,5,3) + ' ' + substring(tbl4.status,9,2) + ' , ' + substring(tbl4.status,25,4) + ' ' + substring(tbl4.status,11,6)) date, datediff(hour,convert(datetime, substring (tbl4.status,5,3) + ' ' + substring(tbl4.status,9,2) + ' , ' + substring(tb

virtualbox - I can't open Virtual Box on windows 10 after the Microsoft update on 9/21/2016 -

i can't open virtual box on windows 10 after microsoft automatic update on 9/21/2016. i error vagrant up: bringing machine 'default' 'virtualbox' provider... ==> default: checking if box 'scotch/box' date... ==> default: clearing set forwarded ports... ==> default: clearing set network interfaces... ==> default: preparing network interfaces based on configuration... default: adapter 1: nat default: adapter 2: hostonly ==> default: forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: booting vm... ==> default: waiting machine boot. may take few minutes... guest machine entered invalid state while waiting boot. valid states 'starting, running'. machine in 'aborted' state. please verify configured , try again. if provider you're using has gui comes it, helpful open , watch machine, since gui has more helpful error messages vagrant can retrieve. example, if you're usi

Why does std::vector::front has two definitions? (C++) -

this question has answer here: meaning of “const” last in c++ method declaration? 7 answers i'm c++ newbie. tell me why std::vector::front has 2 definitions, how different, , how each of them called? the function seems have 2 definitions, reference front(); const_reference front() const; i noticed these 2 definitions, when looked function on web. following 2 web sites seem same 2 definitions. http://www.cplusplus.com/reference/vector/vector/front/ http://en.cppreference.com/w/cpp/container/vector/front the const version used const this pointer due overload resolution . not sensible if non- const object returned, since hack round const ness. the non- const version used non- const this pointer. object can modify. we call const correctness .

How to run multiple bash scripts from python master script in parallel? -

i have series of time consuming independent bash scripts run in parallel on 7 cpu cores python master script. tried implement using multiprocessing.pool.map() function iterating on numbers xrange(1, 300) sequence, every number used define name of directory containing bash script executed. issue following script spawns 7 processes bash script runs , finishes right after completed. import multiprocessing import os a= os.getcwd() #gets current path def run(x): b = + '/' + 'dir%r' % (x) # appends name of targeted folder path os.chdir(b) #switches targeted directory os.system('chmod +x run.sh') os.system('./run.sh') # runs time consuming script if __name__ == "__main__": procs = 7 p = multiprocessing.pool(procs) p.map(run, xrange(1, 300)) print "====done====" i expect other 292 shell scripts run well, fix or alternative implementation me? thank you!

c# - Task.Parallel updating UI. Why So? -

Image
i able update ui code 1 not 2. code 1 parallel.foreach(names, name => { lbltext.text += "\n" + name + " thread " + thread.currentthread.managedthreadid; }); code 2 task.factory.startnew(() => { parallel.foreach(names, name => { lbltext.text += "\n" + name + " thread " + thread.currentthread.managedthreadid; }); }); i know code 2 won't update ui because secondary thread. why code 1 updating ui? don't parallel foreach run different threads? if yes why updating ui? output of code 1 both code segments work... really. the problem first code block runs while blocks ui thread. second code block starts task , continues. the problem isn't in use of multiple threads, since both examples use multiple threads change value of label. problem in state of form. i assume run code in form constructor. in f

jobs - Backburner rake task - NameError: undefined local variable or method -

i'm starting backburner run jobs in background of app. i've tried following documentation under "working jobs", i'm doing obvious , incorrect. gemfile: gem 'backburner' rakefile: require_relative 'config/application' require 'backburner/tasks' rails.application.load_tasks and in rails console: rake backburner:work (which think run pending, enqueued backburner jobs.) but error: nameerror: undefined local variable or method 'work' main:object (pry):1:in '__pry__' i sorta know pry (i use throw binding.pry code debug, that's it), have no idea how might causing this. not mention i'm still pretty weak on whole jobs , rake task front in general. any appreciated! apparently i'm in business of asking dumb questions, lately. passing variable backburner.enqueue id, expected numerical, so: @admin.id . have been fine if @admin defined in scope of helper i'm calling enqueue in, i'm

iphone - WL.nativepage.show crashes in ios 10 -

i working on mfp hybrid project pages displayed in native pages. display content in native page, handling via wl.nativepage.show. wl.nativepage.show("pdfviewcontroller", backfromnativepage, params); it works fine upto ios 8,9. crashes ios 10 , getting following error. [pdfviewcontroller parentviewcontroller]: unrecognized selector sent instance note: not using method of "parentviewcontroller" in native side.and not calling native methods also. please suggest how resolve this? my suggestion should first upgrade 6.3 build dated july 2015, latest 6.3 build dated september 2016... more year apart. can download ifix ibm fix central. once you've upgraded build, try again see if wl.nativepage fails or not. if fails still suggest you'll open pmr , supply test project can debugged.

Return value based on event in python -

i need value calculated calculate function being called once event being fired on_release function. value outside class. class annotate(object): def __init__(self,diff): self.differnce = diff self.x0 = none self.y0 = none self.x1 = none self.y1 = none self.ax = plt.gca() self.ax.figure.canvas.mpl_connect('button_press_event', self.on_press) self.ax.figure.canvas.mpl_connect('button_release_event', self.on_release) def on_press(self, event): print 'press' self.x0 = event.xdata self.y0 = event.ydata # return x0,y0 def on_release(self, event): print 'release' x1 = event.xdata y1 = event.ydata self.calculate(int(self.x0), int(self.y0), int(x1), int(y1)) def calculate(self, a, b, c, d): print a, b, c, d print self.differnce sum = 0 count = 0 in range(a, c):

amazon web services - How to handle users data in an aws-based serverless stack -

i'm first-timer aws , i'm bit lost. have serverless stack using cognito handle authentication, dynamodb, lambda , cloudfront exposing rest services. i don't know how handle users data. example, store user email , physical address. i've seen can have directly in cognito, however, perform custom validation when these attributes set/updated. can trigger, letting user have write access on data? or should restrain write access these attributes , expose rest service update them manually in lambda? i've seen using users table in dynamodb store data, advantage compared using directly identity pool? thanks, you can store kind of data(email, address) in cognito user pools , validate data using presignup lambda trigger, more details .

Minecraft Modding: Make entity teleport up when hit by a certain item -

i learning create minecraft mods. know how make entity teleport upwards when hit item. have made item. override either item#onleftclickentity(itemstack, entityplayer, entity) or item#hitentity(itemstack, entitylivingbase, entitylivingbase) . in method set target's y position whatever want.

can't post form data as json using jquery 3 to jersey -

Image
i need understand why $.ajax not sending post instead jersey? i have seen many posts in stackoverflow , other websites/forums no success. this client code: $('#formlookupuser').submit( function (event) { var userfilter = { "email" : $('#inputemail').val(), "firstname" :$('#inputfirstname').val(), "lastname" : $('#inputlastname').val(), "type" : $('#inputtype').val() }; $.ajax( { method: "post", url: "http://localhost:8080/newjersey/rest/user/filter", data: json.stringify(userfilter), contenttype: "application/json" } ) .done( function(response){ showresults(response); }) .fail( function(jqxhr, textstatus){ alert(textstatus); }); }); and server code: @post @path("/add") @c

ruby - Check version of Python from Chef CookBook and install package according to the outcome -

i need write chef cookbook install packages according version of python installed in system. is possible have following logic in chef recipe: python_version = `python -v` # check python version if python_version == '2.6.6' package 'package_a' # install package_a using chef package resource elsif python_version == '3.3.5' package 'package_b' # install package_b using chef package resource else break # stop execution of cookbook end thank in advance! short answer yes. you should use shell_out!('python -v').stdout().chomp() instead of backticks. but information exist in node automatic attributes don't have call python -v : ohai languages return: { "python": { "version": "2.7.3", "builddate": "jun 22 2015, 19:33:41" }, "perl": { "version": "5.14.2", "archname&q

mysql - Insert column in existing table -

Image
i'm wondering if there way user on site insert columns in table. my situation is: admin define table structure each year. admin users insert data table. e.g. on site this: @ later stage, admin add additional column table, keep data intact. table this: how can accommodate feature? thinking of creating model lot of hidden fields admin later "unhide" , name, i'm not sure best practice :). any ideas solve appreciated! (i'm coding in ruby on rails don't think language relevant in case) oxp1845 i not recommend inserting columns rather use vertical attributes table. e.g. admin_tables | id | year or other descriptor want | 1 2015 2 2016 admin_table_columns | id | admin_table_id | named_column | 1 1 name 2 1 description 3 1 info1 4 1 info2 5 2 name 6 2 description 7 2 i