Posts

Showing posts from May, 2014

Axibase Time Series Database - report of hits per hour -

i using axibase time series database community edition, version 11499, store count every time hit particular web service. how can report of hits per hour last 7 days? you can use of of 2 built-in aggregation functions compute rate of change on period of time: delta , counter. here examples: example 1 example 2 as can see, difference in how these functions handle resets. counter function works particularly continuously incrementing metric might reset (drop 0 or negative value) in case of data type overflow or restart.

x86 - How to compile Tensorflow with SSE4.2 and AVX instructions? -

this message received running script check if tensorflow working: i tensorflow/stream_executor/dso_loader.cc:125] opened cuda library libcublas.so.8.0 locally tensorflow/stream_executor/dso_loader.cc:125] opened cuda library libcudnn.so.5 locally tensorflow/stream_executor/dso_loader.cc:125] opened cuda library libcufft.so.8.0 locally tensorflow/stream_executor/dso_loader.cc:125] opened cuda library libcuda.so.1 locally tensorflow/stream_executor/dso_loader.cc:125] opened cuda library libcurand.so.8.0 locally w tensorflow/core/platform/cpu_feature_guard.cc:95] tensorflow library wasn't compiled use sse4.2 instructions, these available on machine , speed cpu computations. w tensorflow/core/platform/cpu_feature_guard.cc:95] tensorflow library wasn't compiled use avx instructions, these available on machine , speed cpu computations. tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful numa node read sysfs had negative value (-1), there must @ least 1 numa nod

sql server - Non Deterministic Function -

sql server telling me function non deterministic. confused because given date x return same. dateadd(d, 13 - datediff(d, '9/23/10', servicedate) % 14, servicedate) convert(date, dateadd(d, 13 - datediff(d, convert(date, '9/23/10',101), servicedate) % 14, servicedate),101) when refer date data type string literals in indexed computed columns in sql server, recommend explicitly convert literal date type want using deterministic date format style. list of date format styles deterministic, see cast , convert. expressions involve implicit conversion of character strings date data types considered nondeterministic, unless database compatibility level set 80 or earlier. because results depend on language , dateformat settings of server session. example, results of expression convert (datetime, '30 listopad 1996', 113) depend on language setting because string '30 listopad 1996' means different months in different la

c# - Returning newly-added record in EFcore -

i doing prototype using efcore , struggling way return object i've added collection on entity. for example: public songleader addsongleader(int congregationid, songleader songleader) { var congregation = _dbcontext.congregations.include(c => c.songleaders).firstordefault(c => c.id == congregationid); congregation.songleaders.add(songleader); _dbcontext.savechanges(); //todo: return recently-added record... return null; } a congregation has collection of songleaders . once save context, though, i'm not sure of way return new instance. id of songleader generated when it's inserted db can't return object passed method... is there strategy or baked ef in scenario? you can return songleaders caller or integer value return savechanges() method. depend on requirements you. from controller can use createdatroute method return response. here tutorial can read. mention http recommendation rest api.

javascript - unable to delete google contact from nodejs -

from offical google contact api docs: deleting contacts to delete contact, send authorized delete request contact's edit url. the url of form: https://www.google.com/m8/feeds/contacts/ {useremail}/full/{contactid} simple request delete returns 401 error response. var url = "https://www.google.com/m8/feeds/contacts/"+req.token.body.sub.agent.agentid+"/full/"+result.googleid; unirest.delete(url) .header({ 'authorization': 'accesstoken='+req.token, 'if-match': '*', }) .timeout(60000) .end(function (res1) { console.log('delete success... ', res1); res.send(res1); }); note: tried 'authorization': 'bearer '+req.token, still same issue fixed it. problem access token (req.token) sending. sending object instead of actual token string

php - Get sum of all the data inside an multidimensional array recursively : -

