Posts

Showing posts from June, 2010

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(...

java - Parsing JSON Objects with Different Keys -

i created android application uses google books api. when json response server, parse response , retrieve title, authors, category, publisher, page count, thumbnail , more information book. problem books in json response don't have thumbnail key or category key. when try json key values program throws error , consequently skips code of adding other books after error occurred. i solved nested try catch blocks. example, if there isn't publisher key in response, return null. string publisher; try { publisher = volumeinfo.getstring("publisher"); } catch (jsonexception e) { publisher = null; } here how whole method parsing json response looks like: private list<bookdata> parsejsonresponse(string jsonresponse) { list<bookdata> bookdata = new arraylist<>(); try { jsonobject rootobject = new jsonobject(jsonresponse); jsonarray itemsarray = rootobject.getjsonarray("items"); (int = 0; < i...

android - Onclick with Fragment , there's no error but it doesn't work -

public class frag2 extends fragment { button btn_service; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view = inflater.inflate(r.layout.fragment2, container, false); ((edittext) good.findviewbyid(r.id.edittext)).settext("edit text test"); final view v = inflater.inflate(r.layout.fragment2, container, false); btn_service = (button) v.findviewbyid(r.id.btn); btn_service.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { snackbar.make(view, "test snackbar button", snackbar.length_long) .setaction("action", null).show(); } }); return good; } i want know how code onclick fragment layout. i'm novice in android coding. may ask wrong question. ...

sonarqube - How should old resurfaced technical debt be handled within leak period? -

we have on-premises installation of sonarqube, , after upgrading version 6.0 6.5 noticed several bugs , code smells old 2012 have resurfaced. wasn’t expecting happen, per sonarqube 6.3 release notes – see section “remove noise on leak period newly activated rules” . since old , have no plans handle them now, impacting our gate status – red – , don’t see how can rid of them in proper way. i can think of 2 options: shorten leak period, not approach existing valid smells in leak period considered technical debt; mark them "false positive" or "won’t fix" , not idea lose traceability of existing bugs , smells plan fix 1 day. in such cases, what's best approach taken?

javascript - How to prevent Safari from loading back button cache? -

i've noticed common bug browser button usage on web app hitting button after logout loads cached page user appears logged in (though aren't actually). i found lot of helpful questions helpful answers , employed fixes folks suggested, including every combination of suggested cache-control options in header: ('cache-control', 'no-cache, no-store, must-revalidate, max-age=0, max-stale=0') and header works on most browsers, no-cache , no-store, no header options solve on safari. sure enough, reliable way can find resolve safari use javascript such forces reload: <script> window.onpageshow = function(event) { if (event.persisted) { window.location.reload(); } }; </script> the javascript block above does work, if user doesn't disable javascript via safari -> preferences -> security , subsequently hit button. it's edge case, i'm kind of fascinate...

javascript - How can I properly organize my JS code into a more traditional class structure? -

i'm struggling js code structure that's becoming apparent during unit testing attempts. i'm used class structure, i'm bit lost in js world there aren't classes. i'm looking way organize code in traditional class/constructor architecture. here's have: function ddgridselector(primaryid, templatedefault, gridobj) { //set variables this.primaryid = primaryid, this.defaulttemplate = templatedefault, this.gridobj = gridobj, this.gridobj.searchval = '', this.init = ddgs_init } function ddgs_init(ddgs_obj) { ddgs_setdefaulttemplate(ddgs_obj); ddgs_initgrid(ddgs_obj); ddgs_initkendowindow(ddgs_obj); ddgs_initkendobutton(ddgs_obj); ddgs_initresetbutton(ddgs_obj); ddgs_addgrideventlistener(ddgs_obj); } function ddgs_setdefaulttemplate(ddgs_obj) { //doing stuff } function ddgs_initgrid(ddgs_obj) { //more stuff } to call of these... var ddgridselector_new = new ddgridselector('primaryide...

php - Strange behaviour on $get parameter. -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers i'm getting following error "notice: undefined index:" on 'name' => $_get['channel']. when there's parameter works , allows loop proceed, when there's no parameter set error above. if try isset removes error stops wordpress loop proceeding if parameter set. what missing? <?php $args = array ( 'post_type' => 'abc_channels', 'name' => $_get['channel'], 'post_status' => 'publish', 'posts_per_page' => 1, ); $loop = new wp_query( $args ); // if have live channels if (isset($_get['channel'])) : if($loop->have_posts()): while($loop->have_posts()): $loop->the_post(); ?> ...

java - Retrofit object returned as null -

Image
i've built retrofitservice return objects. in mainactivity call service simple button click. seem getting kind of object, don't feel it's being returned rest api specified. shows in debugger attributes null: bfetch.setonclicklistener(v -> { v.startanimation(animationutils.loadanimation(this, r.anim.image_click)); retrofitservice service = servicefactory.createretrofitservice(retrofitservice.class, retrofitservice.service_endpoint); service.getposts() .subscribeon(schedulers.newthread()) .observeon(androidschedulers.mainthread()) .subscribe(new subscriber < post > () { @override public final void oncompleted() { log.e("retrofitservice", "retrofit request completed!"); } @override public final void onerror(throwable e) { log.e("retrofitservice", e.getmessage()); } @override public final void onnext(post post) { if (post != null) { // todo: object returned properties null log.e("retrofit...

python - How to use PolyCollection in matplotlib.collections? -

Image
i don't quite understand function of statement: return [(xlist[0], 0.)] + list(zip(xlist, ylist)) + [(xlist[-1], 0.)] [(xlist[0], 0.)] seems weird me. why have add vertices y=0 @ beginning , end of list? puzzles me. list(zip(xlist, ylist)) seems adequate me, depicts beginning , end of polygon. the webpage of code: http://matplotlib.org/devdocs/gallery/mplot3d/polys3d.html from mpl_toolkits.mplot3d import axes3d matplotlib.collections import polycollection import matplotlib.pyplot plt matplotlib import colors mcolors import numpy np # fixing random state reproducibility np.random.seed(19680801) def cc(arg): ''' shorthand convert 'named' colors rgba format @ 60% opacity. ''' return mcolors.to_rgba(arg, alpha=0.6) def polygon_under_graph(xlist, ylist): ''' construct vertex list defines polygon filling space under (xlist, ylist) line graph. assumes xs in ascending order. ''' r...

javascript - Displaying a string representation of an image on client side using express -

im using jsftp in express application serve string representation of image ftp connection, working fine. however, image not display when sending client: router.get('/', (req, res, next) => { let str = '' ftp.get('/uploads/test.png', function (err, socket) { if (err) return socket.on('data', function (d) { str += d.tostring() }) socket.on('close', function (haderr) { if (haderr) { console.error('there error retrieving file.') } res.writehead(200, { 'content-type': 'image/png' }) res.end(str, 'binary') }) socket.resume() }) }) any appreciated, thanks! you try debugmode: true in ftp connection, listen debug events, , check if there's error during connection.

python - How to read Txt file section by section by special marker using Pandas? -

i trying use pandas analyze text file output s structural analysis software. file has 24000+ lines can broken down sections, each of them starting $, example: $ stories - in sequence top story "platform" height 51.9996 story "bulkhead" height 117 story "emr" height 124.9992 story "roof" height 140.0004 similarto "41st fl" $ grids gridsystem "g1" type "cartesian" bubblesize 60 grid "g1" label "g" dir "x" coord -1068 visible "yes" bubbleloc "end" grid "g1" label "d" dir "x" coord -586 visible "yes" bubbleloc "end" grid "g1" label "d.3" dir "x" coord -460 visible "yes" bubbleloc "end" i can use pd.read_csv , specify skip_row parameter each of them, pretty repetitive , stupid when text file large. since output file quit...

quickbooks webconnector billAdd changing memo on old bills -

we using quickbooks webconnector send bills quickbooks, has been working fine month or more, finding bills previous entered hand just memo field content bill sent through webconnector. time have same memo in 10 old bills. any idea? thanks

r - Add an arrow pointing at the x-axis in my plot in ggplot2 -

Image
my goal arrow text pointing @ x-axis label average word frequency. cannot figure out life of me how either arrow or text outside of plotting area in ggplot2. here code: ggplot(summary.pctdiff, aes(principle, pctdiff)) +xlab("principle")+ylab("% difference")+ geom_bar(aes(fill = sector),position = "dodge", stat="identity",col="black")+ ggtitle("how differing sectors talk different co-operative principles")+theme(plot.title=element_text(hjust=0.5),panel.border = element_rect(colour = "black", fill=na, size=1),legend.background = element_rect(color = "black"),legend.position =c(1.10,0.7),plot.margin=unit(c(0.5,3,0.5,0.5),"cm"))+ geom_hline(yintercept = 0) here data: structure(list(principle = structure(c(1l, 2l, 3l, 4l, 5l, 6l, 7l, 1l, 2l, 3l, 4l, 5l, 6l, 7l, 1l, 2l, 3l, 4l, 5l, 6l, 7l, 1l, 3l, 4l, 5l, 6l, 7l), .label = c("principle 1", "principle 2", ...

angular - @Injectable compared to plain old static methods -

i have utility class converts 1 object , vice versa. export class converter { public tofoo(bar: bar) : foo {} public tobar(foo: foo) : bar {} } would better make class @injectable? @injectable export class converter { public tofoo(bar: bar) : foo {} public tobar(foo: foo) : bar {} } or static method better in case? export class converter { static tofoo(bar: bar) : foo {} static tobar(foo: foo) : bar {} }

python - Not outputting any values -

Image
my code seems not working properly. goal year , location match in same row, , print out information associated row. code posted below excel sheet reading data. load_gen_datafile = 'c:\users\roszkowskim\desktop\data_2016.csv' # csv file read open(load_gen_datafile) csvfile: reader = csv.dictreader(csvfile) mydict={} row in reader: year=row['year'] busnum=row['busnum'] area=row['area'] power=row['power'] tla=row['tla'] location=row['location'] yearlink=row['yearlink'] from=row['from'] to=row['to'] max=row['max'] min=row['min'] year = raw_input("please select year of study: ") print("\n") commands = ["millwood-buchanan", "astoria-east-corona", "bronx", "dunwoodie-north-sherman_creek", "vernon", ...

amazon web services - Server and client side encryption in S3 (EMR config) -

quick & simple question, couldn't find in docs: in emrfs-site.xml , can set both fs.s3.enableserversideencryption , fs.s3.cse.enabled true? provide double encryption, or it's not possible? no, "amazon s3 sse , cse mutually exclusive; can choose either not both." per http://docs.aws.amazon.com/emr/latest/releaseguide/emr-cluster-configuration-object-encryption.html

python - Second os.walk runs extremely slow -

the program works when performs second os.walk operation takes longer first time. first time os.walk occurs walks through directory tree until finds directory name matching partno input. stores directory location path_to_files . walks given directory , opens files start partno . guess after finding directory on first os.walk continues searching make sure doesn't find matching directory. said works great seems find path_to_files directory instantly when runs open files takes longer (8-15 seconds) there doing wrong in code or have attempting open 3-6 files in different applications @ once? appreciated. in advance... import os partno ="" partno = raw_input("enter part no:") #takes user input of part no yourpath = r"y:\shop\manufacturing docs" #parent directory print ("loading part no %r files...please wait") % partno root, dirs, files in os.walk(yourpath, topdown=true): name in dirs: if name == partno: #matches folde...

javascript - Parsing Soundcloud Source with BeautifulSoup -

i'm going keep simple. decently new html/js. it's not complicated don't have syntax down beautifulsoup down point of knowing how parse specific information. <a href="/buygore/k-theory-x-wizard-turn-it?in=blissful-edm/sets/best" class="trackitem__tracktitle sc-link-dark sc-font-light">k theory x wizard - turn it</a> so, above specific tag want information out of. actual artist - song name portion near end of text "k theory x wizard - turn it" in instance. have use regular expressions? link in situation specify want value attached href, don't see attached text above. thanks! you can use findall on soup result. f = soup.findall("a", {"class":"trackitem__tracktitle sc-link-dark sc-font-light") print(f.text) this should work

qt - Grantlee Template: Splitting a list into "N" chunks -

using grantlee template system library (so not quite full django template system), i'm trying take list of objects ( qlist<qobject *> ), split "n" chunks, , build separate (html) table each chunk. in template i'm doing like: {% range objectlist.count startnum %} {% if startnum|divisibleby:16 %} {% include "table.html.django" %} {% endif %} {% endrange %}` i've tried in table.html.django : <table> <thead><tr><th>name</th></tr></thead> <tbody> {% range startnum startnum|add:16 num %} <tr><td>{{ num }} {{ objectlist.num.name }}</td></tr> {% endrange %} </tbody> </table> ( range built-in grantlee tag.) but doesn't reference list item , don't see how access specific item in list when have variable ("num"). there way this? i tried using slice, looking @ slicefilter::dofilter() code seems works...

javascript - Is VueJS guaranteed to call mounted() in correct order? -

let's have basic page vuejs follows: vue.component('child', { template: '<p>placed @ index {{index}}</p>', data() { return { index: 0 } }, mounted() { this.index = this.$parent.addelement(this); } }); new vue({ el: '#theparent', data() { return { allelements: [] } }, methods: { addelement(elem) { this.allelements.push(elem); return this.allelements.length - 1; } } }); <script src="https://cdn.jsdelivr.net/vue/2.3.2/vue.min.js"></script> <div id="theparent"> <child></child> <child></child> <child></child> </div> the purpose of output illustrate @ index elements have been inserted at. use case requires elements added in same order appear in html. every time run page appears indeed happening output in order. my question is: behavior gua...

html - format data and display in view using Angular -

Image
i have page built using php , convert angular. services, controller , stuff done , can data need display. problem cannot display have php page. world great. php page view: angular page view: code i'm using angular side: <form> <div class="row" ng-repeat="x in configitems" ng-init=" header=''"> <div class="col-sm-12" ng-if="header != x.configgroup" ng-init="header=x.configgroup"> <label> <strong nf><h4 style="font-weight:bold;">{{x.configgroup}}</h4></strong> </label> <hr> </div> <div class="col-sm-6 form-horizontal" ng-if="x.datatype != 'boolean'"> <div class="form-group"> <label for="varforuse" class="col-sm-4 control-label align-text-left">...

Access query date/time returns inappropriate records -

i have interesting problem have been unable find answer for! writing queries @ data based on times of 2 different events, difference in arrival of 2 units location. straightforward. data , part two see below 'part two' clarification. [elapsed_time] calculated difference between 2 , date/time. the first query used @ occurrences difference less 30 seconds. qry = "insert [table] select * [new data] ([1st_agency_onscene] = 'abcd') , ([elapsed_time] < #12:00:30 am#);" docmd.runsql qry when query run should return 279 rows instead returns 281, 2 extra. looking @ 2 rows following returned: refer 'part two' in previous image (i may have 2 links!). they both @ 30 seconds should not returned. there other records have time of 30 seconds not returned, (6 others, 8 total). i not sure how/why stored differently others 30 seconds. in attempt find difference created field subtracted [2nd_agency_onscene_time] first , appears somehow stored diffe...

c# - Download progress with a logging callback? -

i have headscratcher of challenge here. i have web application running in azure, @ point expose sas uri (download link) users download files our azure storage. the problem cannot keep track of exact count of content downloaded. i can assume when produce download link user, file downloaded. perhaps wasn't. i've looked @ azure logs , don't think find want in there. is there way have user download file controller method, , have callback being executed every once in while hold transfer progress log somewhere , know user download much. i'm thinking signalr too. used purpose ? thanks. the problem cannot keep track of exact count of content downloaded. if azure storage diagnostics feature turned on, read/write/delete operations on blob logged, can download ( getblob operation) count specified blob diagnostics logs. besides, if users enabled download blobs mvc application, can update & save download count in external storage in controlle...

jquery - How do I change the colour of all select2 elements in a specific row -

i using select2, change back-ground colour of of select elements in table. however, jquery code running, changes colour of first select input. tips fixing issue? my html looks like <table width="100%" class="table table-striped table-bordered table-hover" id="tb2"> <thead> <tr> <th>name</th> <th>type of student</th> <th>thesis/ project/ research</th> </tr> </thead> <tbody> <tr class="table_row"> <td><input class="form-control alert-danger" type="text" name="a"/></td> <td><select class="form-control alert-danger""> <option value="">type</option> <option>bachelors</option> <option>masters</option> <option>doctoral</op...

javascript - Pass options to QuillJS's module extensions through Quill.register -

i upload image aws s3 before add editor. inside imageblot because using insertembed in several places. example code qilljs team. quill.register(imageblot); export class imageblot extends blockembed { static create(value) { const node = super.create(); node.setattribute('alt', value.alt); node.setattribute('src', value.url); return node; } static value(node) { return { alt: node.getattribute('alt'), url: node.getattribute('src') }; } } imageblot.blotname = 'image'; imageblot.tagname = 'img'; is possible add custom functions imageblot through quill.register or other way? using react , redux, hence actions have connected , can't imported.

asp.net mvc - razor syntax confusion if / then -

i have code block works fine @foreach (var message in model.orderby(a => a.messageorder)) { if ((datetime.compare(message.messagestart, datetime.now) < 0) && (datetime.compare(message.messageend, datetime.now) > 0)) { if (!message.hideheader) { @html.raw(string.format("<{0}>{1}</{0}>", message.headerclass, (string.isnullorempty(message.headerhtml)) ? message.header : server.htmldecode(message.headerhtml))); } switch (message.numcolumns) { case 1: @html.partial("_contentblock", message) break; default: <div class="row"> @html.partial("_contentblock", message) </div> break; } } } but tried putting div around code based on if/then , can't razor syntax correct. in visual studio intellisence not highlight if (!message.hideheader) on. not gett...

What is the equivalent to AssociationType in Entity Framework Core 2? -

i use convention (istoremodelconvention) need know if associationtype.isforeignkey true. objective rename foreign keys in mapped tables. example, remove underscore , compose totally new name derived classes , properties names. the question is: exists equivalent associationtype.isforeignkey in entity framework core 2 or how can accomplish type of customization? ef core 2 has different (or better) naming system foreignkeys. name constructed fk_table_referencedtable_fkproperties table fk constraint defined. referencedtable principal side. , fkproperties _ separated list of foreign key properties. perhaps match naming system want. though if want still customize names of foreign key properties, in ef core there no user defined convention support yet. ef core allows iterate on model metadata configure way want. in onmodelcreating method in derived dbcontext can put following code name fk want. protected override void onmodelcreating(modelbuilder modelbuilder) { //...

Unity3D signal 11 SIGSEGV code 1 SEGV_MAPERR, crashes on low end android -

crashes on low end androids, works fine on medium high end(s6 upwards), same crash on iphone 7. not sure problem is. crashes in relatively same area each time. game runs, closer denser area of meshes crash happens. build fingerprint: samsung/gt58wifixx/gt58wifi:6.0.1/mmb29m/t350xxu1bpk1:user/release-keys' 08-14 14:56:52.935 379 379 f debug : revision: '4' 08-14 14:56:52.935 379 379 f debug : abi: 'arm' 08-14 14:56:52.935 379 379 f debug : pid: 25670, tid: 25683, name: unitymain >>> com.test.vroom <<< 08-14 14:56:52.935 379 379 f debug : signal 11 (sigsegv), code 1 (segv_maperr), fault addr 0x3eb53096 08-14 14:56:52.985 379 379 f debug : r0 3eb53092 r1 00000016 r2 3eb53092 r3 00000003 08-14 14:56:52.985 379 379 f debug : r4 b856f218 r5 00000818 r6 00000004 r7 c0000000 08-14 14:56:52.985 379 379 f debug : r8 b6cc2eb8 r9 b30dcdd4 sl 00000001 fp b9fbc34c 08-14 14:56...

java - read SES emails from SQS -

i configured ses push emails sns , sqs queue, i'm reading from: @sqslistener("emails") public void receiveemail( @notificationsubject string subject, @notificationmessage string json) { system.out.println(subject); system.out.println("======================"); system.out.println(json); } this reads fine, payload messy, like: { "notificationtype": "received", "mail": { "timestamp": "2017-08-14t16:39:59.757z", "source": "xxxxxxx@gmail.com", "messageid": "imc1lp6154ppg8d798h7a6ihmd936n8brmagee81", "destination": ["root@luizkowalski.net"], "headerstruncated": false, "headers": [{ "name": "return-path", "value": "<xxxxx@gmail.com>" }, { "name": "received", "value": ...

Android get Bluetooth storage in different devices -

in different devices path of bluetooth different, use post bluetooth folder, different path on different phones but returns null in devices , error, best practice bluetooth path?

pandas - Python groupby imputing -

i have dataframe 200 rows , 151 columns, output variable being of type object . i trying impute null values in input variables (150 columns) mean value of column section grouped output variable. is there way use sklearn imputer in instance? know example follow? thanks.

html - Last margin / padding collapsing in flexbox -

i have list of items i'm trying arrange scrollable horizontal layout flexbox. each item in container has margin left , right, right margin of last item being collapsed. is there way stop happening, or workaround? codepen of issue: http://codepen.io/anon/pen/wxmdpn ul { list-style-type: none; padding: 0; margin: 0; display: flex; height: 300px; overflow: auto; width: 600px; background: orange; } ul li { background: blue; color: #fff; padding: 90px; margin: 0 30px; white-space: nowrap; flex-basis: auto; } <div class"container"> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> </ul> </div> this appears default behavior on major browsers: in testing, right margin collapses in firefox, chrome, safari, ie11 , edge. without going great deal of experimentation, i'll suggest behavi...

c# - Dynamically create an instance of a type from an assembly that is already referenced (but never accessed) -

using .net core console app i have assembly runner.exe has reference functions.dll . inside functions.dll there's class called functions.mylibary from runner.exe want create instance of functions.mylibary (using qualified string name) i've tried how dynamically load assemblies in dotnet core . unfortunately works if assembly functions.dll not referenced. assembly.getentryassembly().getreferencedassemblies() doesn't contain informations functions.dll . (if don't use classes functions.dll ) any clue how solve issue? in runner.exe static void main(string[] args) { // functions.dll not there.. unless next line gets uncommented var assemblies = assembly.getentryassembly().getreferencedassemblies(); //var dummy = new functions.mylibrary(); // works assembly not referenced. var = system.runtime.loader.assemblyloadcontext .default.loadfromassemblypath(@"path\functions.dll"); } in functions.dll pu...

Endless python thread quits without error -

i have python 2.7 program runs in endless loop synchronize remote mysql database local one. once day thread stops working. def sync(): http = urllib3.poolmanager() urllib3.disable_warnings() while 1: try: db = mysqldb.connect(host="localhost", user="username", passwd="password", db="database") cur = db.cursor() cur.execute(device_sql) devices = cur.fetchall() cur.close() print "loaded device_status local db" logger.debug('%s\t\t\tloaded device_status local db' % (datetime.datetime.now().strftime('%y-%m-%d %h:%m:%s'))) #this whats gettin logged last except: failed += 1 try: error(0, logger) except: raise finally: db.commit() db.close() till here regarding logfile everythin ok, seems error occures here: try: r = http.request('get', 'http://some.url.com' % ...