Posts

Showing posts from July, 2012

flutter - How to stretch an icon to fill parent? -

i need icon dynamically stretch fill parent container. i don't think possible directly on icon (since has size property), there solution i'm overlooking? i believe can use fitted box expanded https://docs.flutter.io/flutter/widgets/expanded-class.html https://groups.google.com/forum/#!msg/flutter-dev/lsgdu1yl7xc/0pys2qrzbqaj https://docs.flutter.io/flutter/widgets/fittedbox-class.html https://docs.flutter.io/flutter/painting/boxfit-class.html new expanded( child: new fittedbox( fit: boxfit.fill, child: new icon(icons.home), ), ), please note in docs expanded has wrapped in colium, row or flex widget.

No validator could be found for type: java.lang.Long :No validator could be found for type: java.lang.Long -

i have object class has no required field except id. here code: entity @xmlrootelement @table(name = "t_host_spec") @cacheable(false) @namedqueries({ @namedquery(name = hostspec.find_all, query = "select m hostspec m") ,@namedquery(name = hostspec.find_by_ip_context_path_port, query = "select m hostspec m m.ip = :ip , m.contextpath =:contextpath , m.port =:port ")}) public class hostspec extends abstractentity { @id @sequencegenerator(name = "host_spec_sequence_generator", sequencename = "host_spec_seq", initialvalue = 1, allocationsize = 1) @generatedvalue(strategy = generationtype.sequence, generator = "host_spec_sequence_generator") @xmlelement(name = "id") @notnull @column(name = "id", nullable = false) private long id; @size(max =200 ) @column(name = "app_name",length = 25) @xmlelement(name = "app_name") private string ap

angular - ngif how to give multiple conditions -

this html file <div class="conform"> <button (click)="clicked(i)" class="btn btn-primary">join ride</button> <div class="dialogboxstyle" *ngif="showindex===i"> <p>your pickup time:</p> <p>8:30am </p> <p> <button (click)="cancel()">cancel</button> <button>confirm</button> </p> </div> </div> this component .ts file public showdialog:boolean = false; public showindex:number; clicked(i:any) { this.showdialog = true; this.showindex = i; } by default when page loaded popup in open stage need hidden stage unless until click it. tried using ngif="showindex === && showdialog" but not working.

c# - How to do view 2nd page in paging -

i able view 1st page upon search if data more 10 rows showing me full grid bind. how can view 2nd page public void fncfillapplication() { try { dataset ds = new dataset(); ds.readxml(server.mappath("application.xml")); if (ds.tables[0].rows.count != 0) { gvapplication.datasource = ds; gvapplication.databind(); } } catch (exception ex) { ex.message.tostring(); } on page index applying paging , datasource xml protected void onpageindexchanging(object sender, gridviewpageeventargs e) { gvapplication.pageindex = e.newpageindex; this.fncfillapplication(); } i able view 1 st page when doing paging clicking 1 when click on 2nd page full grid bind. how able see data further if pagesize="10" data in grid 20 rows.how see last 10 rows. set properties- enablepaging

swift3 - How to count number of uicollectionview's rows in swift -

Image
i need determine uicollectionview's height. let layout = contactcollectionview.collectionviewlayout let heightsize = string(int(layout.collectionviewcontentsize.height)) the above solution works on situations in project. in specific situation need count number of rows , multiple number find height. func collectionview(_ collectionview: uicollectionview, numberofitemsinsection section: int) -> int { // height = (count rows) * 30 . every cell height 30 // every cell has different width. return (presenter?.selectedcontact.count)! } how can find number of rows? update look @ image. this collectionview. every cell has different width(because string). has different rows. width of collectionview width of view.frame you can compare if collectionview 's width greater total previous width(s) increment rowcounts one. assuming implementing uicollectionviewdelegateflowlayout methods , per each cell know dynamic width @ moment. if

javascript - Any way to generate documentation of a website project in a restricted environment? -

following title, have unable execute cmdlets, exe, shellscripts, vb. able open git bash, again, have no admin rights. there ways of accomplishing this? 1 idea had create local website in form upload zip file website stuff repacks , sends via local zip file download? edit: trying document out front end site coded in react. thing able run within git bash. no execution of .exe's or cmdlets withing git bash works though... well, apparently if u have git bash in ur restricted laptop , have ability push ur commit git hub, seems using edoc node module job. instead of saving globally (which won't work) npm install -save esdoc. instead of running esdoc -c [json file], use ./node_modules/esdoc/out/src/esdoccli.js -c [json file] worked beautifully me. hope helps faces similar situation me. feel free add additional methods generate documentation.

c++ - Copy constructor for C volatile bitfield struct -

good day i trying use c sd driver/file system libary (keil mdk), in c++11 project. added pack manager in keil mdk 5.23. compiling armcc 5.06u4 i warning class "_arm_mci_status" has no suitable copy constructor" odd, because header declared in has extern "c" { . by default, pack has no option set c or c++, have manually added file c file. still problem. the struct declared, within extern "c" { as: typedef volatile struct _arm_mci_status { uint32_t command_active : 1; ///< command active flag uint32_t command_timeout : 1; ///< command timeout flag (cleared on start of next command) uint32_t command_error : 1; ///< command error flag (cleared on start of next command) uint32_t transfer_active : 1; ///< transfer active flag uint32_t transfer_timeout : 1; ///< transfer timeout flag (cleared on start of next command) uint32_t transfer_error : 1; ///<

php - Apache is not returning 404 error for non existing URL -

here want if entered link not exist ,then should throw 404 error page of webhost,but returning 200. www.example.com/wrong_page.php --> should throw error 404 is throwing 200 right now.i see same page www.example.com/index.php what might have gone wrong ? there configuration needed done in htaccess.php ? please most have existing rewriting rule in effect, all. something redirects requests /index.php quite common thing in web applications. such index script acts router, processing all requests. serves central entry point , simplifies define structure of implemented engine. so should existing internal rewriting rules inside http servers host configuration or in dynamic configuration file (".htaccess").

php - Woocommerce Product Attribute Values picked from Upsell and Cross Sell -

i displaying upsell , cross sell products on single product page. unfortunately additional information tab contains attribute picking upsell , cross sell. when remove upsell , crosssell loop, attributes values become correct. add loop display upsell , cross sell pick attribute value upsell/cross sell. my page is: http://www.healthgenie.in/incofit-premium-adult-diapers-medium-pack-10-71cm-101cm-28-40/ i fixed problem resetting loop query. <?php wp_reset_query(); ?>

r - Nested Modules Shiny and navigation between tabs -

i'm trying develop app using modules display ui content of different tabs. in app want able create new tabpanels dynamically. used rohde's solution found here . works can't figure out why navigation in-between tabs not work, following error message: "warning: error in if: argument of length zero" , "65: observeeventhandler [committedcustomers.r#20]" . i have problem, i'm using nested modules display different ui content. when display iterationtabui3 (on of module) display sidebarpanel , retain same navlistpanel on left, in code disappears. here code , modules used: ui.r: library(shiny) library(shinydashboard) library(trafficmod) library(plyr) source("iterationtabmodule.r") source("committedcustomers.r") source("iterationtabmodule2.r") source("iterationtabmodule3.r") dashboardpage( dashboardheader(title = "shiny_app"), dashboardsidebar( sidebarmenu(id = "tabs",

javascript - Array to Object with Values in a Range -

i have crazy requirement here. not sure how make work well, may thought of getting community's here. first time here me. let me explain situation clearly. i have array of, 10 elements. var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].reverse(); now need create object of keys containing array elements, values should like: first 5 "high". next 3 "medium". rest 2 "low". i have above information in array: var capacity = [5, 3, 2]; the above 3 values ( high , medium , low) static. not sure how proceed here. not sure if should using for loop hardcoded like: var obj = {}; (var = 0; < capacity[0]; i++) obj[arr[i]] = "high"; (; < capacity[0] + capacity[1]; i++) obj[arr[i]] = "medium"; (; < capacity[0] + capacity[1] + capacity[2]; i++) obj[arr[i]] = "low"; not sure if right way proceed. pointers right direction? thanks. snippet var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].reverse(); var capac

Optimising a Python script -

i've been trying complete below task in python: http://codeforces.com/problemset/problem/4/c i created simple script can seen below, returns runtime error 7th test. believe due perhaps code taking long, require assistance optimising it. have looked @ map , filter commands , tried implementing them, without success. a=int(input()) entered_usernames=[] n=0 while n<a: y=input() entered_usernames.append(y) n+=1 valid_usernames=[] in entered_usernames: if not in valid_usernames: valid_usernames.append(i) print('ok') else: count=1 while i+str(count) in valid_usernames: count+=1 valid_usernames.append(i+str(count)) print(i+str(count)) you can try changing valid_usernames set instead of list . for list list_a operation x in list_a takes (on average) linear time . for set set_a operation x in set_a takes (on average) constant time . (source: https://wiki.python.org/moin

javascript - Typescript async/await with Observable Or Promise -

can use async await this? killing async/await here? code below working without error, know async/await works promise<t> . getitem observable . thanks. roleservice.getitem({ page: p.pageindex + 1, pagesize: p.pagesize }) .takeuntil(this.unsubscribe$) .map((res: responsedto) => <dtomodel>res.contentbody) .do(async (dto: dtomodel) => await this.subject.next(dto.content)) // working wihtout error .subscribe(async (dto: dtomodel) => await (this.pager = dto.pager), //working without error (error: any) => observable.throw(error)); you can use async functions way have no effect in example. have understand async function returns promise: const fn = async function() {}; fn() instanceof promise so if use in observable chain receive promise: interval(500) .first() .map(async (v) => { return v; }) .subscribe((v) => { console.log(v instanceof promise); // logs `true` }); the way constructed example won't hav

nhibernate - LocalDB: transaction deadlock in unit tests? -

i'm using localdb database checking if mappings working ok (i'm using nhibernate+fluent nhibernate). now, have complex structure, items shared between several "aggregates". i've configure aggregates collections aren't loaded lazily , i've started getting transaction locks on 1 of unit tests. now, if run same code against sql server, works out correctly. know if there major differences between these 2 versions regarding locking? btw, mapping tests wrapped in transactions rolled automatically @ end of tests. here's example of 1 of tests i'm trying execute: using (var session = gestorligacoes.fabricasessoes.opensession()) { using (var tran = session.begintransaction()) { var area = area.nova(new novaarea(new acao("luis.abreu"), "teste", "area de testes")); session.save(area); session.flush(); var secretaria = new secretaria("secretaria", "sec", new acao(&quo

php - Profile picture only displays black box with an "X" inside -

i trying set profile page user can upload profile picture. problem having when status changed 1 0 image changes default profile image small black box "x" in it. else works fine. thought might css not. if can assist, appreciated. thank you. profile.php: <?php $id= $_get['id']; $sql = "select * user id='$id'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $sqlimg = "select * profileimg id='$id'"; $resultimg = mysqli_query($conn, $sqlimg); while ($rowimg = mysqli_fetch_assoc($resultimg)) { echo "<div class='userprofileimage'>"; if ($rowimg['status'] == 0 ) { echo "<img src='images/profile".$id.".jpg'>"; } else { echo "<img src='images/profile_d

jquery - how to increase recording time duration in recordRTC -

i want increase time duration record canvas , send server ,for write code shown in below not shows error neither create video. using recordrtc jquery plugin. var canvas = document.getelementbyid('can'); var recorder = recordrtc(canvas, { type: 'canvas' }); recorder.startrecording(); var stop = false; (function looper() { if (stop) { var fiveminutes = 5 * 1000 * 60; * recorder.setrecordingduration(fiveminutes, function () { console.log(recorder); var blob = recorder.getblob(); var reader = new window.filereader(); reader.readasdataurl(blob); reader.onloadend = function () { base64data = reader.result; //console.log(base64data); var basecode = { "webemvideo": base64data }; document.getelementbyid("vid

objective c - Pass data from Table View Cell to a View Controller in IOS -

i know question asked many time , had searched lot , tried many solution not worked. have made customize table view in data load service. data load quite limited , have show detail of data new view controller when user click on cell. should pass data of respective cell carries data. have tried segue technique pass data new vc fails , shows null in value i'm passing. have created labels in new vc in i'm calling values table view cell. code is, - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"showdetail"]) { //do showviewcontroller *destviewcontroller = segue.destinationviewcontroller; nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; destviewcontroller.tites = [_title objectatindex:indexpath.row]; destviewcontroller.prce = [_price objectatindex:indexpath.row]; nslog(@"pppp %@",destviewcontroller.phon); destview

Php dynamically replace placeholder variables in string -

i want dynamically replace placeholder variables in string. str_replace("\$", $data["whatever follows \$], $variable); \$ signifies placeholder variable, \$id example. the data want replace in array. $\id should replaced $data['id'] . for example, if have string says "the id \$id , name \$name ". want replace both \$id , \$name relevant data in $data object. $\id $data['id'] , on. this needs dynamic. don't want hard code replace \$id $data['id'] . key used data in $data should equal follows \$ . i'm having trouble figuring out not how dynamically have talked about, every \$ in string. use printf() or sprintf(). if mark placeholder number, can repeat number of times in string. sprintf("this test string. here's placeholder: %1$s, , another: %2$s, first 1 again: %1$s", $var1, $var2);

r - Possible to combine DT, formattable and shiny? -

formattable have easy options format table, example: library(shiny) library(dt) library(formattable) df <- formattable(iris, lapply(1:4, function(col){ area(col = col) ~ color_tile("red", "green") this can later coverted dt datatable df <- as.datatable(df) for me works perfefect view in viewer in rstudion. however, deploy shiny app somehow. complete code: library(dt) library(shiny) ui <- fluidpage( dt::datatableoutput("table1")) server <- function(input, output){ df <- formattable(iris, lapply(1:4, function(col){ area(col = col) ~ color_tile("red", "green") })) df <- as.datatable(df) output$table1 <- dt::renderdatatable(dt::datatable(df)) } shinyapp(ui, server) this not work, there work around? conditional formatting formattable , use options dt offers example filtering, searching, colvis etc. to deploy formattable there thread: how use r package "formatt

html - inline form elements with flex -

this question has answer here: flexbox not working on button or fieldset elements 2 answers i trying create form @ moment, ideally flex responds number of inputs group, so have form setup this: <fieldset class="form__group"> <input type="text" class="form_input" /> <input type="text" class="form_input" /> </fieldset> <fieldset class="form__group"> <input type="text" class="form_input" /> <input type="text" class="form_input" /> <input type="text" class="form_input" /> </fieldset> <fieldset class="form__group"> <input type="text" class="form_input" /> </fieldset> what trying achieve container not care how many

javascript - How to chain multiple webpack loaders, which modify source code -

basically rather theoretical question. let's have source file a.js , loaders l1-loader.js , l2-loader.js. so l1 modify our file a1 state , l2 a12 state. l2(l1(a.js)) . my aim a.js source in browser console. 1) should both loaders produce source-maps? 2) how l2-loader should interact l1-sourcemaps produce correct a12 sourcemap? 3) way easiest produce correct sourcemap loader l1, l2-loader babel, , l1 loader append lines source code? example transform 3-rd question: define({}) to define(function(){ return window.blackmagic ? null : {}; });

php - Wordpress / ACF field as an admin column -

i've created acf field named 'cislo_ponuky'. it's numeric. what need display admin column in custom post type called nehnutelnosti owning slug of 'nehnutelnosti'. add_action( 'manage_nehnutelnosti_custom_column' , 'custom_mycpt_column', 10, 2 ); function custom_mycpt_column( $column, $post_id ) { switch ( $column ) { // display value of acf (advanced custom fields) field case 'acf_field' : echo get_field( 'cislo_ponuky', $post_id ); break; } } this code's not working me unfortunately. you can use "codepress-admin-columns" plugin admin column https://wordpress.org/plugins/codepress-admin-columns/

c# - Corrupt Metadata after adding to Microsoft Compound File (OLE) -

using openmcdf (c#) loading snt (stickynotes) files this: private void loadfile(string filename, bool enablecommit) { fs = new filestream( filename, filemode.open, enablecommit ? fileaccess.readwrite : fileaccess.read ); try { if (cf != null) { cf.close(); cf = null; } //load file if (enablecommit) { cf = new compoundfile(fs, cfsupdatemode.update, cfsconfiguration.sectorrecycle | cfsconfiguration.novalidationexception | cfsconfiguration.erasefreesectors); } else { cf = new compoundfile(fs); } } catch (exception ex) { messagebox.show("internal error: " + ex.message, "error", messageboxbuttons.ok, messageboxicon.error); }

mysql - SQL Query The Will Tell If Any Part On An Order Is Non-Stock -

i don't know best way word question, had hard time searching solution. have query pulls orders on given day. need know orders have items on inventory = 'n'. i'm not looking find orders of items inventory ='n'. if there @ least 1 of them, i'd 'y' in separate column. select a.ordernum, c.inventory, case when c.inventory = 'n' 'y' else 'n' end nonstock orders inner join orditems b on a.ordnum = b.ordnum inner join items c on b.code = c.code a.orderdate = '7/24/2017' group a.ordernum, c.inventory this original code came with. know isn't correct. need similar (or different, don't know) nonstock column y long of items order have c.inventory = 'n'. going in right direction @ all? guidance appreciated. sample data: a.ordernum b.itemnum c.inventory 123 3 y 123 4 n 123 5 y 124 6 y 124 9 n 124 8

ios - Change collection view constraints programmatically -

i have create collection view in storyboard , add constraints. need change collection view constraint specific condition , want programmatically in class. have iboutlet collection view. parameter needs changed? add constraints in collection view select constraint want modify, hold control , drag class when want constraint changed, type nameofyourconstraint.constant = 100 // int

excel - Loop through visible worksheets and refresh all hidden Pivot tables -

i have dedicated computer , tv screen both purpose of showing sales figures entire business see. i have spreadsheet 3 visible worksheets "sales day", "sales month" , "sales year". these worksheets linked hidden pivot tables in same workbook. can kindly design macro loops through worksheets after 30 second intervals. tricky part pivot tables in workbook should refresh after every 30 minutes. the refreshing should make short break in changing of worksheets loop, after refreshing done loop should continue way was. please assistance highly appreciated , send picture of how master piece look. the loop code have below... sub test() dim long, t single on error goto exit_ application.enablecancelkey = xlerrorhandler = + 1 if > 3 = 1 if = 1 sheets("sales day").select elseif = 1 sheets("sales yesterday").select elseif = 2 sheets("sales month").select elseif = 3 sheets(&

Reference existing project in visual studio template -

i'm trying create template company, , going great! problem is, have shared library, needs shared between of our projects. is there way reference existing project (it in same directory on of our computers), , include project reference in solution created template?

ios - Make constraints for subviews programatically -

i need create uislider , put above existing slider. i know how create constraints view if want attach it's superview: uiview *superview = view.superview; [view setvalue: [nsnumber numberwithbool: false] forkey: @"translatesautoresizingmaskintoconstraints"]; nslayoutconstraint *topconstraint =[nslayoutconstraint constraintwithitem: view attribute:nslayoutattributetop relatedby:nslayoutrelationequal toitem: superview attribute:nslayoutattributetop multiplier:1.0 constant:0.0]; nslayoutconstraint *bottomconstraint =[nslayoutconstraint constraintwithitem: view

jquery - Insert specific values from json to database with php -

i have json data : [ { "id_user":"31", "grade" : "a" }, { "id_user":"32", "grade" : "a" }, { "id_user":"33", "grade" : "b" }, { "id_user":"34", "grade" : "b" } ] then send data jquery $.post("myaction.php", {send: myjsondata }, function(res) { }, "json"); then in myaction.php, decode json , want send data database $conn = mysqli_connect( "localhost","root","","mydb"); $data = json_decode($_post['send']); foreach($data $row){ $id_user = $row->id_user; $grade = $row->grade; mysqli_query($conn, "insert tbl_user (id_user,grade) values ('$id_user','$grade') "); } but problem want insert id_user value equal grade a , how can write query? you can check grade's value in loop. $grade =

How to build a modern usable user friendly web application? -

i have question not related programming. developed web sites more 3 years, of time programmer. biggest problem don't know how start designing ui of web applications modern , user friendly , beautiful. i know question general if wants know how design website, or use or color, , on, in best practise, or has search? what tutorial can suggest design ui on paper or tools? i don't care implementation. searched lot have not yet reached quite , complete guide line designing web site or web application looks user friendly. my don't know keywords have search regarding this. the information looking can found searching under ux design , ui design example here pieces of useful information: https://en.wikipedia.org/wiki/user_experience_design or https://careerfoundry.com/en/blog/ux-design/the-difference-between-ux-and-ui-design-a-laymans-guide/

javascript - JSON.stringify not working correctly -

i using json.stringify method string of json data returned server. have noticed string identificação gets converted identifica��o can please suggest can done keep string is? did try encodeuricomponenet did not work. i check network tab in chrome console. check response coming server. find wrong before json.stringify. if using maven. try set properties in pom.xml file. <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</project.reporting.outputencoding> </properties>

spring - Abstract class and url mapping -

i have abstract class i try have generic method in class. i issue mapping. public abstract class basecontrollernew<t extends baseentity, r extends basedto, s extends basesearch> { ... @getmapping(value = "/{id}") public r getbyid(@pathvariable("id") integer id){ return baseservicenew.getbyid(id); } @getmapping(value = "/") public page<r> get(pageable page){ return baseservicenew.get(page); } .... } @requestmapping(value = "/rest/vehicules") @restcontroller public class vehiculesrestcontroller extends basecontrollernew<vehicules, vehiculesdto, vehiculessearch>{ private vehiculesserviceimpl vehiculesservice; @autowired public vehiculesrestcontroller(final vehiculesserviceimpl vehiculesservice) { super(vehiculesservice); this.vehiculesservice = vehiculesservice; } i'm able call /rest/vehicules/1 but 404 for /rest/vehicules

jquery - Toggle class depending on the div -

how toggle class on div element depending on user on screen. eg- if user scrolls past div block class '.dark', active class '.active' should toggled on header element. i have following code works single instance of '.dark'. jquery(document).ready(function(){ var hieghtthreshold = $(".dark").offset().top; var hieghtthreshold_end = $(".dark").offset().top +$(".dark").height() ; $(window).scroll(function() { var scroll = $(window).scrolltop(); if (scroll >= hieghtthreshold && scroll <= hieghtthreshold_end ) { $('header').removeclass('active'); } else { $('header').addclass('active'); } }); }); however work one. i'm trying achieve multiple '.dark' classes on page.

java - Is it possible to use an enum inside a generic interface -

i have enum public enum values{ value_1, value_2 } i want define generic interface (maybe) public interface listener<t extends enum<values>>{ public dosomething(object data); } and subscriber like: new subscriber implements listener<values.value_1>{ ...//do } so can determine via reflection type used generic interface. have lot listeners , not want call every listerner, want determine type of message listening to. how can achieve that? yeah know not work. can't possible... want suggestion how solve this. you can reference types in generics eg: integer , string not values 1 or "string" . same counts enums. can pass type of enum (in case values ) not direct value ( value_1 ) so following valid case: public interface listener<t extends enum<t>> { void dosomething(object data); }

java - SSL certificate issue in SOAP webservice from Windows commandline -

when run java project on eclipse, able access application server thru soap web service. getting ssl certificate issue while running jar file command prompt. verified imported certificate. wondering why failing on command prompt only. needs configured? please advise. c:\users\admin\desktop>java -jar javaapp.jar [ljava.lang.stacktraceelement;@4ec6a292 javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.ssl.alerts.getsslexception(unknown source) @ sun.security.ssl.sslsocketimpl.fatal(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.clienthandshaker.servercertificate(unknown source) @ sun.security.ssl.clienthandshaker.processmessage(unknown source) @ su

postgresql - How to use non-numeric independent variables while training a Linear Regression Model with MADlib-postgre? -

my table contains character field , 2 numeric fields: create table lr_source (char01 varchar(250) ,plnumeric01 numeric ,plnumeric02 numeric); i want train linear regression model char01 , plnumeric01 independent variables , plnumeric02 dependent variable. select madlib.linregr_train( 'lr_source', --source table 'lr_model',--model table 'plnumeric02', --dependent variable 'array[plnumeric01, char01 ]' --independent variables ); when running above query, fails following error: error: spiexceptions.datatypemismatch: array types numeric , character varying cannot matched how can use non-numeric fields independent variable? i suggest encode categorical variables per http://madlib.apache.org/docs/master/group__grp__encode__categorical.html make them numeric, , can pass them linear regression. also, want add explici

java - Is there a way to set the font using pdfcanvas in iText when adding a header? -

i"m using page event add header , footer in pdf using itext. header needs different color, i'm not sure how change color of text. there doesn't seem function calls change text color, how paragraphs have. @override public void handleevent(event event) { pdfdocumentevent docevent = (pdfdocumentevent) event; if (docevent.getdocument().getpagenumber(docevent.getpage()) != 1) { try { pdfcanvas canvas = new pdfcanvas(docevent.getpage()); canvas.begintext(); canvas.setfontandsize(pdffontfactory.createfont(fontconstants.helvetica_oblique), 24); canvas.movetext(50, pagesize.a4.getheight() - 50) .showtext("header") .endtext() .release(); } catch (ioexception e) { e.printstacktrace(); } catch (java.io.ioexception ex) { logger.getlogger(pdfheaderpagenumberevt.class.getname()).log(level.severe, null, ex);

symfony - DomCrawler is removing part of the html -

Image
when content without domcrawler, html custom tags @click when use $this->crawler->filter('something')->html() domcrawler removing @click tags. here example without using domcrawler: and here using domcrawler: as can see, domcrawler removing @clicks, how can stop this? unfortunately, can't. domcrawler uses domdocument under hood , not allow "@click". also: the domcrawler attempt automatically fix html match official specification. the modifiers disable libxml_html_noimplied not used in addhmlcontent method of domcrawler: //... symfony\component\domcrawler\crawler.php $dom->loadhtml($content); // ... and calling @$dom->loadhtml($content, libxml_html_noimplied); not work in case. example: $html = <<<test <html> <div class="test" @click="something"></div> </html> test; dump($html); //<html>\n // <div class="test"

excel - VBA find and findnext to paste values -

Image
i have sheet want use find , findnext search values on sheet bd , copy them main sheet plan1 if value on alocacao matches cells on column 5 . i used have 4 spaces named ranges tecnico1, tecnico2, tecnico3 , tecnico4 paste values , code works fine. this how looks: and bd sheet: and code: sub verifprod_click() dim foundcell range, firstaddr string, fnd string, long fnd = sheets(1).range("alocacao").value set foundcell = sheets("bd").columns(5).find(what:=fnd, _ after:=sheets("bd").cells(rows.count, 5), lookat:=xlpart, _ lookin:=xlformulas, searchorder:=xlbyrows, searchdirection:=xlnext) if foundcell nothing exit sub = + 1 sheets("plan1").range("tecnico" & i).value = foundcell.offset(, -3).value sheets("plan1").range("upps0" & i).value = foundcell.offset(, -1).value set foundcell = sheets("bd").columns(5).f

c# - How to add a CellDoubleClick handler to a grid Automatically generated -

i creating multiple pages tab control foreach (menus menu in allmenus) { tabpage toadd = new tabpage(); _productstabs.controls.add(toadd); toadd.text = menu.menu; toadd.backcolor = color.fromargb(39,39,39); } for each tab create next add grid , fill data sql table #region addgrids foreach (tabpage _tab in _productstabs.tabpages) { datagridview toadd = new datagridview(); toadd.size = new size(1390, 584); toadd.dock = dockstyle.fill; toadd.backgroundcolor = color.fromargb(39, 39, 39); toadd.defaultcellstyle.backcolor = color.fromargb(41, 41, 41); toadd.alternatingrowsdefaultcellstyle.backcolor = color.fromargb(49,49,49); toadd.gridcolor = color.fromargb(49, 49, 49); toadd.forecolor = color.white; toadd.rowheadersvisible = false; toadd.allowusertoresizerows = fa

android - Passing variables to IHttpActionResult Methods -

i want consume webapi in android below (in newproductactivity.java): protected string doinbackground(string... params) { list<namevaluepair> args = new arraylist<namevaluepair>(); args.add(new basicnamevaluepair("name", edittextname.gettext().tostring())); args.add(new basicnamevaluepair("price", edittextprice.gettext().tostring())); args.add(new basicnamevaluepair("description", edittextdescription.gettext().tostring())); jsonhttpclient jsonhttpclient = new jsonhttpclient(); product product = (product) jsonhttpclient.postparams(serviceurl.product, args, product.class); intent intent = new intent(getapplicationcontext(), mainactivity.class); startactivity(intent); finish(); return null; } in web api assigned variables parameters in productscontroller.cs below: [httppost] //[responsetype(typeof(product))] public ihttpactionresult insert

Install error when install R package from github -

i try install r package multidplyr (which not available cran) github. followed this link. i first install.packages("devtools") , library(devtools) , devtools::install_github("hadley/multidplyr") . generates error message downloading github repo hadley/multidplyr@master url https://api.github.com/repos/hadley/multidplyr/zipball/master installing multidplyr "c:/progra~1/r/r-34~1.1/bin/x64/r" --no-site-file --no-environ --no-save -- no-restore --quiet cmd install \ "c:/users/ftxx/appdata/local/temp/rtmpepoem9/devtools34805943869/hadley-multidplyr-0085ded" \ --library="c:/users/ftxx/documents/r/win-library/3.4" --install-tests installation failed: command failed (65535) how fix problem? found if package on cran, system has no problem install.packages("abc") , long needs install packages github, has problem. tried install other packages github, has same problem. i've followed this instructions installed r

r - xgbTree caret matrix or not? -

i running example following code: v.ctrl <- traincontrol(method = "repeatedcv", repeats = 1,number = 3, summaryfunction = twoclasssummary, classprobs = true, allowparallel=t) xgb.grid <- expand.grid(nrounds = 10000, eta = c(0.01,0.05,0.1), max_depth = c(2,4,6,8,10,14)) set.seed(45) xgb_tune <-train(target~., data=train, method="xgbtree", trcontrol=cv.ctrl, tunegrid=xgb.grid, verbose=t, metric="logloss", nthread =3) the error simple: error in train(target ~ ., data = train, method = "xgbtree", trcontrol = cv.ctrl, : unused arguments (data = train, method = "xgbtree", trcontrol = cv.ctrl, tunegrid = xgb.grid, verbose = t, metric = "logloss", nthread = 3) my dataset structure

spring - Java JPA/Hibernate generates database schema twice -

i tried switching application hibernate's sessionfactory jpa's entitymanager spring mvc project. when run application jetty, database schema created twice. (i have hbm2ddl.auto set 'create'). more specifically, see output twice: info: building jpa entitymanagerfactory persistence unit 'default' info: initialized jpa entitymanagerfactory persistence unit 'default' the generated sql hibernate shows exact same sql statements repeated twice. somehow entitymanagerfactory being created twice. i using hibernate version 5.2.9.final, spring version 4.3.5.release unfortunately project not belong me, not think can release code samples. wondering if else has encountered issue, , appreciate if point me in general direction of problem might be. i have tried switching between localentitymanagerfactorybean , localcontainerentitymanagerfactorybean i have switched between using datasource , persistence.xml i have tried filtering <context:compo

python - Factors and shifts in offsets for matplotlib axes labels -

Image
on axes tick labels in matplotlib, there 2 kinds of possible offsets: factors , shifts : in lower right corner 1e-8 "factor" , 1.441249698e1 "shift". there lot of answers here showing how manipulate both of them : matplotlib: format axis offset-values whole numbers or specific number how remove relative shift in matplotlib axis how prevent numbers being changed exponential form in python matplotlib figure i remove shifts , can't seem figure out how it. matplotlib should allowed scale axis, not move 0 point. is there simple way achieve behaviour? you can fix order of magnitude show on axis shown in this question . idea subclass usual scalarformatter , fix order of magnitude show. setting useoffset false prevent showing offset, still shows factor. thwe format "%1.1f" show 1 decimal place. using maxnlocator allows set maximum number of ticks on axes. import numpy np import matplotlib.pyplot plt import matplotlib.ticker