Posts

How to get arguments for 2 different objects from the command line when there is a naming conflict in Python argparse -

i have 2 classes, , b, each have own argument parser defined (using argparse) want add functionality a, calls class b. doing using composition (i.e has instance of object b) i asked here how combine 2 arg parse objects, argparsea include arguments in argparseb in question can 2 python argparse objects combined? problem follows: both , b have arguments same names. but- need 2 different values entered user (ie. argpasea.val1 needs values argparsea.val1 , argparseb.val1) (the obvious solution renaming val1 in either argparsea or argpaseb, there on 50 scripts inherit class a, , 50 scripts inherit class b, want changes , b minimal possible.) i thought of adding new , differently named argument argpasea called val2, can passed argparseb val1. my question is- proper way of doing such conversion or arguments argparsea argparseb? or there better way design this? i'm going guess trying parents suggestion, , illustrate might going on. if you've adopted approach m...

meteor - ReportProcessingStatus": "_CANCELLED_" while try to get Orders Report in Amazon MWS -

i want orders details whatever time are. trying generate order report of amazon mws via report api , sending enumeration "_get_flat_file_orders_data_" or other report enum hit api requestreport gives in response reportrequestinfo": { i20160628-13:14:55.462(5.5)? "reporttype": "_get_flat_file_orders_data_", i20160628-13:14:55.462(5.5)? "reportprocessingstatus": "_submitted_", i20160628-13:14:55.462(5.5)? "enddate": "2016-06-28t07:44:54+00:00", i20160628-13:14:55.462(5.5)? "scheduled": "false", i20160628-13:14:55.463(5.5)? "reportrequestid": "50692016981", i20160628-13:14:55.463(5.5)? "submitteddate": "2016-06-28t07:44:54+00:00", i20160628-13:14:55.463(5.5)? "startdate": "2016-06-28t07:44:54+00:00" i20160628-13:14:55.463(5.5)? } i20160628-13:14:55.463(5.5)? }, bu...

php - How can I set a catch all route as the very last route in Laravel -

i'm building basic cms seo slugs, want catch @ end of routes slug. @ end of routes file added: route::get('/{page?}', ['as' => 'page', 'middleware' => 'web', 'uses' => 'pagecontroller@index']); which works fine, until added laravel file manager , has routes of own. these routes added after of routes in main routes file. catch picks meant file manager. how can load other routes, including in other vendor folders, before running catch all? there way can state route must not match route prefixed laravel-filemanager ? i've not been able find on in laravel documentation or through google. as requested here app providers: 'providers' => [ /* * laravel framework service providers... */ illuminate\auth\authserviceprovider::class, illuminate\broadcasting\broadcastserviceprovider::class, illuminate\bus\busserviceprovider::class, illuminate\cache\cacheserviceprovider::...

javascript - Structuring a Vue + Vuex project -

i kind of confused here on place global functions. in lot of examples main.js file points app component , placed somewhere within html. workflow fine me if contain logic within app component. combining components laravel functionality not work me. currently main.js file contains bunch of methods need have access anywhere in app. these methods don't contain broadcasting events can placed anywhere long vue-resource instance. my main.js file: https://github.com/stephan-v/beerquest/blob/develop/resources/assets/js/main.js hopefully can tell me place friendship methods if use vuex or in general since not seem best practice @ all. thank you. vuex manages of data in application. it's "single source of truth" data on front-end. therefore, changes state of application, such adding friend, or denying friend, needs flow through vuex. happens through 3 main function types, getters, actions, , mutations. check out: https://github.com/vuejs/vuex/tree/mas...

swift - How to create enum optional instance -

i leraning swift 3 "the swift programming language (swift 3 beta)". below enum example. in end of example, have written "use init?(rawvalue:) make instance of enumeration raw value". can tell me, how make that. thanks. enum rank: int { case ace = 1 // raw value case two, three, 4 , 5 , six, seven, eight, nine, ten case jack, queen, king init?(rawvalue: int) { self = rawvalue == 1 ? .ace : .jack } func simpledescription() -> string{ switch self { case .ace: return "ace" case .jack: return "jack" case .queen: return "queen" case .king: return "king" default: return string(self.rawvalue) } } } as can see here: enum rank: int "your" rank enums raw value must of type int . therefore, create new rank element ace value, write: let ace = rank(...

Differentiating between Binary semaphore and Mutex using same code -

void forward(void *pvparam) { while(1) { if(xsemaphoretake(xsemaphore,1000)==pdtrue) { uart0_sendstr("frwd took it\n"); } else { uart0_sendstr("frwd couldn't take it\n"); } vtaskdelay(1000); } } void back(void *pvparam) { vtaskdelay(100); while(1) { if(xsemaphoregive(xsemaphore)==pdtrue) { uart0_sendstr("back gave it:mf\n"); } else { uart0_sendstr("back couldn't give it:ms\n"); } vtaskdelay(1000); } } above code 1 using both binary semaphore , mutex. difference binary semaphore writing "xsemaphorecreatebinary(xsemaphore);" in main , mutex xsemaphorecreatemutex(xsemaphore) in main. according definetion "a semaphore(mutex) occupied task can given task , semaphore(binary) created task can given of tasks" but both codes...

sql - Raw pg GROUP BY query in rails application -

i have simple sql query trying execute in rails console. select name, manual_score objectives group manual_score but throws error is: activerecord::statementinvalid: pg::groupingerror: error: column "objectives.name" must appear in group clause or used in aggregate function i have tried prepending table name columns error remains. appericiated. thanks! the problem listing column not "grouped". should add name group by or remove select. select name, manual_score objectives group name, manual_score -- or select manual_score objectives group manual_score -- or select count(name), manual_score objectives group manual_score why have add column group by or use aggregate function? imagine have following data: name | manual_score 1 | 1 2 | 1 3 | 2 now, try group elements manual_score , think how show name column corresponds manual_score=1 .