Posts

Showing posts from April, 2012

c# - Click on image and show message box depending on the clicked place -

Image
i have idea of world map image , when click country on it, shows information of country in messagebox example have idea how that? i have rectangle , button , when click button shows image in rectangle thought if use polygons shape country's i'm little stuck. i have every country apart , maybe borders light when clicked you can pretty using wpf: find nice world map in svg format. used this one wikipedia: download , install inkscape open svg you've downloaded. inkscape has nice feature makes possible save svg xaml. import viewbox xaml file wpf window/etc: for each path in xaml can add mouseenter / mouseleave event handler or can use same 1 path s sample code: private void countrymouseenter(object sender, mouseeventargs e) { var path = sender path; if (path != null) { path.fill = new solidcolorbrush(colors.aqua); } } private void country_mouseleave(object sender, mouseeventargs e) { var

networking - How to find IP Assigned to my PC by Router using C# -

my pc connected wifi network. , want ip-address assigned(to pc) wifi-network device(router or something). or might say, want find ip-address of pc on network. actually, pc has more 1 network adapters created (3 ethernet adapters , 1 wifi-adapter). i tried following code: iphostentry localhostentry = dns.gethostbyname(dns.gethostname()); string myip = localhostentry.addresslist[0].tostring(); but returns: 192.168.138.1 while ip assigned pc wifi-network-device is: 192.168.1.21 192.168.138.1 ip of ethernet adapter.

c++ - Clang. How to overcome "unknown builtin" error message -

i have program setups clang compiler instance , adds include paths using headersearchoptions class. when run parseast on input file libavutil/samplefmt.c (from ffmpeg package), following message on screen. basically, not able resolve (gcc?) builtin functions. how rid of error? in general, if setting include path through headersearchoptions, how ensure don't miss out on include paths gcc installation? thanks! #include "..." search starts here: #include <...> search starts here: . /usr/include/freetype2 /usr/include/fribidi /usr/local/include /usr/include/clang/basic /opt/llvmrelease/bin/../lib/clang/3.4/include /usr/include/i386-linux-gnu /include /usr/include end of search list. in file included libavutil/samplefmt.c:19: libavutil/common.h:258:12: error: use of unknown builtin '__builtin_clz' return av_log2((x - 1) << 1); ^ libavutil/intmath.h:89:23: note: expanded macro 'av_log2' #define av_log2 ff_log2

javascript - How to simplify this 3 switch-case functions? -

i want simplify long jquery/javascript code, can me? still learn :) here's jquery code: $('.pagination-link').click(function() { settimeout(function() { currentanchor = $('body').attr('class'); switch (currentanchor) { case 'active-slide-1': $('#rond').removeclass().addclass('rond1').animate(); break; case 'active-slide-2': $('#rond').removeclass().addclass('rond2').animate(); break; case 'active-slide-3': $('#rond').removeclass().addclass('rond3').animate(); break; case 'active-slide-4': $('#rond').removeclass().addclass('rond4').animate(); break; case 'active-slide-5': $('#rond').removeclass().addclass('rond5').animate(); break; case 'active-slide-6': $('#rond').removeclass().addclas

regex - How to use variable in extractor with unescaped body? -

i have jmeter user variable x = abc , extractor response, regex = abc\d, using unescaped body option. if try change regex ${x}\d, doesn't work, however, if change body type normal body escape characters, works fine. for better readability, want keep unescaped body, please advise correct syntax. jmeter uses stringescapeutils.unescapehtml4 on response if choose body (unescaped) option but @ end variable "decoded" without choosing option, meaning &nbsp; -> space, can ignore option.

[C++]Algorithm for adding days to an abstract date, eg. year that has 13 months, 13th month has 40 days -

