Posts

Showing posts from August, 2014

wordpress - how to create an interactive graph in a simple way? -

hi know wordpress plugin or tool allows me re-create in simple way interactive graph this: https://www.justpark.com/creative/sharing-economy-index/ ? thanks much. simple ? yea ! your answer data browser automatic chart creator based on existing data on sit 3 click https://wordpress.org/plugins/data-browser/stats/ enter image description here

android - Set last position when scroll load more recycleview -

i trying implement load more recycleview it's working fine when scroll recycleview @ time first item top of view, want next scrollable item @ top, how can solve problem, please me mainactivity.java public class mainactivity extends appcompatactivity { private int page_no = 0; private recyclerview mrecyclerview; private arraylist<notificationbean> musers = new arraylist<>(); private useradapter museradapter; private notificationbean mnotificationbean; private int loadmorearraylistsize; public int arraylistsize; // private linearlayoutmanager mlayoutmanager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); musers = new arraylist<>(); mrecyclerview = (recyclerview) findviewbyid(r.id.recycleview); // mlayoutmanager = new linearlayoutmanager(this); // mrecyclerview.setlayoutmanager(mlay...

android - How to set custom date array in date picker dialog? -

i want set custom date array in date picker dialog. date array not in sequence date. how can set custom array in date picker. please help. here example forget datepickerdialog, build custom dialog numberpicker widget , add code numberpicker picker = new numberpicker(this); picker.setminvalue(0); picker.setmaxvalue(2); picker.setdisplayedvalues( new string[] { "belgium", "france", "united kingdom" } ); just replace new string[] { "belgium", "france", "united kingdom" } arraylist. here link simple number picker.

c# - Delimit concatenated columns -

i have following issue. i receive sql stored procedure columns. after exporting them in xls format in interface, log of info sql table after concatenating it. in c# concatenate number of columns using string.format method: ex: string.format("{0}+{1}", "column1", "column2"); output: column1column2 i want able insert pipe or other character between columns. output shoul this: column1|column2 this string.join intended for. string.join documentation on msdn string[] columns = {"column1", "column2"}; string output = string.join("|", columns); //output contains : "column1|column2"

html - two divs side by side with ellipsis - issue with min-width -

i have 2 divs side side. both divs must remain on same line (not 1 under other), despite length of contents of each div. so used css text-overflow: ellipsis on both divs (cobbled different jsfiddle). work, except 1 small issue. how can add min-width 2nd div class : .container > div:last-child (this div yellow background)? i have tried add min-width: 150px; css class, kills text-overflow: ellipsis; effect. i have attached jsfiddle example of trying achieve. .container { display: -webkit-flex; } .container>div:first-child { white-space: nowrap; -webkit-order: 1; -webkit-flex: 1; background: aqua; -webkit-flex: 0 1 auto; /*important*/ text-overflow: ellipsis; overflow: hidden; width: auto; } .container > div:last-child { white-space: nowrap; -webkit-flex: 1; -webkit-order: 2; background: yellow; -webkit-flex: 1 0 auto; /*important*/ text-overflow: ellipsis; overflow: hidden; width: 150px; } ....

c# - Serialize field as attribute of an element -

i have [xmlroot("root")] class person { [xmlattribute("name")] public strig name {get;set;} } after serialization get: <root name="..."> </root> any simple way get <root> <general name="..."> </root> ? options me are: make other class, using ixmlserializable, etc it's posible have below ? // code not valid [xmlelement("general")] [xmlattribute("name")] public strig name {get;set;} to element inside need use xmlelement attribute. if create 'general' class containing xmlattribute("name") property. can add person class. [xmlroot("root")] class person { [xmlelement("general")] public general general {get; set;} } class general { [xmlattribute("name")] public strig name {get;set;} }

codenameone - AutoCompleteTextField completion strings display issue -

i've made form in gui builder has 5 auto complete text fields. made in same way completion arrays set before form shown, in same way. first 2 fields work expected. second 2 fields show completion options after of picker components used on form (they in same container), , last 1 never shows completion options (or showing them off screen?). this looks related codename 1 - autocomplete popup window location in turn refers 2 open bugs both of scheduled release cycle: https://github.com/codenameone/codenameone/issues/1687 https://github.com/codenameone/codenameone/issues/1697

