Posts

Showing posts from August, 2012

javascript - .next() jquery function skips next sibling -

i trying remove class element , add class next element. problem next element gets skipped. here javascript: var $active = this.$view.find('.active'); if ($active.index() !== this.$view.children().length - 1) { $active.next('.list-group-item').addclass('active'); $active.removeclass('active'); } here html: <div> <a class="list-group-item active">1</a> <a class="list-group-item active">2</a> <a class="list-group-item active">3</a> <a class="list-group-item active">4</a> </div> $('.list-group-item').on('click',function(){ debugger; var $active = $(this).parent().find('.active'); if ($active.index() !== $(this).parent().children().length - 1) { $active.next('.list-group-item').addclass('active'); $active.removeclass('active'); ...

jquery - Datatables : search input hidden record -

datatable contain below data format <tr> <td> displayedval <td><input type="hidden" name="val" id="val" value="hiddenval"></td> </td> </tr> want serach hidden values. when search hiddenval should row.

python - Django: <view_name> takes exactly 4 arguments (1 given) -

my application has form redirects form based on condition (the first form evangelizedform , , second conditional form socialaccountsform ) def fillform(request): if request.method == 'post': form = evangelizedform(request.post) if form.is_valid(): obj = form.save(commit=true) . . . return redirection(request, first_name, last_name, email, other_social_accounts) the view fillform view handles processing of first form. on successful submission of form, redirects redirection view: def redirection(request, first_name, last_name, email, other_social_accounts): if other_social_accounts == 'yes': return yes_social(request, first_name, last_name, email) based on value of other_social_accounts form field in original post, control of program transferred yes_social view: def yes_social(request, first_name, last_name, email): if request.method == 'post': form = socialaccountsfo...

javascript - IE8: Access denied -

i trying access , api using jquery/post not working in ie8. throwing access denied error in ie8 only. js code: var url = 'http://somecomp.cartodb.com:80/api/v1/map?map_key=xxxxxxxxxxxxxxxxxxxx&stat_tag=api'; var data = //some long data of length greater 3000 $.ajax({ crossorigin: !0, type: "post", method: "post", datatype: "json", contenttype: "application/json", url: url, data: json.stringify(data), success: function(a) { console.log('success'); }, error: function(a) { console.log('error'); } }) if add ?callback=? @ end of url, still fires error callback statustext: 'success' , code: 200 here full code: http://textuploader.com/ato0w change datatype jsonp allow make cross-domiain requests. work get requests. if you're using cors accessing cross-origin resource...

spring - Java Map String BigDecimal get function -

public set<product> getproductsbypricefilter(map<string, bigdecimal> filterparams) { set<product> productsbyprice = new hashset<>(); set<string> criterias = filterparams.keyset(); if (criterias.contains("low")) { (product product : listofproducts) { if (product.getunitprice().compareto(filterparams.get("low"))>=0 ) { productsbyprice.add(product); } } } return productsbyprice ; } i want compare product price "low" price map error java.util.linkedlist cannot cast java.math.bigdecimal is filterparams.get("low") linkedlist of 1 value? can't access list. your product.getunitprice() method seems returning linkedlist object instead of bigdecimal one. since did not supply code product.getunitprice() hard further.

google analytics - OnButtonCLick tag is not firing? -

i have defined trigger having event name "gtmevent" , tag "accountcreated". when click on button ("createaccount") goes next page. tag not fired , in summary event not listed when check google analytics through console found tag there in event name. is when click on page , after clicking stayed @ same page event listed on summary otherwise lost. ??

R Error - subscript out of bounds, with error=recover message -

i trying create bivariate ellipse see if true values fall within 95% confidence ellipse. getting subscript out of bounds error in r following code. not sure causing it. used options(error=recover) suggested in other posts not sure make out of it.. library(mass) set.seed(1234) #set working directory setwd("c://tina/usb_backup_042213/paper ii/mln automation/csvs_equal_20s") p1<- .136 p2<- .069 nn<-60 y<-null > y <- read.csv(file=paste0("mvn",i,".csv"), header=t) > > y<-as.matrix(y) > xx <- ifelse(y==0,y+.5,y) > nnn <- ifelse(y==0,nn+.5,nn) > > xx<-as.matrix(xx) > y1<-xx/nnn # estimates of p > > > #print(y1) > > sigma2<- matrix(c(var(y1[,1]),cov(y1[,1],y1[,2]),cov(y1[,1],y1[,2]),var(y1[,2])),2,2) > print(sigma2) [,1] [,2] [1,] 0.02142909 0.010810225 [2,] 0.01081023 0.008138709 > > rho<-sigma2[1,2]/sqrt(sigma2[1,1]*sigma2[2,2]) > > rat...

HBase REST/Stargate PUT -

running hbase 1.1.0.1 standalone, accessing stargate api , able create table 2 columns 'c' & 'd'. i'm trying insert 1 column using following curl command. returns 400 bad request without explanation in logs. i've tried both http://localhost:8080/table1/row1 & http://localhost:8080/table1/row1/c formatted json comments section on issue hbase curl -v -x put -h "content-type: application/json" -h "accept: application/json" ' http://localhost:8080/table1/row1 ' --data '{"row":[{"key":"cm93mq==", "cell":[{"column":"yw==", "$":"dmfsdwu="}]}]}' can i'm missing above request? in json, have mentioned column family ('c') not qualifier.. table1 table name.. row1 row key.. c column family.. whats column name? encode c:columnname using base64 , use in column field in json.. hope helps!

exec - I can't create a PHP background process -

so after user submits form want create php background process checks stuff data submitted, if leave still want checking problem can't work, i've looked @ questions related on site , not find solution. did find code here exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, "output.txt", "pid.txt")); but problem outputs last thing , adds junk in there to. output: sh: line 1: *****: command not found

javascript - how can i add value to form in php? -

i writing program print folder names directory , , print in form , add textbox , button . want give value in text , update it. can print folders iwant suggestion button click . enter code here $rootpath = 'd:/wwebserver/storage/'; if ($handle = opendir($rootpath)) { while (false !== ($dev = readdir($handle))) { if ($dev != "." && $dev != "..") { $folder[] = $dev; echo "<form action='confi.php' method='post'><table class='gradienttable' cellspacing='10'> <tr><td>folder name</td><td>$dev</td> td>folder name2</td><td><input type='text'></td> <td><button type='button' onclick=' ' >apply</button> </tr></table></form>"; } } } want show value provide in textbox after button click . use value attribute of input "<form .... <input type='text' value=...

unit testing - Namespace 'VisualStudio' does not exist, VS 2015 -

Image
i installed visual studio 2015 , i'm getting following exception on unit test classes the type or namespace 'visualstudio' not exist in namespace 'microsoft' is else experiencing problem? here reference just give background on problem, solution experienced problems visual studio 2013 solution migrated visual studio 2015. when looked @ location of microsoft.visualstudio.qualitytools.unittestframework.dll pointing to c:\program files (x86)\microsoft visual studio 12.0\common7\ide\publicassemblies\microsoft.visualstudio.qualitytools.unittestframework.dll i created new solution visual studio 2015 containing unit test , had @ location of microsoft.visualstudio.qualitytools.unittestframework.dll reference, pointing to c:\program files (x86)\microsoft visual studio 11.0\common7\ide\publicassemblies\microsoft.visualstudio.qualitytools.unittestframework.dll i removed references microsoft.visualstudio.qualitytools.unittestframework.dll visual...

java - Ant build of a J2EE project fails by giving various compilation errors and warnings -

i working on java project using web logic 12c server deploy. have written build file consist of init, build, compile , deploy stages. ant build fails when comes compilation.i including build file , error log. please tell me in respect of web logic server.also suggest correction in build file if any. <project name="captchatest" default="build" basedir="."> <property name="weblogic-home" value="\c:\oracle\middleware\oracle_home\user_projects\domains\devdomain" /> <description> build file captchatest </description> <path id="build.classpath"> <fileset dir="webcontent/web-inf/lib" includes="*.jar" /> <fileset dir="${weblogic-home}/lib" includes="*.jar" /> <pathelement location="."/> </path> <target name="init"> <delete dir="dist" /...

c - Why does printf literally print (null) and what exactly happens? -

in c programming exercise i'm doing (just simplifying): printf( "%s", 0); the output is (null) what happens here? assume printf interprets 0 char * , null ? how replicate result like char string[] = null; //compiler-error printf( "%s", string); ? firstly, printf("%s", 0); leads undefined behavior (ub). %s in printf requires char * pointer argument. passing 0 , int . alone breaks code, printf("%s", 42); would. specific ub fact 0 zero not make difference. secondly, if want attempt pass null-ponter %s format specifier, have like printf("%s", (char *) 0); of course, leads undefined behavior well, since %s requires pointer valid string argument, , (char *) 0 not valid string pointer. implementations prefer handle such situations gracefully , print (null) . in particular case got lucky: printf("%s", 0) "worked" same way printf("%s", (char *) 0) , implementa...

r - same results in arules after changing support and confidence -

Image
yesterday i've started experimenting apriori , working fine, i.e. changed support , confidence , results different depending on combination. but today after running same code , same dataset i'm getting 0 rules no matter combination i'm using. my dataset looks (foodmarket data): trans_id,product 3694728,washington berry juice 3779788,washington berry juice 4146666,washington berry juice 4405313,washington berry juice etc. my code is: library('arules') transactions <- read.transactions(file="transactions.csv",format="single",sep=",",cols=c(1,2),rm.duplicates="false") basket_rules <- apriori(transactions, parameter = list(sup = 0.05, conf = 0.01, target="rules",minlen=2)) with following results: http://s2.postimg.org/b9k7xfq91/apriori_results1.jpg and 1 different parameters same result: so, have no idea how possible. the first screen shot hard read. second 1 says there no it...

ruby - Rails application notify changes in local embedded system -

i need display status of embedded system on webpage updates automatically. idea use thread in infinite loop looking changes on system loop old_status = status status = board.request_status() if old_status != status # notify change connected browsers end sleep 1 end and notify users faye in episode 260 of railscast . i've tried using simple thread inside model , sidekiq , need run independent rails application yet still being able communicate it. does have idea on how can it? i've been researching past week without success useful information: rails version %> rails -v rails 4.2.3 ruby version %> ruby -v ruby 2.2.2p95 (2015-04-13 revision 50295) uname -a %> uname -a linux server 4.0.8-2-arch #1 preempt tue jul 14 18:45:50 mdt 2015 armv6l gnu/linux i'm pretty new rails. in advance

r - Each cluster of data frame on separate page of pdf file -

i use mtcars data frame example. print 2 columns of data frame on each page of pdf file depending on cluster belong. mpg cyl disp hp drat wt qsec vs gear carb mazda rx4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 mazda rx4 wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 hornet 4 drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 hornet sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 merc 240d 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 merc 280c 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 merc 450se ...

regex - htaccess rewrite URL and remove GET parameters -

i new url rewrite, regex , .htaccess here issue facing: i have url parameter: www.mysite.in/alpha-beta/abc.php?id=apple%strike=200.00 i want display like: www.mysite.in/alpha/beta/apple/200.00 this code in .htaccess: rewriterule ^alpha/beta/(.*)/([0-9]+(\.[0-9]+))$ alpha-beta/abc.php?id=$1&strike=$2 [nc,l] but blank page when go url: www.mysite.in/alpha/beta/apple/200.00 when change htaccess rule to: rewriterule ^alpha/beta/(.*)/([0-9]+(\.[0-9]+))$ http://www.mysite.in/alpha-beta/abc.php?id=$1&strike=$2 [nc,l] it redirects correct page url displayed http://www.mysite.in/alpha-beta/abc.php?id=apple&strike=200.00 what seems problem? use these rules in root .htaccess: rewriteengine on rewriterule ^oi_tool/iv/(.*)/([0-9]+(?:\.[0-9]+))/?$ oi_analysis_tool/iv_chart.php?symbol=$1&str‌​ike=$2 [nc,l,qsa] # fix path getiv.php redirecting /oi_analysis_tool/ rewriterule ^oi_tool/.+?/(getiv\.php)$ /oi_analysis_tool/$1 [l,nc,r=301]

javascript - How to call an event handler on body tag only when all other event handlers fail? -

i have jquery script have written few event handlers on elements. if these 2 events not called, want event call. somehow i'm not able figure out way. used boolean variable doesn't seem work. here's sample code: $(function(){ var flag = false; $("input[type=text]").blur(function () { //some code flag = true; }); $("input[type=password]").blur(function () { //some code flag = true; }); if(flag!= true) $('body').click(function(event){ alert(event.target.tagname); }); } }); i want click event on body tag execute when first 2 event handlers not executed. know wrong. please suggest better way check. in advance. in first handlers, accept event argument , call event.stoppropagation() prevent event bubbling document. along these lines (you mixing click , blur ; i've used click consistently in be...

ios - swifty json crashing a lot -

Image
i using swiftyjson parse json responses server. the app crashing lot (getting reports on crashlytics) can't seem figure out happening. the line of code of different point is let jsondict = json(data: data, options: nsjsonreadingoptions.allowfragments, error: nil) this same line used parse of json responses different endpoints. the basic code doing these requests is: nsurlconnection.sendasynchronousrequest( req, queue: queue) { (res: nsurlresponse!, data: nsdata! , err: nserror!) -> void in let jsondict = json(data: data, options: nsjsonreadingoptions.allowfragments, error: nil) // , crashes on line there no errors on backend , responses seem sending down 200 ok response code (although hard match up) is there way can put try catch around line doesn't crash app? heres screen crashlytics you should figure out why it's crashing instead of trying mask issue via do/try/catch. start removing backend call , feed sample json that...

Android - Button not clickable when button text set to all uppercase -

i developing android application in text of button set dynamically (e.g. "follow" or "following") through button.settext("text") method. functionality works when button text lowercase, when text set "follow" or "following" button become unclickable. onclick method never activated. however, logcat displays: 07-21 16:18:17.228 31640-31640/co.example.example d/viewrootimpl﹕ viewpostimeinputstage action_down so somehow click being registered action_down touchevent when user taps button. suggestions? thanks.

git merge - What does git pull --rebase --ff-only do? -

i saw command line reference recommended git pull --rebase --ff-only . thought git reject that, doesn’t. what combination of --rebase --ff-only mean? edit: know each alone does. [edit, 4 dec 2016: of git version 2.6, git pull no longer script, no longer easy see , technical details below no longer apply. --ff-only still useful when merging, not when rebasing.] the git pull script (you can view yourself, e.g., less $(git --exec-path)/pull ) separates out --ff-only variable named $ff_only subsequently ignores entirely if winds doing rebase: case "$rebase" in true) eval="git-rebase $diffstat $strategy_args $merge_args $rebase_args $verbosity" eval="$eval $gpg_sign_args" eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}" ;; *) eval="git-merge $diffstat $no_commit $verify_signatures $edit $squash $no_ff $ff_only" eval="$eval $log_arg $strategy_args $...

