Posts

Showing posts from May, 2010

cordova - Authentication fails on Windows phone. User GUID is compared to email -

Image
i developing ionic 2 project (built on cordova) using azure active directory adal plugin cordova: https://github.com/azuread/azure-activedirectory-library-for-cordova it authenticates on android , ios fails on windows phone 10. have debugged problem way until part goes native code , seems fine. i internal @ microsoft , doing authentication flow , first sent 1 login screen our mobile application before being redirected org sign-in page 2 factor authentication flow. after 2fa flow accepted redirects our application fails because string comparison compare login request text returned fails because login text of format xxx@microsoft.com , returned identifier user guid. have verified indeed unique user guid should not compared email address. is there work around issue? update: here jwt. got fiddler. saved , anonymized of request/responses too, let me know if need them. { typ:"jwt", alg:"rs256", x5t:"rrqqu9rydbvrwmcocuxub2*****", ki

Disabling waiting for idle state in UI testing of iOS apps -

basically problem same one: xctestcase: wait app idle i using perpetually repeating "background animations" in views. !@#$#$&@ ui testing of xcode/ios wants wait uiview animations end before considers app idle , goes on stuff tapping buttons etc. doesn't work way we've designed app(s). (specifically, have button animated uiviewanimationoptionrepeat | uiviewanimationoptionautoreverse options, never stops.) but i'm thinking there might way turn off and/or shorten state "wait app idle". there? how? there other way around this? unfortunately using apple's ui testing can't turn 'wait app idle' or poll other network activity, can use environment variables disable animations in app make tests more stable. in setup method before test set environment variable this. override func setup() { super.setup() continueafterfailure = false let app = xcuiapplication() app.launchenvironment = ["uitest_disable_a

python - Improve performance of matplotlib for subset of data -

i have little pyqt4 application shows plots big data set (100k points x 14 channels). want show period of 128 points , click show next period. my naive approach create figures , plot subset of data on each step in loop. leads loading time quite second , thought may task. is there way improve performance? did miss matplotlib built-in functions plot subset of data? wouldn't mind longer loading time @ beginning of application, maybe plot , zoom in? edit: provided simple running example took 7.39s plot 8 samples on machine import time import matplotlib.pyplot plt import numpy np plt.ion() num_channels = 14 num_samples = 1024 data = np.random.rand(num_channels, num_samples) figure = plt.figure() start = 0 period = 128 axes = [] in range(num_channels): axes.append(figure.add_subplot(num_channels, 1, i+1)) end = start+period x_values = [x x in range(start, end)] begin = time.time() num_plot = 0 in range(0, num_samples, period): num_plot += 1 end = sta

c++ - boost async_read not reading all data with ssl -

im using boost asio networking , noticed when switched ssl networking code doesnt work anymore. problem seems line here: boost::asio::async_read(socket_, boost::asio::buffer(inbound_header_), boost::bind(&connection::handle_read_header<handler>, this, boost::asio::placeholders::error, boost::make_tuple(handler))); now far understand should read inbound_header_.size() bytes before calling handler. , works of time. read 0 bytes , still call handler error code 0. there im doing wrong? copied code boost asio serialization example thought should work. minimal working sample here tested boost 1.61.0 on ubuntu 16.04 assert in connection::handle_read_header hit in first few seconds after launch every time. async_read() read until either buffers full or error occurs. if read handler being invoked neither of these conditions being satisfied, 1 potential culprit undefined behavior has been invoked. in particular case, code violates

ios - A more efficient method of blurring a small section of a UIView? -

