Posts

Showing posts from March, 2011

amazon web services - aws CLI blockd through the network -

it appears traffic aws cli blocked in network level. use proxy server let aws traffic through, having difficulty finding documentation can use proxy unblocked. can please point me in right direction show me ports , or websites need unblocked? thank you! i able resolve problem on own. instructions incorrect setting proxy in windows environment. set http_proxy=your.proxy.com set https_proxy=your.proxy.com you don't need http after = sign.

oracle10g - Finding tablespace size on oracle without dba_* metatables -

i need find current tablespace size db in oracle 10g. looking around, i've found many scripts determine size using tables dba_extents, database i'm using has none of these dba_* tables. (i'm using proxy finding table size, complicated because of table size in blobs.) the dba_* views part of "static data dictionary views" there 3 versions of every view, dba_ shows everything, all_ shows have access to, , user_ show own, , not have owner column. for example dba_tables has tables, all_tables table can select from, , user_tables tables own. the views documented in "static data dictionary views" . resource if need translate dba_ all_ or user_ . unfortunately _extents comes in dba , user version. if want information on objects can access not own, need ask resident dba help.

javascript - Possible memory leak or something else? -

i've made visualizer in javascript when select music directory your're able select files within directory play , have visualizer move to. seem after loading directory , changing song more 4 times results in less responsive movement visualizer. i'm unsure why happening. heres example of happening. keep changing song drop down box until see starting slow. window.onload = function() { var input = document.getelementbyid("file"); var audio = document.getelementbyid("audio"); var selectlabel = document.queryselector("label[for=select]"); var audiolabel = document.queryselector("label[for=audio]"); var select = document.queryselector("select"); var context = void 0, src = void 0, res = [], url = ""; function processdirectoryupload(event) { var webkitresult = []; var mozresult = []; var files; console.log(event); select.innerhtml = ""; ...

excel - Loop to search and print unique value from range -

i have list of values, , in table, have same values spread out. i need sort of loop can search 1x20 list , print first value not in table, without having write numerous countif() statements. there way faster? sure need loop of range of cells , test if value exists. you'd need post more of code give specific example should started: sub loopexampleusingrange() dim acell range each acell in activesheet.range("a1:a20").cells if instr(1, "some text/table/or cell value s", acell.value) 'if exists put here 'perhaps nothing? else 'if doesn't exist put code here. end if next acell end sub

wordpress - Can't stop my website redirecting - where could the instruction be? -

sorry silly question , reading! can't stop website redirecting separate, dead, webpage. i've checked redirect options domain registration company, , cpanel. they're not culprits. hoping else might have suggestions of look? site running wordpress, , if redirect happening somewhere within wordpress site, have clue on how stop it? bearing in mind can't /wp-admin log in , look, redirects everything. thank you! while not sure of exact issue experiencing, followed this post when had issue , had fixed me. website redirecting dead webpage belongs or other website/domain? (if latter may malware)

api - Does Asana webhooks only take tasks and projects as resources? -

i want create webhook take workspace resource instead of task or project. per asana's documentation , when creating webhook, you're required enter in resource id, can either task or project.

Superagent request within a kubernetes cluster -

i have 2 kubernetes controllers , services pods running named web , api respectively. in web pod using superagent try , access api pod following http://api:3000/api/user results in error err_name_not_resolved however if run shell on web pod , curl http://api:3000/api/user works should am missing fundamental how superagent works? or else? if launch superagent in browser, browser not part of kubernetes cluster, hence neither uses kube dns nor can access cluster ips. to make work need expose api service external world means of nodeport/loadbalancer service or ingress

.net core - Pre- Post- Build Event Variables in Visual Studio are Empty -

have .net core app i'm trying use $(projectdir) , when attempt pass in macro, empty value. tried suggested in issue 26748846 , didn't seem solve issue. this happens because in .net core projects, pre- , post build macros set , $(projectdir) property not yet available. note pre- , post build macros deprecated , should replaced proper targets (see https://github.com/dotnet/project-system/issues/1569 ). a quick fix replace $(projectdir) $(msbuildprojectdirectory)\ .

Angular return value from one ts to another -

in angular project, have 2 ts files below: data.ts import { injectable } '@angular/core'; import { mystorage } '../storage'; @injectable() export class itemfromstorage { constructor(public storage: storage) { } getitemdatafromstorage(current){ this.storage.get(current).then((val) => { return val; //???? }); }; } main.ts import { itemfromstorage } '../data' export class item_thumb { constructor(public itemstorage: itemfromstorage) { }; fetchthumbdata(){ var data = this.itemstorage.getitemdatafromstorage(this.datanumber); console.log(data);//???? } } from data.ts , how return data value main.ts ? your data.ts method should return request itself, without subscribing it: getitemdatafromstorage(current){ return this.storage.get(current); }; and in main.ts method subscribe , receive data: fetchthumbdata(){ var data = th...

php - Laravel eloquent does not update JSON column : Array to string conversion -

i want update json column in database error : array string conversion i have declared column name array in model : protected $casts = [ 'destinations' => 'array' ]; this code use : $data[] = [ 'from' => $fromarray, 'to' => $toarray ]; flight::where('id', $id)->update(['destinations' => $data]); what should ? according conversation on github : make json attributes fillable if model field fillable taylor otwell recommande use of save method : $model->options = ['foo' => 'bar']; $model->save(); so in case can : $flight = flight::find($id); $flight->destinations = $data; $flight->save();

javascript - boolean in vuejs becomes 1 on server -

i sending value frontend backend , value boolean. when on server this dd($request); i can see receive true, example: "displayslug" => array:2 [ "type" => "boolean" "name" => true ] later when loop through array of parameters page, this: dump($key .': ' . $value['name'] .'; type: '.$value['type']); now prints this: "displayslug: 1; type: boolean" when save db, gets saved number , not boolean, becomes 1. $setting = new setting(); $setting->key = $key; $setting->type = $type; $setting->value = $value; $this->settings()->save($setting); return true; value boolean gets stored 1, i'd store true if string in db i boolean in db. can boolean instead of number? column saving string column. when printing/dumping boolean value in php, gets cast string. a boolean true value converted string "1" . boolea...

cordova - PhoneGap iOS Apps start but display a white screen (with ExtJs) -

i developing application android , ios phonegap , extjs. the application android works correctly. the application ios not work. displays splashscreen , displays blank screen without errors in weinre console. white screen never disappears. navigator object , ext object available , can open camera enter "navigator.camera.getpicture(...)" in console the application works correctly iphone browser. i spent day browsing forums find solution nothing works ... thanks reading.

javascript - Where is browserNoActivityTimeout used in karma? -

i grep karma repository , seems no logic using field besides being set in config. does know field for? for reason have set 20000 or else karma test disconnects it's referenced noactivitytimeout internally, in file: https://github.com/karma-runner/karma/blob/de55bc63205c656eb5f5534894aa4ae92228efb8/lib/browser.js basically, effect of line supposed test stops running if no activity detected in amount of time specified config. helps tests stop when code in infinite loop or otherwise not responding (maybe has async test condition , test never resolves)

haskell - How do you import Data.Heap? -

Image
sorry such dumb question. i'm trying import data.heap , error message: > import data.heap <no location info>: error: not find module ‘data.heap’ perhaps meant data.map (from containers-0.5.7.1@containers-0.5.7.1) haven't had trouble other imports. thanks. as described in comments, need install package contains module data.heap . (see this related question on difference between packages , modules in haskell) on hackage page , in upper left-hand corner see name , version of package looking at: if using stack, add heap build-depends section of project.cabal file, , rebuild. if using cabal, run cabal install heap recent version of package installed on system.

How to filter string with condition using python -

i have string s ='jacky chan || ceo ||managing director , general partner, b robotics || san francisco bay area' how can filter out "he ceo" part based on keyword "ceo" within string using python? output: 'jacky chan||managing director , general partner, b robotics || san francisco bay area' if split string using delimiter || , can inspect each split , include in our new string if does not contain string 'ceo' . '||'.join(substr substr in s.split('||') if 'ceo' not in substr)

python - Websocket connection by Apache2 + mod_wsgi + Django -

i deploying django project on apache2 using mod_wsgi. can confirm see django's page apache2 server websocket cannot connect, think django-channels doesn't start apache2. so solve problem install 'asgi_redis' start django-channels. 'pip3 instal asgi_redis' i changed channel layer. channel_layers = { "default": { "backend": "asgi_redis.redischannellayer", "config": { "hosts": [("localhost", 6379)], }, "routing": "mysite.routing.channel_routing", }, } and tried follow command. 'python3 manage.py runworker' but following error occured. 2017-07-27 08:07:59,660 - info - runworker - using single-threaded worker. 2017-07-27 08:07:59,661 - info - runworker - running worker against channel layer default (asgi_redis.core.redischannellayer) 2017-07-27 08:07:59,663 - info - worker - listening on channel...

javascript - Controller not getting $http return data from factory in AngularJS -

been trying code return http return data in $scope.top , use data on page populate element using {{top}}. all variations i've tried either result in empty $scope.top or $scope.top data arriving late used on page. latest attempt: var app = angular.module("it", []); app.factory('dataprovider', function($http){ return { gettop: function(){ return $http.get("db.php"); } } }); app.controller('toplist', function($log, $scope, dataprovider){ $scope.gettop = function(){ var promise = dataprovider.gettop(); promise.then( function(data){ $scope.top = data.data; }, function(errordata){ $log.error('failure loading', errordata); }); } }); what doing wrong?

osx - Openpyxl in Python is borked -

i have looked , done research. have read/write permissions on library , i've updated pip. however, cannot import openpyxl @ all. error get: >>> import openpyxl traceback (most recent call last): file "<stdin>", line 1, in <module> file "openpyxl/__init__.py", line 29, in <module> openpyxl.workbook import workbook file "openpyxl/workbook/__init__.py", line 5, in <module> .workbook import workbook file "openpyxl/workbook/workbook.py", line 7, in <module> openpyxl.worksheet import worksheet file "openpyxl/worksheet/__init__.py", line 4, in <module> .worksheet import worksheet file "openpyxl/worksheet/worksheet.py", line 34, in <module> openpyxl.cell import cell file "openpyxl/cell/__init__.py", line 4, in <module> .cell import cell, writeonlycell file "openpyxl/cell/cell.py", line 31, in <module> ...

python 3.x - Pandas: Join multiple data frame on the same keys -

i need join 5 data frames using same key. created several temporary data frame while doing join. code below works fine, wondering there more elegant way achieve goal? thanks! df1 = pd.read_pickle('df1.pkl') df2 = pd.read_pickle('df2.pkl') df3 = pd.read_pickle('df3.pkl') df4 = pd.read_pickle('df4.pkl') df5 = pd.read_pickle('df5.pkl') tmp_1 = pd.merge(df1, df2, how ='outer', on = ['id','week']) tmp_2 = pd.merge(tmp_1, df3, how ='outer', on = ['id','week']) tmp_3 = pd.merge(tmp_2, df4, how ='outer', on = ['id','week']) result_df = pd.merge(tmp_3, df5, how ='outer', on = ['id','week']) use pd.concat after setting index dfs = [df1, df2, df3, df4, df5] cols = ['id', 'weedk'] df = pd.concat([d.set_index(cols) d in dfs], axis=1).reset_index() include file reading from glob import glob def rp(f): return pd.read_...

disconnect Twilio video -

hello started video call when disconnect camera led indicator still on. how can disconnect call? video.createlocalvideotrack().then(track => { var localmediacontainer = document.getelementbyid('preview'); localmediacontainer.appendchild(track.attach()); }); video.connect(response.data, { name: 'room', video: {width: 600} }).then(room => { activeroom = room; }); $('#disconnect').on('click', () => { activeroom.disconnect(); }) twilio developer evangelist here. to disconnect local user's video , microphone input can stop tracks . so, before leave room, call activeroom.localparticipant.tracks.foreach(function(track) { track.stop() }); that should force tracks stop , led go off. just note, led on camera in use. when disconnect room media stops streaming room. let me know if helps @ all.

javascript - How to wait for forEach to complete when each iteration calls an asynchronous options? -

alright, here's plan is. go through each file, add file array. once files added, combine them using jsziputility , docxtemplater: 'click .merge-icon': (e) => { var programid = router.current().url.split('/').pop(); var programobj = programs.findone(programid); var inserteddocuments = []; var = 0; var count = programobj.activityids.count; var filedownloadpromise = new promise((resolve, reject) => { programobj.activityids.foreach(function(activityid) { var activityobj = activities.findone(activityid); var documentobj = activityfiles.findone(activityobj.documents.pop()._id); jsziputils.getbinarycontent(documentobj.url(), callback); function callback(error, content) { var zip = new jszip(content); var doc = new docxtemplater().loadzip(zip); var xml = zip.files[doc.filetypeconfig.textpath].astext(); xml = xml.substring(xml.indexof("<w:body>") ...

java - How to repaint with timer? -

this question has answer here: timing swing animation 3 answers spring behavior simulation 1 answer swing timers , animations in jpanel 2 answers java swing timer , animation: how put together 1 answer basic java bullet animation using timer 1 answer i want provide projectile motion timer. first of create timer , change location of x , y timer. when check x , y points updated can not repaint new x , y. how repaint panel , provide projectile motion? in advance. here code. import java.awt.graphics; import java...

bash - Mysql automated installation stuck -

i have written script install set of packages list of servers. when execute script mysql installation got stuck @ "enter root password" section. there need modify in script ? advice me. is there way pass mysql root password through script ? below code used #!/usr/bin/env bash read -p "enter server name : " servername echo "installing package on $servername" ssh "${servername}" sudo apt-get -y install apache2 mysql-server installation got stuck here even if enter password, wouldn't proceed next step. beginner scripting. let me know modify script. apt-get front-end dpkg , debconf , running in interactive mode default, -y won't change that. mysql-server installation requires root password interactively entered during installation. to automatically install mysql server on debian based linux distro, can enter non-interactive mode , preset mysql root password follows. in shell want run process, execute: expor...

hadoop - Example about how set a Hive property from within a Hive query -

i need quick example of how change property in hive using query, instance, change property 'mapred.reduce.tasks' so, how perform change within query. i'm training self hdpcd exam , 1 of goals in exam 'set hadoop or hive configuration property within hive query' suppose it's not same performing in hive console like: set mapred.reduce.tasks=2; to change hadoop , hive configuration variable need use set in hive query. change made applicable query session set -v prints hadoop , hive configuration variables. set mapred.reduce.tasks=xx // in hadoop 1.x set mapreduce.job.reduces=xx // in hadoop 2.x (yarn) reset in query resets configuration default values

string - apex parse csv that contains double quote in every single records -

public static list<list<string>> parsecsv(string contents,boolean skipheaders) { list<list<string>> allfields = new list<list<string>>(); // replace instances double quote begins field containing comma // in case double quote followed doubled double quote // beginning , end of field contents = contents.replaceall(',"""',',"dblqt').replaceall('""",','dblqt",'); // replace remaining double quotes - can reconstruct // fields commas inside assuming begin , end double quote contents = contents.replaceall('""','dblqt'); // not attempting handle fields newline inside of them // so, split on newline spreadsheet rows list<string> lines = new list<string>(); try { lines = contents.split('\n'); } catch (system.listexception e) { system.debug('limits exceeded?' + e.getmessage()); } integer num = 0; for(string line : lines) { ...

raspberry pi - How to update multiple RasberryPi3 from the client? -

currently, have multiple rasberrypi3 devices contains app used friends. problem how possible update app each rasberrypi's ? thinking of sending broadcast packets ports of rasberrypis, i'm not sure if it's possible. since i'm total noob rasberrypi,some tips, examples or tutorials great help! love hear you! you try connect each of them via ssh, if in different locations they'd need set kind of port forwarding , give ports , ip addresses. major pain. if didn't plan software updates before installed, rather out of luck. you try packaging in pip or other package manager, work apt-get. if program in python try pip , publish it. or you, make updater program downloads latest version website , installs it.

androidviewclient - Is ViewClient invalid if new Activity is started? -

i have androidviewclient script testing activity. clicking button in android app creates new activity instance. seems viewclient instance in python script needs recreated after new activity launched - right? this: # main activity started here. vc = viewclient(device, serialno) mybtn = vc.findviewbyid("btnstartnewactivity") mybtn.touch() # starts new activity. time.sleep(5) # seems viewclient still pointing @ # previous activity. vc.traverse() # can see new activity: vc = viewclient(device, serialno) vc.traverse() # it's ok. is correct way it? thanks no, there's no need create new instance, have every time screen changes (whether it's new activity or same one) call vc.dump() and new view hierarchy read (see viewclient#dump() ). recreating instance, in case, not setting autodump parameter , default value true invokes dump() automatically, invoking dump() more efficient.

click and clickLabel function no working by CasperJS -

Image
i try data website http://www.bestbuy.com/site/dji-phantom-3-standard-quadcopter-white/4406800.p?skuid=4406800 using casperjs. my situation have click button ratings & reviews data show out. but check out screen shot this.capture('check2.png); after this.click('#reviews-accordion.accordion-wrapper'); looks button never been clicked , cause can't data rating , date check2.png: i have try selector , still doesn't work. casper.then(function () { this.click('.accordion-toggle.accordion-item'); console.log('clicked reviews tab'); }); casper.then(function() { this.clicklabel('ratings & reviews', 'button'); console.log('clicked clicklabel'); }); how let click function work , appreciated. thanks in advance. here code: var casper = require("casper").create({ verbose: true, timeout: 10000, loglevel: 'debug', // debug, info, warning, error pagesettin...

How to use rgb difference between two colors in C# in order to find the closest match? -

i have code gets closest color based on rgb difference, dark colors dark blue, returns black instead of "dark blue". can u guys me finding out what's happening? this code calculates rgb difference between 2 colors: int colordiff(color c1, color c2) { return (int)math.sqrt((c1.r - c2.r) * (c1.r - c2.r) + (c1.g - c2.g) * (c1.g - c2.g) + (c1.b - c2.b) * (c1.b - c2.b)); } this code gets closest color on list (the 1 has less difference between rgb): int encontrarcor(list<color> colors, color target) { var colordiffs = colors.select(n => colordiff(n, target)).min(n => n); return colors.findindex(n => colordiff(n, target) == colordiffs); } what think happening that, can see in first code, does: (c1.r - c2.r) * (c1.r - c2.r), if 1 of these substrates equal 0, whole product gonna 0, returns black, cause rgb code of black 0,0,0. i've tried make myself clear possible, sorry if little bit c...

Is it possible to run Angular with Webpack, Sass, PHP, and MySQL? -

i want know best practices getting task runner serve angular application compiles sass, reloads or "watches" php, , can query mysql database. i have app uses gulp reload php , compile sass, want add angular mix! any resources, comments, or questions welcome! also, followed webpack documentation on angular website (angular.io) unable deploy application. angular has adopted webpack task runner/bundler. should continue study webpack or there type of workaround? thanks!! -donald though choice based stick webpack2. more powerful, used , getting better functionalities time. frameworks have cli angular-cli use webpack2 under hood. has loaders compile sass css need. checkout github link lists steps compile sass css using webpack loaders. https://github.com/webpack-contrib/sass-loader

c++ - Why the Memory locations for two variables which is allocated dynamically are not consecutive? -

this question has answer here: why successive calls new[] not allocate contiguous memory? 1 answer i use 2 variables in memory allocated dynamically, , print memory locations, not consecutive. why? #include <stdio.h> #include <stdlib.h> int main() { int *a = malloc(sizeof(int)); int *b = malloc(sizeof(int)); printf("\n a=%p \t b=%p \n",a,b); } the answers (in linux) are 1st time: a=0x20a0010 b=0x20a0030 2nd time: a=0x657010 b=0x657030 3rd time: a=0x139e010 b=0x139e030 why exact difference between memory locations of a , b variables way in 1st, 2nd , 3rd times? is related paging memory? my processor 64 bit. the gap between 2 consecutive allocations not related paging. allocations small reside in data segment. libc handles these internally - space outside sizeof int bytes contains p...

javascript - Uncaught TypeError: Cannot set property 'nodeId' of undefined -

i'm getting error on boostrap-treeview.js:267 when retrieving json data boostrap-treeview. $(document).ready(function() { $.ajax({ url: "js/category_data.php", method:"post", datatype: "json", success: function(data) { $('#doctypestree').treeview({ data: data }); } }); }); the json data following: { "2":{ "id":"12", "text":"certified copy", "description":"","root":"0" }, "3":{ "id":"13", "text":"charter", "description":"", "root":"0" }, "4":{ "id":"14", "text":"codicil (will)", "desc...

numpy - How can I calculate the ratio of a value in array to the sum of array in python? -

this question has answer here: how make numpy array column sum 1 1 answer i have array such this: array =[[1,2,3], [5,3,4], [6,7,2]] and each member calculate ratio of them sum of row. therefore, result of question in proposed sample is: result = [[1/(1+2+3),2/(1+2+3),3/(1+2+3)], [5/(5+3+4),3/(5+3+4),4/(5+3+4)], [6/(6+7+2),7/(6+7+2),2/(6+7+2)]] i write following code not work because 2 operators have different shape: array/array.sum(array, axis=1) you can specify keepdim=true while doing sum, , have 2d array result while each row stands row sum: array = np.array([[1,2,3], [5,3,4], [6,7,2.]]) array/array.sum(1, keepdims=true) #array([[ 0.16666667, 0.33333333, 0.5 ], # [ 0.41666667, 0.25 , 0.33333333], # [ 0.4 , 0.46666667, 0.13333333]])

javascript - How to use multiple callbacks when looping data -

i'm trying html form data, loop through, change bit , insert database. have tried below app.js. how can make callbacks formdata have modified available .create function? i have searched everywhere , end in dead end , undefined variable somehow. app.js: //find day save day.findbyid(req.params.id, function(err, day) { if (err) { console.log(err); res.redirect("/diary"); } else { // search function find data _id function ingredientidquery(reqbodyid) { var ingquery = ingredient.find({_id:reqbodyid}); return dbquery; } // loops through html formdata , formats mongoose model (var = 0; < req.body.amount.length; i++) { if (req.body.amount[i] !== "") { var amount = number(req.body.amount[i]); var singlemealtempobj = {}; singlemealtempobj.amount = amount; var _id = req.body.id[i]; var query = ingredientidquery(_id); // executing query data need id query.e...

smack - Issue with obtaining the offline messages using openfire server -

offline messages not delivering user when person avails. delayinformation info = (delayinformation)message.getextension("x","jabber:x:delay"); returns null. when iterate collection of message.getextensions() , delay urn:xmpp:delay. can explain on this. i'm using smack , smackx.jar. though smackx.jar has smack.providers it's not taken account. some suggested use urn:xmpp:delay ,which results in class cast exception. delayinformation inf = (delayinformation)message.getextension("delay","urn:xmpp:delay"); exception: java.lang.classcastexception: org.jivesoftware.smack.packet.defaultpacketextension if android using smack library try this: extensionelement delay = message.getextension("urn:xmpp:delay"); if(message.getextension("urn:xmpp:delay") != null){ log.i("recveived", "delay 1: " + delay.toxml()); log.i("recveived", "delay 2: " + dela...

python - How can I differentiate between users with lookup -

i have 2 classes customer , restaurant have onetoonefield django built in user . when go page trying determine user is. doing doesnt work because user model return true having restaurant attribute, never makes past first if statement... models.py class restaurant(models.model): restaurant_user = models.onetoonefield(user, on_delete=models.cascade) restaurant_name = models.textfield(max_length=50) = models.charfield(max_length=500) class customer(models.model): customer_user = models.onetoonefield(user, on_delete=models.cascade) = models.charfield(max_length=500) views.py def dashboard(request): if user.restaurant: return render(request,'usermanage/dashboard_restaurant.html') elif user.customer not none: return redirect(request, 'usermanage/dashboard.html') else: return render(request, 'usermanage/dashboard.html') your view file checking restaurant attribute on user model , no...

php - Trying to display SQL data in html table -

so have file supposed run sql query , return data , populate html table reason not returning data, in sql in database query return data not on website. <?php //run query $sql = "select id, topic_id, name, surveyid, questionid, longdesc, text, first_name , last_name , email polling_results 'topic_id' = '147796' order 'id, displayorder'"; $result = mysql_query($sql); //fetch results while ($row = mysql_fetch_array($result)) { //display results echo '<br /><table class="table table-bordered table-condensed">'; echo '<thead><tr>'; echo '<th>name</th>'; echo '<th>email</th>'; echo '<th>question text</th>'; echo ...

tensorflow - How to understand constructor of tf.FIFOQueue? -

i have written code, can't explain well. the first code: import tensorflow tf f = tf.fifoqueue(10, [tf.int32, tf.int32]) en = f.enqueue([[1,2],[3,4]]) de = f.dequeue() tf.session() sess: en.run() x = sess.run(de) print(x) i define element of queue tuple of tensor, when enqueue [[1,2],[3,4]] , works , output [array([1, 2]), array([3, 4])] . but second code, can't understand. import tensorflow tf f = tf.fifoqueue(10, [tf.int32]) en = f.enqueue([1,2,3,4]) de = f.dequeue() tf.session() sess: en.run() x = sess.run(de) print(x) according first code, think output [array(1, 2, 3, 4)] , in fact, output 1 . how explain second code? if change arguments in enqueue operation of second code to: en = f.enqueue([[1,2,3,4]]) you have results supposed. you can use shape argument in constructor of tf.fifoqueue more definiteness. example if change code as: import tensorflow tf f = tf.fifoqueue(10, [tf.int32], shapes = [4]) en = f.enqueu...

apache - Header unset Set-Cookie is not working for existing cookies in httpd.conf file -

i want remove set-cookie : 'some cookie details' web server http response in case used below content remove it header unset set-cookie but works if have newly added cookie there , not works existing cookies seeing in http response. for example: if use below content header add set-cookie "somecookie='somevalue'" header unset set-cookie it removes above newly added cookie not existing cookies. know how remove existing cookie http response of apache web server

redux - Dispatching several actions in sequence for single reducer doesn't reflect changes in state for connected component -

when dispatching several different actions 1 reducer, last 1 triggers component update. might better show explain. some notes on provided example: app component reflects history of updates of it's prop redirectpath . when comes null no redirect string adds history. there reducer returns plain string or null depending on action. by pressing button do redirect expect both actions ( set_redirect , clear_redirect ) provide changed state appcontainer component. latest 1 ( clear_redirect ) triggers render method null value. if add slight delay between dispatching these actions, both of them trigger component's render. can check pressing do redirect delay button. i expect both changes (provided set_redirect , clear_redirect actions) in state should trigger component update without using settimeout when dispatching actions. i tried move dispatching of clear_redirect middleware, after gets set_redirect , same result. can somehow reach expected behaviour...

java - SOAPHandler: How to remove automatically added namespace/attribute from child element -

i'm trying setup soaphandler on server convert incoming request <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <getmachine xmlns="http://machine.soap.webservices.product.company.at/"> <machineid>92623-15853588</machineid> </getmachine> </s:body> </s:envelope> to request. <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <enns1:getmachine xmlns:enns1="http://machine.soap.webservices.product.company.at/"> <machineid>92623-15853588</machineid> </enns1:getmachine> </s:body> </s:envelope> my soaphandler looks this. package at.company.product.webservices.soap; import java.io.ioexception; import java.util.iterator; import java.util.set; import javax.xml.namespace.qname; import javax.xml.soap.soapbody; import javax.xml...

Download a file with AngularJS -

i need provide link download file, link must hidden , accessible users, here code , there no errors whatsoever, can't download dialog box open: template <a ng-href="#" target="page" type="button" class="btn" ng-click="download()">download</a> script file $scope.download = function(){ //here need know code,can explain me } first of all, can't "hide/not public" link in web based technology (html/css/javascript) application. downloads handled client, download/link-url must public. can try "hide" protective params e.g. ids in download url using backend executed programming language "php or node.js, etc.". in way can create hash urls http://www.myside.com/download/359ftbw!s3t387ihs hide parameters recordid in url. by knowing this, solution pretty easy. use html attribute download <a href="http://mydownloadurl" download>link text</a> force ...