Posts

Featured post

java - Simplifying Retrofit2 and Rxjava2 chained calls to use a Single instead of Observable in the final result -

what want accomplish update calls @ end of all, when subscribe, return single , not observable because ever receive 1 result due nature of combining calls, had move observable take advantage of observable methods join results single result. the issue having trying figure out how use results 1 call , combine result 1 , return combination of both. the sequence of calls follows: upload list of logos receive result of logos upload more detailed data of logos uploaded. use list of results got , use in new request make create book. receive newly create book response book more auto generated data get current author/user info ( forced make observable because single doesn't work .zip operator ) use author result , book details create pojo object. return final result. currently, returned observable there ever 1 entry returned makes little sense return observable. not sure how can transform return single appreciate suggestions. this code have right now. objects , such e...

Processing a job in background with Haskell Servant -

i'm building facebook messenger chatbot can process long running jobs (that may fail), , need respond 200 facebook before job completed. i've tried using pipes, after while realized didn't know doing. how can achieve this? thanks in advance edit: epsilonhalbe pointed, question broad. try make more clear. right have this: myhandler :: message -> handler text myhandler msg = dosomestuff msg return "ok" the problem "dosomestuff" long proccess , can give timeout error. want achieve respond "ok" before process completed. http code 202 accepted. i thinking sending message mailbox solution. more idiomatic way doing it. i use hworker @ work -- sending batch emails. make instances of job , tojson , , fromjson long-running job, use queue whenever want start job. you'll need redis keep track of state of jobs use hworker.

python 3.x - How to add columns to a tkinter.Listbox? -

i trying add these panda columns listbox , read this: new zealand nzd united states usd etc. i using pandas data .csv, when try , use loop add items list box using insert error nameerror: name 'end' not defined or nameerror: name 'end' not defined using code: def printcsv(): csv_file = ('testcur.csv') df = pd.read_csv(csv_file) print (df[['country','code']]) your_list = (df[['country','code']]) item in your_list: listbox.insert(end, item) you turn csv file dictionary, use combined country , currency codes keys , codes values, , insert keys listbox . code of current selection, can this: currencies[listbox.selection_get()] . listbox.selection_get() returns key use currency code in currencies dict. import csv import tkinter tk root = tk.tk() currencies = {} open('testcur.csv') f: next(f, none) # skip header. reader = csv.reader(f, delimiter=',') co...

regex - Display content of page in subfolder but preserve URL -

i have website people can purchase custom pages. main part of website (the main pages) in root directory, , custom pages located in folder / subdirectory. let's main pages 1 , 2 in root directory, , page 3,4,5,6,etc. (the custom pages) in subdirectory "u". website.com/page1 brings me website.com/page1, website.com/page2 brings me website.com/page2 now, pages in subfolder can accessed this: website.com/page3 gives me 404 error, website.com/u/page3 brings me website.com/u/page3 what want this: website.com/page3 brings me website.com/page3 displays content of website.com/u/page3. in other words, want have pages 3,4,5,6,etc., in folder " u " not want have " u " in url. user should able type in directly website.com/page3 , display contents of website.com/u/page3 , url must still remain website.com/page3 this should not affect page 1 , page 2 (which located in root directory). i've tried several pieces of code answers similar questi...

What does the single colon mean in this PHP statement? -

it used slimframework. first argument router pattern , second should callback. teacher gave class cdapi inside media namespace. understand ::class returns qualified class name resolution, concatenated part don't understand: ":getone" . getone function never saw colon used that, mean? $app->get('/super', \cdapi::class . ':getone'); slim framework has routing feature called "container resolution", , that's you're seeing when see single colon. see slim docs: https://www.slimframework.com/docs/objects/router.html you not limited defining function routes. in slim there few different ways define route action functions. in addition function, may use: container_key:method class:method an invokable class container_key this functionality enabled slim’s callable resolver class. translates string entry function call. their example: $app->get('/', '\homecontroller:ho...

angular - How to change Yeoman generator templates? -

i'm trying use old yeoman generator ( angular-crud ) create frontend rest api, need change templates , that's not working. it going well; found templates, changed them, saw changes - of sudden don't see more changes when generate. original author not responding , it's late find else. i've restarted computer several times same old code keeps being generated. questions, besides obvious general plea help, are: what's best way change generator's templates? does yeoman sort of disk-based caching might surviving restarts , causing old code generated. if #2 yes, how flush cache new code gets used?

google cloud endpoints v2 - GTLRObject not found -

Image
i trying link google cloud endpoint library ios application. using google cloudendpoint framework 2(migrating framework version 1) , compiling source files directly application. . when try build application error "gtlrobject not found". created google cloud endpoint ios client library using discovery document , service generator described here. https://github.com/google/google-api-objectivec-client-for-rest my application-bridging-header.h file this #ifndef myapp_bridging_header_h #define myapp_bridging_header_h #import "gtlrcloudendpoint.h" #endif /* myapp_bridging_header_h */ my header search path includes following - i have google cloud endpoints in lib my gtlrcloudendpoint.h has following code // note: file generated servicegenerator. // ------------------------------------------------------------------ ---------- // api: // cloudendpoint/v1.0 // description: // api #import "gtlrcloudendpointobjects.h" #import "gtl...