php - How to remove array boundary quotes in jquery? -

i have ajax call respond comma separated values. want change value array. here example $.ajax ({ url: url, type: 'post', data: data, success: function(response) { console.log([response]); } }); in response 'alappuzha','beypur','cheruvannur','edakkara','edathala','kalamassery' like this i converting array [response] shows ["'alappuzha','beypur','cheruvannur','edakkara','edathala','kalamassery'"] like but don't want boundary quotes here php code foreach($citydata $keyrow): $citylist[]= "'".$keyrow['location_name']."'"; endforeach; $datacity = implode(",",$citylist); print($datacity); exit; thank in advance the correct solution fix in server side , return proper string array client. if not possible, can split string , pr...

passing signals from linux driver to user application -

my question regarding use of send_sig_info , sigaction functions in order pass signal driver user application signalling interrupt. code below: //in driver's interrupt handler function ret = send_sig_info(signal_number, &info, t); //in user application struct sigaction sig; sig.sa_sigaction = read_proc; sig.sa_flags = sa_siginfo; sigaction(signal_number, &sig, null); where read_proc handler function user application. trying modify code incase of multiple interrupts different signal number sent user application corresponding handler called below: //in driver handler 1 info.si_int =info.si_int+1; //set appropriate signal number info.si_signo = signal_number; ret = send_sig_info(signal_number, &info, t); //in drivers handler 2 info.si_int =info.si_int+1; //set appropriate signal number info.si_signo = signal_number2; ret = send_sig_info(signal_number2, &info, t); and on user application side struct sigaction sig; sig.sa_sigaction = read_proc;...

where is vagrant directory is located in mac? -

i installed vagrant on mac, when ssh cd vagrant i got : vagrant: not directory in windows easy, cd /vagrant works. thanks, in uninstall.tool found following paths: /opt/vagrant /usr/local/bin/vagrant generally can locate command with: whereis vagrant

ruby on rails - How can I add mutiple included blocks in a concern? -

everything illustrated follows: # below common lib definition. module somelib extend activesupport::concern included puts 'executing predefined block lib' end end # want expand lib through logic module somelib # errors: activesupport::concern::multipleincludedblocks included puts 'executing actions defined me' end end then how define included block when there has defined 1 in module?

android - How to use more than one fontpath in xml files? -

