Posts

Showing posts from August, 2011

r - Stacked bar chart with multiple facets -

i trying plot stacked bar chart multiple facets using code below: dat <- read.csv(file="./fig1.csv", header=true) dat2 <- melt(dat, id.var = "id") ggplot(dat2, aes(x=id, y=value, fill = variable)) + geom_bar(stat="identity") + facet_grid(. ~ col1) + geom_col(position = position_stack(reverse = true)) and here minimized example of how data looks like: id col1 col2 col3 col4 col5 1 1 0.2 0.1 0.1 0.1 2 1 0.2 0.1 0.2 0.1 3 1 0.2 0.2 0.2 0.1 4 2 0.1 0.1 0.2 0.1 5 2 0.1 0.1 0.1 0.2 however, keep getting error below. think problem coming facet_grid(. ~ col1) , more using col1 . error in combine_vars(data, params$plot_env, cols, drop = params$drop) : @ least 1 layer must contain variables used facetting does have idea how can fix that? the col1 not included variable in melt function, melted rest of columns. include col1 variable in melt function. dat2 <- melt(dat, id.var=c("id"

msbuild - How to use OpenCover code coverage using Build.Cake file -

my requirement run opencover code coverage using build.cake file , publish code coverage results on sonarqube server. set up:[project setup][1] when invoke opencover using simple command line utility described in following url: https://docs.sonarqube.org/pages/viewpage.action?pageid=6389770#codecoverageresultsimport(c#,vb.net)-opencover , see opencover works perfactly fine , publishes code coverage sonarqube server msbuild.sonarqube.runner.exe begin /k:"sonarqube_project_key" /n:"sonarqube_project_name" /v:"sonarqube_project_version" /d:sonar.cs.opencover.reportspaths="%cd%\opencover.xml" msbuild "%localappdata%\apps\opencover\opencover.console.exe" -output:"%cd%\opencover.xml" -register:user -target:"%vsinstalldir%\common7\ide\commonextensions\microsoft\testwindow\vstest.console.exe" -targetargs:"unittestproject1\bin\debug\unittestproject1.dll" msbuild.sonarqube.runner.exe end trying achieve sa

Recording with Correct FPS in Android (120FPS CamcorderProfile Not Working) -

i'm using following code request phone (lg g5) record using high speed high quality profile, specifies 120fps , 720p. camcorderprofile mprofile = camcorderprofile.get(camcorderprofile.quality_high_speed_high); mmediarecorder.setaudiosource(mediarecorder.audiosource.mic); mmediarecorder.setvideosource(mediarecorder.videosource.surface); mmediarecorder.setoutputformat(mediarecorder.outputformat.mpeg_4); if (mnextvideoabsolutepath == null || mnextvideoabsolutepath.isempty()) { mnextvideoabsolutepath = getvideofilepath(getactivity()); } mmediarecorder.setoutputfile(mnextvideoabsolutepath); mmediarecorder.setvideoencodingbitrate(mprofile.videobitrate); mmediarecorder.setvideoframerate(mprofile.videoframerate); mmediarecorder.setvideosize(mprofile.videoframewidth, mprofile.videoframeheight); mmediarecorder.setvideoencoder(mediarecorder.videoencoder.h264); mmediarecorder.setaudioencoder(mediarecorder.audioencoder.aac); unfor

Use arial font in matplotlib -

Image
when run python script (plot_lhoc.py in rosetta package) make plot, got following error message: /app/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:1297: userwarning: findfont: font family [u'arial'] not found. falling dejavu sans (prop.get_family(), self.defaultfamily[fontext])) i guessed cause absence of arial font in matplotlib. in deed, /app/anaconda2/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/ directory didn't contain arial.ttf file. copy arial*.ttf file /usr/share/fonts/msttcore /app/anaconda2/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/ directory [root@bogon /]#cp /usr/share/fonts/msttcore/arial*.ttf /app/anaconda2/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf/ after that, however, running plot_lhoc.py script gave same "font family [u'arial'] not found" error. i displayed items in target directory: i don't understand why arial* items don't have blue background colo

Java: non-static method cannot be referenced from a static context / ArrayList -

this question has answer here: non-static variable cannot referenced static context 11 answers in laymans terms, 'static' mean in java? [duplicate] 6 answers hello i'm trying resolve 1 exercise. i've got list , have create private method returns new list removed every 3rd argument. i've created method , body of it, have no idea should write lines of code " arraylist inputlist = new arraylist(arrays.aslist(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));" , " arraylist modifiedlist = removeeverythirdelement(inputlist);" i cannot write in main method because it's static , void method , doesn't compile. should write special private method returns or can write these lines in class, without method? public static void main(string[] args) { }

elasticsearch java rest api groovy script update document -

@test public void testrestclient() throws ioexception { restclient restclient = restclient.builder(new httphost("10.12.31.110", 9200, "http")).build(); map<string, string> param = new hashmap<>(); param.put("script", "if(ctx._source.student.books==null){ctx._source.student.books=listvalue}else{ctx._source.student.books.add" + "(objectvalue)}"); map<string, string> params = new hashmap<>(); map<string, string> objectparam = new hashmap<>(); objectparam.put("name", "http"); objectparam.put("id", "15"); list<map<string, string>> listparam = new arraylist<>(); listparam.add(objectparam); params.put("listvalue", gson.tojson(listparam)); params.put("objectvalue", gson.tojson(objectparam)); param.put("params", gson.tojson(params));

vue.js - Computed properties on function instances -

in knockout.js able following: function person() { this.firstname = ko.observable('foo') this.lastname = ko.observable('bar') this.fullname = ko.purecomputed(() => { return this.firstname() + this.lastname() }) } var p = new person() console.log(p.fullname()) // foobar is there way add reactive computed properties on objects which not component data in vue? in vue, not need explicitly declare reactive properties , methods knockout requires. plain object. what makes object reactive in vue when assign component through property declared in data object of component. so example in vue be: function person() { this.firstname = 'foo'; this.lastname = 'bar'; this.fullname = function () { return this.firstname + this.lastname; }; } var p = new person(); console.log(p.fullname()); // foobar if use inside component, reactive, this: const comp = new vue({ template: '<div>{{ person.ful

swift - Do something after WKWebView has finished loading and scraping specific page -

what i'm trying perform action after wkwebview i'm using has finished loading , scraping page. here's code webview: let webview = wkwebview() let url = url(string: "https://web.spaggiari.eu/home/app/default/menu_webinfoschool_genitori.php?custcode=")! let request = urlrequest(url: url) webview.load(request) what want show button "connect" after process has fished (that specific process , not when webview finishes loading every time). i'm using dispatchqueue wait seconds hoping page loads in time. dispatchqueue.main.asyncafter(deadline: .now() + .seconds(4)) { uiview.animate(withduration: 0.8, animations: { self.registerbutton.alpha = 1 self.registerbutton.isenabled = true }) uiview.animate(withduration: 0.8, delay: 0.4, animations: { self.blurbutton.alpha = 1 }) } i'm using xcode swift3 this

html - <input> cannot appear as a child of <tr> -

i want add <input> element, more checkbox, in table. following works: <tbody key={rule._id}> <tr> <td>{rule.deviceid}</td> { <input name="isenabled" type="checkbox" checked={rule.enabled} /> } <td>{rule.name}</td> </tr> </tbody> but produces error in console: <input> cannot appear child of <tr> is there 'proper' way this? put <input> inside <td> . wiki

angularjs - How do you change all ng-show dependent variables in an ng-repeat? -

i have ng-repeat has ng-if attached it, child element changing ng-click. code looks following: <div ng-repeat="object in objects" ng-if="show"> <div ng-click="show = !show">show</div> </div> lets had 2 objects , load 2 repeated divs, , there 2 'show' elements. when click show, remove 1 of repeated elements page. need remove both. thoughts? if want hide wrap of in outer div , place "ng-if" there. <div ng-if="show"> <div ng-repeat="object in object"> <div ng-click="show = !show">show</div> </div> </div> i advise place logic modifies data in ts file instead of in html view. wiki

javascript - slickgrid vertical scrolling while column reorder -

i using slickgrid in project , when try reorder columns , web page scrolls vertically , column headers become invisible .i found in slickgrid.js , in function setupcolumnreorder, start function called when user begins drag column. changed start , stop functions in setupcolumnreorder below. time , first time when user begins drag column header , web page scrolls automatically. when user drags second time works intended , no vertical scrolling occurs . how prevent vertical scrolling in first drag operation ? function setupcolumnreorder() { $headers.filter(":ui-sortable").sortable("destroy"); $headers.sortable({ containment: "parent", distance: 3, axis: "x", cursor: "default", tolerance: "intersection", helper: "clone", placeholder: "slick-sortable-placeholder ui-state-default slick-header-column", start: functi

machine learning - Why does MITIE get stuck on segment classifier? -

i'm building model using mitie training dataset of 1,400 sentences, between 3-10 words long, paired around 120 intents. model training stuck @ part ii: train segment classifier . i've let run 14 hours before terminating. my machines has 2.4 ghz intel core i7 , 8 gb 1600 mhz ddr3 , segment classifier uses available memory (around 7gb), relying on compressed memory, , @ end of last session activity monitor showed 32gb used , 27gb compressed. , segment classifier has never completed. my current output below: info:rasa_nlu.model:starting train component nlp_mitie info:rasa_nlu.model:finished training component. info:rasa_nlu.model:starting train component tokenizer_mitie info:rasa_nlu.model:finished training component. info:rasa_nlu.model:starting train component ner_mitie training recognize 20 labels: 'pet', 'room_number', 'broken_things', '@sys.ignore', 'climate', 'facility', 'gym', 'medicine', '

cordova - PhoneGap Build Android Not Displaying Splashscreen -

here code in config.xml that's relative splash screens: <splash src="splash.png" /> <icon src="icon.png"/> <preference name="splashscreen" value="screen" /> <preference name="splashscreendelay" value="10000" /> <platform name="android"> <preference name="splashscreen" value="res/screens/android/drawable-land-ldpi-screen.png" /> <splash src="res/screens/android/drawable-land-ldpi-screen.png"/> <icon density="ldpi" src="res/icons/android/drawable-ldpi-icon.png" /> <icon density="mdpi" src="res/icons/android/drawable-mdpi-icon.png" /> <icon density="hdpi" src="res/icons/android/drawable-hdpi-icon.png" /> <icon density="xhdpi" src="res/icons/android/drawable-xhdpi-icon.png&qu

sql server - Why is C# console application not returning result on LINQ Select with data -

i'm writing rather complicated database scanning utility using console application, reason i'm running basic of problems when attempt simple linq select on database table data. when database table has no data, query returns control console application. when table has data, sql server shows "suspended" , "async_network_io". thank in advance assistance. program.cs looks follows: class program { static void main(string[] args) { datamodels dm = new datamodels(); list<string> lsreturn = dm.returndatafromtablex(); } } datamodels.cs looks follows: class datamodels { public list<string> returndatafromtablex() { return _dataentities.<table_name>.select(x => x.<column_name>).tolist(); } } first can try class datamodels { public ienumerable<string> returndatafromtablex() { return _dataentities.<table_name>.select(x => x.<column_name

Python type checking in VS Code -

i've learned typing module in python ( https://docs.python.org/3/library/typing.html ) , expected use static type checking , better intellisense in vs code, works typescript, can't seem find tools/plugins that. what options, if any? python dynamically typed language supports duck typing. trying shoehorn static typing going exercise in futility. python vscode extension doesn't care types because can't know. shouldn't care either since types , static analysis aren't make python popular or powerful. when reaching dynamic languages, don't tempted impose constructs other languages you've used. don't try make object, don't try type check based on class , write unit tests since happens @ runtime. typescript accomplishes static typing on top of dynamic language @ great cost. require compilation type definitions external libraries because none of them going know types outside of runtime. to quote own comment: basically, if want static

android - How to Avoid Multiple Options Of Map -

my device have both waze , googlemap. in app want open google map when click button. open waze app when click other button. problem show options of waze , googlemap.how can avoid option selection , go direct map curresponding button click. i used code open googlemap is, intent intent = new intent(android.content.intent.action_view, uri.parse("http://maps.google.com/maps?saddr=" + currentlocation.getlatitude() + "," + currentlocation.getlongitude() + "&daddr=" + destination.getlatitude() + "," + destination.getlongitude())); startactivity(intent); i used code open waze app is, string uri = "geo:" + currentlocation.getlatitude() + "," +currentlocation.getlongitude() + "?q=" + destination.getlatitude() + "," + destination.getlongitude(); intent intent = new intent(android.content.intent.action_view,

c - The denial-of-service in unix-network-programming 3e of chapter 6.8 -

i reading unix network programming 3e, , when coming denial of service in chapter 6.8, have question why read block? codes in book using system call 'select' follow: listenfd = socket(af_inet, sock_stream, 0); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = af_inet; servaddr.sin_addr.s_addr = htonl(inaddr_any); servaddr.sin_port = htons(serv_port); bind(listenfd, (sa *)&servaddr, sizeof(servaddr)); signal(sigchld, sig_chld); listen(listenfd, listenq); maxfd = listenfd; maxi = -1; (i = 0; < fd_setsize; i++) { client[i] = -1; } fd_zero(&allset); fd_set(listenfd, &allset); ( ; ; ) { rset = allset; nready = select(maxfd + 1, &rset, 0, 0, 0); if (fd_isset(listenfd, &rset)) { clilen = sizeof(cliaddr); again: if ((connfd = accept(listenfd, (sa *)&cliaddr, &clilen)) < 0) { if (errno == eintr || errno == econnaborted) { goto again;

watchkit - Is it possible to let Siri push button in swift app? -

is possible ask siri push buttons in app text speech? mean, have calculator , pushing button of "dictation" siri should able understand push + button instead of write inside lable text. thank you! siri cannot used inside apps. moreover, can use siri handling intents part of sirikit framework, quite limited @ moment. voiceover capable of need do. designed navigating through app voice commands part of accessibility framework. the speech framework suggested others not available in watchos , wasn't designed voice navigation. wiki

elasticsearch - A convergence graphic in Kibana -

i have um index next entries in elasticsearch 5 { "time" => "20", "point_id" => "1" } { "time" => "22", "point_id" => "2" } { "time" => "23", "point_id" => "3" } { "time" => "28", "point_id" => "4" } etc i need construct graphic in following form: coordinate x number of n "points" coordinate y average of n selected points example: n avg 1 20 2 (20 + 22)/2 3 (20+22+23)/3 4 (20+22+23)/4 . . . is possible in kibana or grafana? wiki

php - Wordpress custom supports for custom post types -

i'm using register_post_type generate new post type 'gcg_block' , generate ui menu in admin page. using add_post_type_support 'author' gives me column author in page (although not sortable). want add column 'shortcode' list , fill custom data. believe want create new support , register post type i'm unable find could. on right track or should looking @ taxonomies this? what i'm trying make similar contact form 7 list displays shortcode can copied areas in wordpress. add_action( 'init', 'gcg_init' ); // function gcg_init() { //register custom post type , create menu register_post_type( 'gcg_block', array( 'labels' => array( 'name' => 'generic content', 'singular_name' => 'block' ), 'public' => false, 'show_ui' => true, 'show_in_menu' => true, //'supports' => array( // 'title

c# - inserting a string value into viewmodel list -

i posted similar question 2 weeks ago, having issues getting debug successfully. @stephen muecke helping me troubleshoot that. reposting, since not getting traction on second half of problem, outlined below. working on site function shows list of companies, based on membertype, running issue in how list being built in c#. when test code, unhandled exception error, , debugging indicates list empty. here viewmodel: public class memberlistviewmodel { public list<string> memberlist { get; set; } public string membertype { get; set; } } here controller code: public class memberlistcontroller : controller { public actionresult memberlist() { return partialview(preparememberlistviewmodel()); } private memberlistviewmodel preparememberlistviewmodel() { memberlistviewmodel viewmodel = new memberlistviewmodel(); string orgtype = "distributor"; //todo: hardcoded dev datatable table = new datatable(); using (var connection = new sqlc

Cannot connect Jenkins jlnp slaves to Centos 7 master installed using Docker jenkins/jenkins? -

jenkins centos 7 master installed docker jenkins/jenkins . i cannot connect old windows 7, macos, , linux slaves master using jlnp. usually jenkins slave agent displays: "trying protocol: jnlp4-connect" "terminated" repeat clues: occasionally windows7 "jenkins slave agent" display "connected". however, jenkins master displays node not connected . installed using: sudo systemctl start docker sudo docker pull jenkins/jenkins sudo docker run --name jenkins -p 8080:8080 -p 50000:50000 -u 1001 -v /home/jenkins/jenkins:/var/jenkins_home jenkins/jenkins sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --reload added clues: this first time using docker install of jenkins. it running /home/jenkins/jenkins. i can find no useful clues in /jenkins/logs/slaves/ i tied disabling centos & firewall on both master , slave i docker

html - How to use jQuery .has() within a nested table -

i'm trying color td cell has nested table class "red". jquery code i'm using color top table, not parent td cell. how need modify following code. and little reference, i'm using sharepoint nests tables within table within tables. don't have control on unfortunately. thanks $("td:has(.red)").addclass("redbg"); i go reverse order: find table class red , add class redbg closest td cell: $('table.red').closest('td').addclass('redbg'); this rather solution, not answer question. for jquery closest method have: for each element in set, first element matches selector testing element , traversing through ancestors in dom tree. wiki

reactjs - React - Route with different paths but with same component -

i trying make profiles page using react , meteor , decided create route each user , render renders person's data according path. however, came across problem in plan, , found makes route 1 user in array , ignores rest. put console.log statement in there see how many times function ran, , seems correct, find when create route same component different path, allows one. how solve problem? tried making profile on browser , found when went profile, got rendered correctly, when copy , paste userid, returns page not found created unknown routes. in theory, plan should work, right? makes route each user , if go url should see profile. don't know if missing tiny or doing wrong here code: routes.js import { meteor } "meteor/meteor" import react "react"; import { withrouter, switch, browserrouter, route, redirect, link } "react-router-dom"; import { tracker } "meteor/tracker"; import login "../ui/authentication/login"; impo

mysql - How to check in SQL if particular value of a column is appearing more than once -

Image
i trying problem came across have sum sales of particular region , 1 more column needs created result name stores can tell whether particular store in region (east, west, north, , south) or not. i don't know start these 2 tables , output: in mysql, can achieve result by left join-ing store_info geography table , group by on column region below. don't need sum separately case again. select g.region, sum(s.sales) sales, case when sales > 0 'y' else 'n' end stores geography g left join store_info s on s.sn = g.sn group g.region order 2 desc result region sales stores ---------------------- west 2050 y east 700 y south null n north null n you can check demo here hope help. wiki

Spring Security: Custom Authentication Provider -

i have developed application spring mvc high user traffic. suppose there least 20,000 concurrent user. have implemented spring security custom authentication provider in 2 ways. 1st 1 : @override public authentication authenticate(authentication authentication) throws authenticationexception { string username = authentication.getname(); string password = authentication.getcredentials().tostring(); customuser user = _userdetailservice.loaduserbyusername(username); if (user == null || !user.getusername().equalsignorecase(username)) { throw new badcredentialsexception("username not found."); } if (!bcrypt.checkpw(password, user.getpassword())) { throw new badcredentialsexception("wrong password."); } collection < ? extends grantedauthority > authorities = user.getauthorities(); return new usernamepasswordauthenticationtoken(user, password, authorities); } 2nd 1 is: @override public authentication aut

Google App Engine - Event when queue finishes -

i'm starting build bulk upload tool , i'm trying work out how accomplish 1 of requirements. the idea user upload csv file , tool parse , send each row of csv task queue task run. once tasks (relating specific csv file) completed, summary report sent user. i'm using google app engine , in past i've used standard task queue handle tasks. however, standard task queue there no way of knowing when queue has finished, no event fired trigger report generation i'm not sure how achieve this? i've looked more , understand google offers google pubsub. more sophisticated , seems more suited, still can't find out how trigger , event when pubsub queue finished, ideas? seems use counter this. create entity integer property set number of lines of csv file. each task decrement counter in transaction when finishes processing row (in transaction). 1 task set counter 0, , task trigger event. might cause contention though. another possibility have each tas

javascript - C3js - combination chart with data labels only for line -

i want create combination chart stacked bars + line using c3js. don't want see data labels on top of stacked bars want see them line. know flag "labels: true/false" showing/hiding labels. possible this? chart created me using code: var chart = c3.generate({ data: { columns: [ ['data1', 30, 20, 50, 40, 60, 50], ['data2', 200, 130, 90, 240, 130, 220], ['data3', 100, 230, 390, 440, 230, 120], ['line4', 430, 480, 630, 820, 450, 490] ], type: 'bar', types: { line4: 'line' }, groups: [ ['data1','data2', 'data3'] ], labels: true } }); desired chart you can though set data label formatting per data series: labels: { format: { data3: d3.format(), } } ..and seems omitting format data series means labels aren

python - Django Import by filename is not supported -

i new django , trying create file upload page following need minimal django file upload example instructions. however, keep getting "import file not supported" error. actual error seems happening here: c:\users\306432857\appdata\local\continuum\anaconda\lib\importlib\__init__.py in import_module __import__(name) ... full traceback: environment: request method: request url: http://127.0.0.1:8000/ django version: 1.8 python version: 2.7.13 installed applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myapp') installed middleware: ('django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware&#

javascript - Angular2 : How to display image to HTML from JSON API -

i new ionic , developing e-commerce mobile app. using json api, can data api except image, cannot display image coming json api. have no idea how can display image html. hope can me, thank in advance. here how json api looks like: product: [ { prod_id: 1, supplier_id: 8, prod_name: "hippo + friends baby boy triangle merino pant", prod_price: "250", prod_stock: "20", prod_image: "assets/img/4ef1ef51ef6e2f0142452af60048df44merino pants.jpg" } ] .html file <img [src]="getimageuri(product.prod_image)" alt="image preview..."> .ts file getimageuri(image: string): string { if (!image) { image = `/assets/img/noimage.jpg`; } const uri = `${environment.assets}/${image}`; return uri; } environment.assets host location of image. example environment.assets = http://hostlocation.com/images; i'm assuming since e-commerce s

android - Positioning confetti -

i following tutorial below add confetti. final konfettiview konfettiview = (konfettiview)findviewbyid(viewkonfetti); konfettiview.build() .addcolors(color.red, color.green) .setspeed(1f, 5f) .setfadeoutenabled(true) .settimetolive(2000l) .addshapes(shape.rect, shape.circle) .setposition(0f, -359f, -359f, 0f) .stream(200, 5000l); i want confetti appear top right corner instead of top left . values should put in setposition method? how method work? i following https://github.com/danielmartinus/konfetti there not information methods , parameters. here code on editing yields desired output: fun setposition(x: float, y: float): particlesystem { location.setx(x) location.sety(y) return } /** * set position range emit particles * random position on x-axis between [minx] , [maxx]

c# - Whenever I try to execute the test cases from console by using NUnit Exe.I get Data source name not found and no default driver specified this error -

Image
whenever tried execute test cases nunit exe. console execute wherever verification there database gives me error [im002] [microsoft][odbc driver manager] data source name not found , no default driver specified error in report how handle this, how set data source , when ran test cases visual studio not gave me data source error. in result there verification database test cases getting failed rest test cases getting pass. please me solve error , database server localhost only. wiki

html5 - Cannot link CSS and HTML file in NetBeans -

beginning learn html , css project, however, cannot life of me css file , html file link in netbeans. in same folder! index.html: <!doctype html> <html> <head> <link rel="stylesheet" href="test.css" type="text/css"/> <title>view products</title> </head> <body> <nav> <ul> <li> home </li> <li> quantity purchase </li> <li> html test </li> </ul> </nav> <div> <h1> view products </h1> </div> </body> test.css: body { background-color: powderblue; } h1 { color: blue; } any appreciated, cheers after frustration found out in server class (using jooby) have forgotten include assets("/**"), thank took time read post! wiki

java - Hibernate Mapping Issue Tomcat8 -

i'm having problem mapping in hibernate , tomcat 8. when deploy application(through manager/html or creating new folder , putting whole project) there not problem if try put classes web-inf of existing application , run it, log says: org.hibernate.hql.internal.ast.querysyntaxexception: telefonos not mapped [from telefonos canal = :canal , (fechatomado null or (fechatomado + 90) >= getdate())] @ org.hibernate.hql.internal.ast.querysyntaxexception.generatequeryexception(querysyntaxexception.java:96) @ org.hibernate.queryexception.wrapwithquerystring(queryexception.java:120) @ org.hibernate.hql.internal.ast.querytranslatorimpl.docompile(querytranslatorimpl.java:234) @ org.hibernate.hql.internal.ast.querytranslatorimpl.compile(querytranslatorimpl.java:158) @ org.hibernate.engine.query.spi.hqlqueryplan.<init>(hqlqueryplan.java:126) @ org.hibernate.engine.query.spi.hqlqueryplan.<init>(hqlqueryplan.java:88) @ org.hibernate.engine.query.spi.queryplancache.gethqlquery

Strange Results when trying to create JSON output from simple Python Array -

i have written code: myarray = [] myarray.append('abc') myarray.append('def') return json.dumps(myarray) this part of graphql function. equivalent of this: "myarray": "[\"abc\", \"def\"]" how can eliminate backslashes? robert you haven't shown enough code reproduce error. presumably, whatever calling function converting json. should return myarray directly, without converting json in function. wiki

remove too close time elements from a json array -

i having array of json object contain timing , data. basically, each element, contain timing, id , user below [ { "id": "abc", "ts": "2017-08-17t20:42:12.557229", "userid": "seb" }, { "id": "def", "ts": "2017-08-17t20:42:52.724773", "userid": "seb" }, { "id": "ghi", "ts": "2017-08-17t20:42:53.724773", "userid": "matt" }, { "id": "jkl", "ts": "2017-08-17t20:44:50.557229", "userid": "seb" }, { "id": "mno", "ts": "2017-08-17t20:44:51.724773", "userid": "seb" }, { "id": "pqr", "ts": "2017-08-17t20:50:52.724773", "user

reactjs - React Router Redirect Conditional -

i'm trying make button redirects user new page after validation completed correctly. is there way of doing this? how route activated inside of class method? import validator './validator'; class example { constructor(props) { super(props) this.saveandcontinue = thos.saveandcontinue.bind(this) } saveandcontinue () { var valid = validator.validate(this.props.form) if (valid) { axios.post('/path') <redirect to='/other_tab'> } else { validator.showerrors() } } render() { <button onclick={this.saveandcontinue}>save , continue</button> } } as discussed should have access history object via this.props.history described here . if push function redirect route need. example: // use push, replace, , go navigate around. this.props.history.push('/home', { some: 'state' }) https://reacttraining.com/react-router/web/api/history wiki

vba - DLookup Crosstab Query from Numeric Field Name -

i have crosstab crosstab value numeric field, values of 1, 2, 3, 4, 5. this results in query field names numeric: i.e. "1", "2", "3", "4", "5". however, when dlookup on query such as: x1 = dlookup("1", "aquery", "samplecode ='" & samplecode & "'") x2 = dlookup("2", "aquery", "samplecode ='" & samplecode & "'") x3 = dlookup("3", "aquery", "samplecode ='" & samplecode & "'") x4 = dlookup("4", "aquery", "samplecode ='" & samplecode & "'") x5 = dlookup("5", "aquery", "samplecode ='" & samplecode & "'") i returns of 1, 2, 3, 4 , 5 instead of values in fields. happens if this: x1 = dlookup(1,"aquery",...) any ideas? thanks your dlo

time - When has the PHP script finished executing? -

i have script starts timer $time_start = microtime(true); connects soap web service , displays results... results later sent ecommerce platform via api // connect soap... , print_r ($results); displays time on last line of code. echo "time: " . (microtime(true) - $time_start); it's important process not take long. i've noticed when execute script in browser, browser may display "time: x seconds" part in x=60 seconds won't see $results part 10 minutes (or can see few lines, @ least enough fill screen). what wondering when script has finished executing, if microtime timer shows 60 seconds, has finished in 60 seconds, or has finished when $results displayed? when script ready, not need display $results, me check if working. how know how long takes script run? wiki

jquery - How to stop navigation bar from blocking page -

this question has answer here: navbar fixed on top of html page (css / html) 5 answers last week wrote ask navigation bar creating. began fcc , i'm new. **problem:**navigate bar seems blocking content , in way of other elements. notice how "this text" blocked. after tons of copying. i able basic navigation bar working highlight function working. however, bar blocking text seems. want have navigation bar sit on top of screen , scroll down user scroll can click of buttons whenever please. i have completed html, css, jquery, , bootstrap on fcc. these extremely basic lessons. https://codepen.io/bomaran/pen/evorpr here code: css : /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 license: none (public domain) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address

r - How to convert the values in a dataframe to a dummy values by levels() function? -

the given data snp1 <- c("aa","gg","ag") snp2 <- c("aa","cc","ac") snp3 <- c("gg","aa","ag") df<- data.frame(snp1, snp2, snp3) colnames(df)<- c('rs10000438', 'rs10000500','rs1000055') i define data function dominant_dummy . when run codes found goes wrong. error in if (!check) { : argument of length 0 when debug found argument x in dataframe , , need use function levels(x) check level of x, , assign levels(x)<- c(0,1,1) , levels function return null . my purpose convert values in dataframe df dummy values based on conditions. snp_lib<- ncbi_snp_query(names(x)) ncbi_snp_query(names(x)) snp_min<- snp_lib$minor snp_name<- snp_lib$query snp_min ="a" snps <- x check<-substr(levels(snps)[2],1,1)==snp_min i need assign dummy values dataframe levels(x)<- c(0,1,1) . how can that? library(rsnps) domi

time series - auto.arima() severe under/over forecasting -

Image
red:forecast, blue:actuals i using auto.arima() forecast library in r. not clear me why forecast either strictly increasing or strictly decreasing. please explain why happening when using auto.arima()? wiki

.net - Install C# desktop app with sql server DB on client machine -

i have develop desktop application in .netframework, version=v4.5 using visual studio , database using sql sever express 2014. app ready. have install on client machine. how can create database there? which features of sql express have install on client machine? please provide me easy solution. you can use following strategy make work. copy database file program files appdata on installation of software. can't modify files in program files that's why need have in appdata. wiki

node.js - Join payments with database e.g. MongoDB -

i looking in google solutions problem or tutorials, found nothing. try biuld app store online courses, have no idea how join payments (e.g. paypal) , videos. videos locked, if user make payment video unlock. have no idea join payments database e.g. payments:true/false lock/unlock course. know tutorials or articles in case? assuming using sessions store logged in users (if not that's in to) when person pays can add session store: req.user.paid = true example. can use middleware check session variable when access route video in. add field user document indicating paid. use field set status session next time log in. wiki

c# - How to use InvokePattern on Xamarin Android? -

i trying use invokepattern method in xamarin android in order change pattern of polyline. method definition following: public polylineoptions invokepattern(ilist<patternitem> pattern); i have tried doing this: var polyline = new polylineoptions(); polyline.invokepattern(new patternitem()); but doesn't work. how can set pattern to, example, "gap"? i have found solution. following code works me: var list = new list<patternitem>(); list.add(new patternitem(1, java.lang.float.valueof(2))); polylineoptions.invokepattern(list); you can change pattern patternitem's first overload. 0 default (straight line) , 1 pointed line. second overload size of gaps wiki

c# - Filling an array with one field of data from a DataTable -

i've got datatable data in it. simplification, i'll datatable looks this: datatable accdt = new datatable(); string cmdtxt = "select cbl.benefit_id benefitid, "; cmdtxt = cmdtxt + "cbl.benefit_category category, cbl.benefit_provision provision, "; cmdtxt = cmdtxt + "from cstapp_o.d_benefit cbl "; oraclecommand cmd = new oraclecommand(cmdtxt, connection); cmd.connection = connection; cmd.commandtext = cmdtxt; cmd.commandtype = commandtype.text; oracledataadapter da = new oracledataadapter(cmd); da.fill(accdt); now, want fill array values of field called "category". how go doing this? should put column values array. accdt.asenumerable().select(r => r.field<string>("category")).toarray(); wiki

Call a function multiple times; how to add the returned value; Python -

i creating game using python 3.5 exercise. i have function returns score , want sum score every time functions called in order obtain final score. the simplified code follows: letter = 'b' def func(letter): score = 0 word='bye' in word: if letter == i: new_word = remove letter word score += 1 return(new_word, score) else: return('try again') now imagine function called multiple times in function, how add scores produce final score? if simplified code seems wrong, main concern how sum numerical return function. thanks create new variable totalscore initialized outside function, , have updated each time function called. letter = 'b' totalscore = 0 def func(letter): score = 0 word='bye' in word: if letter == i: new_word = remove letter word score += 1 totalscore += score

Custom field handlers syntax when using the Jira/Rally Connector -

i working on jira/rally (ca agile central) integration , can basic sync work, fields require more complex transformation when syncing them between jira , rally. for can see ca agile connector ( https://help.rallydev.com/jira-installation-user-guide ) provides support "custom field handlers" written in ruby , follow format like: # copyright 2015 ca technologies. rights reserved. require 'rallyeif/wrk/field_handlers/field_handler' module rallyeif module wrk module fieldhandlers class mycustomfieldhandler < otherfieldhandler def initialize(field_name = nil) super(field_name) end # ... more code here ... end end end end however when create file , add following connector config: ... <connector> <fieldmapping> <field> <rally>description</rally> <other>description</other> <direction>to_rally</direction&