Posts

adding reference to native visual c++ project -

i have 2 visual c++ projects in solution. first 1 (lets call main) native code. second 1 (test), has main added reference. test contains unit tests methods in main. when add main reference test , try compile - errors library not found. adding project reference , not add output target path of main library directories of test ? i don't know vc doing under hood, adding reference project doesn't seem have effect of linking libraries unlike c#. you can use code project including , linking via usual method of c++ .

typescript - Javascript Promise.all confusion -

i using javascript/typescript in order format password value on collection of personmodel objects. executing promise on each element in collection. i using promise.all allow promises complete, , want return formatted collection. however, error @ build time. personservice.ts private decryptpersons(persons: personmodel[]): promise<personmodel[]> { return new promise<personmodel[]>(resolve => { let promises: array<promise<string>> = []; let decryptedpersons: personmodel[] = []; (let i: number = 0; < persons.length; i++) { let ciphertext: string = persons[i].password; promises.push(this.decrypt(ciphertext).then((password: string) => { // <== line 357 persons[i].password = password; decryptedpersons.push(persons[i]); })); } promise.all(promises).then(() => { resolve(decryptedpersons); }); }); } privat...

java - Scala - error: value max is not a member of my custom class -

i've got own class class foo { mycustomclass value; ... } which consists of mycustomclass java enum following signature: enum mycustomclass{ one(1), two(2), three(3) private int nominal; mycustomclass(int nominal) { this.nominal = nominal; } public int nominal() { return nominal; } } for define ordering as: implicit val mycustomclassordering = new ordering[foo] { override def compare(c1: foo, c2:foo): int = { c1.value.nominal.compareto(c2.value.nominal) } } import mycustomclassordering ._ and i'm able use function max sequence of objects ofmycustomclass type. got error trying use max fucntion in reduceoption function val l = list[foo](...) l.reduceoption(_ max _) got error message: value max not member of ... what should able use in reduceoption max function? max method delegated mycustomclass. either add ordering foo or add method returns foo object according result of max method call ...

python - Softlayer api: How to check that a VSI has been created an cancelation request on "Anniversary Date"? -

Image
for newly created vsi, can cancel on "anniversary date". api billing_item.cancelitem can helps accomplish it. in website/devicelist of softlayer, canceldevice button unable. my question how check vsi has been created cancelation request on "anniversary date" or not api ? ohter word, want api status of vsi has been submit cancelation request or not. you need see "cancelationdate" property of vsi's billing item if value of property "null" means vsi has not been cancelled. in case vsi has been cancelled in "anniversary date" value of property equals date when machine going canceled see example below "cancelationdate" property of particular vsi: import softlayer username = 'set me' api_key = 'set me' vsiid = 123 client = softlayer.client(username=username, api_key=api_key) vsiservice = client['softlayer_virtual_guest'] objectmask = "mask[id, cancellationdate]" try: ...

Solr wildcard query with whitespace and synonym -

this problem this: solr wildcard query whitespace have wildcard query looks like: q=location:los a* i'd match "los angeles" , "los altos". query like: q=location:los\ a* works fine, if have synonym logic:(synonym.txt) los,las and use "los l*" match "las lu".seems not work.how can this? the filetype , file config: <fieldtype name="ngram" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.whitespacetokenizerfactory"/> <filter class="solr.worddelimiterfilterfactory" stemenglishpossessive="0" generatewordparts="0" generatenumberparts="0" catenatewords="1" catenatenumbers="0" catenateall="0" splitonnumerics="0" preserveoriginal="1"/> <filter class="solr.asciifoldingfilterfactory"...

c# - How to set universal path in method's attribute -

i wrote test. use data driven unit tests. method declaration looks follow: [testcategory("integrationtest")] [datasource("microsoft.visualstudio.testtools.datasource.csv", "c:\\myprojectpath\\file.csv", "file#csv", dataaccessmethod.sequential), deploymentitem("file.csv"), testmethod] public void read_csv_file_attribute() i want commit changes source control. problem have hardcoded path in datasource attribute: "c:\myprojectpath\file.csv". if latest version of code repository person have change path in attribute. how make universal path work c-workers? i've tried change path using: methodinfo method = typeof(testclass).getmethod("read_csv_file_attribute"); method.customattributes.elementat(1).constructorarguments.elementat(1).value = _newpath; it doesn't work because value read-only. [testcategory("integrationtest")] [datasource("microsoft.visualstudio.testtools.datasourc...

c# - Webforms and Dependency Injection -

i in process of introducing dependency injection framework existing webforms application (using castle windsor). i have pretty deep experience di, , tend favor constructor injection on setter injection. if familiar webforms, know asp.net framework handles construction of page , control objects, making true constructor injection impossible. my current solution register container in application_start event of global.asax, , keep container public static variable in global well. resolve each service need directly in page or control when need them. @ top of each page, end code this: private readonly imyservice _exposuremanager = global.ioc.resolve<imyservice>(); private readonly imyotherservice _tencustomersexposuremanager = global.ioc.resolve<imyotherservice>(); obviously, don't having these references container scattered application or having page/control dependencies non-explicit, have not been able find better way. is there more elegant solution using d...