Posts

c# - Error while inserting duplicate records -

i have code commit public retornodto commit(efdbcontext _context) { string errovalidation = string.empty; try { _context.savechanges(); } catch (dbentityvalidationexception e) { foreach (var eve in e.entityvalidationerrors) { var erro = string.format("entity of type \"{0}\" in state \"{1}\" has following validation errors:", eve.entry.entity.gettype().name, eve.entry.state); logger.getinstance().erro(erro); foreach (var ve in eve.validationerrors) { errovalidation = string.format("- property: \"{0}\", error: \"{1}\"", ve.propertyname, ve.errormessage); logger.getinstance().erro(errovalidation); } } return new retornodto ...

Assigning content of a R dataFrame cell based on some conditions -

this question has answer here: calculating statistics on subsets of data [duplicate] 3 answers i have r dataframe df following content: serial n year current b 10 14 b 10 16 c 12 11 d 40 20 b 11 15 c 12 9 i add column compute average current if serial number , year same serial number , years. have this serial n year current average b 10 14 15 b 10 16 15 c 12 13 12 d 40 20 20 b 11 15 15 c 12 11 12 i wrote for (i in unique(df$serial_n)) { (j...

android - React Native Release: Could not connect to development server -

i followed official guide create installable android application. however when installing apk ./gradlew installrelease app crashes react fragment loaded: runtimeexception: not connect development server. my fragment code looks this, integration android tutorial suggests. @override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, bundle savedinstancestate) { mreactinstancemanager = reactinstancemanager.builder() .setapplication(getactivity().getapplication()) .setbundleassetname("index.android.bundle") .setjsmainmodulename("index.android") .addpackage(new mainreactpackage()) .setusedevelopersupport(false) // changes nothing .setinitiallifecyclestate(lifecyclestate.resumed) .build(); mreactrootview.startreactapplication(mreactinstancemanager, "helloworld", null); return mreactrootview; } do have ideas might wrong? ...

c# - How many applications should be defined in Azure B2C for a micro-service based infrastructure? -

in preview azure ad b2c can define applications. each application given name, client id, app key , few settings define whether include web app / web api , whether allow implicit flow. in 'old' world of azure ad had greater control interaction between applications such "this application can access graph api", or "this application can talk service" whereas in new world order doesn't appear possible (at least portal ui perspective). question is: given lack of apparent control in azure ad b2c infrastructure has growing number of microservices, make sense create 'application' per service in azure ad b2c (and indeed per environment)? or should whole system share same application (and therefore client id?). (i comment on current score not allow me that) what do: have client ids each web , api app (container micro services). when initializing authentication api apps put client ids allowed talk api in validaudiences : public static st...

scala - PostgreSQL syntax error at or near "$1" -

sql"""copy updatetable $path credentials 'aws_access_key_id=<my_access_key_id>;aws_secret_access_key=<my_secret_access_key>' json '<path_to_s3_repository>' gzip;""".update().apply() above command gives org.postgresql.util.psqlexception: error: syntax error @ or near "$1" when run on spark streaming using scala. might issue? resultant query runs fine when run command line. you cannot use parameter copy . you have add literal value of $path statement string , execute that.

portaudio - Interpreting inputBuffer's Value in a Callback -

i basing code off of portaudio's paex_record_file.c example. 1 of parameters in callback inputbuffer, , wanted use data calculate other numbers double/float type. changed file .raw .txt, notepad still cannot read it, leading me believe data not encoded number. how data stored in inputbuffer , how can arithmetic (add, multiply, divide, etc)? this how initialized inputparameters: inputparameters.device = pa_getdefaultinputdevice(); /* default input device */ if (inputparameters.device == panodevice) { fprintf(stderr,"error: no default input device.\n"); goto error; } inputparameters.channelcount = 2; /* stereo input */ inputparameters.sampleformat = pafloat32; inputparameters.suggestedlatency = pa_getdeviceinfo( inputparameters.device )->defaultlowinputlatency; inputparameters.hostapispecificstreaminfo = null; this question related print floats audio input callback function (unanswered). the inputbuffer parameter callback ...

javascript - Angular2: replace component element entirely -

i looking around while , cannot seem find right answer... should trivial... , documented everywhere... seems cannot find it... so, have very, easy component/directive called navitem this how call it <ul> <nav-item route="/aboutus">about us</nav-item> <nav-item route="/contactus">contact us</nav-item> </ul> and inside (nav-item.html): <li><a [routerlink]="route"><ng-content></ng-content></a></li> so have this: import { component, input } '@angular/core'; import { router_directives } '@angular/router'; @component({ moduleid: module.id, selector: 'nav-item', template: require('./nav-item.html'), directives: [router_directives] }) export class navitem { @input() route = '/'; constructor(){} } what <ul> <nav-item _ngcontent-xng-6="" route="/aboutus" ng-reflect-ro...