Posts

Showing posts from August, 2011

selenium - selenide code for how to fetch dropdown list value? -

i trying fetch values dropdown list using selenide . using selectoptionbyvalue("0") can fetch 1 value.but need values inside dropdown list.let me know how using selenide code maybe, try use this: $$(by.xpath("//path/to/element")).iterator().foreachremaining(element -> { /** * code here, describe here each element found xpath * e.x. * element.click(); */ }); i used click through links on page specific class attribute.

Detect when an HTML5 video finishes -

how detect when html5 <video> element has finished playing? you can add event listener 'ended' first param like : <video src="video.ogv" id="myvideo"> video not supported </video> <script type='text/javascript'> document.getelementbyid('myvideo').addeventlistener('ended',myhandler,false); function myhandler(e) { // want after event } </script>

debugging - How to debug lambda expression in Java 8 using Eclipse? -

i trying debug simple java application using lambda expression. not able debug lambda expression using normal eclipse debugger. you can transform expressions statements. list<string> list = new arraylist<>(); // expression boolean allmatch1 = list.stream().allmatch(s -> s.contains("hello")); // statement boolean allmatch2 = list.stream().allmatch(s -> { return s.contains("hello"); }); you can set break-point on return s.contains("hello"); line

OPenLayers 3.18.2 Is there any way to see when several placemarks superimposed on the same positions? -

Image
i use latest version of openlayers 3, , before asked question on is there way see when several placemarks superimposed on same positions? not yet functional. figure below, google earth, have way see it. thank you.

javascript - Ionic Form Can't Change Option on Select -

i trying create form in ionic, including dropdown list. previously, had following code: <label class="item item-input item-select"> <span class="input-label">* age</span> <select ng-model="data.child1.age" required> <option ng-value="7">year 7 (11-12)</option> <option ng-value="8">year 8 (12-13)</option> <option ng-value="9">year 9 (13-14)</option> <option ng-value="10">year 10 (14-15)</option> <option ng-value="11">year 11 (15-16)</option> <option ng-value="12">year 12 (16-17)</option> <option ng-value="13">year 13 (17-18)</option> </select> </label> th

ios - Thread:1 Signal SIGAGBRT -

why thread:1 signal sigagbrt within code? don't know change fix error. application starts , press button app cancels out , gives me error. import uikit class viewcontroller: uiviewcontroller { @iboutlet var textfieldinput: uitextfield! @iboutlet var lacelsius: uilabel! @iboutlet var lafahrenheit: uilabel! override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func btn(sender: uibutton) { var c_out = 0.0 var f_out = 0.0 var inputvalue = 0.0 let textinput = nsstring(string: textfieldinput.text!) inputvalue = textinput.doublevalue c_out = (inputvalue-32)*5/9 f_out = inputvalue * 1.8 + 32 self.lacelsius.text = nsstring(format: "%3.2f" ,c_out) string sel

c# - Winforms SplitterPanel, z-index of child overlap split -

Image
i working splitterpanel in winforms on right hand side want custom dropdown list control displays 2 columns dropdown list. the problem there being 2 columns want able have larger dropdown list area actual dropdown, , therefore overlap splitterpanel if list doesn't fit in split area. i have tried using .bringtofront(); , not work on splitterpanel , control hidden. come web background have used z-index stumped winforms. see below image of issue. does know how can resolve this? the z-index determine child controls sit higher , can overlap others child controls. never helps when want (real opposed drop downs or menues) child overlap own container . never happens; , since checkedlistbox child of split panel never overlap it. you need make checkedlistbox sit not inside splitter panel in parent 'brethren'. let's assume splitcontainer sits in tabpage tabpage8 . can show moving tabpage: movectltotarget(tabpage8, checkedlistbox1); using function

ios - how i can add animation to any UI by snapkit by swift 3? -

label.snp.makeconstraints { (make) -> void in make.width.equalto(box).dividedby(2) make.top.equalto(100) make.left.greaterthanorequalto(box.snp.left).offset(15) } i want animate label position button after update constraints call layoutifneeded() on view in animation closure. uiview.animatewithduration(0.2, delay: 0, options: [], animations: { () -> void in self.view.layoutifneeded() }) hope helps.

javascript - How I can send value in PHP from one page to another using other than session? -

i have multistep form in on second step have date input field , next , previous button.i want fetch values database in 3 step using date input field clicking on next button not submit button. this second step. <input type="date" name="date" id="date"> <input type="button" name="previous" class="previous action-button" value="previous" /> <input type="button" name="nextnew" id="nextnew" class="next action-button" value="next" /> i have used ajax. <script> $("#nextnew").click(function() { var name2 = $("#date").val(); //alert(name2); $.ajax({ url:"getuser.php", type:"get", data:{ id2: name2}, success:function(data){ $("#detail").html(data); }

android - Recyclerview touch events -

this first time working recyclerview , have made adapter class static mock data. public static class viewholder extends recyclerview.viewholder{ public textview textview; public viewholder(view view){ super(view); textview = (textview)view.findviewbyid(r.id.mytextview); } } @override public viewholder oncreateviewholder(viewgroup parent, int viewtype) { view1 = layoutinflater.from(context).inflate(r.layout.item, parent ,false); toast.maketext(context, "@@@@@@@@@@@@" +viewtype, toast.length_short).show(); viewholder1 = new viewholder(view1); return viewholder1; } @override public void onbindviewholder(viewholder holder, int position) { holder.textview.settext(subjectvalues[position]); } @override public int getitemcount() { return subjectvalues.length; } } this adapter clas it's showing mock data want achieve click ev

java - Access method from another class No static? -

i had lot of problems in code because of static methods , variables. i'm new programming , noticed when use static in class can call wherever want. link below previous question(if need to, why of trying not use static) told me remove static method solved part of problem. ps: english 3rd language may bad. please me i'm stuck get random object arraylist specific variable so problem: i have constructor create cars , parameter filled functions. since object not yet created can't methods. there way cant call them? here code: right cars.getposition() underlined red , telling me make static. from garage class cars created: public void addcar() { cars car = new cars(cars.getid(), cars.askcarid(), cars.getposition(), attendant.askforatt(), system.currenttimemillis()); mygarage.add(car); if(!(car.getassignedto()).equals(null)){ car.getassignedto().setassign(car); car.getassignedto().setavailable(false); } } from car class: private

How do I include muparser library in my Qt project? -

i made muparser.pri had following content, macx|win32|equals(build_muparser, "true")|!packagesexist(muparser){ message("using bundled muparser") muparser_dir = src/rel/muparser dependpath += $$muparser_dir/include \ $$muparser_dir/src includepath += $$muparser_dir/include gen_lib_dir = ../../generated/lib libs += -l$$gen_lib_dir -lmuparser pre_targetdeps += $$gen_lib_dir/libmuparser.a }else{ message("using external muparser") config += link_pkgconfig pkgconfig += muparser } i, then, added include(./muparser.pri) in application's make file. this gave me error ":-1: error: no rule make target '../../generated/lib/libmuparser.a', needed 'debug/akaar1.exe'. stop." what did wrong? how else supposed include library in project? in .pro file can do: libs += -l*path library* -l*library name: foo libfoo.a*

Yii2 unset post request array after save -

i have post array yii::$app->request->post() how can unset request array after performing insert operation , before rendering view you use : yii::$app->request->bodyparams = []; read more $bodyparams .

floating point - How can I use a HashMap with f64 as key in Rust? -

i want use hashmap<f64, f64> , saving distances of point known x , key y point. f64 value shouldn't matter here, focus should on key. let mut map = hashmap<f64, f64>::new(); map.insert(0.4, f64::hypot(4.2, 50.0)); map.insert(1.8, f64::hypot(2.6, 50.0)); ... let = map.get(&0.4).unwrap(); as f64 neither eq nor hash , partialeq , f64 not sufficient key. need save distances first, access distances later y. type of y needs floating point precision, if doesn't work f64 , i'll use i64 known exponent. i tried hacks using own struct dimension(f64) , implementing hash converting float string , hashing it. #[derive(partialeq, eq)] struct dimensionkey(f64); impl hash dimensionkey { fn hash<h: hasher>(&self, state: &mut h) { format!("{}", self.0).hash(state); } } it seems bad , both solutions, own struct or float integers base , exponent seem pretty complicated key. update: can guarantee key never nan , or

angular - Run Method on FormControl's valueChanges Event -

i have following code angular 2 type-ahead component: this.question["input"] = new formcontrol(); this.question["input"].valuechanges .debouncetime(400) .switchmap(term => this.question['callback'](term)) .subscribe( data => { this.question["options"].length = 0; this.question["options"].push(...data); } ); which working great, attempting add loading animation event, i.e. animation starts when formcontrol's value changes, , ends when data returned. with said there way tap method chain code such following? ... .valuechanges /* start animation or run custom function here */ .switchmap(term => /* run ajax here */) .subscribe( data => { /* end animation here */ } ); ... any assistance appreciated. this has not been tested, similar code i've used in app... hope helps:

PHP Insert to MYSql after checking existed value -

i trying register users in app , tried check if age existed stop registration process, wrote code register users , worked when tried validate registration using check_age function doesn't work , still allow registration if age existed can tell me missed code : here code: <?php if($_server["request_method"]=="post") { require "init.php"; creat_student(); } function creat_student() { global $con; $firstname=$_post["firstname"]; $lastname=$_post["lastname"]; $age=$_post["age"]; if(strcmp(check_age(), '0') == 0) { $query="insert student(firstname,lastname,age) values ('$firstname','$lastname','$age');"; mysqli_query($con,$query); mysqli_close($con); } else echo "not true"; } function check_age() { global $con; $age=$_post["age"]; echo " $age"; $temp_arr=array();

javascript - JS - location reload with delay after function executed -

i running js / ajax script update data in table , once script done, reload page. however, current code, reloads immediately, there way delay reload 3 secs? // close modal , refresh page $('#editrecordmodal').modal('hide'); location.reload(); thanks $('#editrecordmodal').modal('hide'); settimeout(function(){location.reload()}, 3000);

How to share a common bindings for different ScriptContext with Java ScriptEngine API? -

i playing nashorn , scriptengine api of java 8. have unique instance of scriptengine execute several different scripts. remove functions (e.g. print) scripts execute, specify specific binding binding each script. my problem not know if possible make kind of hierarchy scriptcontext. here exemple of : public static void main(string[] args) throws exception { scriptenginemanager manager = new scriptenginemanager(); scriptengine engine = manager.getenginebyname("nashorn"); bindings bindings = engine.getbindings(scriptcontext.engine_scope); bindings.remove("print"); // script run string script1 = "print('hello world')"; string script2 = "print(person)"; // define different script context scriptcontext newcontext = new simplescriptcontext(); bindings enginescope = newcontext.getbindings(scriptcontext.engine_scope); // set variable different value in scope enginescope.put("person&

android - FCM still using registration token for sending notificationo like GCM? -

i'm new in fcm , have (may be) stupid questions. does fcm still using registration toke gcm? does fcm use registration token google play ? does fcm registration token periodic change? saw answer in post , think gcm thanks! does fcm still using registration toke gcm? yes. does fcm use registration token google play ? not sure mean here. does fcm registration token periodic change? yes, under conditions managed internal fcm service.

scripting - Accessing hash tables values in the same hash table in powershell -

i'm storing lot of variables depend on other variables, depend on other variables, : $soft_version = "5.8.2" $soft_filename = "somesoft-${soft_version}.exe" $soft_path = "/some/path/$soft_filename" $soft_call_args = "/s /forcerestart" and i'd store in hash table can access values more : tried following $soft = @{ version="5.8.2"; filename="somesoft-${soft.version}.exe" path="/some/path/$soft.filename" call_args = "/s /forcerestart" } so can access values : $soft.version $soft.filename $soft.path $soft.call_args but doesn't seem work, corresponding keys remain empty : $soft name value ---- ----- filename somesoft-.exe

reactjs - meteor-react -Missing class properties transform -

i trying implement react-dnd in meteor react project. i getting error this: errors prevented startup: while processing files ecmascript (for target web.browser): client/card.js:37:2: /client/card.js: missing class properties transform. card.js file: import react, { component, proptypes } 'react'; import itemtypes './itemtypes'; import { dragsource, droptarget } 'react-dnd'; const style = { border: '1px dashed gray', padding: '0.5rem 1rem', marginbottom: '.5rem', backgroundcolor: 'white', cursor: 'move' }; const cardsource = { begindrag(props) { return { id: props.id }; } }; const cardtarget = { hover(props, monitor) { const draggedid = monitor.getitem().id; if (draggedid !== props.id) { props.movecard(draggedid, props.id); } } }; @droptarget(itemtypes.card, cardtarget, connect => ({ connectdroptarget: connect.droptarget() })) @dragsource(it

scala - Key/Value pair RDD -

i have question on key/value pair rdd. i have 5 files in c:/download/input folder has dialogs in films content of files follows: movie_horror_conjuring.txt movie_comedy_eurotrip.txt movie_horror_insidious.txt movie_sci-fi_interstellar.txt movie_horror_evildead.txt i trying read files in input folder using sc.wholetextfiles() key/value follows (c:/download/input/movie_horror_conjuring.txt,values) i trying operation have group input files of each genre using groupbykey() . values of horror movies , comedy movies , on. is there way can generate key/value pair way (horror, values) instead of (c:/download/input/movie_horror_conjuring.txt,values) val ipfile = sc.wholetextfiles("c:/download/input") val output = ipfile.groupbykey().map(t => (t._1,t._2)) the above code giving me output follows (c:/download/input/movie_horror_conjuring.txt,values) (c:/download/input/movie_comedy_eurotrip.txt,values) (c:/download/input/movie_horror_conjuring.txt,values) (c:/do

html - CSS media min-width not applying all styles -

Image
i have following css styles: @media (min-width: 1280px) { .window-padding { padding-top: 20px; padding-bottom: 20px; padding-left: 30px; padding-right: 30px; } } @media (min-width: 769px) { .window-padding { padding-right: 20px; padding-left: 20px; padding-left: 10px; padding-right: 10px; } } .window-padding { padding-right: 10px; padding-left: 10px; padding-left: 0px; padding-right: 0px; } however, when open in browser (width > 1280px), padding-top , padding-bottom min-width:1280px applied. padding-left , padding-right style doesn't have @media condition. here applies: edit : reordered css have lowest size first fixed issue. also, have duplicate padding styles mistake. first u go default style ( after increase screen rez ) means default > 768 > 1280 ( apply min-width ) if u choose use max-width ( u go default > 1280 > 768 ) for min width .clas

javascript - How to add click event tot button in string -

$.ajax({ url:'/getarticles', method:'get', }).done(function(articles){ var content = ''; articles.foreach(function(e){ var res = "<div class='article'>" + "<h3>" + e.title + "</h3>" + "<p>" + e.content + "</p><br>" + "<button onclick=crud.remove(" + e._id + ")>remove</button><br>" + "</div>"; content += res; }); $('#allarticles').append(content); }); window.crud = (function(){ // remove article function remove(id){ console.log(id); } how insert e._id correctly here put id of article? when click button says: (index):1 uncaught syntaxerror: invalid or unexpected token there syntax error in button creation using jquery. missed single quotes id. missing braces. <button onclick=crud.remove(" +

Powerpc assembly instruction bl SYM -

what meaning of "sym" in following powerpc assembly code branch instruction? bl sym (_subroutine) sym macro defined in asm.h #define sym(x) concat1 (__user_label_prefix__, x)

node.js - can't catch Promise queue errors -

i'm setting node app have run series of asynchronous spawn tasks in order, i've got queue system set up. runs when reaches no errors. however, it's failing catch errors , log them when happen. here's right now: function queue(tasks) { let index = 0; const runtask = (arg) => { if (index >= tasks.length) { return promise.resolve(arg); } return new promise((resolve, reject) => { tasks[index++](arg).then(arg => resolve(runtask(arg))).catch(reject); }); } return runtask(); } function customspawn(command, args) { return () => new promise((resolve, reject) => { const child = spawn(command, args, {windowsverbatimarguments: true}); child.on('close', code => { if (code === 0) { resolve(); } else { reject(); } }); }); } the queue built , executed this: myqueue.push(cust

javascript - Paypal Checkout REST API server side code not clear -

Image
background i selling on-line live courses user can purchase example 5 live classes. site built codeigniter , checkout page looks this: my main payment option stripe gateway integrated yesterday minimal hassle. using stripe.js , submitting hidden form pops stripe payment form , redirects processor controller... paypal on other hand nightmare. confused api should choose... checkout rest apparently modern , up-to-date option custom integration... paypal documentation says: the enhanced paypal express checkout in-context gives customers simplified checkout experience keeps them local website throughout payment authorization process , lets them use paypal balance, bank account, or credit card pay without sharing or entering sensitive information on site. fantastic... what have tried i @ enable in-context checkout step , lost due lack of server-side code examples. i have added example code follows. <!-- paypal payment --> <form id="mycon

sql - Invalid object name error on SELECT statement alias -

i've written sql query assigns alias each of 2 nested select statements , attempts join on these aliases. my sql query follows: select empid, (select empid ,count(*) * 8 [fulldayhours] [database].[dbo].[tbllogtimes] activityid = 43 , workdate between '2015-12-31 00:00:00.000' , '2016-09-30 00:00:00.000' group empid) [rec1] ,(select empid ,(count(*) * 4) [halfdayhours] [database].[dbo].[tbllogtimes] activityid = 44 , workdate between '2015-12-31 00:00:00.000' , '2016-09-30 00:00:00.000' group empid) [rec2] [database].[dbo].[tbllogtimes] e inner join [rec1] on e.empid = [rec1].empid inner join [rec2] on e.empid = [rec2].empid on attempted execution of query, i'm experiencing error: invalid object name 'rec1'. i've tried various arrangements , configurations of query component substatements no avail. insights, advic

vsts - Visual Studio Team Services (VSO) Jasmine testcase code coverage -

Image
we using jasmine testing framework executing via karma test runner. works fine in local, in team services (previously vso), while try execute test cases, test cases executed code coverage empty after enabling throwing following error phantomjs 2.1.1 (windows 8 0.0.0): executed 139 of 139 success (1.389 secs / 1.41 secs) total: 139 success finished 'test' after 1.05 min c:\program files\nodejs\npm.cmd install istanbul npm warn optional skipping failed optional dependency /chokidar/fsevents: npm warn notsup not compatible operating system or architecture: fsevents@1.0.14 npm warn paalar@1.0.0 no description npm warn paalar@1.0.0 no repository field. c:\program files\nodejs\node.exe ./node_modules/istanbul/lib/cli.js cover --report cobertura --report html -i .\src\*.ts ./node_modules/jasmine/bin/jasmine.js jasmine_config_path=node_modules/jasmine/lib/examples/jasmine.json **/*specs.ts started no specs found finished in 0.001 s

XPath to exclude certain XML elements? -

i have read many (maybe all) posts on excluding elements in xpath , not working. have no clue why. let's have following structure: <root> <elema> hello world! </elema> <elemb> awesome! <elemc>really!</elemc> </elemb> </root> no want elements except elemc . based on have read, tried following xpath: option 1: //*[not(self::elemc)] option 2: //*[not(name()='elemc')] option 3: //*[name()!='elemc'] i have no clue why not working, suspect stupid mistake. if exact opposite (i.e. leaving out not or ! ) xpath correctly selects elemc element. the result should this: <root> <elema> hello world! </elema> <elemb> awesome! </elemb> </root> xpath selection. want select not exist in xml document. you need tool such xslt generate xml output document based on input xml document. xslt can generate desired outpu

caching - Glide-Android- loading (fullscreen) images not working -

i using glide library loading images in recyclerview works fine. when click item, urls data sent using intent. //rvfragment . . . glide.with(getactivity()).load(gifurl[position]).diskcachestrategy(diskcachestrategy.all).into(holder.mpostiv); holder.mpostiv.setonclicklistener(new button.onclicklistener() { @override public void onclick(view v) { intent = new intent(getactivity(), fullscreenimage.class); i.putextra("fspostiv", gifurl); getactivity().startactivity(i); getactivity().overridependingtransition(android.r.anim.fade_in, android.r.anim.fade_out);); } }); everything ok here, in fullscreenimage.class loading not works. fullscreenimage.class public class fullscreenimage extends appcompatactivity{ private touchimageview imiv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.l

utf 8 - Datastage 11.5 warning with character conversion (teradata connector) -

i've problem teradata connector. when read table teradata connector gives me error : "conversion utf-8 character set iso-8859-1 may affect performance" is there way in order eliminate warning? thank you codepage conversions affect performance - depending on source , target codepages these conversion may necessary. check codepage of target , make sure not use third codepage withing datastage job. codepage of job cen found in job properties.

javascript - Unable to update Body of iFrame -

Image
i have below issue: emailbodyiframe = (iframeelement)domelement.getelementbyid("descriptioneditiframe", this.editcontainer.children[0]); emailbodyiframe.setattribute("url", url.tostring()); //works emailbodyiframe.contentwindow.document.body.style.wordwrap = "break-word"; //does not work and html structure. the issue changes made body element not reflecting in ui. suggestion? have tried sorting out uppercase , lowercase letters? not conform typical style guide . try: emailbodyiframe.contentwindow.document.body.style.wordwrap = "break-word";

c# - changing DataGridviewCellStyle on RowIndex 0 -

i use following code change cell style in cellenter event of datagridview. if remove if-statement rows formated bold after databinding. tip or advice ? datagridviewcellstyle ostyle = new datagridviewcellstyle(); ostyle.font = new font("microsoft sans serif", 9.25f, fontstyle.bold); if (e.rowindex > 0) { datagridview1.rows[e.rowindex].cells[0].style = ostyle; datagridview1.rows[e.rowindex].cells[1].style = ostyle; datagridview1.rows[e.rowindex].cells[2].style = ostyle; datagridview1.rows[e.rowindex].cells[3].style = ostyle; datagridview1.rows[e.rowindex].cells[4].style = ostyle; datagridview1.rows[e.rowindex].cells[5].style = ostyle; datagridview1.rows[e.rowindex].cells[6].style = ostyle; datagridview1.rows[e.rowindex].cells[7].style = ostyle; datagridview1.rows[e.rowindex].cells[8].style =

eclipse plugin - How to install a bison/flex syntax highlighter? -

for flex , bison files looking syntax highlighter. i trying run: http://ccode.tistory.com/77 1. downloaded .jar file 2. , followed instructions file/import adding jars eclipse plugin but nothing changed. can explain me how install it? use instructions in this answer install jar file. after doing , restarting eclipse, .y files should opened bison editor provided plugin, , syntax-highlighted.

Extract any first two letters and 6 digit number from an excel and copy it to another cell -

Image
how extract first 2 letters , 6 digit number 1 cell another? ie. column 1 have aa111111, bb222222, ccccc, dd12, eeee1 i want copy aa111111 , bb222222 in case. thanks, alex try short macro: sub kopykat() dim n long, long, k long dim s string n = cells(rows.count, 1).end(xlup).row k = 1 = 1 n s = cells(i, 1).value if len(s) = 8 _ , mid(s, 1, 1) "[a-za-z]" _ , mid(s, 2, 1) "[a-za-z]" _ , isnumeric(mid(s, 3)) cells(k, 2).value = s k = k + 1 end if next end sub

c - Segmentation Fault before main -

so i've been running problem somehow code causing segmentation faults before of main runs. i've never had happen before , hardly have quarter's worth of coding experience i'm not sure if there's i'm doing wrong. compiles, @ least on computer, upon running main never reached. context: i'm trying connect vertices , edges in adjacency matrix , use prim's algorithm build mst, that's later. built header file, contained typdef calls structures , functions. however, switched structure definitions header file because getting memory errors; hence why think there's issue structs. graph.h: //leland wong 00000897031 //graph header file #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #ifndef graph_h #define graph_h typedef struct vertex { double longitude; double latitude; char city[30]; int index; int visited; //0: not visited, 1: visited, 2: visited struct edge* nexte;

javascript - Triggering a button click when going on page -

is there way have user click on link takes them page , triggers (or multiple) button click(s). imagine use js. more info: page wouldn't have code in it. imagine code in link. try this $(button-selector).trigger('click');

java derby database query, with user input text -

i have java derby database, can write , read database. i having trouble: making text user enters text field, incorporated database query determine results displayed. i tried way, results were, if click search button, return info/query "run" screen, not incorporating user input query tho, have in code, replacing abc number in database. do have create kind of command line argument? set variable differently? can replace query info database info goes variable how tried in upcoming example? private void jbutton1actionperformed(java.awt.event.actionevent evt) { string abc = jtextfield1.gettext(); string data = "jdbc:derby://localhost:1527/sample"; try ( connection conn = drivermanager.getconnection( data, "app", "app"); statement st = conn.createstatement()) { class.forname("org.apache.derby.jdbc.clientdriver"); resultset rec = st.executequery( &q

RabbitMQ resend message to failed consumer only -

if publish message exchange , consumer of message fails process can retry message @ set interval. problem message gets sent consumers instead of consumer failed. how resend message consumer failed? if consumer fails, message stay in queue , dont have send again. when consumer , running receive last message failed process. way solve problem of sending message on , on again. , don't have send nack dont ack message , message in queue when consumer fails. can try getting message , stopping consumer before doing ack . able see message again in queue.

linux - How do I delete all files/driectories within my directory that are older than a day? -

this question has answer here: find files older x days in bash , delete 2 answers i’m using amazon linux bash shell. wanted delete directories , files more day old in directory, tried running statement sudo find /usr/java/jboss-as-7.1.3.final/standalone/tmp/vfs -name "*" -type f -mmin +1441 -delete however, after running above, when check directory, there still child directories older day … [mike@mymachine /]$ ls -al /usr/java/jboss-as-7.1.3.final/standalone/tmp/vfs total 240 drwxr-xr-x 17 jboss jboss 4096 sep 20 23:24 . drwxr-xr-x 5 jboss jboss 4096 jun 24 2013 .. drwxr-xr-x 186 jboss jboss 24576 sep 20 21:12 deployment2368807199465dba drwxr-xr-x 93 jboss jboss 20480 sep 20 23:23 deployment2617ff35c8bff41a drwxr-xr-x 6 jboss jboss 24576 sep 19 20:26 deployment3571c00385713fe3 drwxr-xr-x 2 jboss jboss 20480 sep 19 17:39 deployment3d351ede5

pdf reader - Android - PDFReader renders a smaller output than expected -

good day, following youtube tutorial on how use pdfrenderer display pdfs on imageview. downloaded code (link in description) , tried myself. works , displays pdf. however, output rather small. not occupy entire imageview area. here layout life: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <imageview android:id="@+id/image" android:layout_width="match_parent" android:layout_height="0dp" android:scaletype="fitxy" android:layout_weight="1"/> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" >

Get com.google.gdata.util.ServiceForbiddenException after moving contact sync app to new machine -

i have java application uses google contact api sync contacts a local pda application. working fine on old machine, after copying source , (including client_secrets.json) new laptop, following error calling com.google.gdata.client.service.getfeed(): com.google.gdata.util.serviceforbiddenexception: cannot request contacts belonging user i passing in same user id , password before, i'm not sure why says "another user". here's relevant code: // initialize contacts service service = new contactsservice(cfg.gappname); // authorize service credential credential = authorize(contacts_scope, "contacts"); if (credential != null && (credential.getexpiresinseconds() == null || credential.getexpiresinseconds() < 5)) { credential.refreshtoken(); } string token = credential.getaccesstoken(); service.setheader("authorization", "bearer " + token); // request feed

xml parsing - How to convert nested list to xml Using R -

i've kml file , wanted add nodes @ specific place it, wrote code .. library(xml) kml.text <- readlines("c:/users/pc/downloads/googletraffic/maps/all maps.kml") xml_data <- xmltolist(kml.text) top = newxmlnode("description") table = newxmlnode("table ", attrs = c(width = 300, border = 1), parent = top) tbody <- newxmlnode("tbody",parent = tr) tr <- newxmlnode("tr",parent = table) th <- newxmlnode("th",attrs = c(scope = "col"),scope1 = max(all$traveltime),parent = tr) th <- newxmlnode("th",attrs = c(scope = "col"),scope1 = "md",parent = tr) th <- newxmlnode("th",attrs = c(scope = "col"),scope1 = "pm",parent = tr) tr <- newxmlnode("tr",parent = table) th <- newxmlnode("th",attrs = c(scope = "col"),scope1 = max(all$traveltime),parent = tr) th <- newxmlnode("th",attrs = c(scope = &

GWT JSNI - Java To Javascript Back To Java Results in undefined params -

i have racked brain on better part of 2 days. i've read through documentation on jsni here few different blog posts on jsni , passing variables this one , nothing indicates i'm doing wrong. i'm trying call gwt client side class javascript method i'm exporting javascript class loads. method takes params js method , stores them on instance of java class passed. seems work. but, once reference methods in java code, they're undefined. believe happening java class instance getting lost somehow after js finishes. here's code explain workflow... i have java class named profilewidgee. class has method set local variables location, lattitude, , longitude. method name is... public void handletargetpicked(string mloc, string mlat, string mlng) { loc = mloc.equalsignorecase("undefined") ? "" : mloc; lat = mlat.equalsignorecase("undefined") ? "" : mlat; lng = mlng.equalsignorecase("undefined") ?

android - java.lang.NoClassDefFoundError: org.jsoup.Jsoup -

i got error: java.lang.runtimeexception: error occured while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java:299) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:352) @ java.util.concurrent.futuretask.setexception(futuretask.java:219) @ java.util.concurrent.futuretask.run(futuretask.java:239) @ android.os.asynctask$serialexecutor$1.run(asynctask.java:230) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) @ java.lang.thread.run(thread.java:849) caused by: java.lang.noclassdeffounderror: org.jsoup.jsoup the problem not android version error. example android 6 works whereas android 4.3 throws error. me do? my build.gradle: apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.3" defaultconfig { applicatio

javascript - angularfire not working with me , I don't know why? -

the html code - call required libraries <!doctype html> <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script type="text/javascript" src="https://www.gstatic.com/firebasejs/3.0.0/firebase.js"></script> <script type="text/javascript" src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script> <script type="text/javascript" src="js/app.js"></script> </head> <body ng-app="seworko"> <div ng-controller="users"> {{ 4+4 }} </div> </body> </html> the javascript code var app = angular.module("seworko", ["firebase"]); var config = { apikey:"mykey&qu

html - Text over Image - Make is responsive for smaller screens -

i'm new programming , i'm trying modify retina template customize shopify store. it's been fun far , have had results! however i'm stuck on question: how make code responsive? i managed add html , css codes have text on image, can't figure out make responsive (text automatically adjust size) smaller screens (ex. mobile) html code <div class="textoverimage"> <img src="xxxxxx" alt="xxxx"> <h7> text </h7> </div> css code: /* #custom styles ================================================== */ .textoverimage { position: relative; width: 100%; } h7 { position: absolute; top: 75px; left: 0; width: 100%; text-align: center; } i used h7 not interfere preexisting codes (shopify used h1 - h6 ) you can attain through media queries. @media screen , (max-width:500px) { h7 {         font-size:14px;     } } this make font size of h7 14px when scree

typescript1.9 - Typescript error TS1005 from tinycolor declaration -

i'm converting small project typescript 1.9 try learn language. have been using library called tinycolor, , downloaded declaration file it. the file can viewed here: https://github.com/definitelytyped/definitelytyped/blob/master/tinycolor/tinycolor.d.ts i getting errors c:\users\kbirger\documents\projects\peysage\ts\typings\tinycolor\tinycolor.d.ts(339,9): error ts1005: ';' expected. the relevant line of code here: declare namespace readable { interface readable { brightness: number; color: number; } } i'm not sure issue is. looks correct syntax me, , what's more, no complaints when run thing through playground on typescript site. can shed light?

css - Gulp sass compiles to wrong directory only when triggered by gulp watch -

this 1 has me scratching head sure. have project set so . ├── app | └── styles | ├── foundation | | └── foundatipn.scss | └── app.scss ├── build | └── styles └ └── app.css my gulp-sass task compiles app.scss correct , places final file in build.styles. however, when sass task triggered gulp watch puts css file in app/styles/. still compiles correct file build/styles. relevant code below var gulp = require('gulp'), browsersync = require('browser-sync').create(), notify = require('gulp-notify'), include = require('gulp-include'), autoprefixer = require('gulp-autoprefixer'), sass = require('gulp-ruby-sass'), sourcemaps = require('gulp-sourcemaps'), cssnano = require('gulp-cssnano'), browserify = require('browserify'), source = require('vinyl-source-stream'); var reload = browsersync.reload; var dest = './build&#

android how change size image in background xml -

Image
i'm making layer-list drawable... set stroke (2dp, color: #000000), corners (5dp), background (yellow) , add image on right side, can't change image size. what want: but have that: this code: content_main.xml: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="info.e_kon