i have task twist, , don't know start. need write function add days given date (dd/mm/yyyy), , return date in result, problem is, year not neccessarily needs georgian, eg. can have 13 months, 13th month has 40 days. not need code, need kind of algorithm know, start. tried use julian day number, cannot edit needs. if has suggestions, they'd appreciated. cannot use wrappers time_t you can write 2 functions: int datetoday(const date& date); date daytodate(int day); which convert date days spent since 00/00/00 , in calendar (this straightforward, , can expressed in generic formulas - need know month per year, , days per each month define calendar + logic leap years). after that, can add day date by date result_date = daytodate(datetoday(start_date)+days_to_add);

xml - XPath - find lowest elements with specific attribute values -

how can list of elements fit condition, don't have decedents fit same condition (i.e. lowest elements in hierarchy fit condition)? for instance, consider following xml: <root> <parent1 mycond='true'> <child1 mycond='false'> ... </child1> <child2 mycond='true'> ... </child2> <child3 mycond='false'> ... </child3> </parent1> <parent2 mycond='false'> <child1 mycond='false'> ... </child1> <child2 mycond='true'> ... </child2> </parent2> <parent3 mycond='true'> <child1 mycond='false'> ... </child1> </parent3> </root> using following xpath expression: //*[@mycond='true'] gives [parent1, parent1/child2, parent2/child2, parent3] . i'm looking way filter out parent1 has decedent paren

javascript - Set new object location on button click? -

i'm trying figure out change object's location on screen when clicks button. example image 1 should move {'x' : '300' , 'y' : '200'}, when button clicked. any suggestions? thanks! given have following in html layout: <button id="button1">click</button> <img src="..." id="image1" /> you can in script file (pure javascript): var button1 = document.getelementbyid("button1"); var image1 = document.getelementbyid("image1"); button1.click = function() { image1.style.position = "absolute"; image1.style.top = "300px"; image1.style.left = "200px"; }; or jquery/zepto.js: $(function() { $("#button1").on("click", function() { $("#image1").css({position: "absolute", top: "300px", left: "200px"}); }); });

c# - Randomly pick a specific int from a 2D Array -

i'm trying randomly specific integer (1) 2d array list filled 0's , not many 1's. made this, , works: while (wallslist[randomx, randomy] != 1) { randomx = randomizer.next(34); randomy = randomizer.next(34); } the downside of it, it's takes time find 1 time int (1), , have process on 1000 times since new 1's added , removed 2d array each time. takes 3m launch program know if there optimized version of this, searched lot , found solution 1d arrays. time. you have sparse array. why not represent list of x/y int pairs? then, if x/y int pair in list, it's 1, if not, it's 0. then, find random value/cell containing 1, pick random value list. you use list like new list <tuple<int, int>> { new tuple<int, int>(1, 5), new tuple<int, int>(2, 7) }

css - Can't display SVG image -

i'm trying display svg; below code works inline svg, have svg file lots of content, changed this: background:url("data:image/svg+xml;base64, dot-and-circle.svg") no-repeat; but it's not working. can help? body,html,#map_canvas{height:100%;margin:0;} #map_canvas .centermarker{ position:absolute; /*url of marker*/ background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30'><circle cx='15' cy='15' r='10' /></svg>") no-repeat; /*background:url('dot-and-circle.svg') no-repeat; /*center marker*/ top:50%;left:50%; z-index:1; /*fix offset when needed*/ margin-left:-10px; margin-top:-34px; /*size of image*/ height:16px; width:16px; cursor:pointer; }

perl - Operator to read a file using file handle -

i trying read file, while($line = $file_handle) when ran code, program hung. i noticed read file using file handle, need used <> while($line = <file_handle>) the later code ran. now know operator <> read file line line, want know happening when dont provide <> operator? not able find end of line ?or? thankyou short   file read <> operator without it assignment, infinite loop. the while (...) { ... } checks condition inside () , if true executes body in block {} . keeps doing until condition in () evaluates understood false (generally 0 , '0' , '' , or undef ). operator <> provides, example, have idiom while (my $line = <$file_handle>) { ... } the <> operator reads line @ each iteration resource $file_handle associated , when reaches end-of-file returns undef loop terminates , program execution continues @ next statement after loop. diamond operator <> operator fo

