Posts

Showing posts from July, 2010

css - Transition-delay not working in Chrome and Safari -

Image
edit i've got working now, i'm still not sure how did fixed it. if understands happening i'd love hear it. i'm making animated menu icon , it's working great...except middle bar's transition. it's supposed disappear using transition-delay after top , bottom bars come during first animation, , appear after top , bottom ones meet again second 1 (one third of way through in both instances). there no animation on middle bar, transition on background-color property. i've tried both shorthand transition , explicit transition-delay properties. both give exact same results. whole process works great in ie , firefox, fails in chrome , safari, makes me think it's possible webkit issue. i'm going post relevant code here (since there's 2 hundred lines whole thing). rest available @ codepen . if think should add more code let me know , add more. css: #menu label span.icon, #menu.lightbox label span.icon { height: 5em; widt

How do I share ansible variables across hosts using vars_prompt -

in ansible, code on remote machine, , want use result vars_prompt again on different host. i've searched around, , docs make sound should use {{ hostvars.local_server_name_in_vagrant_group.local_username }} , using example below set context. however, says index dictionary doesn't exist when referencing hostvars . instead, shown below, vars_prompt twice. gross! tips? btw, there's discussion on whether or not using vars_prompt great idea. have confirmed usage, indeed, want use vars_prompt. thanks! - hosts: vagrant vars_prompt: local_username: "enter desired local username" ... remote task activity using local_username... - hosts: localhost connection: local vars_prompt: local_username: "enter desired local username, again (please) ... host task activity, using local_username ... as said in comment question : you can use set_facts register variable fact of current host , access different one. not think standard

ruby - Real time data Rails- socket -

since rails 5 shipped action cable real time data transmission, i'm curious know more web sockets in ruby. i never worked socket in ruby know rails 4+ shipped actionlive real time data use case. but people using pusher-app real time data rails... could give brief idea actionlive vs pusher vs upcoming actioncable ? why pusher better actionlive? , how can take advantage that?

How to set encoding in IntelliJ javadoc generating? -

while generating javadocs within intellij getting multiple errors files: unmappable character encoding cp1251 file encodings utf-8 . found no places encoding control while javadoc generating. you can pass options javadoc tool intellij idea. adding -encoding utf8 -docencoding utf8 -charset utf8 in other command line arguments text field should fix problem. -encoding specifies encoding of source files. -docencoding encoding of output html files , -charset charset specified in html head section of output files.

sql - Avoid indexes for DML in a particular procedure (MySQL) -

i have 1 procedure multiple update statements(dmls). so there way avoid index particular table improve performance of update statements. you can use ignore index in dml inside procedure. otherwise, cannot particularly procedure. further syntax details on update usage docs

python - Change text color of QCheckBox in pyqt -

i want change color of text next qcheckbox . have tried these 2 questions: how change qcheckbox text label color in qt? changing qcheckbox text color none of solutions seem working me. p = qtgui.qpalette(self.chkbox[i].palette()) p.setcolor(qpalette.active,qpalette.windowtext, qtcore.qt.red) self.top_grid.addwidget(self.chkbox[i],i+2,0) edit 1: here minimal working code: from pyqt4 import qtgui, qtcore import sys def main(): app = qtgui.qapplication(sys.argv) w = qtgui.qwidget() top_grid = qtgui.qgridlayout() chkbox=[] chkbox.append(qtgui.qcheckbox('1')) chkbox[0].setstylesheet("color: red") chkbox[0].settooltip('<b>abc</b>' ) top_grid.addwidget(chkbox[0],0,0) w.setlayout(top_grid) w.show() sys.exit(app.exec_()) if __name__ == '__main__': main() when this, color of tooltip changes red, text next checkbox remains black. edit 2: if add line app.setstyle('cleanl

sql - how to find out days from another table -

declare @daystaken table( application varchar(20), statusid varchar(2), flag int, createddate datetime) insert @daystaken (createddate)values ('2015-03-06 17:59:59.410'), ('2015-03-02 17:59:59.410') select datediff(dd,min(createddate),getdate())d @daystaken declare @holiday table(holiday datetime) insert @holiday ( holiday )values ( '2014-04-06 17:59:59.410'), ( '2014-06-06 17:59:59.410'), ( '2015-05-05 17:59:59.410'), ( '2015-05-01 17:59:59.410'), ( '2013-01-06 17:59:59.410'), ( '2015-02-03 17:59:59.410'), ( '2011-02-01 17:59:59.410') i have got days count daystaken table need substract days holidays table.for example daystaken table have 122 days in days 3 days holidays till present date came holidays table.so need minus result , show 119 days will do: declare @mindate date select @mindate = min(createddate) @daystaken; select datediff(day, @mindate, getdate()) - count(*)

node.js - Stylesheet (CSS) is not loading in my Sails application -

i've placed style sheet style.css inside /assets/styles -folder , embedded via <link rel="stylesheet" href="style.css" type="text/css"> in something.ejs file. but stylesheet not loading. has idea? use following give correct location of style sheet: <link rel="stylesheet" href="../../assets/styles/style.css" type="text/css"> the first .. take views folder, next .. take parent folder employees , can give path stylesheet. this because path must relative current .ejs or other current file's location in directory.

ios - UIAlertController in tableViewCell - Swift -

i have button in each cell in tableviewcell . when button clicked, in cell coding page had action working already. decided let users confirm before action starts, added uialertcontroller inside action. alert controller works fine in uiviewcontroller , in uitableviewcell code below got error message: "does not have member named presentviewcontroller ". how can make work? code here. thanks @ibaction func followbtn_click(sender: anyobject) { if title == "following" { var refreshalert = uialertcontroller(title: "sure?", message: "do want unfollow person?", preferredstyle: uialertcontrollerstyle.alert) refreshalert.addaction(uialertaction(title: "yes", style: .default, handler: { (action: uialertaction!) in var query = pfquery(classname: "follow") query.wherekey("user", equalto: pfuser.currentuser()!.username!) query.wherekey("usertofol

tcp - Android How to Configure XMPP Conference - Chat room -

i developing 1 chat application , not work properly, giving different-differet error 406 or 407 , please advice me following code proper or not , first login when application start : public void loginwithuser() { thread t = new thread(new runnable() { @override public void run() { saslauthentication.unregistersaslmechanism("org.jivesoftware.smack.sasl.javax.sasldigestmd5mechanism"); smackinitialization initialization = new smackinitialization(); xmpptcpconnectionconfiguration.builder config = xmpptcpconnectionconfiguration.builder(); config.setsecuritymode(connectionconfiguration.securitymode.disabled); config.setservicename(constants.service); config.sethost(constants.host); config.setport(constants.port); config.setresource("myresource"); config.setdebuggerenabled(true); config.setkeys

XPages Dialog boxes stacking -

Image
i got problem, dialog boxes stacking each time click button opens dialog. if i've clicked 3 times this: i couldn't find out how prevent this. no matter button click (ok partial refresh | abbrechen (cancel) full update) box each time click button. code of button opens dialog: <xp:button value="plan meeting" id="buttonplanmeeting"> <xp:eventhandler event="onclick" submit="true" refreshmode="complete"> <xp:this.action><![cdata[#{javascript:try { var c = getcomponent("dplanmeeting") c.show(); } catch(e) { dbar.error(location + e); }}]]></xp:this.action> </xp:eventhandler> </xp:button> code complete dialog box: <xe:dialog id="dplanmeeting" title="plan meeting" keepcomponents="true"> <xp:panel> <xp:text escape="true" id="mbplanmeeting"> <xp:this.value&g

How to inherit views porperly in openerp 7.0 -

hi view inheritance code , following error while using code . " valueerror: many values unpack " please me resolve issue <record model="ir.ui.view" id="inherit_form_view1"> <field name="name">inherit form</field> <field name="model">student.info.student</field> <field name="type">form</field> <field name="inherit_id" ref="student.info.student.form_view1" /> <field name="arch" type="xml"> <!-- <xpath expr="/sheet/notebook/page/field[@name='mname']" position="after"> <field name="m_tongue" /> </xpath -->> <field name="mname" positon="after"> <field name="m_tongue" /> </field> </fiel

pointers - Can you explain why I get 2 different results passing the same structure in Objective-C? -

have been struggling hope people can me. suppose have defined following structure struct _sparticleeffect { enumparticletypes type; int count; glkvector3 initialpos; glkvector3 direction; float triggerradius; cgsize prtsize; float prtclspeedmax; float prtclspeedinitial; float prtcllifemax; glkvector4 color; }; typedef struct _sparticleeffect sparticleeffect; then make instance of structure , pass single function in 2 ways - pointer , value: - (void) initgeometry { sparticleeffect splasheffect; splasheffect.count = 15; [splashprt testfunc: &splasheffect : splasheffect]; } //test function 2 parameters - pointer , value //method of splashprt - (void) testfunc: (sparticleeffect*) attrpointer: (sparticleeffect) attr { nslog(@"1: %d", attrpointer->count); nslog(@"2: %d", attr.count); } and result get 2015-07-01 16:58:28.766 [1738:707] 1: 15 2015-07-01 16:58:28.770 [1738:707]

How to handle/catch error from database trigger, in YII2 -

this trigger create or replace trigger trg_cek_pengurus before insert on tbl_pengurus each row declare v_cek number(2); begin if :new.jabatan = 1 or :new.jabatan = 2 select count(id) v_cek tbl_pengurus idkoperasi = :new.idkoperasi , jabatan = :new.jabatan; if v_cek > 0 raise_application_error (-20000, 'kepengurusan sudah ada'); end if; end if; end; / nah.., if trigger have return value good,:v doesn't :v set raise_application_error and controller public function actiontambahpengurus() { $model = new pengurus(); if ($model->load(yii::$app->request->post())){ $model->idkoperasi = yii::$app->user->identity->id; if($model->save()) return $this->redirect('kepengurusan'); } return $this->render('tambah-pengurus',[ 'model' => $model, ]); } and error sqlstate[hy000]: general error: 20000 ocistmtexecute: ora-20

c# - Border like classic window with dropshadow in WPF -

Image
does know how border following window in wpf? believe borderless , has drop shadow effect around border. tried following code, doesn't seem work. <border x:name="myborder" background="{dynamicresource {x:static systemcolors.controlbrushkey}}" cornerradius="0"> <border.effect> <dropshadoweffect shadowdepth="2" opacity="1" direction="320" /> </border.effect>

Rest & Soap transactional capability -

in 1 interview, interviewer asked, transactional capability,out of soap , rest having transactional capabilities? could please explain me in simple way. thanks in advance, had come across these references when ran similar questions. hope helps. from http://spf13.com/post/soap-vs-rest ws-atomictransaction need acid transactions on service, you’re going need soap. while rest supports transactions, isn’t comprehensive , isn’t acid compliant. fortunately acid transactions never make sense on internet. rest limited http can’t provide two-phase commit across distributed transactional resources, soap can. internet apps don’t need level of transactional reliability, enterprise apps do. from https://msdn.microsoft.com/en-us/magazine/dd942839.aspx what transactions? here area in soap , ws-* have explicit support "advanced" feature , rest has none. ws-atomic transactions supports distributed, two-phase commit transactional seman

c++ - Unhandled exception at 0x000FBA44 in Top Down Shooter -

i posted question dealing linker errors... whatever reason errors went away , replaced this. when try run program, window opens , appears run, visual studio 2013 presents me error: unhandled exception @ 0x000fba44 in top down shooter.exe: 0xc0000005: access violation reading location 0xccccccd0. and takes me xutility file breakpoint here: #if _iterator_debug_level == 2 if (_myproxy != _parent_proxy) { // change parentage _lockit _lock(_lock_debug); _orphan_me(); _mynextiter = _parent_proxy->_myfirstiter; _parent_proxy->_myfirstiter = this; _myproxy = _parent_proxy; } the arrow on _mynextiter line. know happening? using iterators go through lists had, commented them out yet still error , i'm not sure why edit: ok, after going through stack of methods called, last piece of code called mine this: chunkmanager::chunkmanager(b2world *w){

mysql - Changed phpmyadmin password on mac using AMPPs and now Can not login into phpmyadmin -

i've changed password of localhost user of ampps stack , can not log phpmyadmin shows pink message : access denied... , have tried restoring default configuration have same problem. i've checked config.inc file , it's content : <?php /* servers configuration */ $i = 0; /* server: localhost [1] */ $i++; $cfg['servers'][$i]['verbose'] = ''; $cfg['servers'][$i]['host'] = '127.0.0.1'; $cfg['servers'][$i]['port'] = ''; $cfg['servers'][$i]['socket'] = ''; $cfg['servers'][$i]['connect_type'] = 'tcp'; $cfg['servers'][$i]['extension'] = 'mysqli'; $cfg['servers'][$i]['auth_type'] = 'config'; $cfg['servers'][$i]['user'] = 'root'; $cfg['servers'][$i]['password'] = file_get_contents('/applications/ampps/ampps/data/my.conf'); $cfg['servers'][$i]['hide

c# - Altering array while keeping a backup copy -

i have array 3 integers. want duplicate array , change first integer. magical reason, both arrays first integer adjusted. have no idea why happening , it's driving me crazy. int [] numbers1 = {1, 2, 3} int [] numbers2 = {3, 4, 5} numbers2 = numbers1; at point did system.console.writeline see both arrays {1, 2, 3}. far good. numbers1[0] = 4; when i'm doing system.console.writeline see both arrays {4, 2, 3}. want numbers2 stay same. currently passing reference. numbers in array stored in memory. when reference object in memory points object. not create new object in memory when referencing, need clone ints array points different object in memory. numbers2 = numbers1; you need clone arrays. numbers2 = (int[])numbers1.clone(); as others have noted can use .toarray() method. creates copy of items in array. numbers2 = numbers1.toarray();

c++ - Double-checking understanding of memory coalescing in CUDA -

suppose define arrays visible gpu: double* doublearr = createcudadouble(fieldlen); float* floatarr = createcudafloat(fieldlen); char* chararr = createcudachar(fieldlen); now, have following cuda thread: void thread(){ int o = getoffset(); // same threads in launch double d = doublearr[threadidx.x + o]; float f = floatarr[threadidx.x + o]; char c = chararr[threadidx.x + o]; } i'm not quite sure whether correctly interpret documentation, , critical design: will memory accesses double, float , char nicely coalesced? (guess: yes, fit sizeof(type) * blocksize.x / (transaction size) transactions, plus maybe 1 transaction @ upper , lower boundary.) yes, cases have shown, , assuming createcudaxxxxx translates kind of ordinary cudamalloc type operation, should nicely coalesce. if have ordinary 1d device arrays allocated via cudamalloc , in general should have coalescing behavior across threads if our load pattern includes array index of form: data_array[

PhoneGap/Cordova: How to add PHP support? -

i read indeed possible use php. question how add such support? there api's or plug-ins add php support? in short, want use phonegap alongside php develop apps. how? specifics i'll use linux server & hosting godaddy, park php. in addition, i'll use mysql database the app send database requests server. the server sending large amount of data app. what efficient "light weight" method "transfer data" , requests between app , server/hosting account? from http://phonegap.com/about/faq/ . last faq reads: q: can use php/asp/jsf/java/.net phonegap? a: phonegap application may use html, css, , javascript. however, can make use of network protocols (xmlhttprequest, web sockets, etc) communicate backend services written in language. allows phonegap app remotely access existing business processes while device connected internet. to little more clear, if want use php, on server, , server not run on mobile device (phone

php - Retrieve data from a certain column and i can change the image whenever the data is different -

is possible retrieve data column , have if else statement can change image? want pic tally location retrieve database. <?php $servername = "......byethost5.com"; $username = "...."; $password = "..."; $dbname = "b..."; // create connection $conn = new mysqli($servername, $username, $password, $dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select location,datetime sensordetails limit 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "last seen location: " . $row["location"]."<br>"; $help= $row["location"]; if($help=='toilet') {echo '<center><img src="toilet.jpg"></center>';} elseif($

boot2docker - Broadcasting UDP from within a Docker container -

i've started experimenting docker , have hit issue haven't been able resolve (please note, i'm using boot2docker). my container has simple service listens on 8080/tcp , 5000/udp . docker run -d -p 0.0.0.0:5000:5000/udp -p 0.0.0.0::8080 test/service from macos terminal, can telnet 192.168.59.103:8080 , issue simple commands, tcp working fine. next, try udp issuing following: echo "hello" | socat - udp-datagram:192.168.59.103:5000,broadcast via wireshark, can see datagram making service , service tries echo back, receives icmp response stating port invalid. so seems i'm pretty close having working test case, i'm not sure need configure allow broadcast mac terminal initiated call. any advice appreciated.

javascript - jQuery using arrow key scrolling during presentation -

i'm creating presentation using html project i'm working on. presentation full-page slides , want implement script jquery when arrow keys pressed, scrolls smoothly between slides. left being previous slide , right being next slide obviously. i wrote script works first time. i'm new jquery , can't seem fix it. <script type="text/javascript"> $(document).keydown(function(e){ if (e.keycode == 37) { $('.slide').prev().scrollto({ duration: 2000, easing: 'linear' }); } if (e.keycode == 39) { $('.slide').next().scrollto({ duration: 2000, easing: 'linear' }); } }); </script> see example: http://jsfiddle.net/kevalbhatt18/0tue685a/ $(document).keydown(function (e) { // console.log($('[class ^=slide]')) if (e.keycode == 37) { if ($('#container').find('.scroll').prev()[0]) { $("html, body").anim

android - How to restart activity with data of previous or next position of a ListView -

i'm building book reader app , having issues on how move next or previous chapter. the fragment in charge of showing list of chapter (basically listview). capture item onitemclick: listview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> adapterview, view view, int i, long l) { intent intent = new intent(getactivity().getapplicationcontext(),readeractivity.class); intent.putextra("name",adapter.getitem(i).getname()); intent.putextra("url",adapter.getitem(i).geturl()); startactivity(intent); } }); it start readeractivity , display content of book. readeractivity has 2 buttons moving next/previous chapter. how can data (the name , url ) listview? at moment i'm thinking of 2 methods: calling finish() on readeractivity , override ondestroy() method call method next/previous data in fragment holds listv

How to Search Table1 Column Value is present in Table2 Column or not in spotfire? -

Image
hi have 2 tables same column . first need take 1 column value table 1 need search value weather exists in same column of table 2. can know how in spotfire? one way attempt join , perform logic on join results. below how this: create calculated column in table2 named exists expression of true . go insert>columns , choose add columns table1 table2. match on primary key (in case column "letter") select exists checkboxes add , use join method of left single match in order preserve number of records , hit finish. now have column named exists in table1 either null or true. if have true or false can create calculated column based upon evaluates if it's null or not so: [exists] not null . named mine "exists_tf" in example below. my data , resulting columns after above: you should able filter , calculations based on new column(s).

html - Image Link Not Working -

in webpage have set image link/anchor using following code: <div class="bg_1"> <div class="absolute-center"> <span style="font-size: 50px; color: aqua">in short.</span><br /> live life @ own pace.<br /><br /><br /><br /><br /><br /><br /> <a href="#home1"><img src="images/scrolldown.png" width="50" height="50" border="0" /></a> </div> </div> <div style="height: 100vh; background-color: black;" > <a name="home1"></a> </div> however when run page image not appear clickable, nor take anywhere when click. ideas? if makes difference image using transparent. edit: have narrowed problem down being caused z-index. css code "bg__1" follows: .bg_1 { height: 100vh; position:

regex - Matching a sentence with grep -

i'm trying grep full sentence containing search term. i've tried grep (^.|\.\s).*searchterm.*(\.\s|\n) but it's not working , i'm not sure why. to clarify: want stdout print full sentence of search term. using grep search through single text file. as example, if file has " foo blah. blah blah searchterm blah blah. foo bar." i want stdout print blah blah searchterm blah blah because normal grep uses bre in have write capturing groups \(...\) , alternation operator \| . ( or ) or | alone match it's corresponding literal ( , ) , | chars. grep '\(^.\|\.\s\).*searchterm.*\(\.\s\|\n\)' or grep '\(^.\|\.[[:space:]]\).*searchterm.*\(\.[[:space:]]\|\n\)' or enable -e or -p parameter. grep -p '(^.|\.\s).*searchterm.*(\.\s|\n)'

javascript - String split with RegExp returns empty strings at either end -

// pattern -- <some name optional 1/2/3 @ end separated _> var re = new regexp("^\(.*\)_\([1-3]\)$") "".split(re) // returns [""] --- ok "abc_d_4".split(re) // returns ["abc_d_4"] --- ok "abc_d_3".split(re) // returns ["", "abc_d", "3", ""] --- whoa! hoped-for ["abc_d", "3"] // similarly, "_3".split(re), "abc_d_3_4_3".split(re) why empty strings @ either end in last case, , how avoid that? appreciate explanation. i can see similar questions have been asked before on not case (or pl point me there) moved comment (per request). try split on /_(?=[1-3]$)/

regex - Comparing gold standard csv file and extracted values csv files in Python -

this data mining task automating scoring of quality of extraction. there gold standard csv might consist of the fields like golden_standard.csv | id | description | amount | date | |----|-------------------------|---------|------------| | 1 | description. | $150.54 | 12/12/2012 | | 2 | other description. | $200 | 10/10/2015 | | 3 | other description. | $25 | 11/11/2014 | | 4 | description | $11.35 | 01/01/2015 | | 5 | description. | $20 | 03/03/2013 | , , there 2 possible extraction results files: extract1.csv | id | description | date | |----|-------------------------|------------| | 1 | description. | 12/12/2012 | | 2 | other description. | 10/10/2015 | | 3 | other description. | 11/11/2014 | | 4 | 122333222233332221 | 11/11/2014 | | 5 | description. | 03/03/2013 | extract2.csv | id | description | amount | date | |----|---------------------

Make a android app maps marker -

hello want know how make android application of markers (warnings ) in map, example radar warnings, notices of free parkings... people can , put information in same map. thank much. first thing you're going need familiarise googlemaps android api v2: https://developers.google.com/maps/documentation/android/intro have @ samples should , running. it sounds though you're going need add custom markers map, check out following stackoverflow question - how create custom-shaped bitmap marker android map api v2 started.

android - How to start activity in another application? -

i have application defined below: <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name="com.example.myexampleactivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> now in application b, how can write code start activity in application a? thanks! the other solution works 2 activities in same application. in case, application b doesn't know class com.example.myexampleactivity.class in code, compile fail. i searched on web , found below, , works well. intent intent = new intent(); intent.setcomponent(new componentname("com.example", "com.example.myexampleactivity")); sta

java - Task dependency order in Ant -

i trying learn ant , found example build file in docs. <project name="myproject" default="dist" basedir="."> <description> simple example build file </description> <!-- set global properties build --> <property name="src" location="src"/> <property name="build" location="build"/> <property name="dist" location="dist"/> <target name="init"> <!-- create time stamp --> <tstamp/> <!-- create build directory structure used compile --> <mkdir dir="${build}"/> </target> <target name="compile" depends="init" description="compile source"> <!-- compile java code ${src} ${build} --> <javac srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depe

aggregate - R Aggregation Error: count distinct -

i'm relatively new r, forgive me if seems dumb question. i've started run out of ideas other examples on how make work, , hoping guide me in right direction working. so i'm attempting count distinct on site_id clncl_trial_id. my data in dataframe (data2), kind of looks like: clncl_trial_id: 89794, 89794, 8613, 8613 site_id: 12456, 12456, 100341, 30807 the idea end result count of 89794=1 , 8613=2 here's have far: z <- aggregate(data2$site_id ~ data2$clncl_trial_id, data2, function(site_id) length(unique(data2$site_id))) and i've attempted alternate forms aggregate(site_id ~ clncl_trial_id, data2, sum(!duplicated(data$site_id))) aggregate(site_id ~ clncl_trial_id, data2, nlevels(factor(data2$site_id))) aggregate(site_id ~ clncl_trial_id, data2, function(site_id) length(unique(data2$site_id))) i keep running problem instead of grouping trial_id, counting whole table. 89794=3 , 8613=3. does have idea how correct issue? feel i'm ove

r - Access zoo or xts index -

i using zoo objects, buy question applies xts objects. looks me 1 column vector index. in case index vector of dates , 1 column vector data. except access dates (from index). for example have following result: objzoo <- structure(c(10, 20), .dim = c(2l, 1l), index = c(14788, 14789), class = "zoo", .dimnames = list(null, "data")) unclass(objzoo) # data # [1,] 10 # [2,] 20 # attr(,"index") # [1] 14788 14789 i want 14789 in variable or vector, i'm not sure how access it. from ?zoo , there 2 convenience methods access data in zoo objects: coredata() returns data in zoo object index() returns index for example: x.date <- as.date("2003-02-01") + c(1, 3, 7, 9, 14) - 1 x <- zoo(rnorm(5), x.date) index(x) [1] "2003-02-01" "2003-02-03" "2003-02-07" "2003-02-09" "2003-02-14" coredata(x) [1] -1.2487943 0.8911630 1.2713133 -0.1024638

Android - find image link API -

hey ! i have android app user can search on specific subject, let's take word "cats" example. when user submits search want find image similar or on subjects searched for. a search engine images more or less. want "easy" deal with , thought integrating google search api app. let user search google, , take first image comes up. however, haven't found example , need push in right direction. if give me example api needs, that'd great. apparently google search api never deprecated it's still , running. provides json data , parsed android. if else needs image api here's test search: https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=searchquery&rsz=8&start=1&imgsz=small|medium and json reference: https://developers.google.com/image-search/v1/jsondevguide

How to call storyboard.TargetName from Xaml to C# -

Image
i want rotate 3d through xaml having code <window.triggers> <eventtrigger routedevent="window.loaded"> <beginstoryboard> <storyboard> <doubleanimation from="0" to="360" duration="00:00:10" storyboard.targetname="angle" storyboard.targetproperty="angle" repeatbehavior="forever"/> </storyboard> </beginstoryboard> </eventtrigger> </window.triggers> but when try run code project stops running giving me error: how can add "angle" class xplorermainwindow()? , should put it. in constructor, somewhere in class, in function open file, or have create new function? this "angle" <model3dgroup.transform> <rotatetransform3d centerx

ios - Xcode 7 beta 2 and swift not getting along -

i have error when typed in code, gave me error. looks perfect, here code: import uikit class secondviewcontroller: uiviewcontroller { @iboutlet weak var resultlabel: uilabel! @iboutlet weak var temptext1: uitextfield! @ibaction func converttemp1(sender: anyobject) { #let fahrenheit = (temptext1.text nsstring).doublevalue let celsius = (fahrenheit - 32 )/1.8 let resulttext = "celsius \(celsius)" resultlabel.text = resulttext } override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } } it give me following error: 'string?' not convertable 'nsstring' on line put # on. # not in real code. note: not understand computer talk please try speak simply. :) the text property of uitextfield ret

dictionary - HashMap in Java Not Working -

this second day coding in java, no worries though not new coding. anyhow, not use not having dictionaries python has, can store key , value . that when came upon java hashmaps. currently, can not seem them work, , unsure why. here code using, these seems raising errors: map<string, string> visual = new hashmap<string, string>(); then here error generating: multiple markers @ line - type map not generic; cannot parameterized arguments <string, string> - hashmap cannot resolved type i importing hash libraries: import java.util.map; import java.util.hashmap; so question is, why hashmap not working? thank you! :) p.s. here little piece of code: public map areatotal() { map<string, string> visual = new hashmap<string, string>(); return visual; } edit sorry, guess did forget include other information. using eclipse only other import math you have map class in same package not generic - should removed

python - Modifying Multiple Rows based on Specific Criteria -

i have csv file looks this: id class status species 1 sands d carex 1 sands c eupesu 1 sands c poapra 2 limy d carcra 2 limy c eupesu 2 limy c poapra 3 limy d poapra 3 limy c eupesu 3 limy c poapra when status d , species carex or carcra want change class wet values within specific id. desired output is: id class status species 1 wet d carex 1 wet c eupesu 1 wet c poapra 2 wet d carcra 2 wet c eupesu 2 wet c poapra 3 limy d poapra 3 limy c eupesu 3 limy c poapra import pandas pd df = pd.read_table('data',

linux - Disable pagination on the command line -

i trying write script using python module pexpect connect server , execute commands typing @ command line. so example, can have like: child = pexpect.spawn('/usr/bin/ssh user@example.com') child.sendline('ls -al') or whatever command want send. act typing in terminal. in script, trying run command using sendline() api dumps out bunch of info command line. there pagination requires there command have press key continue next command. so example: [some info] --------------- continue, press key. quit, press 'q'. --------------- [some more info] is there way can turn pagination off or command can send before try dump info command line turn off? in linux: can use redirection skip pager( more or less ). if important display output on screen, output can redirected tee . for example in man ls; ls , man command expects user press q termination , ls executed. execute both commands simultaneously without user intervention, can don

Error in Faraday and RubyGems API -

i want obtain list of gems of owner. http client faraday, i'm doing this: connection = faraday.new "https://rubygems.org/api/v1/gems.json" connection.token_auth(token) response = connection.get but have error "@body="access denied. please sign account @ http://rubygems.org"" i don't know if authenticating in wrong way or method. appreciate help. thanks. just fyi solved header connection = faraday.new response = connection.get 'https://rubygems.org/api/v1/gems.json', {},{'authorization' => token}

string - Access to value of a Table Item -

i doing vaadin project , maybe it's easy question brain stop working right now. i have table code like: table table = new table(); table.addcontainerproperty("value", string.class, ""); table.addcontainerproperty("combo", combobox.class, null); table.additem(new object[]{"asd123", combo1}, 1); table.additem(new object[]{"asd1234", combo2}, 2); combo1 , combo2 comboboxes, code like: combobox combo1 = new combobox(); combo1.additem("choice 1"); combo1.additem("choice 2"); combobox combo2 = new combobox(); combo2.additem("girls"); combo2.additem("boys"); i want access item on table, , hold string. assume there string str , string str2 variables, , want (str = asd123) , (str2 = combo2's selected element). how can that? if can help, appreciate that. table.getitem(itemid); // or combo2.getvalue(); however, these functions both return object values have typecast the

javascript - Read JSON data with AngularJS from PHP connecting to SQL -

i'll briefly explain trying do. i have different entries on mysql database, want load them php page, convert json, , read them through angularjs. far have manage steps last one. i'll go step step other people can use reference: /// grab data sql database php access_db.php <!doctype html> <html> <body> <?php $host = "myhost"; $user = "myusername"; $psw = "mypsw"; $dbname = "mydatabasename"; //open connection mysql db $conn = mysqli_connect($host,$user,$psw,$dbname); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select entryname name, entrytype type, entryplatform platform, entrystatus status, entrydate submitdate pl_entries"; $result = $conn->query($sql); $rows = array(); if ($result->num_rows > 0){ while($r = $result->fetch_assoc()){

postgresql - -Infinity added to database for NpgsqlParameter Timestamp field; expecting NULL -

i'm inserting record in postgressql table passing dbnull.value timestamp without time zone field using npgsqlparameter below: ncmd.parameters.add(new npgsqlparameter(":enddate", npgsqldbtype.timestamp)); datetime? dtval = sr.getdatetime("enddate"); ncmd.parameters["enddate"].isnullable = true; if (dtval.hasvalue) ncmd.parameters["enddate"].value = dtval; else ncmd.parameters["enddate"].value = dbnull.value; when try select records null values field use "select * "eval" "enddate" null" nothing returned. when read table data in pgadmin see value "-infinity" in field. please, tell me how pass null values npgsqlparameter? thanks in advance, danilo da silva sorry, i've found error. when read data inserted datareader, getting default value datetime field when null , inserting default(datetime) not dbnull.value. i'm testing dtval.hasvalue && dtval != defa

android - How to call another activity after destroy() of service is called -

in code have created service.after 3 seconds want destory service , want call activity in destroy method.but doesnt seem work. public class timerservice extends service { @override public ibinder onbind(intent intent) { return null; } @override public void oncreate() { super.oncreate(); } @override public int onstartcommand(intent intent,int flags,int startid) { new countdowntimer(3000, 1000) { public void ontick(long millisuntilfinished) { } public void onfinish() { stopself(); } }.start(); return super.onstartcommand(intent,flags,startid); } @override public void ondestroy() { super.ondestroy(); intent = new intent(this,dummy.class); i.putextra("sessiontimedout","expire"); i.addflags(intent.flag_activity_new_task);