c# - New Line at Every Full Stop in ASP.NET MVC -

i connect sql database using asp.net mvc. new concept , looking make database displayed in more readable format. at minute, have field within database table called description , application dumps in field on page. wanting make easier read having brand new line each sentence. want start new line @ every full stop. this view... @model dataintelligence.models.error @{ viewbag.title = "details"; } <script language="javascript" type="text/javascript" src="jquery-1.8.3.js"> </script> <script> function goback() { window.history.back(); } </script> <div class="jumbotron"> <h2>error details</h2> </div> <fieldset> <legend>@html.displayfor(model => model.source)</legend> <div class="row"> <div class="col-sm-3"> <div class="display-label"> @html.displaynamefor(model => model.executionid) ...

php - cant insert data to just one of my mysql table -

i developing website , funny thing can insert data table except 1 of table. php part function newproperty(){ global $link; if(isset($_post['sendprop']) && $_post['agree'] == 'yes'){ $name=mysqli_real_escape_string($link,$_post['name']); $owner=mysqli_real_escape_string($link,$_post['owner']); $tel=mysqli_real_escape_string($link,$_post['tel']); $email=$_session['cust_user']; $type=$_post['type']; $loc=$_post['location']; $address=mysqli_real_escape_string($link,$_post['address']); $bed=$_post['bed']; $price=$_post['price']; $descrip=mysqli_real_escape_string($link,$_post['desc']); $temp = explode(".", $_files["pic"]["name"]); $thumb = round(microtime(true)) . '.' . end($temp); move_uploaded_file($_files["pic...

sql - Insert new Records from one table to another table using Minus -

i inserting records in table1 , inserted table 2. if insert new records table1 new records should populated table2. can use minus concept both tables not purged out. proper use minus concept means suppose both table have 100 000 records available. in table 1 inserting more 100 000 records. minus useful use here or have use concept? as @tony andrews said in comments, want use merge statement here. here's basic syntactic use: merge <target table> using <souce table/view/result of subquery> on <match condition> when matched <update clause> <delete clause> when not matched <insert clause> extremely powerful in warehousing.

html - Possible to convert container/row to container-fluid/row-fluid at viewport breakpoint? -

for purpose of learning bootstrap, i'm copying http://www.newsweek.com/ (using vanilla bootstrap possible) , top bar (sign in, register, etc.) has me stymied. large viewport, appears simple container/row, resizes , gets medium viewport, instead of breaking seems transition container-fluid/row-fluid. i set tester in codepen every possible combination of containers , rows fluid , responsive independent , codependent (that i'm aware of) figure out going on , experiment bit: http://codepen.io/spectre6000/full/vozebb/ at 1200px viewport width (as indicated below rulers), <div class="container"> <div class="row"> ... </div> </div> and <div class="container-fluid"> <div class="row-fluid"> ... </div> </div> ...are identical. seems newsweek site doing, can't find way myself without coding bar twice different visibility. how switch 1 container/row setup other @...

ios - lldb - Couldn't resolve the class for an Objective-C static method call -

what's wrong lldb? doing many times not work. (xcode 6.4 , xcode 7.0-beta) (lldb) po [uiapplication sharedapplication] error [irfortarget]: couldn't resolve class objective-c static method call error: 0 errors parsing expression error: expression not prepared run in target (lldb) p @[@"", @""] error [irfortarget]: couldn't resolve class objective-c static method call error: 0 errors parsing expression error: expression not prepared run in target (lldb) po @[@"", @""] error [irfortarget]: couldn't resolve class objective-c static method call error: 0 errors parsing expression error: expression not prepared run in target (lldb) e id $a = @[@"11"] error [irfortarget]: couldn't resolve class objective-c static method call error: 0 errors parsing expression error: expression not prepared run in target update maybe problem ipod touch on ios 9.0 beta on mine colleague's ipad ios 8.4 work well. problem h...

javascript - export {x as x} does not work with babeljs -

why pattern end in undefined when try import module: export {machines machines} './machines'; if doing export default function machines(state, action) {} then have default export, not named export. export default exports arbitrary expression, fact function has name machines has no effect on export behavior. format, do export {default machines} './machines'; with export ... from format have in question, export have be: export function machines(state, action) {}

php - Download .ics from website to Android calendar -

Image
i have problem .ics files , calendar on smartphone. first, create ics file , download it, use function : function createeventcalendar($start, $end, $description, $location) { $event = array(); $rand = rand(5, 1000000000); $event['name'] = "event"; $event['data'] = "begin:vcalendar\nversion:2.0\nprodid:-//blabla//blabla//fr\nbegin:vevent\ndtstamp:".date('ymd\this')."\nstatus:confirmed\nuid:".$rand."\ndtstart:".date('ymd\this', strtotime($start))."\ndtend:".date('ymd\this', strtotime($end))."\nsummary:rendez-vous assurance\ndescription:".$description."\nlocation:".$location."\nend:vevent\nend:vcalendar\r\n"; return $event; } public function downloadeventcalendar($event) { $eventname = $event['name'].'.ics'; header("content-type: text/x-vcalendar"); header("content-disposition: attachment; filename=...

ios - Pass a class to other class SWIFT -

i pass class class b , call method backwards class a. i'm not sure if understand me. class a: public func showalertfor() { let secondcontroller = secondcontroller() var alert : uialertcontroller = secondcontroller.showalertfortranslate( **????** ) self.presentviewcontroller(alert, animated: true, completion: nil) } public func dosomething { println("dosomething") } class b: (second controller) public func showalertfortranslate( **????** ) { **????**.dosomething() // other stuff } this how call function class b , b a: class a{ func foo(){ println("a foo"); } func tellbtocallfoo(){ var myb = b() myb.foothea(self); } } class b{ func foothea(mya : a){ mya.foo(); } } var mya = a(); mya.tellbtocallfoo() you can work protocols protocol mycustomprotocol { func mycallbackfunction(); } class : mycust...

javascript - Remove selected items in the previous selections after cloning into a new dynamically generated dropdownlist -

i have asp.net dropdown list , asp.net button control. each time on clicking button, new dropdownlist supposed generated values except 1 selected previously. for example: if selected 'a' list of values {a,b,c} , clicked on button, supposed new dropdownlist values {b,c}. although, able clone dropdownlist values, have no idea how filter values removing selected ones. edit here scenario i start off 1 drop down list (that has 5 options) => 1,2,3,4,5 -> first options selected default. i select option 5 (in select list #2) i hit clone -> new list (#3) added options 2,3,4 i select option 2 (in select list #3) i hit clone -> new list (#4) created options 3,4 ..and on. here code: <form id="form1" runat="server"> <div> <asp:dropdownlist id="ddlcityname" runat="server" class="ddlclone" datatextfield="city" datavaluefield="city" cssclass="">...

windows - Error while compiling using Dev-C++ -

i'm trying compile following code using dev-c++ on winxp machine: #include <windows.h> int apientry _twinmain( hinstance hinstance, hinstance hprevinstance, lptstr lpcmdline, int ncmdshow ) { msg msg; while (getmessage(&msg, null, 0, 0)) return 0; } i following error message; c:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt0_c.c undefined reference `winmain@16' i've search error message don't understand what's wrong. thanks in advance. ps: i'm real noob @ c++ sorry if seems obvious guys. try replacing _twinmain winmain.

swift - NSFetchRequest by date -

i have method below pass nsdate() results today. i've trying results midnight midnight doesnt seem work. i've noticed predicate outputs this: "date >= cast(460249200.000000, "nsdate") , date <= cast(460289100.000000, "nsdate")" presumed 460249200.000000 unix timestamp if @ day correct year 1984? func getall(dayofrecords: nsdate) -> nsarray { var calendar = nscalendar.currentcalendar() var components = calendar.components(.calendarunitmonth | .calendarunitday | .calendarunityear, fromdate: dayofrecords); var midnightcomponents = nsdatecomponents(); midnightcomponents.day = components.day; midnightcomponents.month = components.month; midnightcomponents.year = 2015; midnightcomponents.hour = 0; var midnightdate = calendar.datefromcomponents(midnightcomponents); var twentyfourhourslater = nsdatecomponents(); twentyfourhourslater.day = components.day; twentyfourhourslater.month = component...

c# - Winform DataGridView not refreshing after changing datasource programmatically -

i have datagridview won't update contents after programmatically setting it's datasource. i've verified new data fine, , tried .refresh, setting datasource nothing , few other things redraw new data. i've spent hours trying every combination of events (even downgrading dotnet framework 3.5 see if bug in 4.5 framework) , tricks other forums. nothing works. public sub getneworders(optional calledfrompopup boolean = false) me.dgvorders.datasource = qbi.order_dataict.getnewordersict() if calledfrompopup ''100% datasource info has changed, yet datagridview won't reflect change! me.pnlorders.refresh() 'does not work me.dgvorders.refresh() 'does not work end if end sub basically, form opened, calls "getneworders" in form.closing event, closes. calling form has method above , checks see if needs refresh datagridview (a solution thought work, but, alas, not). can see, i've tried refreshing panel datagr...

java - Jackson FasterXML POJO to XML list -

i'm using fasterxml jackson implementation convert pojo's xml output xml-databing package. i'm trying achieve output: <myrequest> <mysubrequest>4</mysubrequest> <mysubrequest>5</mysubrequest> </myrequest> my classes: public class mysubrequest { @jacksonxmltext private string id; public string getid() { return id; } public void setid(string id) { this.id = id; } public mysubrequest(string id) { super(); this.id = id; } } and: @jacksonxmlrootelement public class myrequest { private collection<mysubrequest> mysubrequest; public collection<mysubrequest> getrequests() { return mysubrequest; } public void setrequests(collection<mysubrequest> requests) { this.mysubrequest = requests; } } i'm testing with: objectmapper mapper = new xmlmapper(); myrequest entity = new myrequest(); collection<mysubrequest> myids = new arraylist<>(); myids.add(new mysubrequest(...

c# - Editing dIfferent types of objects using different controls in Wpf Datagrid Column -

Image
i need create wpf datagrid binding observablecollection dozen dictionary string name of property , object property value. every object different type boolean (checkbox), string (textbox), customclassobject (combobox or textbox), integer (textbox) or enum (combobox every value enum). and needs populated dynamically. i trying figure out last week hard. do have idea how create such datagrid solve problem? how bind such list of objects pulled dictionary or whole dictionary datagrid allow user edit it? should use datatemplate converters if possible, return right control corresponding value each object. or should create usercontrol consist bindable property object assign right control full field each value , bind contentcontrol? i grateful every hint. thanks perhaps this: public class myobjectlist : observablecollection<object> { public myobjectlist() { add(new keyvaluepair<string, int>("key1", 1)); add(new keyvaluepair...

Mulesoft salesforce connector getting subquery of commentcase does not display -

i creating new project reads data salesforce , pushes data google search appliance (gsa). in salesforce soql statement, have query gets comments case. when use salesforce workbench, able see casebody casecomment case. when use datamapper in mule, casecomment.commentbody not display. there way log file or on console salesforce getting back? tried map casecomment list, still no luck. there way see that salesforce connector returning? here soql: select id, lastmodifieddate, casenumber, subject, internalsubject__c, description, isclosed, poc__r.firstname, poc__r.lastname, owner.firstname, owner.lastname, informationfrom__c, contact.firstname, contact.lastname, account.name, productname__c, productversion__c, productproblemtype__c, subjectmatterexpert__r.name, caseproductregion__r.name, caseproductmodel__r.name, caseproductsecondarymodel__r.name, createdby.firstname, createdby.lastname, lastmodifiedby.firstname, lastmodifiedby.lastname, (select commentbody casecomments...

android - impossible to start adb - cannot debug Visual Studio 2015 Cordova -

visual studio 2015 provides tool hybrid app using apache cordova. trying first app deploying on android device. i manage deploy on device, when launch see 2 things: on device, menu gets open couple of seconds before "hello world" starts on pc see pop-up windows containing below message i cannot debug because connection between pc , device dropped impossible start path\adb.exe - unknown error 0x80070057 - please note @ path file adb.exe present. os windows 8.1 how fix it? this issue mentioned again in question posted site after yours: visual studio 2015 apache cordovo not running in emulator blank app project template the solution there re-install android sdk , try again.

mysql - order by percentage of likes and return the next row -

i'm trying join 2 tables, image table , likes/dislikes table. need calculate percentage of likes each image , order percentage. find current item , return next item. so i've broken couple of queries, first find percentage current image has. then second i'm utterly confused: select *, sum(case when liked = '1' 1 else 0 end) liked, sum(case when liked = '0' 1 else 0 end) disliked images left join image_like il on i.image_id = il.like_image_id (liked/liked + disliked) > ? , image_site_id = ? group i.image_id order (liked/liked + disliked) desc limit 1 i'm getting error stating disliked not recognised in clause. the reason because cannot use column alias in where @ same level select . but, logic on aggregated values anyway, belongs in having clause. assuming liked takes on values 0 , 1, can write query as: select i.*, sum(liked = 1) liked, sum(liked = 0) disliked images left join ...

python - If thing exists, do something with thing -

what correct (pythonic) way this? var = 'the quick brown fox' def exists(query, string): if query in string: return query else: return none if thing = exists('fox', var): print(thing.upper()) this example, i'm trying check if selenium web element exists. want avoid setting result variable because defeats purpose of "exists". also, don't want perform search twice returning true/false first time , again, if it's true, it. this 1 of cases there's more 1 way it . few things do: treat result collection of 0 1 elements (it makes more sense if call find_one in such cases): def find_one(query, string): if query in string: return [query] return [] then can use function in for loop: for existing_element in find_one(query, string): # existing element break else: # here if don't have elements (note `break` above) pass callback first argument: def if_exists(cb, que...

Spring Boot safety of application.properties -

is safe put in file application.properties security data, example connection db. example: db.driver: org.postgresql.driver db.url: jdbc:postgresql://localhost:5432/test db.username: postgres db.password: root with safe mean data inside file not visible web.

entity framework - how to ignore/avoid/skip child collection from a LINQ query? -

i have collection : order o1 o2 o3 i have orderitem collection : orderitem orderid oitem1 o1 oitem2 o1 oitem3 o1 oitem4 o2 oitem5 o3 now selecting orders line, how skip/avoid/ignore child collection linq i don't want orderitems orders .

How to implement a Tmar test in Jspresso? -

following www.tmar-test.com installation procedure, wrote basic test (arithmetic sum) in jspresso application , ok. in second step, write more realistic test , call method part of jspresso application. i need initiate test description context in order call method, lack of information. do have snippet me ? as example, based on hrsample, provide tmar method calling computeage method ? below computeage method : package org.jspresso.hrsample.model.service; import java.util.date; import org.jspresso.hrsample.model.employee; import org.jspresso.framework.model.component.service.icomponentservice; /** * services delegate of employee entity */ public class employeeservicedelegate implements icomponentservice { /** * computes employee age. * * @param employee * employee service execution has been triggered on. * @param birthdate * birth date (might different actual employee birth * date). * @return age computed birth date passed parameter. */ public integer computeage(employee e...

javascript - google map way points not removing using direction services -

Image
new plunker demo: http://plnkr.co/edit/6tmeshnvn0onjjwbwzjx //source , destination auto complete textbox binding google.maps.event.adddomlistener(window, 'load', function () { var places = new google.maps.places.autocomplete(document.getelementbyid('source')); google.maps.event.addlistener(places, 'place_changed', function () { var place = places.getplace(); sourcelat = place.geometry.location.lat(); sourcelng = place.geometry.location.lng(); }); var places1 = new google.maps.places.autocomplete(document.getelementbyid('destination')); google.maps.event.addlistener(places1, 'place_changed', function () { var place1 = places1.getplace(); }); }); var cnt = 1; var v = [];var autocomplete = []; var map = null;var usedids = []; var insertcontrols = []; var directionsdisplay; var directionsservice = new google...