Assembly binding redirect does not work

Any typo in configuration xml can be a cause. Loader just can’t see your configuration. I also had a hour of headache until I realize that the error was in character “=” instead of “-” in schema name: <assemblyBinding xmlns=”urn:schemas=microsoft-com:asm.v1″> Just check carefully all attribute names and values. I guess “PublicKeyToken” should be “publicKeyToken” This … Read more

Have you ever used PhantomReference in any project?

I used PhantomReferences in a simplistic, very specialized kind of memory profiler to monitor object creation and destruction. I needed them to keep track of destruction. But the approach is out-dated. (It was written in 2004 targeting J2SE 1.4.) Professional profiling tools are much more powerful and reliable and the newer Java 5 features like … Read more

Strings in Java : equals vs == [duplicate]

First of all String.toString is a no-op: /** * This object (which is already a string!) is itself returned. * * @return the string itself. */ public String toString() { return this; } Second of all, String constants are interned so s1 and s2 are behind the scenes changed to be the same String instance.

What is an idiomatic way to collect an iterator of &T into a collection of Ts?

Is a bicycle an idiomatic way to get from one city to another? Like most things in software (and life), it depends. If your type implements Copy I’d prefer these in this order: some_iter.copied() some_iter.cloned() some_iter.map(|&v| v) some_iter.map(|v| *v) some_iter.map(Clone::clone) some_iter.map(|v| v.clone()) If your type implements Clone I’d prefer these in this order: some_iter.cloned() some_iter.map(Clone::clone) … Read more

Variable re-assignment of object reference leaves other object unaltered (no “transitive” assignment)

Not possible. JS passes objects by a copy of the reference, so in the step var ref = obj1 you’re not actually assigning a reference pointer like you would in a language like C. Instead you’re creating a copy of a reference that points to an object that looks like {x: ‘a’}. See this answer … Read more