Posts

c++ - template member of std::pair<> must have const copy constructor. How to implement that constraint -

c++11 standard require template member of std::pair<> must have const copy constructor. otherwise, not compile.(from book the c++ standard library , nicolai m. josuttis.). so, code below wouldn't compile if it's against c++11 standard: class a{ int i; public: a(){} a(a&){} }; int main(){ pair<int, a> p; } with -std=c++11 , g++ compiler report error: constexpr std::pair<_t1, _t2>::pair(const std::pair<_t1, _t2>&) [with _t1 = int; _t2 = a]' declared take const reference, implicit declaration take non-const: constexpr pair(const pair&) = default that because declare a's copy constructor non-const. if change a(a&){} a(const a&){} , or remove -std=c++11 flag, fine. my question is, how constaint implemented? can see no support in language provide inside template parameter t . mean, declared this: template<typename t1, typename t2> class pair{ ... //how...

eclipse - Adding Files to the Root of a elipse e4 rcp application -

in order add configuration files eclipse e4 rcp application, have followed steps greg-449 in link : the application featured based, , in feature project folder have attached file "test_config_file.txt" at feature´s 'build.properties' file next lines: bin.includes = feature.xml root=file:test_config_file.txt basically stated @ above link. when run product (via run configuration), file not copied folder run configuration locates product. thanks much the configuration in feature used when build / export product. when running code using run configuration have put files in correct location manually. alternatively code support command line argument specify location of file.

How to clear the form after submitting in model-driven form? (Angular 2) -

how can clear form after submitting in model-driven form? have use ngmodel ? thanks <form [ngformmodel]="myform" (ngsubmit)="onsubmit()"> <input type="text" [ngformcontrol]="name"> <button type="submit">submit</button> </form> . myform: controlgroup; name: abstractcontrol; ngoninit() { this.myform = this._formbuilder.group({ 'name': [""] }); this.name = this.myform.controls['name']; } onsubmit() { this.name.value = ""; // not working. } you can iterate controls in this.myform.controls , call updatevalue() . otherwise see https://github.com/angular/angular/issues/4933

c# - How to get Appium working on a Mac for mobile web automation using Simulators -

i long time windows user have been tasked figuring out mobile automation on mac company. i using windows visual studio , c# write automation scripts. able run locally against chrome, firefox, ie, & android web applications using selenium. attempting run on macbook pro received run selenium tests against safari on ios simulators. first time using mac i'm not @ familiar how things work on platform. once mobile web figured out need looking native apps well. my setup on mac is: os x el capitan version 10.11.3 macbook pro (retina, 15-inch) 2.5ghz intel core i7, 16gb ddr3 amd radeon r9 m370x 2048mb xcode 7.2.1 (7c1002) apple developer license (with available simulators downloaded) appium 1.4.13 (draco) installed dmg downloaded appium.io. when run appium doctor following: last login: mon feb 22 14:34:40 on ttys000 '/applications/appium.app/contents/resources/node/bin/node' '/applications/appium.app/contents/resources/node_modules/appium/bin/appium-do...

java - Configuration mechanism to flag the attributes of an object that should be synchronized -

i'm refactoring old java application. has component responsible synchronizing complex object object of same type different source. object has lot of attributes (nearly hundred) of different types, including class types, in turn have lot of attributes. i want have feature tell component attributes of object should synchronized or not. first idea dependency injection. should inject? don't want have interface methods public boolean shouldsynchronizeattributea() , public boolean shouldsynchronizeattributeb() etc. every attribute including attributes of compositions of objects. how solve issue in nice , maintainable way? here example using strings , mvel . there many other libraries available (e.g, ognl). use orika (i not familiar with. used dozer many years ago) public static void main(string[] args) { final someclass o1 = new someclass(); o1.setaddress(new address("paris")); final someclass o2 = new someclass(); o2.setaddress(new addres...

Sorting the C# List with Date(11 Sep 2015 --> Date format) in Descending Order? -

indexlist = savelist .where(i => (convert.todatetime(i.event_startdate) < datetime.today) && (convert.todatetime(i.event_enddate) < datetime.today)) .tolist(); event_list.itemssource = indexlist.orderby(i => i.event_startdate); i wrote code above sort list contains date in format(11 sep 2015), want sort in way that, should display recent date date on top of list. how modify above statement i have tried using orderbydescending(i=>i.event_startdate); no use. you need parse date to datetime object in order sort it, things easy: var results = (from item in savelist let dtstart = convert.todatetime(item.event_startdate) let dtend = convert.todatetime(item.event_enddate) dtstart.date < datetime.today && dtend.date < datetime.today orderby dtstart descending select item).tolist(); event_list.itemssource = results;

javascript - state could not be resolved in angularjs -

i using nested view ui-router. menu html <li ng-class="{active: $state.includes('staffs')}"> <a ui-sref="dashboard"><i class="fa fa-users"></i> <span class="nav-label">{{ 'staffs' | translate }}</span> <span class="fa arrow"></span></a> <ul class="nav nav-second-level collapse" ng-class="{in: $state.includes('staffs')}"> <li ui-sref-active="active"><a ui-sref="staffs.add"><i class="fa fa-circle-o"></i>{{ 'addstaff' | translate }}</a></li> <li ui-sref-active="active"><a ui-sref="staffs.view"><i class="fa fa-circle-o"></i>{{ 'viewstaffs' | translate }}</a></li> <li ui-sref-active="activ...