i wanting capture snapshot of small area of screen , apply blur - albeit @ 60fps - not possible code: let rectangle = cgrect(x: -37, y: -153, width: uiscreen.main.bounds.width, height: uiscreen.main.bounds.height) capturesnapshotwithgaussianblur(rect: rectangle) public func capturesnapshotwithgaussianblur(rect: cgrect) -> uiimage { let screen_size_scale_factor = uiscreen.main.scale let cropping_rect = cgrect(x: 0, y: 0, width: 118*screen_size_scale_factor, height: 66*screen_size_scale_factor) uigraphicsbeginimagecontextwithoptions(cgsize(width: 118, height: 66), true, 0.0) backgroundview!.drawhierarchy(in: rect, afterscreenupdates: true) let capturedimage: uiimage = uigraphicsgetimagefromcurrentimagecontext()! let ciimage: ciimage = ciimage(image: capturedimage)! uigraphicsendimagecontext() let gaussianfilter: cifilter = cifilter(name:"cigaussianblur")! gaussianfilter.setdefaults() gaussianfilter.set

java - What is configuartion required to get data from object storage by SWIFT in Spark -

i go through document still confusing how data swift. i configured swift in 1 linux machine. using below command able container list, swift -a https://acc.objectstorage.softlayer.net/auth/v1.0/ -u username -k passwordkey list i seen many blog blumix( https://console.ng.bluemix.net/docs/services/analyticsforapachespark/index-gentopic1.html#gentopprocid2 ) , written below code sc.textfile("swift://container.myacct/file.xml") i looking integrate in java spark. need configure object storage credential in java code. there sample code or blog? this notebook illustrates number of ways load data using scala language. scala runs on jvm. java , scala classes can freely mixed, no matter whether reside in different projects or in same. looking @ mechanics of how scala code interacts openstack swift object storage should guide craft java equivalent. from above notebook, here steps illustrating how configure , extract data openstack swift object storage in

javascript - AngularJs Provider in ES6 -

i trying create provider in angularjs es6 seems not getting injected ($get not getting called). below code: export default class ngintltelinputprovider { constructor() { this.props = {}; this.setfn = (obj) => { if (typeof obj === 'object') { (var key in obj) { this.props[key] = obj[key]; } } }; this.set = this.setfn; } $get() { return object.create(this, { init: { value: (elm) => { if (!window.intltelinpututils) { console.log('intltelinpututils not defined. formatting , validation not work.'); } elm.intltelinput(props); } }, }); } } here app.js angular.module('sample-app', [ngroute]) .config(routing) .provider('ngintltelinputpr', ngintltelinputprovider)

magento2 - Getting expected object definitions from Magento 2 REST API -

when calling magento 2 rest api schema working products using: ..rest/all/schema?services=catalogproductrepositoryv1 the response includes: ... "paths": { "/v1/products": { "post": { "tags": [ "catalogproductrepositoryv1" ], "description": "create product", "operationid": "catalogproductrepositoryv1savepost", "parameters": [ { "name": "$body", "in": "body", "schema": { "required": [ "product" ], "properties": { "product": { "$ref": "#/definitions/catalog-data-product-interface" }, "saveoption

php - Codeigniter view returned as a string with data -

i'm using codeigniter 3 , im trying pull in view variable, , pass data view inclusion. view not recognising data being passed , telling me variable doesn't exist. this how i'm calling view: $view = $this->load->view('notifications/' . $report_type, $data ,true); and in view i'm trying loop through $data , display appropriate, so: foreach($data $item){ // echo stuffs } i know $data definately contains data i've var_dump'ed it. can this? you need pass associative array loader. $view = $this->load->view('notifications/' . $report_type, array('data' =>$data) ,true); now variable visible @ view.

c# - Can TKey be inferred? -

this question has answer here: generic type in constructor 1 answer i've created validator checks ilist<t> duplicates. came following implementation: namespace consoleapplication1 { class program { static void main(string[] args) { var bar = new foo() {bar = "buzz"}; var list = new list<foo>() { }; //foo has property named bar of type string var validator = new validator<foo, string>(x => x.bar); //i have specify type of bar validator.isvalid(list); } } } public class foo { public string bar { get; set; } } public class validator<t, tkey> { private readonly func<t, tkey> _keyselector; public validator(func<t, tkey> keyselector) { _keyselector = keyselector; } public bool isvalid(ilist<t>

java - How to run Spring Batch Jobs in certain order (Spring Boot)? -

i'm developing spring batch using spring boot. i'm minimal configuration provided spring boot , defined jobs (no xml configuration @ all). when run application, springapplication.run(app.class, args); the jobs sequentially executed in arbitrary order. i'm defining jobs way in @configuration annotated classes, spring rest: @bean public job requesttickets() { return jobbuilderfactory.get(config.job_request_tickets) .start(steprequesttickets()) .build(); } how can instruct framework run jobs in order? edit: warning give hint? (maybe has nothing be) 2016-12-29 17:45:33.320 warn 3528 --- [main] o.s.b.c.c.a.defaultbatchconfigurer: no datasource provided...using map based jobrepository 1.you first disable automatic job start specifying spring.batch.job.enabled=false in application.properties 2.in main class, - applicationcontext ctx = springapplication.run(springbatchmain.class, args); assuming main class named - spri

Apache Jmeter response time too high for web pages -

we using apache jmeter performance testing of web application. apparently response time high in comparison loading page in browser during load. when open page during load opens in 2 seconds jmeter reports 70 seconds. understand browser memory cache , disk cache used in browser isn't jmeter cache manager same. how assert it, comparing response header 1 option. thoughts on appreciated. it may wrong configuration in script. there won't difference between web browser , jmeter response times (browser rendering time ignored in jmeter, not big factor must considered) if using single http sampler web page , retrieving resources in tha page, select "parallel downloads" option '6' in http sampler advanced section. so, simulating browser behaviour of parallel downloading of resources .js, .css, images etc. if recorded script using test script recorder, there http sampler each resource requet page sent sequentially, hence increase in response time. might

ajax - PHPBB 3.1.10 Dependency Injection of User Object only delivers Anonymous User in a live environment -

the goal login status of user in phpbb 3.1.10 in extension module using ajax calls. i have succeded on xampp on local machine. (meaning problem described not exist in environment) trying roll out online site installing extension on live phpbb installation. the problem opposed local environment @user object delivered dependency injection mechanism "anonymous", no matter if logged in or not. "anonymous" username of phpbb user not logged in. both envrionments use phpbb 3.1.10. the folder structure deviates in name of phpbb3 root folder name. both have functioning url rewrite now, after had manually set live environments rewritebase in .htaccess. board settings seem identical domain. as php server settings - have no direct influence on php config on live environmenht .htaccess , have little knowladge possible in regard. here service defintion, routing information , authorization class used read @user object. ext/foo/bar/services.yml

media player - Android MediaRecorder recording looping back on itself -

i have made app uses mediarecorder , mediaplayer, whenever record , play it, kinda loops on itself. e.g say, one, two, three, four, five, six, seven, eight, nine, ten but plays one, two, 3 three, 4 four, 5 five 5 etc. gets worse if recording longer? it might simple bug, don't see it. here code : import android.media.audiomanager; import android.media.mediaplayer; import android.media.mediarecorder; import android.net.uri; import android.os.countdowntimer; import android.os.environment; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.button; import android.widget.compoundbutton; import android.widget.progressbar; import android.widget.switch; import android.widget.toast; import java.io.file; import java.io.ioexception; public class mainactivity extends appcompatactivity { switch switchplay; button btnrecord, btndelete; progressbar pbarmetronome; mediarecorder mrecord

php - Check if one datetime is higher then another datetime -

i have question , have 2 input boxes type datetime-local can see below. from <input type="datetime-local" value="2017-01-11t08:30:00"name="datemin" step=1> till <input type="datetime-local" value="2017-01-11t08:30:00"name="datemax" step=1><input type="submit" name="daysubmit"> now want check php if the date datemax higher date datemin , if date datemin lower datemax. know how can that? i post values of 2 inputboxes , format value "yyyy-mm-ddthh:mm:ss" "yyyy-mm-dd hh:mm:ss". this php code have far: if(!empty($_post["datemin"]) , !empty($_post["datemax"])) { $datemin=$_post["datemin"]; $datemin= str_replace("t"," ",$datemin); $datemax=$_post["datemax"]; $datemax= str_replace("t"," ",$datemax); //here wa

excel - VBA do not fire "Worksheet_PivotTableUpdate" on startup -

hi have excel file couple of worksheets macros. 1 worksheet uses build in method "worksheet_pivottableupdate": private sub worksheet_pivottableupdate(byval target pivottable) 'complex stuff end sub whenever open work book event fired. there way firing method whenever "change" pivot (i know initial setup of update well, exclude initial call) the problem caused due everytime open workbook sheet pivots on gets shown (and not last opened prior saving / first sheet). any ideas?

java - Android - I need some clarifications -

1.i have textview id textview1 i. textview tv = (textview) findviewbyid(r.id.textview1); tv.settext("hellow world"); or without creating tv, ((textview) findviewbyid(r.id.textview1)).settext("hellow world"); ii. textview tv = (textview) findviewbyid(r.id.textview1); tv.settext("hellow world"); tv.settextsize(somevalue); tv.settag("title"); or ((textview) findviewbyid(r.id.textview1)).settext("hellow world"); ((textview) findviewbyid(r.id.textview1)).settextsize(somevalue); ((textview) findviewbyid(r.id.textview1)).settag("title"); which approach in both cases , what's difference. 2.similerly have string childname need access 3 methods i.i can create field variable childname , , can access 3 methods ii.passing variable through each methods like, setchildfragment(childname); in public setchildfragment(string childname){ . . . setchildview(childname); } and in , public setchildview(str

ios - Table View reloadData() not working when populating Values using UserDefaults -

Image
i working on project shows news feeds user. i calling function getnewsfeeds() news feeds. i generate new newsfeeds every 1 hour viewdidload(){ current time in "hh" format , store in currenttime store currenttime in hoursvar variable using userdefaults } viewdidappear(){ if( currenttime - hoursvar >= 1){ getnewsfeeds }else{ } retreivestoredvaluesfromuserdeafults() } i dont know setup tableviewdatasource , delegate methods , reloaddata populate tableview when getting data saved userdefaults retreivestoredvaluesfromuserdeafults() override func viewdidload() { super.viewdidload() hoursformatter.dateformat = "hh" hoursvar = int(hoursformatter.string(from: hours))! if hoursvar > 12 { hoursvar = hoursvar - 12 } self.defaults.set(self.hoursvar, forkey: "hoursvar") customnavbar() self.view.addgesturerecognizer(self.revealviewcontroller().pangesturere

java - A txt file with scores(92 92 92 92 92) get assigned all A's, but with scores(92 10 70 95 84) 92 and 95 get assigned 'B'? -

so need debugging code. problem code incorrect grades assign each score in array. file reads in txt file include first name[space]last name[tab]score. stores them in arrays, calculates mean , standard deviation of scores , should assign letter grades scores, thing if rewrite txt file (92 92 92 92 92) assigned 'a' right, when txt file is(92 10 70 95 84) 92 , 95 assigned 'b' instead of 'a', problem. have spent hours trying find out why this, have had no luck. how calculate letter grades: a = mean + standard <= score, b = mean + (standard/3) <= score < mean + standard, c = mean - (standard/3) <= score < mean + (standard/3), d = mean - standard <= score < mean - (standard/3), f = score < mean - standard import java.io.file; import java.io.filenotfoundexception; import java.util.scanner; public class scannerreadfilesplit { public static int[] scores = new int[5]; public static string[] names = new string[5]; public static char[]

jQuery AJAX file upload returning errors, why? -

when upload file server, response either number or boolean, i'm getting error: object {readystate: 4, responsetext: "", status: 200, statustext: "ok"} abort : (a) : () catch : (a) done : () fail : () getallresponseheaders : () getresponseheader : (a) overridemimetype : (a) pipe : () progress : () promise : (a) readystate : 4 responsetext : "" setrequestheader : (a,b) state : () status : 200 statuscode : (a) statustext : "ok" : (b,d,e) proto : object my code this: var btn = $("input[name=submitname]"); var url = btn.parents("form").attr("action"); var filename = btn.parents("form").find("input[type=file]").attr("name"); var fileval = btn.parents("form").find("input[type=file]").val(); var datastring = btn.parents("form").serialize() + "&" + btn.attr("name") + "

rabbitmq c++ client not connecting to rabbitmq-server at 5672 port -

i have installed rabbitmq-server on linux machine. have installed amqp-cpp client library given on official website of rabbirmq. enter link description here now want connect rabbitmq-server producer , want publish message in queue. have made connection handler , main file follow: int main(int argc, char** argv) { const std::string exchange = "my-exchange"; const std::string routingkey = "my-routing-key"; const char* message = "hello world"; mytcphandler myhandler; // address of server cout<< "tcphandler object created.." <<endl; amqp::address address("amqp://guest:guest@localhost:5672"); //("amqp://guest:guest@localhost/vhost"); cout<< "address object created.." <<endl; // create amqp connection object amqp::tcpconnection connection(&myhandler, address); cout<< "connection object created.." <<endl; // , create channel amqp::tcpchannel channel(&connectio

c# - Remove Auto Increment in EF 7 - RC2 -

in ef7 rc2, default, integer primary key auto increment field. tried remove it. using data annotation fluent api, nothing works. using data annotation: [key, column(order = 1, typename = "int"), databasegenerated(databasegeneratedoption.none)] using fluent api: modelbuilder.entity<tblproduct>().haskey(t => t.prodid).hasannotation("databasegenerated", databasegeneratedoption.none); //or use following modelbuilder.entity<tblproduct>().haskey(t => t.prodid).hasannotation("databasegenerated", 0); //or use following modelbuilder.entity<tblproduct>().haskey(t => t.prodid).hasannotation("sqlite:autoincrement", false); nothing has worked :( can please me? updated as requested, here table script after running add-migration localdb_v1 migrationbuilder.createtable( name: "tblproduct", columns: table => new { prodid = table.column<int>(n

javascript - Issue with recalling information -

i new @ java script , trying practice have learnt. i tried create text field access , recall information. <body> <form> name of book have read: <input id="books" type="text" name="ewq" value="qwe"> <input type="submit" name="ui" value="submit" onclick="bookse()"> </form> <p id="qwe">name:</p> <script type="text/javascript"> function bookse() { var nameofbook = document.getelementbyid('books').value; document.getelementsbyid('qwe').innerhtml = nameofbook; } </script> </body> and tried local storage <form id="book"> name of book have read: <input id="books" type="text" name="" value=""> </form> <p>name:</p> <script type="text/javascript"> var x = document.getelementbyid('books'); if (l

python - File handling and counting of occurrence of a string in files -

occurrences( inputfilenames, words, outputfilename ) for each file in list inputfilenames , output file called outputfilename name of input file , each word in list words , number of occurrences individual word; if of input files cannot read, issue suitable error message , skip file. added fun, without using .count() built-in function. occurrences( ["sample1.txt","sample2.txt","sample3.txt"], ["why","you","fate","among"], "out.txt") out.txt contains: file name: why fate among sample1.txt 3 0 0 0 sample2.txt 2 2 1 1 sample3.txt 0 3 0 0 and i've got far def occurrences(inputfilenames,words,outputfilename): output = open(outputfilename,"a") try: file in inputfilenames: opned = open(file,"r") print(opned) counters = [0 file in range (len(words))] index = 0 in words: line in op

Salesforce JavaScript button in Lightning -

we have buttons on our contact page via javascript update handful of hidden fields on object. moving lightning ui , understand these not supported, struggling decipher documentation on best replacement. can point me in right direction. requirement update several fields on contact on screen... nothing more, other don't use chatter nothing feed please. the winter 17 release included ability create actions based on lightning components. way want go convert existing javascript buttons. suggest check out new trailhead released lightning alternatives javascript buttons . i working on course pluralsight lightning development , 1 of areas plan on covering since applicable lot of people right now. not sure if realize next year, javascript buttons have no longer work (even in classic). part of 3 phased approach salesforce implementing phase them out security reasons. good luck in conversion. wish easy, @ least possible. best. sara

java - Log4j2 Delete on Rollover is not working as expected, in Pingfederate -

in pingfederate, internally uses log4j2 log events. trying rollover , delete older logs. while rollover functionality works, , log rolled over, deletion functionality doesn't seem work. don't understand ? kindly explain , me fix this. also, trying log log4j2 itself, reason not getting logged in console logs. thanks bunch. if need more information, kindly comment. <?xml version="1.0" encoding="utf-8"?> <configuration status="trace"> <appenders> <console name="console" target="system_out"> <patternlayout> <charset>utf-8</charset> <pattern>%d %p %c{1.} [%t] %m%n</pattern> </patternlayout> </console> <!-- main log : size based file rolling appender --> <rollingfile name="file" filename="${sys:pf.log.dir}/server_${sys:pf.ip}.log" filepattern="${sys:pf.log.dir}/server_$

c# - Posting from AWS-API Gateway to Lambda -

i have simple c# aws lambda function succeeds test lambda console test fails 502 (bad gateway) if called api gateway (which generated lambda trigger option) , if use postman.(this initial function has open access (no security)) // request header content-type: application/json // request body { "userid":22, "files":["file1","file2","file3","file4"] } the error in logs is: wed feb 08 14:14:54 utc 2017 : endpoint response body before transformations: { "errortype": "nullreferenceexception", "errormessage": "object reference not set instance of object.", "stacktrace": [ "at blahblahmynamespace.function.functionhandler(ziprequest input, ilambdacontext context)", "at lambda_method(closure , stream , stream , contextinfo )" ] } it seems posted object not being passed lambda input argument. code below //

c# - JsonRequestBehavior Error When downloading file from WebAPI -

a similar question asked here: getting error while download file in mvc2 has 1 answer doesn't solve problem , doubt solved problem other person... here's problem: trying expose documents whether pdf, xlsx, tif, or type through webapi , here's current code on api: public httpresponsemessage download(string documentid, string contactid) { var path = documentsource + "\\"; var document = documentdomain.getdocument(new guid(contactid), new guid(documentid)); if (referenceequals(document, null) && referenceequals(document.filename, null)) { return new httpresponsemessage(httpstatuscode.notfound); } else { try { memorystream responsestream = new memorystream(); stream filestream = new filestream(path.combine(path, document.portfolioid == null ? "" : document.portfolioid.tostring(), document.filename)

python - Using np.random.randint as fill_value -

i want create numpy array, each element amount of 1 s in numpy array of size x created np.random.randint . >>> x = 10 >>> np.random.randint(2, size=x) array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1]) >>> sum(array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1])) 5 and using results in same array being used, instead of generating new random 1 each time >>> np.full((5,), sum(np.random.randint(2, size=10)), dtype="int") array([5, 5, 5, 5, 5]) how can this, or there better way this? tried following >>> = np.random.rand(10) >>> len(a[a < 0.5]) 7 >>> np.full((5,), len(np.random.rand(10)[np.random.rand(10) < 0.5]), dtype="int") array([7, 7, 7, 7, 7]) but can see resulted in same numbers. problem don't want use loops, , instead find way using numpy . you generate matrix n arrays each of size x made of random ints. sum on each array, import numpy np x = 10 n = 5 = np.sum(np.random.randint(2, size=[

asp.net mvc - Asp Mvc Xml Upload -

i uploading xml , posting on action method.at top of received file there information ------webkitformboundarytuarn4bf71aoefqg content-disposition: form-data; name="file"; filename="samplexmp.xml" content-type: text/xml because of cannot load on xdocument.this code public actionresult postxml() { string xml = ""; if (request.inputstream != null) { streamreader stream = new streamreader(request.inputstream); string x = stream.readtoend(); xml = httputility.urldecode(x); var xmldocument = xdocument.parse(xml);//exception (invalid data @ root) } return view(); } this view @using (html.beginform("postxml", "home", formmethod.post, new { enctype = "multipart/form-data" })) { input type="file" name="file" input type="submit" value="upload" } how can remove additional data?

html - Woocommerce Footer not Aligning to FullScreen -

Image
i have developed first woocommerce site , have had niggling issues trying fix. the site can viewed @ http://www.dcsreceivers.co.uk/ . the problem have footer bar background behind not display edge edge on different screen sizes. when developed on laptop (screen size 13), fine when have viewed on bigger screens leaves gap on right hand side , i'm not sure how how fix it. the code used is: #colophon .site-info { background-color: #2c2c2c; margin-left: -500px; padding-left: 500px; margin-right: -46px; padding-right: 500px; border-top: 1px solid #3a3a3a; } would appreciate if advise on how fix display correctly on screen sizes. thanks in advance. image attached show issue you have 2 possibilities. may want have black bar in footer to: expand fit width of screen ; fit width of content above it, not width of screen. to achieve first aim, can put .site-info div outside of container, div class col-full . in case code be:

how to update package.json after npm installl in a package -

i'm writing npm package, i'd package update package.json file in installed folder, say: npm install mypackage this installs mypackage, , read package.json in folder npm install run, , write entries, possible? thanks, npm -g npm-check-updates npm-check-updates -u npm install or specific package, may change dependency version , npm update --save

python - Add a Two Line Comment to Table Before Saving with Numpy savetxt -

here python 3 code giving me problem: name_in_stk = name+'.out.abs.stk' data_stk = np.loadtxt(name_in_stk, skiprows=0) wavelength = [] ext_coef = [] ext_coeff = [row[1] row in data_stk ] wavelength = 1e7/np.array([row[0] row in data_stk ]) dataout = [] dataout = np.column_stack((wavelength,ext_coeff)) np.savetxt(name+'.stk',dataout, fmt=('%5.1f','%5.4e')) the output is: 435.6 1.8225e+04 396.7 3.2189e+04 333.8 3.7765e+03 325.2 4.6922e+04 315.5 1.0923e+05 307.0 9.9065e+02 296.4 1.3264e+03 288.2 5.6207e+04 282.8 3.4048e+04 266.1 2.5265e+04 the question haven't been able answer, althought have searched, : how add 2 line header table before saving it? np.savetxt has option specify header, not (as expected) specifying list of column names corresponding columns want save, specifying string placed start of file, commented out # . there no option create 2 headers, since savetxt wants string header, makes thing easier can split heade

asp.net - The resource cannot be found after refresh -

dears , below code in ctrl_menu.ascx navigating accounts page <li class=""> <a href="../employeeschedule/administration/account/accountsview.aspx" title="bootstrap tables"> <i class="fa fa-puzzle-piece"><span class="overlay-label greensea80"></span></i> accounts </a> </li> it works fine , while im in accountsview.aspx , if press again on , show source cannopt found. error:requested url:/employeeschedule/administration/employeeschedule/administration/account/accountsview.aspx i have no idea why duplicate “employeeschedule/administration ” to more clear , here’s code ctrl_menu.ascx whih registered in ctrl_header.ascx , ctrl_header.ascx registered in master page. <%@control language="c#" autoeventwireup="true" codefile="ctrl_menu.ascx.cs" inheri

polymer 2.0. How to open dialog in parent element from child? -

i using polymer starter kit 2.i created paper-dialog , event in my-app.html: <paper-dialog id="animated" entry-animation="scale-up-animation" exit-animation="fade-out-animation" with-backdrop> <h2>dialog title</h2> </paper-dialog> --------------------------------------------------------------- feedback(){ this.$.animated.open(); } and want open dialog child view1 iron-pages. how can it? you either raise event in child element , open dialog when receive or pass callback function child gets called whenever want open dialog. events documentation: https://www.polymer-project.org/2.0/docs/devguide/events

excel - Why does my pivot table show all of the "many" records against each "one" record? -

i have excel spreadsheet 2 datasources, have one-to-many relationship. i've set relationship , tried create pivottable join 2 tables together. however, each line in "one" table, it's showing every single line in "many" table , repeating each "one" entry. the datasources sharepoint lists. what have done wrong here?