Posts

Showing posts from February, 2012

Webpack build taking too much time -

i'm using webpack module bundler project. added third party libraries lead increase in build time. due uglify js plugin. build stucks @ 91% before compltetly running webpack. without plugin, it's taking less time. have use plugin. tried use parallel uglify js plugin. didn't seem work in case. suggest me in other ways should try succeed in reducing build time. have attached webpack file reference. var webpack = require('webpack'); var path = require("path"); var glob = require("glob"); module.exports = { entry: glob.sync("./app/javascript/views/*.js") .reduce(function(map, path) { map[path.split('/').pop()] = path; return map; }, {}), output: { path: path.resolve(__dirname, 'app/assets/javascripts'), filename: '[name]' }, stats: { colors: true, reasons: false }, resolve: { extensions: ['.js', '.jsx'],

Excel VBA: Trigger macro on cut/paste/delete/insert events -

i have conditional formatting rule defined macro, deletes old rules , replaces them updates ones: sub setcondformat() set table = activesheet.listobjects("rules") table.range.formatconditions.delete set attribute = table.listcolumns("attribute") attribute.databodyrange.formatconditions _ .add(xlexpression, xlequal, "=isempty(a2)") .interior .colorindex = 0 end end end sub the conditional formatting in excel needs updated. otherwise cell ranges in rules fragmented. let's have 2 rules: make $a$1:$a$30 red make $b$1:$b$30 blue select a10:b10 , copy/paste a20:b20 . excel delete conditional formatting. for a20:b20 rules applied cells , add new rules have formatting a20:b20 . end 4 rules: make =$a$20 red make =$b$20 blue make =$a$1:$a$19,$a$21:$a$30 red make =$b$1:$b$19,$b$21:$b$30 blue this happens, when table structure gets changed through cut/paste/delete/insert events

javascript - REACT - Child position with respect of scale of parent -

