Posts

c# - Linq to SQL Associated Table Not Accessible -

i reworking application had working code in it. necessity, i'm moving several commonly-used bits separate project. 1 of linq sql model. i have references resolved , namespaces corrected compiles correctly except couple of areas code using mapping association access different table. so example, template t = db.templates.firstordefault( f => f.templateid == templateid ); list<item> templatelist = new list<item>( ); foreach ( var r in globalitems ) { if (t.templatechildren.firstordefault( f => f.itemid == r.itemid ) != null ) // stuff... } in instance, cannot access t..templatechildren. compiler tells me inaccessible due protection level. taking @ linq sql designer code, find problem: [global::system.data.linq.mapping.associationattribute(name="template_templatechildren", storage="_templatechildren", thiskey="templateid", otherkey="templateid")] internal ent...

c# - WPF MySQL connection error handling -

i try error handling when comes connecting mysql database. want separate out connection errors , sql errors. issue being error being returned doesn't seem mysql error in fact ms error. doing: using (mysqlconnection con = new mysqlconnection(constring)) { mysqldataadapter da = new mysqldataadapter(); mysqlcommand cmd = new mysqlcommand(sqlcmd, con); try { system.security.cryptography.rsacryptoserviceprovider.usemachinekeystore = true; var provider = new system.security.cryptography.rsacryptoserviceprovider(); con.open(); da.selectcommand = cmd; da.fill(dt); con.close(); } catch (exception x) { //amazing error catching code } } now lets try connect machine not have mysql installed, exception being returned: mysql.data.mysqlclient.mysqlexception (0x80004005): unable connect of specified mysql hosts. @ mysql.data.mysqlclient.nativedriver.open() @ mysql.data.mysqlclient.driver...

c++ - How to generate set of enumerations with even number of ones -

i have idea of how prevent single bit flip (due cosmic radiation or similar externally induced event) causing enumerations (enum) change 1 defined value defined value in relatively easy way. put simple each value should have amount of ones, binary speaking. if 1 flips, enum odd , guaranteed not match other enum. i'm not sure how "generate" such sequence may used enum values values must compile time constant. macro function returning n:th element in set perfectly. the first few numbers in sequence 0 (000), 3 (011), 5 (101), 6 (110). think idea now. non-enumeration (non-compile time) answers appreciated may me realize how myself. to make myself clear want macro generating n:th number in enum number of ones in bit pattern, similar macros generating fibbonachi sequence. lowest bit parity bit. most of memory protected hardware ecc, l1 cache being 1 exception. single bit error in l1 has been measured occur once every 10000h enough seen requirements. vram not...

java - servlet don't respond to remote requests -

on windows 10 machine. issue: servlet works on private ip on 8080 port, can't access remotely. solutions tried: open port 8080(port use on connectors) on firewall | turn off firewall (done) disable anti-viruses (done) tried once public ip on connector address , engine defaulthost , host name (and combination of of them), , same private ip!(done) i skimmed tomcat/config documentations nothing helpful!

Azure PowerShell Error - Output of Get-AzureRmLocation changes when stored to variable -

in azure powershell, version 1.5, when write line below: get-azurermlocation | {$_.displayname -eq "east 2"} i following (expected) output console: location: eastus2 displayname: east 2 providers: {microsoft.automation, microsoft.backup...} however, when instead write following code, *which should (in understanding) have exact same output above: $location = get-azurermlocation | {$_.displayname -eq "east 2"} $location i see different output console: microsoft.azure.commands.resourcemanager.cmdlets.sdkmodels.psresourceproviderlocation further, if want call of properties expect object returned get-azurermlocation (such displayname property), error. picture attached prove i'm not losing mind: error what going on?

java - Retrofit 2 - Elegant way of adding headers in the api level -

my retrofit 2 ( 2.0.2 currently) client needs add custom headers requests. i'm using interceptor add these headers requests: okhttpclient httpclient = new okhttpclient(); httpclient.networkinterceptors().add(new interceptor() { @override public response intercept(chain chain) throws ioexception { final request request = chain.request().newbuilder() .addheader("custom_header_name_1", "custom_header_value_1") .addheader("custom_header_name_2", "custom_header_value_2") ... .addheader("custom_header_name_n", "custom_header_value_n") .build(); return chain.proceed(request); } }); retrofit retrofitclient = new retrofit.builder() .baseurl(baseurl) .client(httpclient) .build(); some headers want add, headers need add based on requirements of specific endpoint, example whether user need...

angular - In an angular2 component how do you get both the attribute text value as well as the bound variable? -

is there way both plain text value of attribute getting attribute input component? e.g. have @input('c-failure') cfailure; gives me this.cfailure bound outer variable. component created in outer template <c-component c-failure="failures.secondary['cause']"> . variable value "failures.secondary['cause']" variable bound value of outer this.failures.secondary.cause. tried injecting elementref, doesn't seem have or attributes bound @input. i try following leveraging @input , @attribute decorators. seems it's not possible mix them on same attribute @component({ selector: 'test' }) export class somecomponent { @input('c-failure') cfailure; constructor(@attribute('c-failure-expr') cfailureexpr:string) { } } and use way: <test [c-failure]="failures.secondary['cause']" c-failure-expr="failures.secondary['cause']"></test> see...