Posts

Showing posts from February, 2015

jquery - Assigning map area to tooltip -

i got bootstrap tooltip working text , buttons, when try assign map area it, doesn't should. the text there, bootstrap neatness gone. here code: <a> <img src="http://i621.photobucket.com/albums/tt296/viktorvnh/deskone_zpswpfj5mrc.jpg" usemap="#map"/> <map name="map" id="map"> <area shape="rect" coords="374,414,624,570" href="#" data-toggle="modal" data-toggle="tooltip" title="i don't remember painting that." data-target=".modal" </map> </a> look @ example : bootply : http://www.bootply.com/hsm6jquk1s the area has no ~position , size~, you've got set it... else, tooltip doesn't know should appear.... css : #myarea{ position:absolute; left:374px; width:250px; top:414px; } js : $('#myarea').tooltip();

javascript - Nearest-neighbor interpolation in canvas (internet explorer 9) -

i've created simple image viewer (with grid , image) canvas (the image only) , svg-gridlines d3.js (simliar this ). use zoom-function d3.js zoom , pan image/gridlines. my image on canvas should use nearest-neighbor interpolation. i've set many style elements achieve goal. chrome , firefox works well, have problems internet explorer 9 (i need support ie9). in ie9 image blurred. does internet explorer 9 repect nearest-neighbor interpolation canvas? are settings correct? my canvas code in d3.js: canvas .attr("width", dx) .attr("height", dy) .attr("style", "outline: thin solid black;") .style("width", width + "px") .style("height", height + "px") .style("transform", "translate(" + marginleft + "px,0)") .style("image-rendering","-moz-crisp-edges") .style("image-rendering&qu

javascript - reset content in an Ionic ios/android application -

in html/css/js web application have js reset button so: //reset button// document.forms[0].addeventlistener('reset', function() { document.getelementbyid('result').innerhtml = ''; document.getelementbyid('container').innerhtml = ''; document.getelementbyid('resultprem').innerhtml = ''; document.getelementbyid('containerprem').innerhtml = ''; }); i testing natively on android , ios using ionic , cordova , function doesn't work. what correct way reset on ionic based applications? should using angular this? im sorry if stupid or vague question, have searched similar questions. any appreciated. f a simple example reset form in angularjs: controller: $scope.data = { "name": ""}; $scope.reset = function() { $scope.data.name = ""; } html: <form name="form" id="form" novalidate> <input name="name" ng-m

jquery - JavaScript - get value from dynamic key/value into dynamic key/value -

var data = { "dynamic_key/value_a":{ "dynamic_key/value_1":{ "key_1":"value_1", "key_2":"value_2", "key_3":"value_3" }, "dynamic_key/value_2":{ "key_1":"value_1", "key_2":"value_2", "key_3":"value_3" }, "dynamic_key/value_3":{ "key_1":"value_1", "key_2":"value_2", "key_3":"value_3" } }, "dynamic_key/value_b":{ "dynamic_key/value_1":{ "key_1":"value_1", "key_2":"value_2", "key_3":"value_3" }, "dynamic_key/value_2":{ "key_1":"val

c++ - Emitting a signal not working properly -

i have class called dosecalibration contains dosecalibration.cpp , dosecalibration.h. class associated separate ui form. on form, when button clicked, signal emitted. there connection within main window receive signal, doesn't seem working. code following: dosecalibration.h : #ifndef dosecalibration_h #define dosecalibration_h #include <qdialog> #include <qdebug> namespace ui { class dosecalibration; } class dosecalibration : public qdialog { q_object public: explicit dosecalibration(qwidget *parent = 0); ~dosecalibration(); double dosefactor; //bool dose; private slots: void on_usecharge_clicked(); void on_usecounts_clicked(); void on_pushbutton_clicked(); // void on_pcsb_valuechanged(); // void on_countssb_valuechanged(); signals: void applydose(); private: ui::dosecalibration *ui; }; #endif // dosecalibration_h dosecalibration.cpp : #include "dosecalibration.h" #include "ui

powershell - Passing hashtable as argument to a function in PS -

i have problem in powershell script : when want pass hashtable function, hashtable not recognized hashtable. function getlength(){ param( [hashtable]$input ) $input.length| write-output } $table = @{}; $obj = new-object psobject;$obj | add-member noteproperty size 2895 | add-member noteproperty count 5124587 $table["test"] = $obj $table.gettype() | write-output ` hashtable $tx_table = getlength $table `unable convert system.collections.arraylist+arraylistenumeratorsimple in system.collections.hashtable why ? $input automatic variable enumerates input given. chose other variable name , it'll work - although not might expect - number of entries in hashtable need inspect count property: function get-length { param( [hashtable]$table ) $table.count } write-output implied when leave $table.count is. also, () suffix in function name unnecessary syntactic sugar 0 meaning when declare parameters inli

Combine Columns in CSV file using JAVA -

i want combine columns in csv file using java here in file want combine first 2 columns "product no" , "product name". this csv file productno,productname,price,quantity 1,java,300,5 2,java2,500,10 3,java3,1100,120 here code private void parseusingopencsv(string filename) { csvreader reader; filewriter out = null; csvwriter outt; try { reader = new csvreader(new filereader(filename)); string[] row; try { out= new filewriter("e:/data/test/newww.csv"); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } try { while ((row = reader.readnext()) != null) { (int = 0; < row.length; i++) { // display csv values system.out.println(row[i]); string com = row[i]; out.write(com); } } } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } catch

c - implementing a binary search tree - "incompatible types when returning type 'struct item_t *'..." -

i'm trying implement binary search tree holds inventory of ordered stock. stocked item attributes stored in nodes such: typedef struct item item_t; struct item{ char name; int price; int quantity; item_t *left; item_t *right; }; the idea prompt user enter above attributes, , add entered item node. i've written far: item_t *root = null; item_t *current_leaf = null; void prompt_user(){ /* in here contains code prompts user item attributes , stores in variable called input */ insert_node(input); } void insert_node(char *input){ /*if tree doesnt have root...*/ if (root == null){ /*create one...*/ root = create_node(input); } else{ item_t *cursor = root; item_t *prev = null; int is_left = 0; int comparison; while(cursor != null){ /*comparison 1 key of input less key of cursor, , 2 otherwise...*/ comparison = compare(in

linux - ssh Banana pi with mac -

so want control banana pi macbook pro using ssh. first using ssh. followed lot of different tutorials , still not work. if run : pi@172.25.54.12 or bananapi@172.25.54.12 or whatever name try answers me that ssh: connect host 172.25.*.*2 port 22: operation timed out and when try bananapi@localhost or pi@localhost it answers me: ssh: connect host localhost port 22: connection refused i found ip address doing ifconfig on bananapi. bananapi using bananian (debian banana pi), , mac 10.10.3. when run sshd -t, have: port 22 protocol 2 addressfamily listenaddress 0.0.0.0:22 listenaddress [::]:22 usepam 1 serverkeybits 768 logingracetime 120 keyregenerationinterval 3600 x11displayoffset 10 maxauthtries 6 maxsessions 10 clientaliveinterval 0 clientalivecountmax 3 permitrootlogin yes ignorerhosts yes ignoreuserknownhosts no rhostsrsaauthentication no hostbasedauthentication no hostbasedusesnamefrompacketonly no rsaauthentication yes pubkeyauthentication yes

Exception for listview adapter when listview is missing(Fragment) -

1) activity has many fragment, fragments can switch another(whole rootview change) navigation drawer. 2) have listview in fragment update using simple adapter. 3) if switch fragment while listview still loading. -an error occur. may know how make exception this?? i extend simple adapter listview listadapter adapter = new extendedsimpleadapter( getactivity(), news_list, r.layout.news_item, new string[]{"news", "datetime", "desc","day"}, new int[]{r.id.news, r.id.new_time, r.id.desc,r.id.day}); setlistadapter(adapter); this custom adapter : public class extendedsimpleadapter extends simpleadapter{ context context2; public extendedsimpleadapter(context context, list<? extends map<string, string>> data, int resource, string[] from, int[] to){ super(context, data, resource, from, t

openoffice.org - Start and Stop OpenOffice Service using Java code? -

i have openoffice installed on both windows , linux machine. want write simple java application connect openoffice remotely , file conversion. want run openoffice service on both windows , linux on random port. after file conversion done, want stop service. you need start first : soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard then use library connect , use service jodconverter to call executable java : process process = new processbuilder("c:\\pathtoexe\\myexe.exe","param1","param2").start(); you gave him path openoffice exe, each parameter ( -headless ...) more infos in runtime.exec

jquery - How create follows mouse movement - javascript? -

i'm beginner @ coding. want effec on page - http://tympanus.net/development/animatedheaderbackgrounds i use scripts site , greensock gsap animation library. can't connect site. html: <div id="container"> <canvas id="demo-canvas" width="1400" height="622"></canvas> </div> and part of javascript use id elements: largeheader = document.getelementbyid('container'); largeheader.style.height = height+'px'; canvas = document.getelementbyid('demo-canvas'); canvas.width = width; canvas.height = height; ctx = canvas.getcontext('2d'); when use javascript code, error "typeerror: largeheader null". how correctly use effect ? is code either a) @ end of <body> element, or b) wrapped in dom ready handler? otherwise referencing dom element before exists. this 1 way wrap dom ready (shortcut handler locally scoped $ ): j

python - Explain the code of Z-order curve -

in explanation of z-order curve in wikipedia , there python code: def less_msb(x, y): return x < y , x < (x ^ y) two questions here: what msb short ? since x < y , why should compare x , (x^y) still ? msb most significant bit one way determine whether significant smaller compare floor of base-2 logarithm of each point. turns out following operation equivalent, , requires exclusive or operations: def less_msb(x, y): return x < y , x < (x ^ y) the second comparison needed because, if x < y , x 's msb isn't less y 's msb : for example x = 2 , y = 3 : x < y x , y have same msb : print bin(2), bin(3) 0b10 0b11 you can see on table below x^y not less x until y 's bit_length greater x 's, until point msb s equal: (2, 3) 2^3 = 1 bin(2): 10 bin(3): 11 (2, 4) 2^4 = 6 bin(2): 10 bin(4): 100 (3, 4) 3^4 = 7 bin(3): 11 bin(4): 100 (4, 5) 4^5 = 1 bin(4): 100

skspritenode - Get the type of AnyObject in Swift -

i have custom skspritenode subclass. name of class unit1 . in gamescene : var allunit1:[unit1]? var enemy1 = unit1(imagenamed: "1") enemy1.position = cgpointmake(cgfloat(startpointx), cgfloat(self.frame.height)) // add custom node array. not relative // question want describe of them. if(allunit1 == nil) { allunit1 = [enemy1] } else { allunit1?.append(enemy1) } self.addchild(enemy1) self.getdamage2unit(self.allunit1!.first!) // function in gamescene. problem starts here. parameter anyobject // see in below and getdamage2unit function (its in gamescene too); func getdamage2unit(val:anyobject){ if(val.type == "unit1") println("this anyobject unit1 objects") } } this if condition doesn't work. looking that. need know anyobject's real type. how know that? thank you try this. func getdamage2unit(val:anyobject){ if let mytype = val as? unit1 { println("this anyobject unit1 o

php - Setting serialization groups for entity in other bundle with FOSRestBundle / JMSSerializerBundle -

i have simple rest api created using fosrestbundle, , returns serialized objects using jmsserializerbundle. one of entities of bundle uses entity located in bundle. i set serialization groups entity, not set aggregated entity json result empty. i've followed documentation yaml groups configuration: http://jmsyst.com/libs/serializer/master/reference/yml_reference file seems unused (adding groups entity's properties has no effect, , don't errors if yaml file invalid). here's code: mycompany\mybundle\entity\meeting.php class meeting { /** * @var point * * @orm\column(name="location", type="point", nullable=true) * @jms\groups({"privatecontact"}) */ private $location; // getters, setters , other stuff } acme\somebundle\orm\point.php class point { /** * @var float */ private $latitude; /** * @var float */ private $longitude; // getters, setters } mycompany\mybundle\r

image - Theare aren't different drawable folders on Android Studio -

Image
i m trying integrate different image size in app problem in android studio there not drawable-idpi,mdpi,hdpi,xhdpi folders. ve checked other threads , answers need skip project view instead of android one. results same. there 1 generale folder called drawable and if try add resource folders drawable missing. just create new folder: right click 'res' folder --> new --> android resource directory. in wizard, select drawable 'resource type'. , 'density' resource qualifiers. with regard 'mipmaps' folders, android prefers app icons in these folders because can use icon in different density screen density. more mipmaps here: http://android-developers.blogspot.de/2014/10/getting-your-apps-ready-for-nexus-6-and.html

javascript - Reading Clipboard Images in IE -

i can read clipboard images in chrome using following code: data = event.originalevent.clipboarddata; (var = 0; i<data.items.length; i++){ var item = data.items[i]; if (item.type === 'image/png'){ itemfound = true; break; } } this approach not work in ie however. microsoft posted blog pasting in ie ( http://blogs.msdn.com/b/ie/archive/2013/10/24/enhanced-rich-editing-experiences-in-ie11.aspx ). blog states should able use following line of code var filelist = clipboarddata.files; filelist comes empty however. does know way of accessing clipboard images in ie? able read text fine, not images.

Assembly language simple program -

i have write simple program in assembly language h8s. user enters 50 uint16 numbers, , after each number program should sort entered numbers , print them out. how can implement array , work it? .text .global _start _start: mov.l #stck,er7 xor.l er6,er6 begin: inc.l #1,er6 mov.w #puts,r0 mov.l #par_o,er1 jsr @syscall mov.w #gets,r0 mov.l #par_i,er1 jsr @syscall jsr @insert jsr @sort jsr @write cmp.l #50,er6 bcs begin jmp @end insert: rts sort: rts write: rts end: jmp @end suppose on masm, can use operator "dup" in smallarray dword 10 dup (?) this line define array 10 members of double words unknown initial values for acce

reactjs - React.js: Disable button when input is empty -

i'm new react.js, sorry if question sounds stupid you. i'm trying disable button when input field empty. beest approach in react this? i'm doing following: <input ref="email"/> <button disabled={!this.refs.email}>let me in</button> is correct? it's not duplication of dynamic attribute, because i'm curious transferring/checking data 1 element another. you'll need keep current value of input in state (or pass changes in value up parent via callback function , or sideways , or <your app's state management solution here> such gets passed component prop) can derive disabled prop button. example using state: <meta charset="utf-8"> <script src="https://fb.me/react-0.13.3.js"></script> <script src="https://fb.me/jsxtransformer-0.13.3.js"></script> <div id="app"></div> <script type="text/jsx;harmony=true"

Delete entities don`t work in Orion -

how can delete entities? show in code, entity exist obtain error when try delete it. [root@host-192-168-192-78 ~]# curl localhost:1026/v1/contextentitytypes/room -s -s --header 'content-type: application/xml' | xmllint --format - <?xml version="1.0"?> <querycontextresponse> <contextresponselist> <contextelementresponse> <contextelement> <entityid type="room" ispattern="false"> <id>bedroom1</id> </entityid> <contextattributelist> <contextattribute> <name>temperature</name> <type>float</type> <contextvalue>27.8</contextvalue> </contextattribute> <contextattribute> <name>presence</name> <type>boolean</type> <contextvalue>true</contextvalue> </contextattribute> <contextattribute&g

web scraping - Scrapy: how to return a new request after request.meta['proxy'] is changed? -

i'm crawling pages few proxies, of proxies don't work , debug: crawled (403) <get http://xiyuanxiaoqu0571.fang.com/xiangqing/> or debug: crawled (302) <get http://yilexincun.fang.com/xiangqing/> below spider.py , in parse_community() tried recrawl pages response.status not 200 doesn't seem work. any appreciated! besides, how can exclude bad proxy ips caused "http 302/403" when running crawler? #-*- coding=utf8 -*- import scrapy scrapy.contrib.spiders import crawlspider, rule scrapy.contrib.linkextractors import linkextractor soufang.items import community_info scrapy import log import sys import random soufang.misc.proxy import proxies imp import reload reload(sys) sys.setdefaultencoding( "utf-8" ) class soufangspider(crawlspider): name = 'soufang' allowed_domains = ['fang.com'] start_urls = ['http://esf.hz.fang.com/housing/151_2352_1_0_0_0_1_0_0/'] rules = ( rule(li

javascript - Rails select with suggestions and remote data -

i have, example, project , category models: # project.rb has_and_belongs_to_many :categories # category.rb has_and_belongs_to_many :projects in front-end need to: show input name of project category suggest / autocomplete category name if exist if doesn't exists, need dynamically create , paste name input , hold id, send id server when user submits form. so, have categories controller, have methods search , create . search returns in json format pairs of id , name of suggested categories; create saves category database , returns pair of id , name when user submits new category input. multiple category input. also, in other part of website meet models, uses category model not has_and_belongs_to, belongs_to. there need show select box single value of category, same logic multiple input. select2 or selectize libs covers part of issue, have no idea how hold ids instead of names input , how render name of category input , send id when user submits form. are the

css - make a row clickable in html -

i trying make table's rows clickable, calling controller (am using symfony) , found this solution , problem have titles of row clickable , leads me error, , other problem when customize hover it's applied on rows if use class or specified style inside <tr> here code <table class="table table-hover "> <thead> <tr> <th>n°</th> <th>titre</th> <th>date</th> </tr> </thead> <tbody> {% key, rech in recherche %} <tr style="cursor: pointer;"> <td><a href="{{ path('resultat',{'id':rech.id}) }}">{{ loop.index }}</a> </td> <td>{{ rech.titre | raw }}</td> <td>{{ rech.date | date('y-m-d') |raw }}</td> </tr> {% endfor %} </tbody> </table> thanks response. you can try solution below. edit make sure

database - Oracle sql query Order By gives different results -

output of query 1: select id users order case when deviation_level=2863 1 else 2 end is 800019 800030 800040 800003 800007 800015 800025 800026....etc output of query 2: select id (select id users order case when deviation_level=2863 1 else 2 end) rownum<=16; is 800019 800030 800028 800020 800021 800018 800012 800161...etc why order changes in 2nd query? please suggest correct solution limit size of first query result. the reason order cannot guarantee ordering on duplicate values . in query, put deviation_level in column list of select , understand order not same when duplicate values. for example, query 1 sql> select empno, deptno emp order case when deptno=10 1 else 2 end; empno deptno ---------- ---------- 7782 10 7839 10 7934 10 7566 20 7654 30 7698 30 7900 30 7788 20 7369

reactjs - How does a canvas library fit in the Flux Pattern and React? -

i how flux focuses on separation of concerns , unidirectional data flow, makes me wonder how should incorporate canvas library fabricjs . fabricjs creates object model on native canvas element extend , simplify functionality. question whether initialize fabricjs canvas element in view (react component) , handle actions on canvas directly in view , store , update canvas state or set canvas element in view , register canvas actions store , use view dispatch actions? just send actions store , listen changes canvas if there updates - update canvas. goes action, action calls store saves data , emits changes. component listens changes , updates it's state , view.

php - I will like an assistant with codeigniter pagination -

i need assistant codeigniter pagination. i have been struggling create week, here code. have controller , view, on view page have table want create pagination below code controller <?php /* * **manage members**** */ function member($param1 = '', $param2 = '', $param3 = '') { if ($this->session->userdata('admin_login') != 1) redirect(base_url(), 'refresh'); if ($param1 == 'create') { $data['names'] = $this->input->post('names'); ; $data['birthdate'] = $this->input->post('birthdate'); $data['gender'] = $this->input->post('gender'); $data['email'] = $this->input->post('email'); $data['address'] = $this->input->post('address'); $this->db->insert('member', $data); $member_id = mysql_insert_id(); move_uploaded_file

multithreading - I'm getting a NullPointerException in android , what's wrong with my code? -

i'm java/android beginner. nullpointerexception when trying run below app. want access points using getscanresults() null when don't use thread used it. can tell me what's wrong code?thanks in advance! public class mainactivity extends activity implements view.onclicklistener { button btn; wifimanager wifi; final string tag = "connecttowifi"; string[] wifis; listview list; wifiscanreceiver wifireciever; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); btn = (button) findviewbyid(r.id.button_id); btn.setonclicklistener(this); if (wifi.iswifienabled()) { btn.settext(r.string.on_label); } else { btn.settext(r.string.off_label); } new thread(new runnable() { @override public void run() { // todo auto-generated method stub wifi = (wifimanager) getsystemservice(wifi_service);

javascript - Sticky Footer with dynamically added content -

i've been searching quite while , tried several different approaches, can't figure out solution. i footer @ bottom of page, not shown. whenever enough posts added, want page keep growing, footer on bottom. can see in example in snippet below how's works. however, don't want posts on left side, or start top. whenever try move page-wrap div absolute positioning, gets screwed up. originally inspired article: https://css-tricks.com/snippets/css/sticky-footer/ $(".btn").click(function() { var post = $('.status-box').val(); $("<li>").text(post).prependto(".posts"); }); html, body { height: 100%; } .page-wrap { min-height: 100%; /* equal footer height */ margin-bottom: -200px; } .page-wrap:after { content: ""; display: block; } .site-footer, .page-wrap:after { /* .push must same height footer */ height: 200px; } .site-footer { background: orange; } .container {

scoping - How to achieve "public static" member visibility using Xtext? -

within dsl there packages (one per file), imports, classes , class members. 1 file contains package p1 contains class c1 , class c1 has member m1. file contains package p2 contains class c2 has member m2. i member m1, have visibility of member java modified public static . meaning package p2, after including p1, in class c2, member m2 have value reference m1 (m2=c1.m1). imports work, can see elements directly contained imported entity (including p1.c1.* fix problem don't want way) there solution type of scoping? reference: type=[type] is short for reference: type=[type|id] the |id means id parsed. id not allow dots ( . ) thus may want change grammar to reference: type=[type|qualifiedname]

Why do we have int type in Java? -

why have int type in java? couldn't numeric type double (and maybe float)? can keep integer number in variable of type double. for performance reasons , memory saving. plus , fact numbers precise no decimal values handy lot of cases.

ios - No architectures to compile for (ARCHS=armv7,armv7s, VALID_ARCHS=armv7 armv7s) -

when use xcode6.3 , base sdk ios8.3 , build project(old project), issue appeared : no architectures compile (archs=armv7,armv7s, valid_archs=armv7 armv7s). someone can me? thanks! uhm maybe using library doesn't support armv7s architecture. try remove armv7s project settings.

C# - Effeciently writing code -

i pasting code snippet below. body suggest better , effecient way of writing this. minimum code written , avoid repetition. private void setcontrolvisibility() { if (dropdownlist1.selecteditem.text.equals("getassetsbasicbyid") || dropdownlist1.selecteditem.text.equals("getassetdetailsbyids")) { label2.text = "(please enter asset ids e.g. 1,2)"; chkexcludemapfunds.visible = false; chkpublishxml.visible = true; } else if (dropdownlist1.selecteditem.text.equals("getassetsbasicbysedols") || dropdownlist1.selecteditem.text.equals("getassetdetailsbysedols")) { label2.text = "(please enter sedols e.g. b1yw440,0003496)"; chkexcludemapfunds.visible = false; chkpublishxml.visible = true; } else if (dropdownlist1.selecteditem.text.equals("getinvestmentreportbyids")) { label2.text = "(please enter asset ids e.g. 1:100)";

c# - Get all files in directory and subdirectory after date range -

this question has answer here: getting files creation date in .net 4 answers is there way files in directory , subdirectories after date range? i know directory.getfiles() can iterate folders not give me access file object in can if statement on. you use file.getcreationtime , searchoption.alldirectories , example: var allfilesin2015 = directory.enumeratefiles("dir-path", "*.*", system.io.searchoption.alldirectories) .where(path => file.getcreationtime(path).year == 2015) .tolist(); you use fileinfo s , it's properties creationtime or lastaccesstime : directoryinfo dir = new directoryinfo("dir-path"); var allfileinfosin2015 = dir.enumeratefiles("*.*", system.io.searchoption.alldirectories) .where(fi => fi.creationtime.year == 2015) .tolist(); i use enumeratefiles since more eff

c# - AutomationElement is still alive? -

i using microsoft ui automation , have problems it, 1 being want know if automationelement still alive. more precisely want check if window has been closed. think common case kind of question , tried different scenarios, ending solution try access different properties of element , see if throws elementnotavailableexception. stumbled upon property called isoffscreen, seems helpful in case. still, couldn't find on net, want know if there better solution. haven't been happy framework these last days because seems unstable me (especially in finding automationelement). maybe me little more expertise in implementation. thank much marcel before fetching automationelement, may catch elementnotavailableexception try { var info = automationelement.current; var name = info.name; } catch (elementnotavailableexception) {}

Eclipse Java - Android - Source Not found -

Image
please dont mark duplicate. not. nothing described in other solutions works. i installed eclipse & android sdk studio. setting debug code .. giving "source not found".. code crashes code 'eventually' basic textview edittext = (edittext) findviewbyid(r.id.textview1); these tabs open , thread situation. anyway, trying cast textview edittext? make sure have create textview , not edittext in layout. also make sure have set layout content view. super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main);

javascript - JQuery AJax Result Echo PHP -

i must check result of ajax same php variable value. there anyway this? thank in advance help. my ajax html: <?php $x = '<p id="ip"></p>'; $y = '2_2_1_3'; if($x == $y){ echo $x; } ?> <a id="input" href="#">get value<input type="hidden" value="2_2_1_3"></a> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script> jquery(document).ready(function(){ $("#input").on("click", function(){ $.ajax({ type: 'post', url: "ip2.php", data:'ip=' + $(this).parent().find('input').val(), success: function(data){ $("#ip").html(data); } }); }); }); </script> the php script: <?php if($_post['ip'] >= 0){ $ip = $_post['ip']; echo $ip; } ?> $x = '<p id="ip"></p>&

Which equals operator (== vs ===) should be used in JavaScript comparisons? -

i'm using jslint go through javascript, , it's returning many suggestions replace == (two equals signs) === (three equals signs) when doing things comparing idsele_unvehtype.value.length == 0 inside of if statement. is there performance benefit replacing == === ? any performance improvement welcomed many comparison operators exist. if no type conversion takes place, there performance gain on == ? the identity ( === ) operator behaves identically equality ( == ) operator except no type conversion done, , types must same considered equal. reference: javascript tutorial: comparison operators the == operator compare equality after doing necessary type conversions . === operator not conversion, if 2 values not same type === return false . both equally quick. to quote douglas crockford's excellent javascript: parts , javascript has 2 sets of equality operators: === , !== , , evil twins == , != . ones work way expect. if 2 operands of s

javascript - Slicebox 3D Compatibility -

i've had necessity use slicebox 3d animation animate pictures on website. while firefox , chrome render animation fine, author planned fade on ie because of fact wouldn't support these animation. ie supports them tho, not in correct way. if open website through ie animation appear corrupted. idea workaround work inside slicebox.js in order force fade in out? what got : var isie = /*@cc_on!@*/false || !!document.documentmode; // @ least ie6 if (isie === false){ $('#sb-slider').slicebox(options); }else{ $('#sb-slider').slicebox(options, isie); }; the isie variable gets used in js file forse this.support false in case ie detected. what isn't workign right ie falls on fade, renderes images way big little while before changing them correct size. ideas?

datastax enterprise - Does `dse spark` default to use `local_dc`? How do I change it? -

for dse 4.6, dse spark default limitting analytics datacenter ( spark.cassandra.connection.local_dc )? same apply dse shark ? last, not least, can change datacenter default somewhere? have migrated simpledsesnitch gossipingpropertyfilesnitch , run spark jobs on non- analytics datacenter. for dse 4.6, dse spark default limitting analytics datacenter (spark.cassandra.connection.local_dc)? same apply dse shark? yes, dsesimplesnitch does. see docs details: http://docs.datastax.com/en/datastax_enterprise/4.6/datastax_enterprise/deploy/deployconfigrep.html?scroll=configreplication__configrepdsesimplesnitch last, not least, can change datacenter default somewhere? yes i have migrated simpledsesnitch gossipingpropertyfilesnitch , run spark jobs on non-analytics datacenter. when using gossipingpropertyfilesnitch, tell each node belongs in cassandra-rackdc.properties file. see docs: http://docs.datastax.com/en/datastax_enterprise/4.6/datastax_ente

html - Bootstrap buttons with glyphicons show different results -

i've written code makes menu. i've used bootstrap manage this. problem show different behaviour on different computers: this html code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" id="createstorybox"><span class="glyphicon glyphicon-book" style="display: inline-block"></span><span class="hidden-xs hidden-sm"style="display: inline-block"> {{ _('create story') }}</span></button> <button type="button" class="btn btn-defa

image - Unable to save multiple Bitmaps with OutputStream/FileOutputStream in Android -

currently,i'm having double trouble. unable crop bitmap. unable save multiple bitmaps. recently, i've made camera app saves jpeg image sd card without frail, however, wanted crop bitmap , save 2 parts (save 2 images same folder). however, i'm unable crop bitmaps in current code. and second problem tested , tried save same bitmaps testing purpose same folder using fileoutputstreams failed.(actually want save cropped version of bitmap). everything seemed well, until now. since i'm noob may missing or may have done nonsense codes. i've put codes (method) tried , failed. public static void makerotateimage(activity activity, byte[] data, int maxpixel) { // original bitmap bitmap bitmapsrc = maketargetpixelimage(data, maxpixel); // degrees int degree = getcameradisplayorientation(activity); int destwidth = 0; int destheight = 0; //alter or rotate if (degree % 180 == 0) { d

mysql - Group datetime within range -

Image
i have troubles in grouping datasets. here query , query result. select count(*),salarie_id, created_at enregistrement group salarie_id, created_at my point group similar created_at rows, in interval of +/- 3 sec. didn't manage it, in using interval , in such criterias having , where ... between . how can group these rows get, example 36 (33+3) in count result, shown in image ? didn't found suitable solution... let me know if want additional information. update 1 : looks @fancypants solution on right way. select count(*),salarie_id, date_format(created_at, concat('%y-%m-%d %h:%i:', left(right(created_at, 2), 1), right(created_at, 1) % 3)) 'date' enregistrement group salarie_id, date_format(created_at, concat('%y-%m-%d %h:%i:', left(right(created_at, 2), 1), right(created_at, 1) % 3)) select count(*),salarie_id, created_at enregistrement group salarie_id, date_format(created_at, concat('%y-%m-%d %h:%i:', left(ri

Detecting element widh DOM javascript -

my question pretty simple, can't detect element, wanna change backgroundcolor through javascript can't check since tag+class + tag+class... here's code tried: var 1 = document.getelementsbytagname("div"); var 2 = document.getelementsbyclassname("red"); var 3 = document.getelementsbytagname("h2"); var 4 = document.getelementsbyclassname("title"); one.two three.four.style.backgroundcolor ="#00c497"; the format "div.red h2.title". hope me, thanks if can, use queryselector this: document.queryselector("div.red h2.title").style.backgroundcolor = "#00c497"; <div> <h2>don't touch</h2> </div> <div class="red"> <h2>don't touch</h2> <h2 class="title">change</h2> </div>

javascript - Send HTTP Post When Google Spreadsheet Updated -

i have spreadsheet submitted 3rd party apps (which can't change code). then, need send http (post) automatically http://thisismyurl.url/go.aspx?fieldone=xxx&fieldtwo=xxx when google spreadsheet updated. what in mind create script in google spreadsheet , use urlfetchapp in code. function sendhttppost() { //how pick data field in last column (everytime google spreadsheet updated)? var data = { "fieldone" : "value field 1 (from last column)", "fieldtwo" : "value field 2 (from last column)", }; var options = { "method" : "post", "payload" : data }; urlfetchapp.fetch("http://thisismyurl.url/go.aspx", options); } i know missed command fetch data spreadsheet. idea this? thanks helping me :) thanks @mogsdad giving clue me. , @zig mandel suggesting me read spreadsheetapp documentation. here did in code, , it's works! // spreadsheet object v

c++ - Why is my terminate handler never invoked? -

i have read 1 can call std::set_terminate() use own function global exception handler, catches unhandled exceptions. simplified code of program: #include <exception> #include <stdexcept> #include <iostream> void my_terminate_handler() { std::cerr << "terminate handler" << std::endl; std::cin.get(); std::abort(); } int main() { std::set_terminate(my_terminate_handler); int = 1; i--; std::cout << 1/i << std::endl; return 0; } why my_terminate_handler() never invoked? both in vc++ 2013, 2015 rc , gcc++-4.8. the terminate handler called if program calls terminate . can happen various reasons - including uncaught exception - division 0 isn't 1 of reasons. gives undefined behaviour; typically, raises signal (not c++ exception), , you'd need install signal handler, not terminate handler, catch that.

algorithm - What is actually mean't by the big-O graph -

Image
there lot of explanation big-0, i'm confused on part. acoording definition of big-o in function f (n) ≤ c ·g(n), n ≥ n0 “ f (n) big-oh of g(n).” but description of function in terms of big o notation provides upper bound on growth rate of function. so e.g here 34 upper bound set { 5, 10, 34 } so if in graph how f(n) o(g(n)) because if upper bound of g(n) function it's value different mentioned here n>=n0 .. beyond n0, f(n) not grow faster g(n). f(n)'s rate of growth function of n @ g(n). g(n)'s rate of growth said upper-bound of f(n)'s rate of growth of f(n) big-o of g(n). the worst case rate of growth of f(n) @ g(n) since f(n) big-o of g(n). this knowing how big f(n) can grow relative known function. for example, if f(n) = n^2, , g(n) n^3, trivially f(n) big-o of g(n) since n^2 never grow faster n^3. "c" used mathematical proofs - it's linear scaling variable. can't go around , claim big-o of else. if choose