public void oncreate() { super.oncreate(); calligraphyconfig.initdefault(new calligraphyconfig.builder() //.setdefaultfontpath("fonts/helvlight-regular.ttf") .setdefaultfontpath("fonts/helveticaneue-light.otf") //.setdefaultfontpath("fonts/helveticaneue-medium.otf") //.setdefaultfontpath("fonts/helveticaneuebold.ttf") //.setdefaultfontpath("fonts/myriadpro-regular.otf") .setfontattrid(r.attr.fontpath) .build() ); } xml file: <edittext android:id="@+id/edittextpassword" fontpath="fonts/helveticaneue-light.otf" android:layout_width="fill_parent" android:layout_height="40dp" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margi...

sending multidimensional JSON data via PHP cURL -

i'm developing http client , choose php curl extension make http request. api needs multidimensional json parameter. $jsondata = json_encode($data); $ch = curl_init(); curl_setopt($ch, curlopt_url,$url); curl_setopt($ch, curlopt_post,1); curl_setopt($ch, curlopt_postfields, $jsondata); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_httpheader, array( 'content-type: application/json', 'content-length: ' . strlen($jsondata)) ); $response = curl_exec($ch); curl_close($ch); when use snippet single script file , try in php cli works in laravel not working. error "maximum execution time of 60 secods exceeded." when stackoverflow examples use single dimensional json objects, is there restriction in php curl settings json dimensions ? when search error mentioned above related "max_input_time = 60" when change 120 or higher error message didn't cha...

linker - Why does the compiler only generate object files .o only from .cpp files -

as title says : why compiler generate object files .o .cpp files not header files ? , how linker knows how link object files if implementation in .h files ? why compiler generate object files .o .cpp files not header files for concreteness, i'll assume compiler gcc's c++ compiler. the compiler compile header file object file, if make clear that's want. header.h #ifndef header_h #define header_h #include <iostream> inline void hw() { std::cout << "hello world" << std::endl; } #endif if do: $ g++ header.h then won't generate object file, because assumes .h extension don't want to. instead, generate precompiled header file , header.h.gch . this reasonable assumption because don't want compile header file directly object file. usually, don't want compile header file directly @ all, , if do, want pre-compiled header file. but if want header.h compiled header.o , can insist on this: $ g++ -c...

ruby on rails - Why Sidekiq 4 does not work with mailer correctly? -

Image
i'm writing project rails 4.2.5 , sidekiq 4.0.2 , sidekiq_mailer 0.0.8 . i'm developing feature send emails asynchronously. so, here mailer: class usermailer < actionmailer::base include sidekiq::mailer sidekiq_options queue: 'mailer', backtrace: true default from: '<mail_from>' def one_c_client_problems_email(message) @message = message email_subject = "subj" mail(to: '<mail_to>', subject: email_subject) end end sidekiq initializer: require 'sidekiq' require 'sidekiq/web' sidekiq::web.use(rack::auth::basic) |user, password| [user, password] == ['<login>', '<pass>'] end schedule_file = 'config/schedule.yml' if file.exists?(schedule_file) && sidekiq.server? sidekiq::cron::job.load_from_hash yaml.load_file(schedule_file) end sidekiq config file: --- :concurrency: 10 :pidfile: tmp/pids/sidekiq.pid :logfile: log/sidekiq....

java - Groovy script xml parser for multiple files -

hi groovy script strips out xml tag file , writes file. import org.apache.commons.lang.randomstringutils import groovy.util.xmlslurper inputfile = 'c:\\sample.xml' outputfile = 'c:\\ouput.txt' xmltag='details' filecontents = new file(inputfile).gettext('utf-8') def xmlfile=new xmlslurper().parsetext(filecontents) def mypayload= new string(xmlfile.'**'.find{node-> node.name() == xmltag} *.text().tostring()) file = new file(outputfile) w = file.newwriter() w << mypayload.substring(1, mypayload.length()-1) w.close() my question how write goes through entire directory , performs on multiple xml files , creates multiple output @ moment hard coded. ('c:\sample.xml' , 'c:\ouput.txt') thanks leon first, recommend take have , put single function; it's coding practrice , improves readabililty. now executing function on each xml file in directory, can use groovy's file.eachf...

php - CORS - API Authentication : Sessions (CSRF Security) - Work Around? -

i using cors method (rewriting external requests example.com/api?param=args example.com/api/public/api.php?param=args ) , sending request so: $.get('http://www.example.com/api'), { param: "args" }) .done(function (data) { alert(data); }); this works absolutely fine , can cross-domain reference requests , responses api software. i wondering, set test request try achieve session . session_start(); if(isset($_get['store'])): $_session['key'] = $_get['store']; elseif(isset($_get['show'])): echo $_session['key']; endif; when go link directly in browser, works fine however, when send request external domain, second request seems "forget" session key stored. code: $.get('http://www.example.com/api'), { store: "test" }) .done(function () { $.get('http://www.example.com/api'), { show: "args" }) .done(function (data) { ...

What causes an IBM Domino server to throw away compiled java code -

i've created couple of servlets in nsf. in future i'll use osgi plugin framework better. servlets work fine stop working until project rebuilt. log believe compiled java being deleted. coincide colleagues opening database in designer. know triggers cause domino server or designer delete compiled java contained within nsf? check whether other developers have build automatically switched on. if do, rebuilding .class files java files. other thing check whether "refresh entire application when design changes" ticked in xsp.properties (xsp.application.forcefullrefresh). it. i tend keep build automatically switched off kind of reason. i've seen beans disappear because else did build on java files. it not typically problem in eclipse environment, don't think, because don't tend touching live code in eclipse. nsf can live code.

github - Git Hub pages page build failure related to not properly initialized submodule -

upon pushing update gh-pages remote branch, received email github, “page build failure”. the submodule ‘mygithubuser.github.io’ not initialized ‘.gitmodules’ file. providing link, https://help.github.com/articles/page-build-failed-missing-submodule/ following instruction in link tried, git submodule init which returned, no submodule mapping found in .gitmodules path ‘mygithubuser.github.io' during research, found, https://support.deployhq.com/articles/common-deployment-errors/no-submodule-mapping-found which explains, this occurs when repository using submodule has had no mapping reference source repository created it. mapping needs entered .gitmodules file inside repository using. but @ point i’ve gone further down rabbit hole can keep track of. can explain going on here @ high level?

Spring doesn't find a bean for view -

i have controller maps path / file index.html . i getting error doesn't show in log, when debug logging turned on shows: no matching bean found view name 'index' this trivial error couldn't find on it. found questions no matching bean of type ... found dependency ... don't think same one. ps. may unrelated if write code this: @requestmapping("/") public string index(model model) { model.addattribute("title", "my custom title"); return "index"; } i don't see change in title.

php - Laravel: Install Microsoft Azure Client Library with composer -

does installed microsoft azure client library laravel 5 project composer on ubuntu server? when try install composer (command: composer require microsoft/windowsazure), got next error: using version ^0.4.1 microsoft/windowsazure ./composer.json has been updated > php artisan clear-compiled loading composer repositories package information updating dependencies (including require-dev) requirements not resolved installable set of packages. problem 1 - installation request microsoft/windowsazure ^0.4.1 -> satisfiable microsoft/windowsazure[v0.4.1]. - microsoft/windowsazure v0.4.1 requires pear-pear2.php.net/http_request2 * -> no matching package found. potential causes: - typo in package name - package not available in stable-enough version according minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> more details. read <https://getcomposer.org/doc/articles/troubleshooting.md> further common problems. installation fai...

pentaho - Retrieving only the word from the source via switch/case -

Image
with reference sample data in pdi c:\pdi-ce-5.2.0.0-209\data-integration\samples\transformations\switch-case - substring example.ktr output of .ktr such sends data across step matching string. if want forward string been mentioned , not entire line containing string. e.g case value mentioned in switch , target step mentioned in dummy step world,hello,others(for defaults) the output(in dummy step) shows occurrence of word specified,but here want word mention in case value. tried inserting space after word world , hello didn't worked.seeking same.

python - Is there a one line code to find maximal value in a matrix? -

to find maximal value in matrix of numbers, can code 5 lines solve problem: ans = matrix[0][0] x in range(len(matrix)): y in range(len(matrix[0])): ans = max(ans, matrix[x][y]) return ans is there 1 line solution problem? 1 came pretty awkward actually: return max(max(matrix, key=max)) or return max(map(max, matrix)) you can use generator expression find maximum in matrix. way can avoid building full list of matrix elements in memory. maximum = max(max(row) row in matrix) instead of list comprehension given in previous answer here maximum = max([max(row) row in matrix]) this pep (the rationale section): ...many of use cases not need have full list created in memory. instead, they need iterate on elements 1 @ time. ... generator expressions useful functions sum(), min(), , max() reduce iterable input single value ... the utility of generator expressions enhanced when combined reduction functions sum(), min(), ...

mysql - Php - Display image from Database using path (PDO) -

i tried display image database, image in directory path in database require_once "connection.php"; class displaydataimageprofile { function showimageprofile(){ $connection = new connection(); $conn = $connection->getconnection(); $id = $_get['id']; try{ $sqldisplay = "select photo frofile id =$id"; $getimage = $conn->prepare($sqldisplay); $getimage->execute(); $getimage->fetchall(pdo::fetch_assoc); foreach($getimage $data){ header('content-type: image/jpg'); // echo "<img src='$data'>"; echo $data; } }catch (pdoexception $e){ echo "error : " + $e->getmessage(); } }} after call in html page : <img src="displaydataimageprofile .php?id=3" align="center" /> i got problem image cannot retrieve database using path. other case on webpage image broke...

What is the error in my python code -

you given integer nn on 1 line. next line contains nn space separated integers. create tuple of nn integers. let's call tt. compute hash(t) , print it. note: here, hash() 1 of functions in __builtins__ module. input format first line contains nn. next line contains nn space separated integers. output format print computed value. sample input 2 1 2 sample output 3713081631934410656 my code a=int(raw_input()) b=() i=0 in range (0,a): x=int(raw_input()) c = b + (x,) i=i+1 hash(b) error: invalid literal int() base 10: '1 2' there 3 errors can spot: first, for-loop not indented. second, should not adding 1 - for-loop automatically. thirds - , error thrown - raw_input reads entire line. if reading line '1 2', cannot convert int. to fix problem, suggest doing: line = tuple(map(int,raw_input().split(' '))) this takes raw input, splits list, makes list ints, turns list tuple. in fact, can scrap...

objective c - How to share image in Pinterest using latest iOS SDK -

i want share image in pinterest. have configured pinterest ios sdk without cocoapods. i have written code making me redirect pinterest app , getting authorisation. after didn't response. in previous version of ios sdk, have pass url of image. asking board id also. i don't know how board id , share image in pinterest since not getting response success block. this code using. [[pdkclient sharedinstance] authenticatewithpermissions:[nsarray arraywithobjects:pdkclientreadpublicpermissions, nil] withsuccess:^(pdkresponseobject *responseobject) { nslog(@"response object:%@",responseobject); } andfailure:^(nserror *error) { nslog(@"error:%@",error); }]; i trying past 1 week. please suggest me doing mistakes. thank you. i solved issue , thank people helped me. now, can share image in pinterest. have referred example app github link https://github.com/pinterest/ios-pdk share image in pinterest. here steps followed....

Gitlab CI: running the same set of tests on several machines -

Image
in high performance computing crucial have code tested against many different architectures/compilers: laptop supercomputer. assuming have n testing machines/ workers (each 1 running gitlab-ci-runner ); m tests , what shall correct layout of .gitlab-ci.yml ensure each of n machines runs tests? looks me adding more workers ends in round-robin assignment of jobs. thanks help. you use tags in .gitlab-ci.yml , on runners distribute tests mashines want. gitlab ci open use cases. assume don't use docker testing. to accomplish goal, following steps: install gitlab-ci-multi-runners on n mashines if runner ask tags, tag mashine specifc name e.g. "mashinewithmanycpuswhatever". please use gitlab-ci-multi-runner register command so. can alternatively change tags in gitlab on administration view after registration. type of runners should "shared" not "specific". when installed , tagged every runner on mashines, tag jobs...

c# - Whats best practice to access Model inside Command in MVVM pattern in UWP app -

lets have simple ui in mainpage.xaml <listview itemsources="{binding records}" itemtemplate="{staticresource recordtemplate}"> </listview> in app.xaml <datatemplate x:key="recordtemplate"> <textblock text="{binding title}"/> <button content="change title" command="{binding datacontext.changetitlecommand, relativesource={relativesource ancestortype=listview}}"/> </datatemplate> i want keep record class simple , clean possible, have 1 property title . in mainviewmodel.cs , in changetitlecommand want access record model of listviewitem click on button. i can cast sender object frameworkelement , access datacontext , cast record type , start making change. ugly , require viewmodel aware of view (frameworkelement), make viewmodel not reuseable in difference ui framework, want avoid approach. one possibility bind command in record class, not in mainviewmodel ...

How to achieve Android ScreenSaver via service or application -

after research, concluded there nth screen saver in androd. there similar live-wallpapers in launcher screen or lock screen. i attempted small wayout using service. in activity after inactive time started service. my service started twice after inactivity. i want service start once , whole on app.how that? here codes used. user inactive: servicehandler = new handler(); servicerunnable = new runnable() { @override public void run() { log.e("run times","myservice"); startservice(new intent(getbasecontext(), myservice.class)); servicehandler.removecallbacks(servicerunnable); } }; @override public void onuserinteraction() { super.onuserinteraction(); servicehandler.removecallbacks(servicerunnable); stopservice(new intent(getbasecontext(), myservice.class)); servicehandler.postdelayed(servicerunnable, 8000); } myservice: public class myservice extends service { @nullable @override publ...

c# - Use wget command to download multiple files at different locations -

Image
i want download multiple files www.google.com, yahoo.com , gmail.com @ 3 different locations using wget. how should go it? please me out.. i doing through c#: processstartinfo startinfo = new processstartinfo("cmd.exe"); process p = new process(); startinfo.redirectstandardinput = true; startinfo.useshellexecute = false; startinfo.redirectstandardoutput = true; startinfo.redirectstandarderror = true; p = process.start(startinfo); p.standardinput.writeline(@"wget --output-document=c:\1.xml xyz.com/a.xml"); p.standardinput.writeline(@"wget --output-document=c:\2.xml xyz.com/b.xml"); p.standardinput.writeline(@"wget --output-document=c:\3.xml xyz.com/c.xml"); p.standardinput.writeline(@"exit"); string output = p.standardoutput.readtoend(); string error = p.standarderror.readtoend(); p.waitforexit(); p.close(); ...

python - Stride with different height and width in Tensorflow -

i'm using tensorflow process 1d signals (shape being (?, 5000, 1, 12) ) , perform stride operations. however, when try tf.nn.conv2d(input_variable, w, strides=[1, stride, 1, 1], padding='same') , valueerror: /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/common_shapes.pyc in conv2d_shape(op) 207 if stride_r != stride_c: 208 # todo(shlens): add support this. --> 209 raise valueerror("current implementation supports equal length " 210 "strides in row , column dimensions.") 211 valueerror: current implementation supports equal length strides in row , column dimensions. is there known workaround limits of current implementation, allow me have horizontal stride only? we're working on supporting strides different lengths.

Launcher Activity Not getting called on marshmallow Android -

i have developed application 6 months target version 22. build.gradle android { compilesdkversion 22 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.sample.mobile.test" minsdkversion 17 targetsdkversion 22 versioncode 1 versionname "2.3" multidexenabled true } } so when trying run application on marshmallow changing compilesdkversion 23 targetsdkversion 23 it not calling launcher activity of application , strange thing is, not throwing error. not getting problem is, please me resolve issue, in advance.

python - Palindromic substrings -

given 2 strings a , b , each consisting of lower case alphabets, possible choose non empty strings s1 , s2 s1 substring of a, s2 substring of b such s1 + s2 palindromic string. here '+' denotes concatenation between strings. for example: case 1: a='abc' b='abc' solution 1 possible way of choosing s1 & s2 s1 = "ab", s2 = "a" such s1 + s2 i.e "aba" palindrome. case 2: a='a' b='b' solution:there no possible way choose s1 & s2 such s1 + s2 palindrome. note: if possible , print 'yes' else print 'no' algorithm finding palindromic substring between 2 strings ? it necessary (and sufficient) 2 strings have 1 letter in common. def test(a, b): return not set(a).isdisjoint(set(b))

tcpdump to capture socket data -

can use tcpdump capture socket data ?. since , @ listener end i'm freqyently getting additional info along send message. in between client , end listener , 1 edge server , 1 application server running, not sure @ point additional info being added. troubleshoot, tried use tcpdump capture socket data. couln't capture it. can please tell me, tcpdump not fit capture socket data?. if so, 1 correct 1 this. note: i'm using centos tcpdump can capture data base on port following: tcpdump tcp port 23 , host 210.27.48.1 -w temp.pcap if still can't capture data, can capture data interface ensure tcpdump working: tcpdump -i eth1 -w temp.pcap ps: if client , server on same machine, need capture lo interface.

Python: form a list based on the same values -

consider x = [10,10,20,20,20,30] how form list_x1 contains same values example: list_x1 = [10,10] , list_x2 =[20,20] , list_x3 =[30] ? with itertools.groupby >>> itertools import groupby >>> x = [10,10,20,20,20,30] >>> [list(g) k, g in groupby(x)] [[10, 10], [20, 20, 20], [30]]

php - Add attributes to XML tags in Yii 2 Response -

yii2. action (method) in controller: public function actionget() { yii::$app->response->format = response::format_xml; return [ 'items' => [ ['id' => 'data'], ['id' => 'body'], ], ]; } at output xml: <?xml version="1.0" encoding="utf-8"?> <response> <items> <item> <id>data</id> </item> <item> <id>body</id> </item> </items> </response> how can add attributes in xml tags? , remove response tag: <?xml version="1.0" encoding="utf-8"?> <items> <item update="true"> <id>data</id> </item> <item update="false" new="true"> <id>body</id> </item> </items> documentation n...

php - Number of bound variables does not match number of tokens with PDO -

i running through errors displayed in this post since 2 days . here response var_dump($_post) : array (size=5) 'select_old' => string '2' (length=1) 'patient_name' => string '' (length=0) 'app_date' => string '2016-03-07' (length=10) 'app_time' => string '11:11' (length=5) 'app_reason' => string 'a' (length=1) and here error got: exception 'pdoexception' message 'sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens' in c:\wamp\www\dentist\pages\add_appoint.php:35 stack trace: 0 c:\wamp\www\dentist\pages\add_appoint.php(35): pdostatement->execute() #1 {main} here php code: <?php //set error reporting on error_reporting(e_all); ini_set("display_errors", 1); //include connection file require_once('../include/global.php'); //json , php header header('content-type: appli...

xpath - Python code to click on anchor tag -

i writing python code automate web page. need click on play button play recording. not able through code. inspect element gives me - outer html of 'play' : <div class="play"> <a id="sm_1855464769" class="sm2_button" href="#"> </a> </div> inspect element gives me - xpath of 'play' : //*[@id="recording_1855464769"]/div/div/div[8] the python code wrote : element = webdriverwait(self.driver, 15).until(ec.presence_of_element_located(ec.find_element_by_xpath("//*[@id='recording_1855464769']/div/div/div[8]")) element.click() error message in terminal : element = webdriverwait(self.driver, 15).until(ec.presence_of_element_located(ec.find_element_by_xpath("//*[@id='recording_1855464769']/div/div/div[8]"))) attributeerror: 'module' object has no attribute 'find_element_by_xpath' i need click on anchor tag in order play audio. how can ...

javascript - List function in XPages -

i use same function in xpages via javascript. dim firstlist list double dim secondlist list double firstlist("any")= 0 firstlist("many")= 2 firstlist("work")= 23 any suggestion appreciated. regards cumhur ata use javascript object : initialize object with var firstlist = {any:0, many:2, work:23}; or var firstlist = {}; firstlist.any = 0; firstlist.many = 2; firstlist["work"] = 23; get entry value var anynumber = firstlist.any; var manynumber = firstlist["many"];

Drupal 7 Rules: after generating new content, unable to access a view related to this new data -

using rules modules, set rule "after saving new content of type x". so, adding new content of "x" should: based on nid, call view, returns json, fetch info work later. info need on view, not in node inserting, view need nid , other info node creating the problem if nid of new node, when call view returns empty result. seems data it's still not on drupal database, view results empty. tried add sleep(10) before calling view, giving time drupal, no success. the content published, , added 'save entity' action rule hope code here helps understand: dsm($node); //i can see al attributes node inserting $url="http://localhost/bopa/?q=export_cultivos/$node->nid"; dpm($url); //it gives me correct url, tested later directly on browser, works $data=file_get_contents($url); $data2 = json_decode($data,true); dsm($data2); //empty array i guess passing nid string not variable in url. $node->nid not getting substituted. use f...

Is 576 bytes the safe size for UDP payload to eliminate fragmentation? -

the safe size of datagram packet (considering mtu such packet not fragmented) said 576 bytes ipv4 , 1500 ipv6. is correct ? if having connection machine server in country, 2 of communicate using udp, maximum (safest) payload size should have udp packet, 1500 or 576 ? thank you no. that's safe size of total ip packet. 534.

angular - How to plugin a Component in a Component other -

i have component a, plugin index.html, , have template is: <div> content of </div> <component-will-plugin></component-will-plugin> <button (click)="pluginbtoa()">click me plugin b plugin </button> and code of function pluginbtoa: pluginbtoa(){ redirecttob; } how plugin b component in component when click button? thank read question. you use dynamiccomponentloader , loadintolocation method way: @component({ selector: 'my-app', template: ` parent <div #child></div> <div (click)="onclick()">add sub component</div> ` }) export class myapp { constructor(private dcl: dynamiccomponentloader, private elementref: elementref) { } onclick() { this.dcl.loadintolocation(childcomponent, this.elementref, 'child'); } }

java - Delay in view setvisibilty to complete -

Image
i trying create custom view , unlike button user. if swipe l-> r , reveals button , swiping r->l reveals unlike button. since clicking on top of view triggering click on buttons underneath, have make button invisible if not being shown. i using custom gesture detector detecting scroll , moves top view reveal buttons underneath. private handler setlikewrappervisibility = new handler(new handler.callback() { @override public boolean handlemessage(message msg) { // log.i(tag, "likewrapper: " + (msg.what == visible ? "visible" : "invisible")); likewrapper.setvisibility(msg.what); return true; } }); in custom gesture detector. @override public boolean onscroll(motionevent e1, motionevent e2, float distancex, float distancey) { move(distancex); if (isleftopen() > 0) { if (dislikewrapper.getvisibility() == visible) ...

Migration Non Autosar project to Autosar -

i working on project developing software component based on given application. concern software component, without bsw developing or ecu integration or else. what main aspect should worried about? well swc need know configuring rte (swc-swc or swc-bsw interaction), little knowledge on services modules (comm, com, os etc) apis required application.

polymer 1.0 - how to configure server host ip address and port in cordova app for ajax calls -

i trying convert 1 of web app hybrid mobile app using cordova. using polymer , web components. able render ui in ios device also. want know how configure ip address , port of server (my laptop in case) dynamicallly when building or depolying app. may cordova setting (like env variable or build argument) my html <html lang="en"> <head> <meta charset="utf-8"> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="styles/app-theme.html"> <link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html"> <link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html"> some ajax call. <iron-ajax id="...

ios - How to create a dictionary with 2 arrays inside? -

i want create dictionary next structure, sending via alamofire json server: { "user": { "firstname": "fname", "lastname": null, "img": null, "books": [ { "id": 1 }, { "id": 2 } ] }, "locale": "en", "gender": "male" } for structure of json, i've tried next: let parameters: [[string: [string: string]], [string: string]] but there lot closures, confused it. can me creating structure? the collection types in swift standard library support homogenous collections, i.e. elements in collection must have same type. cannot declare array first element of type [string: [string: string]] , second element of type [string: string] if wanted. this works: let parameters = [ "user": [ "firstname...

php - how to check if values inside array is present codeigniter -

hi how can check values of array if present? example have table ------------------ id | key | group | ------------------ 1 | abc | 1 | ------------------ 2 | def | 1 | ------------------ 3 | abc | 2 | ------------------ so can see value 2 doesnt have def key. if query select * thistable group = 2. it give array(id = > 1 key => abc group = 2) how check value of array instance if(this array have key abc){ execute code} if(this array have key def){ execute code} you need use in_array() required result like: basic example: <? $testarr = array('id' => 1, 'key' => 'abc', 'group' => 2); if(in_array('abc', $testarr)){ echo "success"; } else{ echo "failed"; } ?>

c# - How foreach loop works? -

this question has answer here: does “foreach” cause repeated linq execution? 7 answers imongocollection<jobinforecord> records = ... foreach (var record in records.find(query).tolistasync().result) {...} is true foreach iteration compute .result value again , again? no, it's going evaluate records.find(query).tolistasync().result once , call getenumerator on result. each loop going call movenext on returned "enumerator" , set record current property of "enumerator" loop breaking when movenext returns false .

testing - Is it bad practice to use the weak attribute to write test code in c? -

is practice use weak attribute in production code test code 1 can override functions? i don't know if good practice , there ways override functions in test code not interfere production code: using macros redefine function names wish override using ld_preload using macros expand __weak in debug mode , nothing in production mode.