Posts

jquery - bootstrap select not showing items -

Image
i trying use bootstrap-select in python flask web page. following code have. <head> <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css')}}" > <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-responsive.min.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/font-awesome.min.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/sl-slide.css')}}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-select.min.css')}}"> <script src="{{ url_for('static', filename='js/jquery-3.2.1.m...

go - GORM Cannot pass foreign key to query -

i usin jinzhu gorm package connecting db, etc. this code package pizzas import ( "github.com/jinzhu/gorm" "github.com/gin-gonic/gin" "speedy-gonzales/db" "net/http" ) type pizza struct { gorm.model name string `gorm:"not null"` image string `sql:"type:text"` psizesandprices []pizzapricesize } type pizzapricesize struct { gorm.model sizetitle string `gorm:"column:size_title;type:varchar(50);not null'"` priceeur int `gorm:"column:price_eur"` pricebam int `gorm:"column:price_bam"` pizzaid uint `gorm:"index"` } func (pizzapricesize) tablename() string { return "pizza_price_sizes" } func fetchpizzaswithsizes(c *gin.context) { var pizza_model []pizza var p_sizes_prices_model []pizzapricesize db := db.dbconnect...

web services - RAML inline application/xml example -

responses: 200: body: application/xml: example: | <?xml version="1.0" encoding="utf-8"?> <my_response> <result>success</result> <message>great</message> </my_response> is valid inline application/xml body example raml endpoint definition? if not how should be? yes is. depending on want may want specify type using xsd. example: /jobs: displayname: jobs post: description: create job body: text/xml: type: | <xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="api-request"> <xs:complextype> <xs:sequence> <xs:element type="xs:string" nam...

automation - Automatic Weekly Backups to a Server? -

i'm trying fun little project building budget backup server on cheap , have come across hp dl320-g6. can support 4x 3tb drives , intend set in raid0 cheap, massive, offline, 2nd-copy backup. the computer it's backing windows 7 home server in jbod , runs 24/7. both connected gigabit switch , in future might add 10gbe card both. i'd do, ideally, power on dl320 once week , have automatically w7 machine , shut down when done. is @ possible or have thoroughly underestimated complexity of setting enterprise grade server consumer software? i have considered building nas advantages of using "proper" server reliable/easily-replaceable raid hardware, sata backplanes, hotswap , more elegant solution.

PHP array merge on Inner keys -

i have 2 arrays like: $a = [ 0 => [ 'price' => 5.5 ], 1 => [ 'price' => 6.0 ], 2 => [ 'price' => 6.2 ], 3 => [ 'price' => 6.5 ], ]; $b = [ 0 => [ 'color' => 'red' ], 1 => [ 'color' => 'white' ], 2 => [ 'color' => 'blue' ], 3 => [ 'color' => 'red' ], ]; i should have response: array ( [0] => array ( [price] => 5.5 [color] => red ) [1] => array ( [price] => 6 [color] => white ) [2] => array ( [price] => 6.2 [color] => blue ) [3] => array ( [price] => 6.5 [color] => red ) ) i heard function: array_mer...

javascript - React: Add/Change text input base on a selected option -

i trying display new text input based on selected option. able below old value entered present no matter change new select option to. what might better way achieve this? appreciate suggestions. class loadcomponent extends react.component { static proptypes = { ...... }; static defaultprops = { .... }; constructor() { super(); this.state = { value: "" }; } state = { ... }; reset = (selected) => { this.setstate({ selectedinputname: selected.target[selected.target.selectedindex].text, selectedinputid: selected.target.value }); }; maketextinput = () => { return ( <textinput label={this.state.selectedinputname} placeholder={`please enter ${this.state.selectedinputname} here!`} onblur={event => this.setstate({[this.state.selectedinputid]: event.target.value})} showclear value={this.state....

bayesian - rjags error Invalid vector argument to ilogit -

i'd compare betareg regression vs. same regression using rjags library(betareg) d = data.frame(p= sample(c(.1,.2,.3,.4),100, replace= true), id = seq(1,100,1)) # looking reproduce regression jags b=betareg(p ~ id, data= d, link = c("logit"), link.phi = null, type = c("ml")) summary(b) below trying same regression rjags #install.packages("rjags") library(rjags) jags_str = " model { #model y ~ dbeta(alpha, beta) alpha <- mu * phi beta <- (1-mu) * phi logit(mu) <- + b*id #priors ~ dnorm(0, .5) b ~ dnorm(0, .5) t0 ~ dnorm(0, .5) phi <- exp(t0) }" id = d$id y = d$p model <- jags.model(textconnection(jags_str), data = list(y=y,id=id) ) update(model, 10000, progress.bar="none"); # burnin 10000 samples samp <- coda.samples(model, variable.names=c("mu"), n.iter=20000, progress.bar="none") summary(...