Posts

Showing posts from April, 2010

xcode - Can an iOS 10 application run on an iOS 9 device? -

i'm exited using new xcode application, wanted know if it's possible run ios 10 app on ios 9 device ? because i'm developing app on xcode 7 , don't know if must finish app first migrate on xcode 8 or not ? thanks. xcode 8 support older deployment targets ios 10 (just xcode 7 supports older deployment targets other ios 9). have adjust project settings appropriate. if want use ios 10 features (i.e., elements of sdk available ios 10 forward), need use availability syntax in swift , ensure don't access sdk elements on older versions of ios.

django-localflavor fields not showing up in Django admin models? -

i trying implement django-localflavors django app. i import usstateselect & uszipcodefield @ beginning of models.py , include them field in model along other fields, so: from localflavor.us.forms import usstateselect, uszipcodefield ... class mymodel(models.model): ... state = usstateselect() zip_5 = uszipcodefield() however, when go django admin , try create new model object, see every other field wrote (charfields, etc.) except of localflavor fields. not showing @ input field in model object form. have done migrations on database not issue. am misunderstanding how use django-localflavor? read in answer different post localflavor doesn't create input fields, stores data... i've read let input data. @ point confused. appreciated! i think looking model fields . form fields used when building own forms (usually outside admin, such contact form). localflavor has couple fields should need. note these charfield s have validation make sure follo