i have situation, have parent div in there can number of children divs , applying scale on parent div , since scale applied on parent looks child element displacing position, want children divs follow parent scale how manage situation, here portion of code.. <div classname="image-viewer"> <div classname="image-wrapper"> <div class="zoom-2 image-outer"> <img class="map-image" src="map.png"/> <div class="booth" style="left: 617px; top: 178px;">&nbsp;</div> <div class="booth" style="left: 735px; top: 160px;">&nbsp;</div> </div> </div> </div> in above code child elements have there left , top defined dynamically mouse click position on map image . have 4 predefined zoom levels css supplying dynamically on zoom in/out buttons. below css .image-viewer .image-wrapper { posi

oauth - Caching Google JWT -

i have mobile app communicates server. authentication in mobile app, i'm using sign in google. sign in returns accesstoken send server , verify using google-auth-library suggested here: https://developers.google.com/identity/sign-in/web/backend-auth import googleauth 'google-auth-library' const auth = new googleauth() const client = new auth.oauth2(myclientid, '', '') apiroutes.use((req, res, next) => { // token request const token = req.token if (token) { // verify secret google client.verifyidtoken(token, myclientid, (err, payload) => // proceed user authenticated ... is necessary make call every request user makes? practice sort of caching? or have own implementation of jwt on server includes google payload? no, server should creates account user once validates access token , saving google id in database along other user details (id, email, name etc), , returns access token mobi

Nifi - No Viable alternative @ Input '{' -

while trying insert xml data in cassendra db using apache nifi, getting below error. what's going wrong? error : "no viable alternative @ input '{' below replacetext processor entries: search value : (?s:(^.*)$) replacement value : $1 character set : utf-8 maximum buffer size :1 mb replacement strategy :regex replace evaluation mode :entire text putcassandraql expects input valid cql statement. if have json in content (presumably following suggestions your other question ), need create cql statement json "payload", such using replacetext following replacement value: insert mytable json '$1' if previous flow file contains json object (and has no single quotes or escaped), should create valid cql statement it, use in putcassandraql.

java - Cross browser testing on Selenium using NetBeans -

i've been working selenium webdriver 2 weeks now. came across tutorials on youtube on how test selenium on multiple browsers. but, of tutorials run using eclipse. video shows implementing xml file , running xml file. tried doing on netbeans, doesn't seem run. is there way run xml file or there way can run script on multiple browsers using netbeans? this java file: public class hotel_tree_of_life { extenthtmlreporter htmlreporter = new extenthtmlreporter("d:\\selenium\\report_v3.html"); extentreports extent = new extentreports(); extenttest test; javascriptexecutor jse; webdriver driver; @beforetest @parameters("browser") public void setup(string browser) { if(browser.equalsignorecase("firefox")) { system.setproperty("webdriver.gecko.driver", "d:\\selenium\\geckodriver.exe"); driver = new firefoxdriver(); } else if(browser.

c# - Updating big table inside migration -

i've created migration update values in 1 column. migration looks follow: public partial class updatestatuses : dbmigration { public override void up() { var updatesql = @" begin update article set status = case when status <> -1 status + 1 else status end, statusprev = case when statusprev <> -1 statusprev + 1 else statusprev end; end;"; sql(updatesql, true); } public override void down() { var updatesql = @" begin update article set status = case when status <> -1 status - 1 else status end, statusprev = case when statusprev <> -1 statusprev - 1 else statusprev end; end;"; sql(updatesql, true); } } migration works fine on smaller datasets, table migration designed run on has ~11m of records. when i'm running it throw me such exception: engine task e

eloquent - Taking user information that is stored in another table (Laravel) -

i have laravel project, , need take logged in user information stored in table. i have tried using eloquent, no luck. example. i have user model connects login table: public function logininfo() { return $this->belongsto('app\logininfomodel', 'infoid'); } and logininfomodel , connection: public function user() { return $this->hasone('app\user','userid'); } but outputting auth::user() , there no info logininfo table. any suggestions or maybe can done not using eloquent? thanks auth::user() instance of user model, if have loginfo relationship on user model can do: auth::user()->logininfo()

javascript - timeSpan date pc VS device -

i have simple code of date in as3: var currdate:date = new date(number(461624400000)); trace("currdate= "+currdate); when run code on pc date: sat aug 18 00:00:00 gmt+0300 1984 when run code on device date: fri aug 17 23:00:00 gmt+0200 1984 a 1 day difference. that happens particular date when try running similar code javascript, got difference when running on pc , device. here code: console.log(new date(461624400000)); i happy if me. thanks. you can use code both as3 , js, date set epoch, hence results identical both platforms. var utcseconds = 461624400000; var date = new date(0); // 0 sets date epoch date.setutcseconds(utcseconds); trace (date); //alert (date) example timezone shifting: function timestampdate(value) { return new date(new date(value).gettime() + (new date().gettimezoneoffset() * 60 * 1000)); }; var timestamp = 461624400000; date = timestampdate(timestamp); alert (date); you'll identical hour, minute,

javascript - How to send broadcast to all connected client in node js -

i'm newbie working application mean stack. iot based application , using nodejs backend. i have scenario in have send broadcast each connected clients can open socket , can wait incoming data. unless web-browser can not perform event , till have gone through socket.io , express.io couldn't find can helpful achieve want send raw data open socket connections ' is there other node module achieve this. ? here code using websocketserver, const express = require('express'); const http = require('http'); const url = require('url'); const websocket = require('ws'); const app = express(); app.use(function (req, res) { res.send({ msg: "hello" }); }); const server = http.createserver(app); const wss = new websocket.server({ server }); wss.on('connection', function connection(ws) { ws.on('message', function(message) { wss.broadcast(message); } }

Python 3: TypeError: '>' not supported between instances of 'str' and 'int' -

i'm new user of python . have changed python 2.7 python 3.6 , having trouble 1 line of code worked before in python 2.7 . please can line below: paidgrouped_large = paidgrouped.loc[paidgrouped['gross incurred inf'].astype(int) > paidgrouped['largeclaimcutoff'].astype(int), :].set_index('claim', drop=true) which gives me error: typeerror: '>' not supported between instances of 'str' , 'int' both columns columns of numbers , there no null data. have idea why it's not working?

react native - unable to press the view when I passed callback as props to TouchableHighlight component -

i passing callback <touchablehighlight> component onpress method display alert, not working. when pass alert('item pressed') directly onpress() method works. i using simple example of <scrolllist> react-native. import react, { component } 'react'; import { text, view, stylesheet, platform, scrollview, button, flatlist, listview, sectionlist, dimensions, touchablehighlight } 'react-native'; import scrollabletabview, { scrollabletabbar, } 'react-native-scrollable-tab-view'; import navstyles './../styles' import datafields './../constants/constants' import jsoninputfeedcomponent './../../components/jsoninputfeedcomponent' import divider './../../components/divider' import screenmenuobject './../screens' import { iconsmap } './../../appicons' import planyourday './planyourday' import questionnaire './questionnaire' import newprofilepage './new

How to insert into one column in table using select in phpmyadmin -

i have 2 table below : users_data: listing_id | country | keywords 1 | belgium | 2 | usa | 3 | brazil | temp table: listing_id | keywords 1 | iqmal 2 | aiman 3 | afiq i want insert keywords temp table keywords users_data table. please me. simple update data using join update users_data join temp on temp.listing_id =users_data.listing_id set users_data.keywords=temp.keywords; for insert follow these steps 1st : can create table same structure create table new_table users_data 2nd : simple select data both table , insert below insert new_table select users_data.listing_id,users_data.country,temp.keywords join temp on temp.listing_id =users_data.listing_id

node.js - Express app: webpack bundle.js is not served -

i new building apps express , working on creating application node-express-angular4 , postgres. using webpack build application , deploying heroku. below app.js file app.js var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieparser = require('cookie-parser'); var bodyparser = require('body-parser'); var approutes = require('./routes/app'); var eventroutes = require('./routes/events'); var userroutes = require('./routes/user'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'hbs'); app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({extended: false})); app.use(cookieparser()); app.use(express.static(

Java - Data Structures -

i came across java data structures task. i'm looking confirmation understood correctly , approach right. the task: product can have many different types of attributes, , can vary between products, e.g. bike can have following attributes: {price, color, size} , product kitchen table: {price, width, depth, height}. product attributes organized in hierarchical group structure, product attribute group can contain 1 or several product attributes and/or product attribute groups. write code needed in java handle above described products , print function prints data in such way clear attributes belong product , attribute group if any. there image attached notation: image figure 1: note order important. in figure above attributes 1, attribute 3 , attributes 2 belong product attributes group. so approach create abstract product class, , make 2 subclasses(bike, kitchentable) extending product class. correct? or entirely different? please have @ composite pattern . the

c# - Dynamically created linkbuttons' common event not firing -

whenever dropdownlist selectedindexchanged, adding linkbuttons ul-li list in codebehind. each linkbuttons assigned ids , common click event. problem code in click event not executed or maybe event not triggered. code below: [edit] tried suggested in other posts ( dynamically created list of link buttons, link buttons not posting back ) protected void ddl_selectedindexchanged(object sender, eventargs e) { populate(); } protected override void oninit(eventargs e) { base.oninit(e); populate(); } void populate() { htmlgenericcontrol ullist = new htmlgenericcontrol("ul"); panel.controls.add(ullist); foreach (datarow dr in drc) { htmlgenericcontrol lilist = new htmlgenericcontrol("li"); ullist.controls.add(lilist); var lnk = new linkbutton(); lnk.id = dr["col1"].tostring(); lnk.text = dr["col1"].tostring(); lnk.click += clicked; lilist.controls.add(lnk); } } pri

python - Inheritance in IronPython and circular references -

Image
i have question circular references in ironpython. let's have class hierarchy. in 1 file have parent class: from child import child class parent(object): def getchild(self): return child() in file have child class: from parent import parent class child(parent): def dosomething(self): return 0 i have kind of circular references here. so, when try execute code this: from parent import * parent = parent() child = parent.getchild() i've got error: can avoid circular reference in kind of way? as say, have circular import problem. the normal way of solving have 2 classes in same file. python not enforce kind of link between file , class, can have many classes in single file , can called whatever like. (in fact, giving file exact same name class contains un -pythonic; apart else, files should have lower_case_with_underscore names, whereas classes camelcase.) however, if reason can't that, can break circular import doing insi

php - MYSQL UNION : returning output of two columns. Need in rows -

Image
i 2 outputs following i need *---------------* | cram | dbam | |---------------| |10000 | 1020 | *---------------* query select sum(netamount) 'cram' account typee = 'credit' union select sum(amount + scharge) 'dbam' account typee = 'debit' order `cram` you can use case: select sum(case when typee = 'credit' netamount else null end) cram, sum(case when typee = 'debit' (amount + scharge) else null end) dbam account

alfresco - How to set email and data configuration in activiti-explorer-5.22 -

i changed in activiti-custom-context.xml file , after changes not able send email users , have changed database properties after relaunch server ,my server not connected database ,which provided. <class="org.springframework.jdbc.datasource.simpledriverdatasource"> <property name="driverclass" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/explorer" /> <property name="username" value="root" /> <property name="passw`enter code here`ord" value="root" /> </bean> --> <bean id="transactionmanager" class="org.springframework.jdbc.datasource.datasourcetransactionmanager"> <property name="datasource" ref="datasource" /> </bean> </property> <property name="mailserverusetls"

jestjs - Jest createSpyObj -

with chai, can create spy object follows: chai.spy.object([ 'push', 'pop' ]); with jasmine, can use: jasmine.createspyobj('tape', ['play', 'pause', 'stop', 'rewind']); what's jest equivalent? context: migrating (typescript) jasmine tests (typescript) jest. migration guide useless in case: https://facebook.github.io/jest/docs/migration-guide.html relatively new tech, there's nothing can found in docs this. i've written quick createspyobj function jest, support old project. ported jasmine's implementation. export const createspyobj = (basename, methodnames): { [key: string]: mock<any> } => { let obj: = {}; (let = 0; < methodnames.length; i++) { obj[methodnames[i]] = jest.fn(); } return obj; };

linux - Script for counting lines in sections excluding # -

i'm searching ideas have script doing following: i have textual file eg. test.txt similar text in it: # # sectione 1 # several text lines , on # # sectione 2 # more text , more # , more # ... # # sectione 3 # more more more # # sectione 4 # ... ... i need possibility count lines in sectione 2 , exclude lines starting # in above example script should show me counter "3" @ end eg. # counter_script.sh test.txt # 3 is possibility , how can it? i'm using debian linux bash shell. you can use following awk command: awk '/sectione/{f=$3==2?1:0}f&&!/^#/{c++}end{print c}' file explanation in multiline version: section2.awk: /sectione/ { # set f(ound) 1 (true) if number between 'sectione' 2 # otherwise 0 (false) f=$3==2?1:0 } # if f(ound) true (1) , line starts not # # count f&&!/^#/{ c++ } # @ end of input print c(ount) end{ print c }

string - Scan DynamoDB table for results from the current month using PHP -

i have table in aws dynamodb, , every item in table has string-type "date" attribute, contains date when specific item created. date in attribute being saved in format: dd/mm/yyyy . what want scan table, , of results current month. want 2 more individual scans. 1 results last month (for example, july, want results june), , 2 months ago (for example, want results may). in dynamodb php sdk documentation, demonstrating scan, , in example filtering scan according attribute called "time" using code: 'time' => array( 'attributevaluelist' => array( array('n' => strtotime('-15 minutes')) ), 'comparisonoperator' => 'gt' ) so thought replace -15 minutes -1 month , problem that, can see in code above, "time" attribute number-type, , not string-type, can't perform action. what can results current month? if store data in yyyy/mm/dd format can use begin_with fu

angularjs - App getting slow in IOS iPad (3rd generation) with Version: 9.3.5 (13G36) -

i created cross platform mobile application ionic1 framework using angularjs.recently upgraded ionic cli , cordova.so ,now current configurations of project following: global packages: @ionic/cli-utils : 1.5.0 cordova cli : 7.0.1 gulp cli : cli version 3.9.1 local version 3.9.1 ionic cli : 3.5.0 local packages: @ionic/cli-plugin-cordova : 1.4.1 @ionic/cli-plugin-gulp : 1.0.2 @ionic/cli-plugin-ionic1 : 2.0.1 cordova platforms : android 6.2.3 ios 4.4.0 ionic framework : ionic1 1.3.0 system: node : v6.9.5 os : macos sierra xcode : xcode 8.2.1 build version 8c1002 ios-deploy : 1.9.1 ios-sim : 6.0.0 npm : 3.10.10 i used client side socket.io. in application (version:1.4.5).now problem , app working in every device in ipad (3rd generation) version: 9.3.5 (13g36) , app working slow , events (like tap , scroll) working. can please provide me reason why application getting slow in ipad ?

bluetooth lowenergy - Codename one - BluetoothLE MATCH_MODE_STICKY vs. MATCH_MODE_AGGRESSIVE -

what's difference between match_mode_sticky , match_mode_aggressive in cn1 library ble? matchmode argument in in startscan method. startscan(actionlistener callback, arraylist services, boolean allowduplicates, int scanmode, int matchmode, int matchnum, int callbacktype) i can't find documentation explains what's difference. refer android's bluetooth le documentation: match_mode_sticky: sticky mode, higher threshold of signal strength , sightings required before reporting hw match_mode_aggressive: in aggressive mode, hw determine match sooner feeble signal strength , few number of sightings/match in duration.

javascript - Catch HTTP redirect loop? -

i'm user of site s have no control of , has infinite redirect loop (page redirects page b, using http 302 code response, , page b redirects page a). redirect can fixed clearing site cookies. i wondering if automate process, using greasemonkey script example. sample algorithm (but don't know if it's feasible gm api): when script detects 302 on page of s, removes cookies site s.

Angular 2 call function with subscribe inside a for loop -

i have function subscription service inside: selectcar(carnumber) { this.carservice.getcarbynumerator(carnumber) .subscribe( (car) => { console.log(carnumber); //more stuff here }, (err) => console.log(err) ); } i want call function inside loop following: for(let carnumber of carnumbers) { this.selectcar(carnumber); } the issue is, sometime works expect, order not in list. e.g. list is: 45 67 89 but when in console, see following: 67 89 45 how can force loop not go next item till current function call finished? i guess flatmap in case. observable.of(carnumbers) .flatmap(term => this.selectcar(term)) .subscribe( (car) => { console.log(carnumber); //more stuff here }, (err) => console.log(err) );

SQL Server query performance issue using synonyms -

i check synonym table records against database table. the following statement works fine me, rid of insert , temporary table: if object_id('tempdb..#tmp_table') not null drop table #tmp_table select id #tmp_table synonyms_table (nolock) created_date between getdate() - 4 , getdate() - 1 select id #tmp_table tmp left join main_table main (nolock) on tmp.id collate sql_latin1_general_cp1_ci_as = main.id main.id null the problem is, both tables huge , if going use left join or not exist, going slow: select id synonyms_table sy (nolock) left join main_table main (nolock) on sy.id collate sql_latin1_general_cp1_ci_as = main.id sy.created_date between getdate() - 4 , getdate() - 1 , main.id null maybe here knows solutions me :) you try this, bearing in mind optimiser might decide run execution plan goes non-performant version: with base ( select id collate database_default id synonyms_table (noloc

nginx - Managing docker image throw systemctl -

i built docker image containing nginx configuration lets call when build manually building , running no errors when decided manage docker image throw systemctl it's giving me no errors either when type: sudo systemctl status a. service it's inactive(dead) here nginx.service file here output given when managed throw systemctl what can make active on startup? in advance you can't kill non existing container 1 on execstartpre field. can first : check if container running , kill if needed. think it's complicated. if have recent docker version (> 1.10), prefer restart policies : https://docs.docker.com/engine/admin/start-containers-automatically/ docker run --restart mynginx

c++ - Vxworks sdOpen() errno: S_pgPoolLib_PAGES_NOT_ALLOCATED -

i trying read fpga registers user space application using vxworks function sdopen() (which create shared memory space). runned inside main function on vxworks 6.2 on arm-cortex a8. tried code still same error in title: sd_id sdid; sdid =sdopen( (char *)"iptest", // name : name of shared data region0, 0, //option om_create, // mode : open mode = create if not exits 4*1024, // size : size of shared data in bytes (off_t)0x25000000, // physaddress : optional physical address sd_attr_rw | sd_cache_off, (void **)&pvirtaddress); // attr : allowed user mmu attribute //pvirtaddress: optional virtual base address if(sdid == 0) { switch(errno) { case s_sdlib_virt_addr_ptr_is_null: printf("pvirtaddres

c# - DbConnection::Open hangs, in case of unreachable server -

i have c++ application uses c# api access 1 mysql database. in case connection successful, retry reconnect ontimer event. problem if ip of server not found, second or third time try connect database with: dbconnection::open, application freezes , following message box displayed: server busy if press retry, exception raised: first-chance exception @ 0x754fc54f (kernelbase.dll) in myprogram_d.exe: 0xe0434352 (parameters: 0x80004005, 0x00000000, 0x00000000, 0x00000000, 0x711d0000). connection string: uid=userid;password='password';connection timeout=10; pooling= false; do know might go wrong , open function not return?

jmeter - Execute request for each element in CSV, not per user -

Image
i'm using jmeter 3.2 write tests. have csv file test account info. each row contains login info user. each user needs request token used on later requests. my test plan: the token request retrieves token. login requests logs in user , returns token. select customer card selects customer , returns final token. code postprocesser (i'm not experienced in this, advice appreciated): import org.json.simple.jsonobject; import org.json.simple.parser.jsonparser; // check if our map exists if (props.get("map") == null) { jsonobject obj = new jsonobject(); obj.put("${department}", new string(data)); log.info("adding department map. department: ${department}. token: " + new string(data)); props.put("map", obj.tojsonstring()); } else { // retrieve current map map = props.get("map"); jsonparser parser = new jsonparser(); jsonobject jobj = (jsonobject) parser.parse(map); // add new departme

Resizing external image in Rmarkdown: html vs. ioslides output -

i'm using external images in rmarkdown document meant rendered ioslides , need resize them. doing html way works both when knit ioslides , html_document. <img src="image.png" style="height: 200px"/> doing markdown way below works when knit html_document not when knit ioslides (i.e., image isn't resized). ![](image.png){width=200px} my question is: how can make markdown resizing approach work when output ioslides?

java - Spring MVC Controller Test passing due to not finding model attribute -

i have created home controller below. controller fetches 5 dummy posts have created in "postrepository" class through postservice class. @controller public class homecontroller { @autowired postservice postservice; @requestmapping("/") public string gethome(model model){ model.addattribute("post", postservice); return "home"; } } i have implemented following test.. @runwith(springjunit4classrunner.class) @contextconfiguration(classes = {webconfig.class}) @webappconfiguration public class controllertest { @test //test home controller public void testhomepage() throws exception{ homecontroller homecontroller = new homecontroller(); mockmvc mockmvc = standalonesetup(homecontroller).build(); mockmvc.perform(get("/")) .andexpect(view().name("home")) .andexpect(model().attributedoesnotexist("post")); } }

wordpress - update product meta_data in wocommerce REST API -

i added new field using small plugin script... works fine in woocommerce interface , shows using rest api product here excerpt of results using $woocommerce->get() 'meta_data' => array (size=1) 0 => array (size=3) 'id' => int 3293 'key' => string 'kambusa' (length=7) 'value' => string '123' (length=3) using: $data = [ 'regular_price' => '21.00', 'meta_data' => [ ['kambusa' => '456'] ] ]; print_r($woocommerce->put('products/530', $data)); updates price ignores (without error) meta_data i searched web morning didn't find clear solution (some suggested have register_meta(), made tests nothing changed (the meta data show before registering)) following code used create filed in "admin" part of plugin $args = array( 'id' => $this->text

image in angular 2 with webpack giving 404 -

i trying put image in project keep getting 404, set config in webapck , didn't solve . spilogo.jpg:1 http://localhost:4200/imagens/spilogo.jpg 404 (not found) index.html <!doctype html> <html lang="pt"> <head> <meta charset="utf-8"> <title>thegreatcthulhu</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="src/favicon.ico"> <link rel="" type="image/jpg" href="src/app/imagens/spilogo.jpg"> </head> <body> <app-root></app-root> </body> </html> my nav-bar.component.html <!-- dropdown structure --> <ul id="dropdown1" class="dropdown-content"> <li routerlinkactive="active"><a ro

javascript - trigger resize event causes error $digest already in progress angularjs -

i'm trying set resize active on angualr js directive cause dygraph begin scope.option.eidth = 0 if set value.. after many tries found this: window.dispatchevent(new event('resize')); and in browser works ! if put no directive raises error angular.js:11655 error: [$rootscope:inprog] $digest in progress http://errors.angularjs.org/1.3.15/$rootscope/inprog?p0=%24digest i know caused scope state in digest instead of apply.. there way verify this? my code: (function() { var app = angular.module('dashboard.view', []); app.directive('dygraph', function(){ return { restrict: 'e', scope: { data : '=', options : '=?' }, template: '<div id="graphdiv" style="width: 100%"></div>', link: function (scope, elem, attrs) { var div = elem.children()[0]; sco

java - Having trouble handling exceptions in Spring Integration -

i'm new spring integration , confused how send error messages designated error queue. want error message header on original message , end in separate queue. read can done header enricher, tried implement nothing showing in error queue. also, need separate exception handling class in order error messages make error queue or can throw exceptions in transforming methods? here xml config: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp" xmlns:rabbit="http://www.springframework.org/schema/rabbit" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/sprin

c# - ASP.NET Core authentication cookie only received once -

i developing application asp.net core , using custom cookie authentication. cookieauthenticationoptions are: app.usecookieauthentication(new cookieauthenticationoptions() { authenticationscheme = cookieauthenticationdefaults.authenticationscheme, loginpath = new pathstring("/login"), accessdeniedpath = new pathstring("/unauthorized/"), automaticauthenticate = true, automaticchallenge = true }); the cookie created fine , can see in browser settings throughout whole time running application. homecontroller class: public homecontroller(ihostingenvironment env, iantiforgery antiforgery, ioptions<appsettings> appsettings, terminaldbcontext terminalcontext, iloggerfactory loggerfactory, ihttpcontextaccessor _httpcontextaccessor) { _env = env; _antiforgery = antiforgery; _appsettings = appsettings; _terminalcontext = terminalcontext; _logger = loggerfactory.createlogger<homecontroller>();

Chrome changes Poster image on mouse hover with Afterglow HTML5 Video -

i'm using afterglow 's html5 video player. have created sample video poster attribute. when using chrome browser, when hover mouse on video, poster image disappear , reappear. creates blinking effect not want. how stop this? <script src="https://cdn.jsdelivr.net/afterglow/latest/afterglow.min.js"></script> <div class="video-div"> <div id="group_1" class="videocontainer"> <video id="video_s08e01" poster="http://via.placeholder.com/566x318" class="afterglow" width="566" height="318" style="z-index:1;"> <source type="video/mp4" src="https://www.w3schools.com/html/mov_bbb.mp4" /> </video> </div> </div> here jsfiddle. https://jsfiddle.net/zpo1cxbb/2/ just delete style="z-index:-1" video element. jsfiddle

html - Why doesn't flex item shrink past content size? -

i have 4 flexbox columns , works fine, when add text column , set big font size, making column wider should due flexbox setting. i tried use word-break: break-word , helped, still, when resize column small width, letters in text broken multiple lines (one letter per line) column not smaller width 1 letter size. try watch video: http://screencast-o-matic.com/watch/cdetln1tyt (at start, first column smallest, when resized window, widest column.i want respect flex settings always.. flex sizes 1 : 3 : 4 : 4) i know, setting font size , column padding smaller help... there other solution? i can not use overflow-x: hidden . jsfiddle: https://jsfiddle.net/78h8wv4o/3/ .container { display: flex; width: 100% } .col { min-height: 200px; padding: 30px; word-break: break-word } .col1 { flex: 1; background: orange; font-size: 80px } .col2 { flex: 3; background: yellow } .col3 { flex: 4; background: skyblue } .col4 { flex: 4;

ansible - Repo will not clone, "Permission Denied", using git module -

i've looked @ similar questions, not found answer yet. i can ssh in server (ubuntu 16.04) , clone git repo manually. leaves me believe isn't sshforwardagent issue. the error pretty typical: "cloning bare repository '/home/deploy/apps/myproject/production/cached-copy'...", "permission denied (publickey).", "fatal: not read remote repository.", ansible.cnf: [ssh_connection] ssh_args = -o forwardagent=yes the role looks this: - name: update bare git repository become_user: "{{ deploy_user }}" git: repo: "git@github.com:myuser/myproject.git" dest: "{{ deploy_to }}/cached-copy" version: "{{ branch }}" bare: yes update: yes accept_hostkey: yes ssh_opts: "-o stricthostkeychecking=no -o forwardagent=yes" the verbose output ansible is: "changed": false, "cmd": "/usr/bin/git clone --bare '' /home/deploy/apps/mypr

python - How to parse twitter feed data using json.reads(line) -

i've downloaded big stream of twitter data in json format , saved text file. want read in, line line, , decode dictionary using json.reads() . my problem throws error on first line, assume means function doesn't think data json? have added line want decode @ bottom of post. when print lines code works fine, json.reads() function throws error. here code: def decodejson(tweet_data): line in tweet_data: parsedjson = json.loads(line) print(parsedjson) # want print confirm works. here error: file "/users/cc756/dropbox/pythonprojects/twitteranalysisassignment/tweet_sentiment.py", line 17, in analysesentiment parsedjson = json.loads(line) file "/users/cc756/anaconda/envs/tensorflow/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) file "/users/cc756/anaconda/envs/tensorflow/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).

android - zxing lib does not scan qrcode fast -

i'm using zxing library scan qr codes, find takes lots of time scan code. below can find code i've used implement scanner. dont know whether missing something? mainactivity.java: package com.nadhi.qrcodescanner; import android.app.activity; import android.app.alertdialog; import android.content.activitynotfoundexception; import android.content.dialoginterface; import android.content.intent; import android.net.uri; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.toast; import com.google.zxing.client.android.captureactivity; public class mainactivity extends appcompatactivity { static final string action_scan = "com.google.zxing.client.android.scan"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //set main content layout of activity setcontentview(r.layout.activity_main); } //product q