Understanding exactly when a data.table is a reference to (vs a copy of) another data.table

Yes, it’s subassignment in R using <- (or = or ->) that makes a copy of the whole object. You can trace that using tracemem(DT) and .Internal(inspect(DT)), as below. The data.table features := and set() assign by reference to whatever object they are passed. So if that object was previously copied (by a subassigning <- … Read more

Dependent DLL is not getting copied to the build output folder in Visual Studio

I found that if ProjectX referenced the abc.dll but didn’t directly use any of the types DEFINED in abc.dll, then abc.dll would NOT be copied to the main output folder. (It would be copied to the ProjectX output folder, to make it extra-confusing.) So, if you’re not explicitly using any of the types from abc.dll … Read more

How come a non-const reference cannot bind to a temporary object?

From this Visual C++ blog article about rvalue references: … C++ doesn’t want you to accidentally modify temporaries, but directly calling a non-const member function on a modifiable rvalue is explicit, so it’s allowed … Basically, you shouldn’t try to modify temporaries for the very reason that they are temporary objects and will die any … Read more

Why are explicit lifetimes needed in Rust?

The other answers all have salient points (fjh’s concrete example where an explicit lifetime is needed), but are missing one key thing: why are explicit lifetimes needed when the compiler will tell you you’ve got them wrong? This is actually the same question as “why are explicit types needed when the compiler can infer them”. … Read more

Referencing a string in a string array resource with xml

In short: I don’t think you can, but there seems to be a workaround:. If you take a look into the Android Resource here: http://developer.android.com/guide/topics/resources/string-resource.html You see than under the array section (string array, at least), the “RESOURCE REFERENCE” (as you get from an XML) does not specify a way to address the individual items. … Read more

MSBuild doesn’t copy references (DLL files) if using project dependencies in solution

I just deal with it like this. Go to the properties of your reference and do this: Set “Copy local = false” Save Set “Copy local = true” Save and that’s it. Visual Studio 2010 doesn’t initially put: <private>True</private> in the reference tag and setting “copy local” to false causes it to create the tag. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)