i've array : array ( [self] => folder [my_data] => array ( ) [18] => array ( [self] => folder aa [my_data] => array ( [0] => stdclass object() ) [20] => array ( [self] => folder aa [my_data] => array ( [0] => stdclass object() ) [21] => array ) i want total number of records in of present in ' my_data '. i've created function call recursively add count : function getdocumentcount($tab, $count = 0) { foreach ($tab $subtabkey => $subtabvalue) { if ($subtabkey == 'my_data') { $count += count($subtabvalue); } if ( count($tab) > 2 && $subtabkey != 'self' && $subtabkey

css - Hovering all images on a td? -

i want hover images on td or on table . found way came tiring me. way : classed of images 1 one , css'ed them hover. but want shortway instead of this. want group pictures , hover them. images on td or table. how can this? tried <div> td didn't work. help. try this. using > after td in css, apply style img direct child of td . if not direct child can remover > . td>img{ width:100px; display:inline-block; margin:10px; } td>img:hover{ opacity:0.2; cursor:pointer; } <table> <tr> <td class="hoverover"><img src="http://www.chinabuddhismencyclopedia.com/en/images/thumb/b/b8/nature.jpg/240px-nature.jpg"></td> <td class="hoverover"><img src="http://www.chinabuddhismencyclopedia.com/en/images/thumb/b/b8/nature.jpg/240px-nature.jpg"></td> <td class="hoverover"><img src="http://www.chinabuddhismencyclo

functional testing - Meaning of "browser" in Selenium's requested capabilities -

i developing functional tests behat, mink , selenium. have long been perplexed "browser" item included in capabilities object that's created each new session: 02:13:48.592 info - got request create new session: capabilities [{browser=safari, name=behat feature suite, browsername=safari, [...] }] as far can tell, "browsername" has effect - if set "browsername" "safari" , "browser" other value, new session created on node can run safari. so why mink include value? must surely have purpose, haven't found documentation explaining it. a possible answer be: browser , browsername same capability browser use. if using capabilities parametter set desired capabilities use, browsername has priority. if not using capabilities parametter can setup browser name using browser . to better picture please take getconfig method @ arraynode('selenium2') line extension.php located in vendor > behat >

Ruby Code Explanation: Numbers to String using Recursion -

someone shared ruby code on how completed challenge have convert numbers words. solution far simplest read, not understand recursive aspect of it. specifically, in line below... elsif int.to_s.length == 1 && int/num > 0 return str + "#{name}" if return statement breaks code out of loop, why wouldn't code execute , break loop once true? example, when int = 4 , num = 1, prove true , trigger return statement, yet code continues until num = 4. any clarification on aspect of code, general advice understanding solution, helpful. still trying understand recursion. thanks def in_words(int) numbers_to_name = { 1000000 => "million", 1000 => "thousand", 100 => "hundred", 90 => "ninety", 80 => "eighty", 70 => "seventy", 60 => "sixty", 50 => "fifty", 40 => "forty", 30 => "th

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

java - How to create a single war file from multiple dynamic web project -

i want create single war file multiple dynamic web project. example first project's webcontents folder data should merge second project's webcontents folder data. like suppose first project "login.jsp" file , second project "welcome.jsp" file should merge single war file. using eclipse, possible create single war file multiple dynamic web project, if yes please suggest me point regarding same or there way achieve this. you might try using web fragment projects core dynamic web project instead. new web fragment project wizard create meta-inf directory within default java source folder. create resources folder inside of that, , contents available root of deployed web-app. can add , remove fragments deployment using deployment assembly property page on dynamic web project, other kind of java project. see https://blogs.oracle.com/alexismp/entry/web_inf_lib_jar_meta guidance on how works, if don't want dive part of java ee , servlet spe

grails javascript asset executes every page load without even being 'called' -

i need javascript libraries in grails project. read putting file in grails-app/assets/javascripts , calling <asset:javascript src="myjsfile.js"/> way go. however, notice without putting <asset:javascript src="myjsfile.js"/> anywhere in project, file executes every page load... i notice problems seem disappear if remove line in grails-app/javascripts/application.js: //= require_tree . feels i'm doing wrong... i don't understand documentation ( https://grails.org/plugin/asset-pipeline ) enough know i'm doing wrong. know? the //= require_tree . says manifest should include files in directories starting root javascript directory assets. so, when remove it's going no longer pick of javascript files part of manifest. gets included in pages. if want fine grained control on included in manifest you'll have remove existing //= reuire_tree . , specify individual assets or configure plugin ignore javascript entirely (wh

Connect to Dynamics CRM 2016(On-Premise) from Android -

i want integrate android application dynamics crm 2015 online , on-premise. online version connect android app dynamics crm using web api works fine, adal dependency not supported onpremise. there resources show basic steps access microsoft crm on-premise. sample code around same connecting rest endpoint helpful. setup ifd on-premise deployment. authenticate microsoft dynamics 365 web api when use web api dynamics 365 (online) or on-premises internet-facing deployment (ifd) must use oauth described in connect microsoft dynamics 365 web services using oauth. connect microsoft dynamics 365 web services using oauth applies to: dynamics 365 (online), dynamics 365 (on-premises) , dynamics crm 2016, dynamics crm online the recommended authentication api use dynamics 365 web api azure active directory authentication library (adal) , available wide variety of platforms , programming languages. adal api manages oauth 2.0 authentication dynamics 3

python - Celery daemon production cannot import Celery error -

i follow instruction of celery docs. first follow this link create production process , here app code. 1-test_celery/celery.py:- from __future__ import absolute_import import os celery import celery kombu import queue, exchange celery.schedules import crontab import datetime app = celery('test_celery', broker='amqp://jimmy:jimmy123@localhost/jimmy_v_host', backend='rpc://', include=['test_celery.tasks']) # optional configuration, see application user guide. app.conf.update( result_expires=3600, ) if __name__ == '__main__': app.start() 2-test_celery.task.py:- from __future__ import absolute_import test_celery.celery import app import time kombu import queue, exchange celery.schedules import crontab import datetime app.conf.beat_schedule = { 'planner_1': { 'task': 'test_celery.tasks.printtask', 'schedule': crontab(minute='*/1'

XSLT : Value-of select using date attribute -

currently trying pull data csv using value-of select command in xslt. totally new xslt , while trying read values, able string attribute date , number attribute not able to. please find below current code , related output. me how read date/number field csv. code: <cas:label>hr data</cas:label> <cas:property> <cas:key>customerid</cas:key> <cas:value> <xsl:value-of select="a/string[position()=1]"/> </cas:value> </cas:property> <cas:property> <cas:key>reportingperiod</cas:key> <cas:value> <xsl:value-of select="a/string[position()=4]"/> </cas:value> </cas:property> <cas:property> <cas:key>

javascript - button value pass to modal -

i have dynamic table, , in button value store value of each id. need pass id modal , queries in modal. via php. <td><button="type" class="btn btn-success btn-sm" onclick="getnarudzbaid(this)" value="<?php echo $r['id'];?>" data-toggle="modal" id="modal" data-target="#modal_theme_success">pregled <i class="fa fa-play position-right"></i></a></td> <script type="text/javascript"> function getnarudzbaid(object) { var x = $(object).attr("value"); $.ajax({ type: "get", url: "pregled.php", data:{name:x}, success: function(data){ alert("return here if success") } }) } </script> actually want passed value in modal window on same page buttons are. here modal <div

angularjs - Error: $injector:modulerr Module Error in angular1 -

i have implemented ui-router in angular 1 application , configured route state. when try access page, error mentioned in title of post. please find code below. tell me have gone wrong. app.js (function () { "use strict"; var app = angular.module("productmanagement", ["common.services","ui.router"]); }()); config.js (function () { "use strict"; var app = angular.module("productmanagement"); app.config(["stateprovider", function ($stateprovider) { $stateprovider .state("productlist", { url: "/product", templateurl: "app/product/productlistview.html", controller: "productlistcontroller vm" }); }]); } ()); productlistcontroller (function () { "use strict"; angular .module("product

Scaleform Play a live video in texture? -

i know if it's possible play live video, webcam example, in texture in scaleform? thanks. to this, need replace appropriate image inside swf, 1 wraps texture contains video. you need have video texture in texture graphics api using (for example, in directx 11, you'd need id3d11texture2d ). can create scaleform wrapper image around this, using textureimage class. need find resource within swf want replace, , set wrapper image image. finally, need call forceimageupdate on gfx::movie, propagate texture change. id3d11texture2d* videotexture = ...; ptr<gfx::movie> pmovie = ...; ptr<d3d1x::texturemanager> pmanager = ...; ptr<render::texture> scaleformtexture = *pmanager->createtexture( videotexture, imagesize(width, height)); ptr<textureimage> scaleformimage = * sf_new textureimage(image_r8g8b8, scaleformtexture->getsize(), 0, scaleformtexture); imageresource* pimageres = (imageresource*)pmovie->getmoviedef()->getresource("

SQL Server : find break in dates to show unique rows -

i have developed solution problem (i think), , keen see if there better way around this, can't feel there better way. the problem: company name, , move in date shown. company leave, company come in , original company come back. make problem bit tricky, there may rogue dates company in there. best way explain via table: table example what need extract, first time company moved in, until broken different company , on. the code have is: if object_id('tempdb..#tmpdata') not null drop table #tmpdata go create table #tmpdata ( company_name nvarchar(30), date_moved_in datetime, id int identity(1,1), unique_id int ) insert #tmpdata(company_name, date_moved_in) select 'abc ltd','01/01/2017' union select 'abc ltd','01/04/2017' union select 'xyz ltd','01/10/2017' union select 'abc ltd','01/12/2017'; declare @intminid int, @intmaxid int, @strnextcomp nvar

SSIS Execute Package Task - Child package fails when called from Parent package but runs successfully when executed independently -

i have parent package 'a' used call different package 'b' using 'execute package task'. package 'b' called in several other packages , executes correctly, fails every time when called package 'a'. the error message 'task update last run status failed'.

How write declaration for class and namespace with same name in Typescript -

i'm using 3rd party javascript library in format: var myclass = function (name) { this.name = name; } myclass.prototype.greet = function () { window.alert('hello ' + this.name) } i want write typescript declaration this. i've got sort of thing: declare class myclass { constructor(name: string); greet(): void; } this compiling fine , when want refer types working expected. i'm having problems trying use class implementation. using way, compiles , runs, no compile time checking const myclass = (require('./myclass') any).myclass; const = new myclass('bob'); //a using way compiler error const myclass = (require('./myclass') any).myclass myclass; const = new myclass('bob'); //cannot use 'new' expression type lacks call or construct signature. using way compiler error import './myclass'; const = new myclass('bob'); //duplicate identifier in myclass.d.ts i try this d

java - Spring-boot using RestTemplate -

i'm trying use resttemplate class spring framework hit restful endpoint. when debug program, every time hit following statement final resttemplate resttemplate = new resttemplate(); , following error appears in console. connected target vm, address: '127.0.0.1:50055', transport: 'socket' disconnected target vm, address: '127.0.0.1:50055', transport: 'socket' exception in thread "main" java.lang.noclassdeffounderror: org/springframework/beans/fatalbeanexception @ org.springframework.http.converter.json.mappingjackson2httpmessageconverter.<init>(mappingjackson2httpmessageconverter.java:57) @ org.springframework.http.converter.support.allencompassingformhttpmessageconverter.<init>(allencompassingformhttpmessageconverter.java:61) ... here entire code // set endpoint final string url = "https://xxxxxxx/api/yyyyyy"; // set content-type header final httpheaders requestheaders = new httpheaders(); requestheaders.se

typescript - Using Observable of array in angular 2 -

i have following code: items():observable<menuitem[]>{ let items: menuitem[] = [ { label: "incidents_dialog_tab_actions_measures_defined" }, { label: "incidents_dialog_tab_actions_measures_with_supplier_agreed" }, { label: "incidents_dialog_tab_actions_measures_are_implemented" }, { label: "incidents_dialog_tab_actions_measures_are_effective" } ]; return observable.from(items).mergemap( obj => this.commonmodel.translate(obj.label)).buffercount(items.length); } and this.commonmodel.translate(obj.label) returns observable. in template use [model]="items | async" , items should observable of array contains translation in format { label: translation} . how can achive ? you need add .map() this.commonmodel.translate continue transforming returned translation , give desired shape: observable.from(items) // call translat

c++ - How to get OpenGL VAO related functions to compile under Emscripten? -

i'm trying port code gl 3.x compile , work emscripten, though em++ doesn't find glgenvertexarrays() , related funcs (i don't know why, maybe not part of gles api), so, following example code, reached possible solution: #ifdef __xf_target_opengles #include <dlfcn.h> typedef void(*glgenvertexarraystype) (glsizei n, gluint *arrays); glgenvertexarraystype glgenvertexarraysfunc = nullptr; #define glgenvertexarrays glgenvertexarraysfunc typedef void(*gldeletevertexarraystype) (glsizei n, gluint *arrays); gldeletevertexarraystype gldeletevertexarraysfunc = nullptr; #define gldeletevertexarrays gldeletevertexarraysfunc typedef void(*glbindvertexarraytype) (gluint array); glbindvertexarraytype glbindvertexarrayfunc = nullptr; #define glbindvertexarray glbindvertexarrayfunc #endif // __xf_target_opengles and later... void vao::create() { #ifdef __xf_target_opengles if (glgenvertexarrays == nullptr && !mvaochecked) { glgenvertexarrays = (glgenve

php - CakePHP: buildStatement() and behaviors -

in 1 of models need sql query of find() request , combine other sql queries before fetching data db. in case: <sqlquerya> , <sqlqueryb> (from different models) need combine <sqlquerya> union <sqlqueryb> . the creation of single queries possible pdosource.buildstatement() , partly. problem comes when model uses behavior (e.g. translatebehavior). in case, buildstatement returns sql query before behavior has handled query. query adjustments of behavior not visible in query of buildstatement . query returned different query used find() request. i had different ideas tried implement, without success. therfore question: is possible manually call behaviors beforefind() method correct result? if yes, how? if not: there way paginate data of different models not associated each other?

python - Website Scraping with BeautifulSoup : TypeError: 'NoneType' object is not callable -

i absolute beginner. try use beautifulsoup , scrape website. html, divs have class content_class . here attempt: import requests beautifulsoup import beautifulsoup #request page , parse html url = 'mywebsite' response = requests.get(url) html = response.content #beautiful soup soup = beautifulsoup(html) soup.find_all('div', class_="content_class") this not work however. get: traceback (most recent call last): file "scrape.py", line 11, in soup.find_all('div', class_="content_class") typeerror: 'nonetype' object not callable what doing wrong? you using beautifulsoup version three , appear following documentation beautifulsoup version four . element.find_all() method available in latest major version (it called element.findall() in version 3 ). i urge upgrade: pip install beautifulsoup4 and from bs4 import beautifulsoup version 3 has stopped receiving updates in 2012; sever

Rails - passing a variable to string interpolation -

this what's in controller. i'm using devise , i'm trying show take user email , pass find specific family can display unique family controlled user. i'm having issue string interpolation. if hard code email query works fine. want dynamic. help! home_controller.rb user_email = current_user.email @unique_family = unit.where(:accountowner => '#{user_email}') for string interpolation need use double quotes "" , like: name = 'some name' puts "hello #{name}" # => "hello name" you see there name defined within single quotes, using puts , interpolating "hello" string name variable, necessary use double quotes. to make where query can try with: user_email = current_user.email @unique_family = unit.where(:accountowner => user_email) in such case isn't necessary interpolate user_email "nothing" or trying convert string, unless want make sure what's being passed st

css - Font Awesome icons not displaying on the VPN -

Image
i noticed font-awesome icons not displaying when users access website via vpn. if accessing website onsite, everything's working fine , work perfectly. the same problem doesn't occur other jquery , bootstrap cdns if on same page , access via vpn. problem occurs font-awesome css. have tried both javascript , css version , both give me same error. happens on browsers too. my vpn changes links <link href="https://portal.mysite.ac.uk/ui/1.11.4/themes/ui-lightness/,danainfo=code.jquery.com,ct=css+jquery-ui.css" rel="stylesheet" type="text/css" /> <link href="https://portal.mysite.ac.uk/,danainfo=use.fontawesome.com,ssl+4b650a8101.css" rel="stylesheet"> and shows me error in browser below: so, if guys ever encountered kind of problem, please let me know how can around it? here example of fa usage: <a title="view application" class="fa fa-folder-open-o" href="/applicat

javascript - Multiply the object properties -

someone tell me how multiply object's properties? need object multiplied count of property price , put together var menu = [ { "id": 5, "price": 13, "count": 2 }, { "id": 8, "price": 7, "count": 3 }, { "id": 9, "price": 17, "count": 1 } ] var sum = 0; (var key in menu) { (var key1 in menu[key]) { //console.log(key1); if (key1 == 'price'){ price += menu[key][key1]; } } } but have no idea how multiply count property suppose want calculate sum var menu = [ { "id": 5, "price": 13, "count": 2 }, { "id": 8, "price": 7, "count": 3 }, { "id": 9, "price": 17, "count": 1 } ];

.net - Web API Swagger documentation export to PDF -

in according of documentation ( http://swagger.io/open-source-integrations/ ) there plugin java export swagger documentation pdf , have documentation cant see regarding .net . my question is: there simile java plugin swagger2markup, swagger2markup-gradle-plugin in .net or other way export pdf documentation web api? thanks

Why Android Studio generate signed APK failed? -

when import weibosdkcore_3.1.4.jar , libweibosdkcore.so , building release .apk file doesn't work. weibosdkcore_3.1.4.jar in path: app/libs/ libweibosdkcore.so in path: app/src/main/jnilibs/ build.gradle: apply plugin: 'com.android.application' apply plugin: 'android-apt' android { compilesdkversion 24 buildtoolsversion '24.0.2' uselibrary 'org.apache.http.legacy' defaultconfig { applicationid "com.aaaa.bbbb" minsdkversion 19 targetsdkversion 24 versioncode 20161019 versionname "2.1.1" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } packagingoptions { exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' exclude 'meta-inf/ser

javascript - JQuery datatable with table-layout fixed and colresizable feature -

i'm using jquery datatable , trying apply on table both features: cut long strings in table cells enable jquery colresizeable feature resizemode:'overflow' but when defining colresize mode overflow- long rows not cut anymore.. table css: #teststoexectable { table-layout: fixed; float: left; } #teststoexectable.datatable thead th, #teststoexectable.datatable thead td, #teststoexectable.datatable tbody td { padding: 4px 4px; border-bottom: 1px; margin: 0px; min-width:20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } colresizable code: $('table').colresizable({ livedrag: true, resizemode:'overflow', disabledcolumns: [0,1] } is there way use both features? actually point if hiding cells overflow uses 'table-layout: fixed' while columns resizing mode 'overflow' conflicts.. thanks lot...

java - Getting error when selenium script run in background and executing switching from one tab to another -

exact error message : exception in thread "main" java.lang.indexoutofboundsexception: index: 1, size: 1 @ java.util.arraylist.rangecheck(arraylist.java:653) code snippet: arraylist<string> tabs = new arraylist<string>(driver.getwindowhandles()); driver.findelement(by.cssselector("body")).sendkeys(keys.control + "t"); driver.switchto().window(tabs.get(1)); driver.get(url2); you getting exception because populating tabs arraylist 1 tab. if want browse url2 in new tab use below code snippet: driver.findelement(by.cssselector("body")).sendkeys(keys.control + "t"); arraylist tabs = new arraylist(driver.getwindowhandles()); driver.switchto().window(tabs.get(0)); driver.get(url2);

flip - Flipping specific cards onClick in a memory game -

so working on memory game , got cards flip nicely, whenever click flip one, flips them all. rather use methos not giving each , every card id if possible...please help. html <section class="cardscontainer"> <div class="card" onclick="flip()"> <div class="front"><img src="../images/backsideblue.png"></div> <div class="back"><img src="../images/cookie.jpg"></div> </div> </section> <section class="cardscontainer"> <div class="card" onclick="flip()"> <div class="front"><img src="../images/backsideblue.png"></div> <div class="back"><img src="../images/cookie.jpg"></div> </div> </section> <section class="cardscontainer&

Flask Celery update_state from inside another function -

i'd update state of celery task function. here's have now: the route @app.route('/my-long-function', methods=['post']) def my_long_function(): param1 = request.form['param1'] param2 = request.form['param2'] task = outside_function.delay(param1, param2) return task.id celery task - starts some_python_script.handle in background @celery.task(name='outside_function') def outside_function(param1, param2): app.app_context(): some_python_script.handle(param1, param2) some_python_script.handle: def handle(param1, param2): param1 + param2 # many, many different things ideally, i'd able self.update_state celery task can request status app, so: some_python_script.handle (ideally): def handle(param1, param2): param1 + param2 # many, many different things self.outside_function.update_state('progress', meta = {'status':'progressing'}) check progress

ios - expectationForPredicate doesnt work as expected -

using xcuielement+extension : private func waitforexpectations() { mysoberroommateuitests.shared?.expectation(for: nspredicate(format: "exists == true"), evaluatedwith: self, handler: nil) mysoberroommateuitests.shared?.waitforexpectations(timeout: 10) { error in if error != nil { mysoberroommateuitests.shared?.recordfailure(withdescription: "failed find \(self) 5 seconds", infile: #file, atline: #line, expected: true) } } } class mysoberroommateuitests: xctestcase { static var shared: xctestcase? ...//my uitests } and doesn't work. element exists, prints "failed find..." wrong?

macros - How to autofill OpenOffice Math formula editor in OOo Calc? -

i using openoffice calc spreadsheet formulas psuedo-random numbers generate arrays of arithmetic problems can update creating new worksheets (i'm teacher) problems output formula mark-ups in string form. ooo math formulas use these string commands typed editor display nicely formatted maths expressions. i can next step manually: 1) go source cell , copy string mark-up clipboard 2) select target cell , clear existing contents , objects 3) create new math object anchored target cell 4) open math editor window , paste in mark-up string 5) exit math editor window , return cursor source cell result: nice maths expression of given arithmetic problem. i need able entire columns of source cells on various sheets. ...even better, add listener dynamically update sources updated. i found code here: cell content inside formula achieves fixed pair of cells, despite best efforts, have had admit defeat - generalising code beyond expertise! the absolute ideal macro func

.net - PayPal:DoDirectPayment is returning null -

pay pal api, paypalapiasoapbinding.dodirectpayment (dodirectpaymentreq) returning null, here details endpoint , credit card number details endpoint url: https://api-3t.sandbox.paypal.com/2.0/ credit card: visa (4012888888881881) below test accounts( https://www.paypalobjects.com/en_us/vhelp/paypalmanager_help/credit_card_numbers.htm ) regards, satya

json - How do I get the url of the image tag in Java? -

Image
the imageurl is: the jsonobject: { "type":"table", "subtype":"attribute_list", "doc":"https://api-v2.swissunihockey.ch/api/doc/attribute_list", "data":{ "context":null, "headers":[ { "text":"name", "key":"teamname", "long":"name", "short":"name", "prefer":"fit" }, { "text":"logo", "key":"logo_url", "long":"logo", "short":"logo", "prefer":"fit" }, { "text":"webseite", "key":"website_url", "long":"webseite&

ios - Randomly getting Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.” -

i'm randomly getting error domain=nsurlerrordomain code=-1005 “the network connection lost.” try again , works. different devices different networks. happens when using wifi on device or simulator. issue? typically, means network connection being lost. when happens, ask reachability tell when it's time try again, try again. iirc, can occur programming errors cause servers drop connection immediately, such trying pass request body in request, may or may not remembering correctly.

javascript - Scrollmagic Parallax sections and pinning combined -

i trying create page combines both: http://scrollmagic.io/examples/advanced/parallax_sections.html and http://scrollmagic.io/examples/basic/simple_pinning.html so scroll down, top of parallax parent attached bottom of spacer s1. when boundary between bottom of spacer , top of parallax parent reaches top of page, top of parallax parent pins top of page. after this, next spacer s1 (with attached parallax parent same first) should slide on original pinned parallax parent. in same first, top of second parallax parent should pin top of page third pair can slide on , etc. many times sis necessary. here codepen set up: http://codepen.io/webbuild_steve/pen/jrvkea // build scenes new scrollmagic.scene({triggerelement: "#parallax1"}) .settween("#parallax1 > div", {y: "100%", ease: linear.easenone}) .addindicators() .addto(controller);

ios - Using TableView instead of ScrollView -

for creating login page or that, in autolayout case use tableview instead of using scrollview in viewcontroller. indexpath majority cases reuse customcell. entirely different items use customcell. since cell class increasing in project. dont know practice. please share opinion increase overall performance , least memory usage application. putting uitableview in views not practice every time. recommend using scrollviews , content views inside them in pages login. use tableviews in screens show repeated contents. have seen codes generated through tableview controllers in every page. dont in way. better go scrollviews.. method far have seen.

playframework - Play JSON Reads[T]: split a JsArray into multiple subsets -

i have json structure contains array of events. array "polymorphic" in sense there 3 possible event types a , b , c : { ... "events": [ { "eventtype": "a", ...}, { "eventtype": "b", ...}, { "eventtype": "c", ...}, ... ] } the 3 event types don't have same object structure, need different reads them. , apart that, target case class of whole json document distinguishes between events: case class doc( ..., aevents: seq[eventa], bevents: seq[eventb], cevents: seq[eventc], ... ) how can define internals of reads[doc] json array events split 3 subsets mapped aevents , bevents , cevents ? what tried far (without being succesful): first, defined reads[jsarray] transform original jsarray jsarray contains events of particular type: def eventreads(eventtypename: string) = new reads[jsarray] { override def reads(json: jsvalue): jsresult[jsarray] = json