what is “failure atomicity” used by J bloch and how its beneficial in terms of immutable object?

Bloch’s “Failure atomicity” means that if a method threw an exception, the object should still be usable afterwards. Generally, the object should be in the same state as it was before invoking the method. In the case of an immutable object, you gain that simply from the fact that it’s immutable. There is no operation … Read more

In Ruby, why does inspect() print out some kind of object id which is different from what object_id() gives?

The default implementation of inspect calls the default implementation of to_s, which just shows the hexadecimal value of the object directly, as seen in the Object#to_s docs (click on the method description to reveal the source). Meanwhile the comments in the C source underlying the implementation of object_id shows that there are different “namespaces” for … Read more

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