java - I edited vim configuration file and error occured (on MS Windows, error says "don't know "%\" option) -

i'm using ms windows first, i'm novice in programming , linux , many question here, i'm sorry i wanted comfile java source code on gvim , searched googled.. found post , found code "myjava.vim", configuration , _vimrc code and error occured here myjava.vim if config file java ~/.vim/myjava.vim set cindent set smartindent set ai syntax on " indent config set sw=4 sts=4 ts=8 et " compile , execution map <f6> :!java %:r<space> map <f7> :w<enter>:make<enter> " compile config set makeprg=javac %\ set errorformat=%a%f:%l:\ %m,%-z%p^,%-c%.%# " finding compile error map ,n :cn<enter> map ,p :cp<enter> map ,l :cl<enter> map ,w :cw<enter> " set block , auto annotation vmap ,c :s/^/\/\//g<enter> vmap ,uc :s/^\/\///g<enter> " taglist config nnoremap <silent> <f8> :tlist<cr> nnoremap <silent> <f9> :w<cr>:tlistupdate<cr>

javascript - Sails.JS - retry on NTLM Auth failure? -

i writing nodejs application based on sails.js, , i'm using ntlm-express ntlm authentication. works fine when authentication succeeds in cases fails (for example, firefox user entering wrong credentials) ntlm-express returns 500 error code, firefox stores credentials in cache , user unable login web app @ all, since he's not getting new prompt enter credentials. way user log in manually clear authentication cache in firefox , try again. what i'd in cases ntlm-express fails authenticate user, prompt him again credentials instead of returning 500. has done , can point me in right direction? found little information online regarding topic... for runs similar issue, managed solve overriding express-ntlm forbidden function return 401 instead of of 500 , editing default sails unauthorized.js response return "www-authenticate: ntlm" header. way forcing client retry ntlm negotiation until gets right...

javascript - jQuery form plugin and PHP file uploads tutorial questions -

i found nice tutorial jquery php file upload knowledge is`t because dont know put these samples of code... , xml file ? i have 2 files : 1-named kontakt.php body of simple contact form body <form action="contact.php" method="post" id="my-form" enctype="multipart/form-data"> 2-file named contact.php php scripts. im trying basic operations files no effect. can u write me directions these parts of code because dont recognize them wery well thanks alright, let's this: xml stands extensible markup language. markup language, similar html store general data. you put 2 files on root (main) directory on webserver. the code posted top isn't complete contact form html. use whole code tutorial. <div id="container"> <form action="process.php" method="post" id="my-form" enctype="multipart/form-data"> <p>e-mail<br /> &l

coldfusion - Can I queue a cfthread with the same name in a multi user environment? -

user fires off cfthread called 'thread1'. thread takes 30 minutes complete, , 'set & forget' thread. in other words, thread not join main page request. thread contains routines highly memory intensive. user b fires off same named thread [cfthread name 'thread1'], different page request, 5 minutes after user a. in scenario, how can queue threads, can reduce processing load on cf application server? please note, understand thread queuing threads have different names. talking instances of same thread. the answer lock function call inside cfthread tag. here example: <cfthread action="run" name="thread1"> <cflock name="threadlock" type="exclusive" timeout="10000"> <cfset calltosomefunction()> </cflock> </cfthread> so, test this, copy code below, .cfm template. open firefox, , open chrome. test template inside firefox. wait 5 seconds , test template insid

javascript - jQuery missing targets in loaded templates -

i have particular route mapped particular controller , view: app.config(['$routeprovider', function ($routeprovider) { $routeprovider .when('/create', { templateurl: 'partials/form/form.html', controller: 'tournamentcreatecontroller' }); }]); in form page including partials well: <div ng-include="'partials/form/start.html'"></div> and start.html has element like: <input id="time" type="text" ng-model="time"> when try activating javascript components on element, it's ignoring target ( #time ). tried following: app.controller('tournamentcreatecontroller', function ($scope, $rootscope, service) { $('#time').on('click', function () { alert('time clicked'); }); } and when input being clicked no alert shown. if move element start.html (the partial) parent being that's including it, form.html , jquery working p

Sitecore Analytics tracking click events -

in project working on tracking click events done following code: var goal = new pageeventitem(goalitem); var eventrow = tracker.current.interaction.currentpage.register(goal); eventrow.datakey = id; eventrow.data = name; eventrow.text = data; this recorded interactions table on mongodb, need know create report display these registered data? question how can read these data mongodb? approach build reports on data directly mongodb not work on big amount of records. you should take in direction how aggregate data in reporting db , build report using it .

Why DynamoDB java sdk doesn't allow always auto-generated keys? -

i'd implement change history objects in dynamodb. easy way of doing specify "object id" hash , "updated time" range key. however, java sdk doesn't allow annotating keys autogenerated (changing value without annotation convenience seems work). why? example code: @dynamodbtable(tablename = "data") public class person { public static void main(string[] args) { amazondynamodbclient client = new amazondynamodbclient() .withendpoint("http://localhost:8000"); dynamodbmapper mapper = new dynamodbmapper(client); tableutils.deletetableifexists(client, mapper.generatedeletetablerequest(person.class)); tableutils.createtableifnotexists(client, mapper.generatecreatetablerequest(person.class) .withprovisionedthroughput(new provisionedthroughput(1l, 1l)) ); person person = new person(); person.setpersonid("abc"); mapper.save(person);

Rails: How to dynamically add rows to database through controller method? -

Image
after accepting data through form 1 table, want process data , use generate entries table. taking first set of data, plugging formula, , entering result entry of table. each original set of data generates multiple rows in other table (as formula runs several times 1 variable being incremented throughout runs). in short, want this: def show @diagram = diagram.find(params[:id]) @horizon = @diagram.horiz @horizon.times |i| @cashflow = cashflow.new @flow = compute_cashflow(@diagram.investment, i) @cashflow.flow = @flow @cashflow.year = @cashflow.save end end is possible? in advance. edit here function "compute_cashflow(investment, year)": def compute_cashflow(investment, year) return investment+year end (it's meaningless right want test idea)

c++ - How to implement Factory pattern? -

i trying implement factory class , interface. getting below error message. have created factory class decides class return normaltaxmanager or importedtaxmanager. have provided abstraction using interface. #include<iostream> #include<vector> using namespace std; class taxinterface { public: virtual int calculate_tax(int price,int quantity)=0; }; class taxfactory { public: // factory method static taxinterface *callmanager(int imported) { if (imported == 0) return new normaltaxmanager; else return new importedtaxmanager; } }; class normaltaxmanager: public taxinterface { public: virtual int calculate_tax(int price,int quantity) { cout << "normaltaxmanager\n"; price=quantity*price*10/100; return price; } }; class importedtaxmanager: public taxinterface { public: virtual int calculate_tax(int price,int quantity) { cout << "import

javascript - AJAX post to PHP empty -

i have checked other questions - not duplicate. have tried of solutions find , implement. i trying send data task.php → showcats.php task.php: <script type="text/javascript"> $(document).on("click", ".btncat", function () { var filter = $(this).data("id"); alert(filter); $.ajax({ type: 'post', url: 'showcats.php', data: {'filter': filter}, }); $('div.container-fluid').load('showcats.php'); }); </script> showcats.php: $area = $_post['filter']; $sql = "select aid,name,surname,street_name,house_number, area, plz,poster,visible addresses area '$area' , visible 'show' order aid desc"; $rs = mysqli_query($con,$sql); $str = ''; while ($res = mysqli_fetch_array($rs)) { $str .= ' <div class="col-md-9"> <div class="task

Laravel Cashier Stripe Trial creates new subscriptions, allows exploit -

i using laravel cashier add stripe payments (subscriptions) premium version of web app. users offered 5-day free trial (card in advance). now happens is, create subscription using: $user->newsubscription('premium','monthly')->trialdays(5)->create($stripetoken,['email' => $user->email], "") works well, let's user cancels subscription within trial period.. on 'grace' period, let's 4 more days.. when these days passed, user lose account benefits, trial expire , subscription cancelled. but, after that, if user wants subscribe again, since $subscription->resume() available during grace period, have create subscription using $user->newsubscription, generating new subscription on table , new trial period.. allowing them cancel again, wait 5 days, create 1 , repeat getting free trial days forever.. is there way "resume" existing subscription when cancelled , grace period over?

python - Validate that a WTForms BooleanField is checked -

i creating form using flask-wtforms. i using booleanfield user can indicate agree terms. i cannot validate booleanfield upon submission ensure has been checked. have tried using required(), datarequired() , custom validation in each case have not received validation error. here nuts , bolts of application: from flask import flask, render_template, session, redirect, url_for, flash flask_wtf import form wtforms import booleanfield, submitfield wtforms.validators import required, datarequired flask_bootstrap import bootstrap app = flask(__name__) app.config['secret_key'] = 'impossibletoknow' bootstrap = bootstrap(app) class agreeform(form): agreement = booleanfield('i agree.', validators=[datarequired()]) submit = submitfield('submit') @app.route('/', methods=['get', 'post']) def index(): form = agreeform() if form.validate_on_submit(): agreement = form.agreement.data if agreement tru

c# - Set 'cshtml' data and return a string -

i have confirmation email template .cshtml following: <html> <head> <title>company name: email verification - action required</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> signing company name! <br/> <br/> thank signing company name. please press link below confirm email address <br/> if did not sign company name, please ignore email, , accept our apologies inconvenience. <br/> <br/> <a href="@model.confirmlink">@model.confirmlink</a> <br/> <br/> <br/> thanks,<br/> <a href="http://company name.com" >company name</a> team </table> </body> &l

python - Does os.walk() use recursion or iteration? -

this question has answer here: time complexity of os.walk in python 3 answers okay have seen people os.walk() in python uses recursion , uses iteration. correct answer? from winpython-64bit-3.5.1.3 ~/lib/os.py... it's recursive def walk(top, topdown=true, onerror=none, followlinks=false): dirs = [] nondirs = [] # may not have read permission top, in case can't # list of files directory contains. os.walk # suppressed exception then, rather blow # minor reason when (say) thousand readable directories still # left visit. logic copied here. try: # note scandir global in module due # earlier import-*. scandir_it = scandir(top) except oserror error: if onerror not none: onerror(error) return while true: try: try: entry = ne

javascript - AngularJS custom directive two way data binding -

i new angular.js , trying make custom directive(which has controller functions in it) linked controller. when object in controller($scope.myobj), changes have similar object in directive controller changes same way. in addition possible invoke function/scope method declared in directive controller, basic controller(or invoke function directive controller when object basic controller has changed.) ? aviv ben-yosef writes pretty nice post on http://www.codelord.net hooks controller isolated directive scope: http://www.codelord.net/2015/09/02/controller-directive-communication-part-3-controller-to-directive/

.net - Filesystemwatcher C# watcher objects persist on startup -

following tutorial: http://www.codeproject.com/articles/26528/c-application-to-watch-a-file-or-directory-using-f i've modified above tutorial , created windows form application can create multiple filesystemwatcher instances , track/delete them in list on form. my next goal make on computer restart/startup, windows form application remain active watcher objects i've created. i figure take 4 parts: 1) save information on watcher objects , metadata accessed after restart (currently save references watcher objects in list variable) 2) have watcher objects persist after restart 3) start windows form on startup 4) access saved watcher object information still appears on windows form list. i new c# , first project, have little idea on how tackle these steps. appreciated. you have create new watcher objects after restart. information need store needs have different class, e.g.: public class settingitem { public string path { get; set; } } public class sett

javascript - Angular - circular dependency injector whie trying inject $modal to exception handler decorator -

due john papa - 10 angularjs patterns presentation advices try implement additional functionality exception handling: exceptionhandlerdecorator.$inject = ['$provide']; function exceptionhandlerdecorator($provide){ $provide.decorator('$exceptionhandler', handleexception); } handleexception.$inject = ['$delegate', 'exceptionhandlerservice']; function handleexception($delegate, exceptionhandlerservice){ function handle(exception, cause){ $delegate(exception, cause); exceptionhandlerservice.handle(exception.message); } return handle; } exceptionhandlerservice.$inject = ['$modal']; function exceptionhandlerservice($modal){ //do things } but when try ti inject $modal exceptionhandlerservice angular ui bootstrap got error: $injector:cdep circular dependency terrified me. tried use accepted solution similar question, injecting $http angular factory($exceptionhandler) results in circular dependency :

Excel VBA Type Mismatch Error 13 -

i'm kind of new vba, , having problems working multiple workbooks @ once. had code functional takes data 1 sheet given conditions met. now trying update code move 1 workbook another, , have begun declare workbooks instead of referencing sheet names. now getting various errors. code follows. before (worked) option explicit sub trenddatabyday() 'determine date of data pulled dim currentdate string currentdate = sheets("daily pull").range("b23").value after (fails; using 2 workbooks) option explicit sub trenddatabyday() dim wbdaily, wbhistory workbook 'declare daily , history workbooks set wbdaily = activeworkbook workbooks.open filename:="\\daily focus metrics\focus metrics history facility.xlsm" set wbhistory = application.workbooks("focus metrics history facility.xlsm") 'determine date of data pulled dim currentdate string 'error here! currentdate = workbook

refactoring - Applying bootstrap only on mobile -

i have legacy website work on , not support mobile browsers. web has gigantic amount of css files , & feel of web not modified. bootstrap used make web responsive mobile users. the problem is, i'd web apply bootstrap mobile browsers. let's following html code legacy web , it's not responsive. <div id="header"> <div><img src="view/image/logo.png"/></div> <div><img src="view/image/lock.png"</div> </div> if add row , column classes... <div id="header" class="row"> <div class="col-xs-6"><img src="view/image/logo.png"/></div> <div class="col-xs-6"><img src="view/image/lock.png"/></div> </div> now, responsive mobile browsers .row changes margin & padding of #header pc browsers not meant be. so, came 2 solutions problem. import bootstr

jwplayer6 - jwplayer crossdomain issue - IE9 only -

trying play movie on ie9 (jwplayer 6) - getting error loading skin: crossdomain loading denied. my skin (and player buttons) on same domain page. there no error on other browsers, on ie9. what can do? as per assumption based on information provided in question, suggesting 2 solution 2 common scenarios might have caused issue. if using cdn video, jwplayer files , skins then need enable cors in cdn server. ( see here ) you should include crossdomain.xml in server per instructions in jwplayersite . ( see here also ) i hope above 2 solution works.

f# - How to convert the download program to async? -

i have following code open fsharp.data let downloadfile link = ...... use os = file.create(...) http.requeststream(....).reponsestream.copyto(os) let rec consume() = async { ...... |> seq.iter (fun x -> xxx |> seq.iter(fun link -> downloadfile link )) } i found sync downloading makes code not run concurrently. i'm trying somthing following. how change use fsharp.data http asyncrequeststream ? maybe copyto can async too? open fsharp.data let downloadfile link = async { ...... use os = file.create(...) http.asyncrequeststream(....).reponsestream.copyto(os) // error } let rec consume() = async { ...... |> seq.iter (fun x -> xxx |> seq.iter(fun link -> downloadfile link |> async.start // do! downloadfile link???? )) } consume() |> async.runsynchronously here's skeleton solution, worthy of blank spots in example: let downloadfile link =

ruby on rails - Nginx X-Frame-Options -

i use nginx 1.8.0 under centos 6.7 serving ruby on rails 4.2.3 application. the problem: i need enable iframe options domains tried this: x-frame-options: * then when check headers see twice 1 time sameorigin , 1 time * , here response: http/1.1 200 ok server: nginx/1.8.0 date: sun, 01 nov 2015 15:48:32 gmt content-type: text/html; charset=utf-8 connection: keep-alive status: 200 ok strict-transport-security: max-age=31536000 x-frame-options: sameorigin x-xss-protection: 1; mode=block x-content-type-options: nosniff etag: w/"d14b3de05fb18ebe4a94774c8f209e7f" cache-control: max-age=0, private, must-revalidate set-cookie: guess_locale=en; path=/; secure set-cookie: _admin_numgames_com_session=y3n0qjr2nxy0vflzmlvnmhjlzc9wbuvraldzyjhpeho0ug41akpaze1rb0tqws9yegpkckltrmviuu5avmjpuelccwpmafjwqmpiwhrsazi4te9qdtgvq2vvrgyrsw9vcja4ewvcmvlsuhjrejr1wmnoqwzol2hgeva1zhp5ywxpdfz4s25ydettamvnbflzmehjrddxalq2mu93t24vwnr6b28wm0nvys82nm1xmgv2njh4djizr1rnb2w3wtvhudm3cvl3nnvrqnj1wtm

linux - KeeWeb Desktop Install Error -

i installed ubuntu gnome 16.04 lts , i'm trying install keeweb worked on elementary os... downloaded newest version of keeweb desktop linux (.deb package) , error... looked in google didn't find usefull... can guys help? please :) (reading database ... 191047 files , directories installed.) preparing unpack keeweb.linux.x64.deb ... unpacking keeweb-desktop (1.2.2-1) ... dpkg: error processing archive keeweb.linux.x64.deb (--install): unable create '/opt/keeweb-desktop/content_shell.pak.dpkg-new' (while processing './opt/keeweb-desktop/content_shell.pak'): no such file or directory dpkg-deb: error: subprocess paste killed signal (broken pipe) processing triggers gnome-menus (3.13.3-6ubuntu3.1) ... processing triggers desktop-file-utils (0.22-1ubuntu5) ... processing triggers mime-support (3.59ubuntu1) ... processing triggers shared-mime-info (1.5-2ubuntu0.1) ... errors encountered while processing: keeweb.linux.x64.deb same problem me. execute:

common lisp - Output prompts are on top of each other -

i reading book practical common lisp . typed simple cd database shown in chapter 3. see below. when run (add-cds) program result prompt containing 2 prompts on top of each other (more precisely, 1 prompt after another, on same line): (add-cds) => title: artist: why doing this? program should give me title: prompt first , artist: prompt after i've typed in value title: followed newline. pretty sure typed in program faithfully. how fix this? (defvar *db* nil) (defun make-cd (title artist rating ripped) (list :title title :artist artist :rating rating :ripped ripped)) (defun add-record (cd) (push cd *db*)) (defun prompt-read (prompt) (format *query-io* "~a: " prompt) (force-output *query-io*) (read-line *query-io*)) (defun prompt-for-cd () (make-cd (prompt-read "title") (prompt-read "artist") (or (parse-integer (prompt-read "rating") :junk-allowed t) 0) (y-or-n-p "ripped [y/n]"))) (defun

javascript - How to avoid Meteor helpers run multiple times -

in template have html: <input id="name" type="text" value="{{card.name}}"> <input id="prefix" type="text" value="{{card.prefix}}"> <input id="phone" type="tel" value="{{card.phone}}"> and javascript template.cardform.helpers({ card: function() { return getcard(); } }); var getcard = function() { console.log("i'm here !!!"); return cards.findone({_id: cardid}); } when run app, console.log shows "i'm here !!!" 3 times, , think ecards.findone() executing 3 times. how can avoid calls? i want card object in order fill {{card.name}} , {{card.prefix}} , {{card.phone}} , 1 call getcard() . the card helper executed several times since card present in evaluated template code more once. a pattern avoid duplicate calls in scenarios 1 you're facing use #with : {{#with card}} <input id="name"

firefox - How to close tabs to the right using vimperator? -

i'm using firefox, , installed vimperator. it's great, can't found method close tabs right using hotkey. please tell me how this? thanks. close right/left. place following code in .vimperatorrc file. defines commands :closealltoright , :closealltoleft bindings v > , v < respectively. change bindings desired in lines beginning "map" towards bottom. js <<eof closealltoright = function () { var current = tabs.gettab(); var currentix = tabs.index(current); var nexttab = current.nextelementsibling; var n = tabs.count; var numtoclose = n - (currentix + 1); tabs.remove(nexttab, numtoclose); } closealltoleft = function () { var current = tabs.gettab(); var currentix = tabs.index(current); var firsttab = tabs.gettab(0); var n = tabs.count; var numtoclose = currentix; tabs.remove(firsttab, numtoclose); } eof " close tabs left map v< :js closealltoleft()<cr> " close tabs

Invalid JSON objects from Twitter API in Python -

i'm trying obtain data twitter apis. following code in python (i'm using twitterapi ) api = twitterapi(consumer_key, consumer_secret, access_token_key, access_token_secret) r = api.request('search/tweets', {'q':'pizza'}) item in r: print(item) the code works , prints result. however, aren't valid json objects. actually, contains additional "u" character, example: {u'contributors': none, u'truncated': false, u'text': u'rt @pizzaminati: smile.\nyour laugh.\nyour crust.\nyour sauce.\nyour cheese.\nyour toppings.\nyour jokes.\nyour weird faces.\nyour teasing.\npi\u2026'... i've worked twitter libs in objective-c , never responds strange results that. can show me how valid json objects (i've tried twython , got same result)? , best way parse json objects in python? thank you. i'm assuming you're using python 2.x this notation python's way of displaying unico

node.js - Writing multiple files asynchronously -

while trying understand event loop, wrote quick snippet test assumptions. no surprise, wrong! import fs 'fs' let buffera = new buffer(1e+9) buffera.fill(0) let bufferb = new buffer(1e+0) bufferb.fill(0) let filea = fs.opensync('filea', 'w') let fileb = fs.opensync('fileb', 'w') fs.write(filea, buffera, 0, buffera.length, (err) => { console.log(err || 'wrotea')}) console.log('started writing a..') fs.write(fileb, bufferb, 0, bufferb.length, (err) => { console.log(err || 'wroteb')}) console.log('started writing b..') i hoping both files written asynchronously (i.e., fileb finishes first), output follows: started writing a.. started writing b.. wrotea wroteb with delay before wrotea shown. while fs.write seems operate asynchronously code (i.e., logs written first) seems can have 1 file writing @ time? per ben noordhuis on github issue opened this : libuv serializes disk writes o

ios - Background Image overlaps Refresh Control -

in xcode 7.1, have used refresh control feature of tableview. have used following code set image background uiimageview *tempimageview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"image.png"]]; [tempimageview setframe:self.tableview.frame]; self.tableview.backgroundview = tempimageview; this image overlaps activity indicator on app can't see if working. there way put activity indicator on top? thanks use line self.tableview.backgroundcolor = [uicolor colorwithpatternimage:[uiimage imagenamed:@"image.png"]]; instead of using self.tableview.backgroundview = tempimageview; note: but uiimage size should greater/equal uitableview size

Creating an independent set from a graph in Alloy 4.2 -

i've created test graph try , create independent set from. know , independent set set of vertices aren't connected, i'm not sure how accomplish in alloy 4.2. here's have: abstract sig vertex { e: set vertex -- e edge relation } -- test graph has vertices a, b, c, d, e, f 1 sig a, b, c, d, e, f extends vertex { } pred independentset[e: vertex->vertex, s: set vertex] { --code here? } pred show { -- setting edge relation (a->a + a->b + a->c + a->d) + (b->a + b->b + b->c + b->e) + (c->a + c->b + c->c + c->f) = e } run show 6 all i, j: s | not -> j in e that's answer put, think it's sort of correct , gives instance. think it's missing point not sure how express it. hope gives idea!

ios - Calling WCF (on Azure) from Swift 2.0 fails with status code 400 -

This summary is not available. Please click here to view the post.

javascript - jqplot.dateAxisRenderer.js X-Axis sort with 2hour parameters and tooltip -

i have use jqplot-dateaxisrenderer-js plugin , have on x axis sorting 0h 2h 4h 6h 8h 10h 12h 14h 16h 18h 20h 22h 24h , on y axis sorting bandwidth....and need show in tooltip us_ch2 (channel number corresponds data returned server). data returned server this: var prevyear = [ ["2011-08-02 00:00:00 us_ch1",398], ["2011-08-02 06:00:00 us_ch2",255.25], ["2011-08-02 12:00:00 us_ch3",263.9], ["2011-08-02 18:00:00 us_ch4",154.24], ["2011-08-02 23:00:00 us_ch5",210.18], ["2011-08-02 24:00:00 us_ch6",210.18]]; var curryear = [ ["2011-08-02 00:00:00 us_ch1",796.01], ["2011-08-02 06:00:00 us_ch2",510.5], ["2011-08-02 12:00:00 us_ch3",527.8], ["2011-08-02 18:00:00 us_ch4",208.48], ["2011-08-02 24:00:00 us_ch5",420.36]]; as can see have prevyear (that yellow in graph) , curryear (t

ios - UITableView with autolayout not smooth when scrolling -

Image
i'm using xib files design cells in uitableview. use dequeue mecanism, instance : let cell = tableview.dequeuereusablecellwithidentifier("articlecell", forindexpath: indexpath) as! articletableviewcell . precalculate row height in viewdidload of viewcontroller method func tableview(tableview: uitableview, heightforrowatindexpath indexpath: nsindexpath) -> cgfloat returns instantly right value. of works. in uitableviewcell, i'm using many dynamic height labels (lines = 0). layout : i don't use transparent background, subviews opaque specified background color. checked color blended layers (everything green) , color misaligned images (nothing yellow). here cellforrowatindexpath method : func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let tableviewsection = tableviewsectionatindex(indexpath.section) let tableviewrow = tableviewsection.rows.objectatindex(indexpath.row) as! tablev

python - Obtaining widget values in tkinter -

how refer widget values in following code.here have added widgets calling methods in app class different frames.next,i want access values in widgets(which user enters) of frames @ same time.but not able figure out how should refer them , access values! class myapp(): def __init__(self,parent): self.parent=parent self.container=frame(self.parent) self.container.pack() self.tab1=button(self.container,text='tab1',command=self.tab1click) self.tab2=button(self.container,text='tab*emphasized text*2',command=self.tab2click) self.tab1.pack() self.tab2.pack() def tab1click(self): top=toplevel() self.container1=frame(top) self.add_widget1(self.container1)#self.add_widgeti(parent) method in myapp() class add widget frame self.add_widget2(self.container1) self.add_widget3(self.container1) self.container1.pack() def tab2click(self): top=toplevel()

Wilcox.test between data frames in R -

i want apply wilcox.test each row of 2 dataframes in r. instance, row 1 in df1 , row 1 in df2, see if differ significantly. have hundreds of rows , expect hundreds of p-values outcome. there 105 columns. not quite sure how write command test each of row pairs, since there hundreds of them. appreciated! using following data example: #2 numeric data.frames (all columns numeric) #5 rows , 100 columns set.seed(5) df1 <- as.data.frame(matrix(runif(500), nrow=5, ncol=100)) df2 <- as.data.frame(matrix(runif(500), nrow=5, ncol=100)) solution #a single lapply enough run wilcox test each row lapply(1:nrow(df1), function(i) { #you run wilcox.test each pair of rows , return p.value wilcox.test(as.numeric(df1[i, ]), as.numeric(df2[i, ]))$p.value }) output: > lapply(1:nrow(df1), function(i) { + wilcox.test(as.numeric(df1[i, ]), as.numeric(df2[i, ]))$p.value + }) [[1]] [1] 0.8690001 [[2]] [1] 0.1390142 [[3]] [1] 0.7479788 [[4]] [1] 0.5340455 [[5]] [1] 0.8459806

ios - Swift - Saving user data using NSKeyedArchiver, getting error on conversion to NSArray -

so have array of custom objects. when try save array nsuserdefaults, have archive them. here doing archive array of custom objects : override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { //3 var allmessages = defaults.objectforkey(userdefaultsmesssagekey) as! [addmessageviewcontroller.harasstext] var amessage = addmessageviewcontroller.harasstext(phonenumber: 0, message: "1", frequency: 1, active: 1) allmessages.append(amessage) savemessage(allmessages) return (allmessages.count) } func archivemessage(message:[addmessageviewcontroller.harasstext]) -> nsdata { let archivedobject = nskeyedarchiver.archiveddatawithrootobject(message nsarray) return archivedobject } func savemessage(messages: [addmessageviewcontroller.harasstext]) { let archivedobject = archivemessage(messages) defaults.setobject(archivedobject, forkey: userdefaultsmesssagekey) defaults.synchronize() } func retriev

python - Best practice for TextInput validation in kivy/kv -

i'm designing gui android kivy. there many textinput-fields, of them need kind of validation. i've found far is, on_text_validate allow plausibility checks, if user leaves field enter, case in android-environment. how can achieve checks if user sets focus widget tapping? doing (allways) on_text seems bit weird me, maybe it's possible. simple example: how make sure user able insert integers , value in definite range? other question ask: how possible deactivate textinput depending on value of previous inputs or set focus appropriately? think these standard tasks in gui-programming , i'm bit confused on how manage these in kivy - appreciated!

docusignapi - Document Templates - Roles Set to In person or email signing -

i have created system use document template create new envelope. the system has tabbed ui , iframe fetches new urls docusign api every time tab changed, , when url expires. my problem is now, clients either sign in-person or sign via email. after reading docs, don't see way change in-person email signer after envelope has been created. is correct? is possible set whether role in-person or email sign @ time of envelope creation, without affecting original template? if not possible, best option create template duplicate fields both in-person , email signing, , use appropriate ones based on case? if need change in-person signer remote signer, or vice-versa, or other recipient type recipient type have 2 options: perform envelope correction remove add recipient in-process envelope different type. for option #1, using envelope correction can edit things recipients, tabs, , documents if have not been signed yet. make following api call request correction

html - Can we perform multiple transformations on an element through different animations? -

in css apply multiple transformations same element in 1 rule must written this: .selector{ transform:translatey( *value* ) scale( *value*) rotatez(*value*) etc. how add multiple transformations in multiple animations? example: @import 'https://necolas.github.io/normalize.css/latest/normalize.css'; /* //////////////////////////////// initial //////////////////////////////// */ html, body{ height:100% } body{ background:#eee } #btncont{ display:block; width:100px; height:100px; margin:0 auto; position:relative; transform:translatey(-50%); top:50%; perspective:1000px } #btn { width:100%; height:100%; background:#333; color:#eee; border:0; outline:0; text-transform:uppercase; transform:rotatex(93deg) translatex(0); transform-origin:bottom } /* //////////////////////////////// __anim_ //////////////////////////////// */ .rotup{ animation-name:rotateup; animation-duration:1s; animation-fill-mode:forwards } .movup{ animation-name:moveup; an