javascript - Using canvas.getContext("2d") on multiple canvases on same page -

i'm trying make page allows users choose canvas size want draw on. to i've created page 3 canvases of different sizes along button each. i've hidden canvases in css used jquery show canvas when relevant button clicked. problem is, that's broken ability draw on canvases except 1 that's first in html doc. suspect problem code: html <canvas width="400" height="250" class="small"></canvas> <canvas width="600" height="400" class="medium"></canvas> <canvas width="1000" height="800" class="large"></canvas> js var context = $canvas[0].getcontext("2d"); $canvas.mousedown(function(e){ lastevent = e; mousedown = true; }).mousemove(function(e){ //draw lines if(mousedown) { context.beginpath(); context.moveto(lastevent.offsetx, lastevent.offsety); context.lineto(e.offsetx, e.offsety); context.strokestyl

pika - kombu not reconnecting to RabbitMQ -

i have 2 servers, call them , b. b runs rabbitmq, while connects rabbitmq via kombu. if restart rabbitmq on b, kombu connection breaks, , messages no longer delivered. have reset process on re-establish connection. there better approach, i.e. there way kombu re-connect automatically, if rabbitmq process restarted? my basic code implementation below, in advance! :) def start_consumer(routing_key, incoming_exchange_name, outgoing_exchange_name): global rabbitmq_producer incoming_exchange = kombu.exchange(name=incoming_exchange_name, type='direct') incoming_queue = kombu.queue(name=routing_key+'_'+incoming_exchange_name, exchange=incoming_exchange, routing_key=routing_key)#, auto_delete=true) outgoing_exchange = kombu.exchange(name=outgoing_exchange_name, type='direct') rabbitmq_producer = kombu.producer(settings.rabbitmq_connection0, exchange=outgoing_exchange, serializer='json', compression=none, auto_declare=true) setti

ios - CryptoSwift + CryptoJS Swift -

i need here decrypting server response encrypted cryptojs. i use cryptoswift decrypt response. here sample of server response data get. {\"ct\":\"twqy1xihfw+shg9l8onyuah8xwbgy7yhef/ibb6jkkmx+ndq2u78553/0hxlxvknp6xsagc0zg+2avkccshlkrjrsilvgzmdcklparbzia3z2drozegrkrctin2fk4pkn0xiidnbeth0umdinurdfxoeirqlffobgqdz5virdw9tvhl3ftz169ooeg1dutag0bq5qu4tp1k4vstd78kwr4c2a4qypj1baqrjrsabdahhbvjrgiosy5d30h10e9re9iegdwsfuoxw0+2n5nhfswpuwadv45t6funz5ptc/l1njvpti2czghiw4vl8px3huzpefpje9uunupr2e8/vhqt8hx+jjt0looszhcuj4ewv2l6teawxk5i1mnz7xmkvrayut7jyu2ob8ite+zjaatiokhhri1heu9wmeves6sdp2jdqflm6rb2v3vnhtrqwgqlcg+rnpsgg0zqumtoko6mrn/vjadmtpyjbgp1o5ickrr5vvsvyi3aejwrjkitppy/hvk8oa8ovmzjuwsncpejflww8adegawrbzzyguszsooc8/o5objvspzqrohtffao8sbms2ovjes5wgycbew33i1ka8d1ejg+ncyr7h/rojwpy8ynbwc0qbn9qkbnfrdxlqvrr8g6chrrezgvvplx8aypmfsahzf/kppax0ypmf1v29rjwkbcworslisa7uulkzzhvdrgx3pel+mpi2bqb9myajhhrkjat2t6k8ffxkzvmckrulllm/k9ax3duqnmubj6schblg+cl3vfeqzzwj1mjw09cklgfcoi06bebkp9apqbrkrybo

Web scraping using rvest -

i want scrape text in following website: http://curia.europa.eu/juris/document/document.jsf?text=&docid=49703&pageindex=0&doclang=en&mode=lst&dir=&occ=first&part=1&cid=656172 my code: html = http://curia.europa.eu/juris/document/document.jsf?text=&docid=49703&pageindex=0&doclang=en&mode=lst&dir=&occ=first&part=1&cid=656172 main_content <- html_nodes(html, css = "#document_content") main_text <- main_content %>% html_nodes("p") %>%html_text() however, in way, not text extracted because text in node "dd"..."/dd" i wonder if can html_nodes("p") or html_nodes("dd") or html_nodes("dt") replace html_nodes("p") in above dode. how can achieve this? or there other way can accomplish task? ideally, dont want use main_text <- main_content %>% html_text() because want separate each sentence. when se

Changing spring-cloud-stream instance index/count at runtime -

in spring-cloud-stream, there way change instance count , instance index of application without restarting it? also, there recommended way automatically populate these values? in microservices world, seems prohibitively difficult, since services starting , stopping time. in spring-cloud-stream, there way change instance count , instance index of application without restarting it? not in current version, open discuss in context of github issue. also, there recommended way automatically populate these values? in microservices world, seems prohibitively difficult, since services starting , stopping time. my recommendation @ http://cloud.spring.io/spring-cloud-dataflow/ helps orchestration of complex microservice topologies (and designed work in conjunction spring cloud stream streaming scenarios)

sql - Get records by hash value -

i'm trying records table hash value. here record example: activity:0x0000000709be18> { :id => 1, :trackable_id => 3, :trackable_type => "user", :owner_id => 1, :owner_type => "user", :key => "user.ban", :parameters => { :status => "new" }, :recipient_id => nil, :recipient_type => nil, :created_at => wed, 01 jun 2016 22:19:39 utc +00:00, :updated_at => wed, 01 jun 2016 22:19:39 utc +00:00 } i need activities paremeters status new (parameters[:status] == 'new'). this code works, need return activerecord relation not array. activity.select{|act| act.parameters == { status: 'new'}} it not easy search within serialized field, can use like limitations. activity.where('parameters ?', '%status: new%') this working, suggest adding custom field, public a

r - Scraping dataTable gets only header -

Image
i'm trying salary data the feds data center . there 1537 entries read. thought i'd gotten table xpath chrome's inspect . however, code returning header. love know i'm doing wrong. library(rvest) url1 = 'http://www.fedsdatacenter.com/federal-pay-rates/index.php?n=&l=&a=consumer+financial+protection+bureau&o=&y=2016' read_html(url1) %>% html_nodes(xpath="//*[@id=\"example\"]") %>% html_table() i (lonely) header: [[1]] [1] name grade pay plan salary bonus agency location [8] occupation fy <0 rows> (or 0-length row.names) my desired result data frame or data.table 1537 entries. edit: here's relevant info chrome's inspect, header in thead , data in tbody tr the site not expressly forbid scraping data. terms of use generic , taken main http://www.fedsmith.com/terms-of-use/ site (so appears boilerplate). aren't doing source free data adds value.

Access validation information from Angular 2 model-driven form? -

i have angular 2 form uses template-driven approach converting model-driven approach. currently, form uses style this: .ng-valid[required] { border-left: 5px solid #42a948; /* green */ } this marks of fields have required attribute green bar. now moving model-driven, control no longer has "required" attribute. there way access validation rules associated control (see below) binding in form? buildform() { this.heroform = this.fb.group({ 'name': [this.model.name, validators.compose([validators.required, validators.minlength(4), validators.maxlength(24)])], 'alterego': [this.model.alterego], 'power': [this.model.power, validators.required] }); i able provide logic using set of internal data structures , building method this: isrequired(controlname: string): boolean { if (object.keys(this._validationmessages).includes(controlname

html - rails I have a background image in development environment this show but not in production -

css/html code snippets in localhost can see in production environment, not loading. i tried many forms haven't had results. thank you, jhonny you give code image, cant modify it. give idea. for css , first add .scss extension filename. file name should this, filename.css.scss now, if place image in app/assets/images folder can access this, background: url(asset-path("image.jpg")); for html , make sure html file has .erb extension it. can refer small ruby block (assuming image in app/assets/images folder). <%= asset_path "image.png" %> fot more info, can read asset pipeline .

How to add MAVEN SHADE plugin to eclipse -

i have maven project in eclipse. able create jar using maven build. trying create jar using maven shade. how add in eclipse? don't see installation on website. tutorials show edited pom.xml maven shade tags. i missing here. please guide. the maven shade plugin plugin maven, , not eclipse. if include plugin in pom file per tutorials , examples (or configured needs) maven download plugin create uber-jar repacked dependencies.

computer vision - Are Extrinsic Camera Parameters classified as a Rotation Matrix? -

i've been reading prince's book computer vision: models, inference, , learning , aim of understanding camera parameters , pose estimation problem , i'm having trouble extrinsic camera parameters. understand it, extrinsic camera parameters consist of rotation matrix , translation vector . rotation matrix transforms world co-ordinate system camera co-ordinate frame. question whether rotation matrix rotation matrix in strict sense; in it's orthogonal , has determinant 1. i ask because in subsequent chapter on geometric transformations, describes case camera viewing plane (w/z co-ordinate = 0), , introduces affine , projective transformations represented extrinsic camera matrix. i'm confused because such transformations can't achieved using rotation matrix, or wrong? confused affine , projective transformations represented projection matrix. for typical case of pinhole camera, can think of projection matrix product p = k * [r | t] of 3x3 upper

jquery - Calling a function in Javascript Syntax -

this might simple question reason can't find solution. new javascript , had lot of code put on me work on. trying call function in different html file , use in different html file. keeps printing out statement. so included file in html using this <xi:include href="model_pdb.html"/> this labeled in call jquery libraries , functions <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript" src="canvas.js" ></script> <script type="text/javascript" src="viewer.js" ></script> <script type="text/javascript" src="render.js" ></script> <script type="text/javascript" src="blowup.js" ></script> <script type="text/javascript" src="rotateimages.js" ></script> and calling function in tag of function &l

java - Convert 12 hours to 24 hours -

how convert 12 hours hh:mm a hh:mm ? when converting unable 24 hours format. here time format pm not converting when assigned start time @ 10pm , wake time 7am. here unable total time. it's getting stopped @ 12:00am , getting total time double 10pm 7am 18 hours. when time changing 11:59pm 00:00am "00:00am" causing problem here. public class wakeup extends activity { imagebutton home, back, up_arw2, up_arw1, up_arw3, down_arw4, down_arw5, down_arw6; textview hours, minutes, ampm; button save_btn; sharedpreferences timepreference; sharedpreferences.editor edittime; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.wakeup_time); hours = (textview) findviewbyid(r.id.hours); minutes = (textview) findviewbyid(r.id.minutes); ampm = (textview) findviewbyid(r.id.ampm); home = (imagebutton) findviewbyid(r.id.home); save_btn = (button) findviewbyid(r.id.save_btn); timepr

javascript - function inside Controller inAngularjs -

i have 2 functions drag_drop , drag_start , inside these functions nedd data controller scope. code somthing function drag_start(event) { event.datatransfer.dropeffect = "move"; event.datatransfer.setdata("text", event.target.getattribute('id')); } function drag_drop(event) { // here want use $scope controller } controller code : institutioncontroller.controller('institutioncontroller',function $http.get('/myresponses').then(function(myres) { $scope.myrps=myres.data; // want use $scope.myrps when drag , drop element inside div html code : ul(ng-hide="siwtchci",class="list-inline") li(ng-repeat="owninst in owninsts",draggable='true',ondragstart='drag_start(event)') a(class="btn btn-default btn-org" ,role="button") {{owninst.org.name}} #drop_z

ember.js - Architect admin interface for single page app -

i have single page app built emberjs rails backend. common pattern build admin interface on rails serverside on subdomain. right approach this? your question vague try answer best. have done node , go backend combined ember.js. no , there technically nothing prevent doing single page application admin interface. rails choice this, , should stick backend framework/language , team master most. as right approach, there no magic recipes. document code, write test , follow best practices tools using. one key element though communication between frontend , backend. ember chose follow json api specification ( http://jsonapi.org/ ) , comes out of box adapter talk these kind of api. using such adapter save lot of time. here implementation of json api ruby : http://jsonapi.org/implementations/#server-libraries-ruby one more thing frontend code structure. haven't how big app be. if gets big, may want take pod approach in ember-cli ( http://ember-cli.com/user-guide/#pod

How to get a year first date and last date in javascript -

need first date , last date time of year passing year number. it's below. var year = 2016 //any year var first_date = ? //from year var last_date = ? //from year var year = 2016 //any year var first_date = new date(year, 0, 1); var last_date = new date(year, 11, 31); document.write(first_date); document.write("<br/>"); document.write(last_date);

Calculate nearest location Google Map Android Studio -

i know how find distance between 2 location on android studio google map how calculate distance nearest 1 compering 3 or 4 found location? public void ondirectionfindersuccess(list<route> routes) { progressdialog.dismiss(); polylinepaths = new arraylist<>(); originmarkers = new arraylist<>(); destinationmarkers = new arraylist<>(); (route route : routes) { mmap.movecamera(cameraupdatefactory.newlatlngzoom(route.startlocation, 16)); ((textview) findviewbyid(r.id.tvduration)).settext(route.duration.text); ((textview) findviewbyid(r.id.tvdistance)).settext(route.distance.text); originmarkers.add(mmap.addmarker(new markeroptions() .icon(bitmapdescriptorfactory.fromresource(r.drawable.start_blue)) .title(route.startaddress) .position(route.startlocation))); destinationmarkers.add(mmap.addmarker(new markeroptions() .icon(bitmapdescript

php - Codeigniter base_url() added for every <a> tag -

i developing project ci. in project need add "tel" in "a" tag calling website. addded <a link="tel:+919898989898"> when open link page, link abc.com/tel:+919898989898 , redirecting error page.if manually remove baseurl page working. please give me idea why happening , how prevent baseurl adding auomatically. please don't give link explain "tel" tag description use <a href="tel:555-555-5555">555-555-5555</a>.

tensorflow - Are there any documents for Eigen/CXX11? -

i add new op tensorflow. find ops in tf implemented using tensor operations implemented in ``third_party/eigen3/unsupported/eigen/cxx11/tensor'', seems independent of original eigen library. there documents new eigen/cxx11 library? this readme describes how use eigen tensor module. overview, can refer wiki page

matrix - How to parallel for-loop in python? -

update 1.0 start it seems when call for i, wi in enumerate(w.t): idx.append(i) result.append(pool.apply_async(als_y, (x, wi, q, lambda_, n_factors, i,))) the arguments passed function als_y/als_x not references, copied arguments..so, when x or y is large matrixes , such as, in case, it's 6000*40 or so(and it's for-loop , let's assume number iterations 50 000 , ...), exceeds limit of memory. , tried using global arguments, passing indices parameters functions, import multiprocessing import time import numpy np def func(idx): global a[idx] += 1 if __name__ == "__main__": a=range(10) j in xrange(2): pool = multiprocessing.pool(processes=8) result = [] in xrange(10): result.append(pool.apply_async(func, (i, ))) pool.close() pool.join() print print "sub-process(es) done." it outputs: ` [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] sub-process(es) done. [0, 1

relayjs - Relationship between GraphQL and database when using connection and pagination? -

it easy set pagination relay there's small detail unclear me. both of relevant parts in code marked comments, other code additional context. const posttype = new graphqlobjecttype({ name: 'post', fields: () => ({ id: globalidfield('post'), title: { type: graphqlstring }, }), interfaces: [nodeinterface], }) const usertype = new graphqlobjecttype({ name: 'user', fields: () => ({ id: globalidfield('user'), email: { type: graphqlstring }, posts: { type: postconnection, args: connectionargs, resolve: async (user, args) => { // getuserposts() in next code block -> gets data db // pass args (e.g "first", "after" etc) , user id (to user posts) const posts = await getuserposts(args, user._id) return connectionfromarray(posts, args) } }, }), interfaces: [nodeinterface]

configuration - How to set `Copy user password reset e-mail to manager ` in OIM 11gr2ps3? -

i need set copy user password reset e-mail manager specifies whether manager of user password being reset must notified of password reset. http://docs.oracle.com/cd/e27559_01/admin.1112/e27149/system_props.htm#omadm884 as per above link there property sends email user's manager on password reset in 11gr2 dont see same in ps3 suppose create same in system configuration should value same?

Basic code editor functionality in Racket -

i'm creating program live coding performance, want basic s-expressions code editor (whose contents input eval ed racket code in appropriate syntactical context). since drracket written in racket, expected recreating text editing functionality of code editor painless, , documented, i've found no guidance. have following code far: (define frame (new frame% [label "simple edit"] [width 800] [height 800])) (define canvas (new editor-canvas% [parent frame])) (define text (new text%)) (send canvas set-editor text) (send frame show #t) (define menu-bar (new menu-bar% [parent frame])) (define edit-menu (new menu% [label "edit"] [parent menu-bar])) (define execution-menu (new menu% [label "execution"] [parent menu-bar])) (new menu-item% [label "run"] [parent execution-menu] [callback (λ (mi e) (update (send text get-text)))] [shortcut #\r]

amazon web services - Alexa Skill kit : The target Lambda application returned a failure response -

i created simple hello world alexa skill aws lambda using java based on https://github.com/amzn/alexa-skills-kit-java/tree/master/samples/src/main/java/helloworld . but when tried test lambda function returned following error { "errormessage": "error loading class helloworld.helloworldspeechletrequeststreamhandler: com/amazon/speech/speechlet/lambda/speechletrequeststreamhandler", "errortype": "class java.lang.noclassdeffounderror" } but zip file uploaded consist of helloworldspeechletrequeststreamhandler why error?

javascript - Add label to the right of the qualtrics slider? -

in qualtrics survey have horizontal slider want put label right of actual slider. i assume relatively simple css fix have not been able figure out how qualtrics/css works. i wound figuring out. with slider styled question you: click on choices text edit text question go rich content editor paste following code snippet (edit text appropriately) <p> <span style="float: right">on right</span> <span style="float: left">on left</span> </p> a bit of odd hack works!

java - value of variable {5} is not set -

this in properties file: message=you scheduled {0} @ {1} {2} {3} @ {4}. we'll see then! questions please call {5}. java code setting values: string[] msgparams = new string[6]; msgparams[0] = "tire rotation" msgparams[1] = "2016-06-03" msgparams[2] = "12:00" msgparams[3] = "vehicle" msgparams[4] = "dehli" msgparams[5] = "9876543210" string message = messagesource.getmessage("message", msgparams , locale.getdefault()); system.out.println(message); output is: you scheduled tire rotation @ 2016-06-03 12:00 vehicle @ dehli. see then! questions please call {5}. value of {5} not set. it maybe because missing \ before ' : message=you scheduled {0} @ {1} {2} {3} @ {4}. we\'ll see then! questions please call {5}.

data structures - need help in python list -

i implementing linked list in python. insert operation giving error below. can 1 in fixing ? list have head first node. subsequent nodes appended in insert operation. output: 10 traceback (most recent call last): file "z.py", line 45, in <module> list_mgmt() file "z.py", line 43, in list_mgmt ll.display() file "z.py", line 32, in display print current.get_data() attributeerror: 'function' object has no attribute 'get_data' class node: def __init__(self, data): self.data = data self.nextnode = none def get_data(self): return self.data def get_nextnode(self): return self.nextnode def set_nextnode(self, node): self.nextnode = node class linklist: def __init__(self): self.head = none def insert(self, data): if self.head == none: current = node(data) self.head = current else: current = self.head

java - Sorting List in pairs without using Map or Sets -

i have strange problem in have data in 3 columns of students follows, student initdate findate abc 2/2/2016 5/5/2017 abc 3/2/2016 3/30/2017 ced 1/1/2015 3/12/2017 lef 1/12/2016 11/17/2017 ced 1/12/1999 12/23/207 lef 2/13/2000 11/19/2017 my goal find lowest initdate of every student , highest findate of same student. data stored string have parse dates have done using dateformat parse date first. initially, tried storing data in pair student , initdate , other pair student , findate , , tried storing data in hashmap date key problem store unique data , if 2 students have same initial dates 1 of them stored in hashmap. i realized cannot use set , maps store data store unique values have decided use list . i have created 3 lists, 1 of type string , other 2 of type date , can store duplicate data. have stored student names in 1 list , dates in other 2 lists. what want sort list of students in such way

java - Mockito's spy functionality fails -

i have public class mclass contains public static method getsystime() . in test trying mock 1 particular method of class. need whenever method of class called in test, returns string "faketimestamp". class mclass doesn't have parent class. following code: mclass m = mockito.spy(new mclass()); mockito.when(m.getsystime()).thenreturn("faketimestamp"); however, following error on test: org.mockito.exceptions.misusing.missingmethodinvocationexception: when() requires argument has 'a method call on mock'. example: when(mock.getarticles()).thenreturn(articles); also, error might show because: 1. stub either of: final/private/equals()/hashcode() methods. methods *cannot* stubbed/verified. 2. inside when() don't call method on mock on other object. 3. parent of mocked class not public. limitation of mock engine. @ com.scb.edmhdpif.filevalidator.cdcrowcountvalidatortest.cdcrowcountfiledrivertest(cdcrowcountvalidatortest.java:77)

php - codeigniter url encrypt not working -

<a href="<?php echo base_url().'daily_report/index/'.$this->encrypt->encode($this->session->userdata('employee_id')) ?>"> i have encrypted above url using codeigniter encrypt set encryption key in codeigniter config file $config['encryption_key'] = 'giouetfdwgzbl2bje9bx5b0rlsd0gkdv'; and called in autoload $autoload['libraries'] = array('session','form_validation','encrypt','encryption','database'); when ulr(href) load url this http://localhost/hrms/daily_report/index/fvjgcz4qqztqak0jaomjiafbz/vkvsbug1igpqekqcz/k7+wue4e/m9u1ejwh3uktkeihexjgkk1dj2awl0+zq== but url not decoded, , i;m not getting employee_id shows empty. public function index($employee_id) { $save_employee_id = $employee_id; // decoding encrypted employee id $get_employee_id = $this->encrypt->decode($save_employee_id); echo $employee_id; // answer: fvjg

java - How to perform UPDATE and DELETE operation simultaneously on JSP page ? -

this question has answer here: how pass current item java method clicking hyperlink or button in jsp page? 1 answer i want perform multiple operation delete , update need send data controller, doing mistake?? following jsp page <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <jsp:usebean id="timedetailbean" class="com.logic.bean.userbean" scope="application" /> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type&