sudo dpkg -i package_file.deb
fails with messages like dependency not satisfied.
To fix this, there are two ways:
sudo dpkg -i package_file.deb && sudo apt-get -f install
sudo dpkg -i --force-depends package_file.deb
Obviously, the second one is shorter =)
Found these on HabraHabr today. Here are some tricks I found usefull.
Let us have class:
Here, class method
foo is not private:
Oftenly there is a need to create a class instance and set it some params (or, maybe, call some methods on it). It's done usually like this:
This can be shortened with the use of `tap` method:
Yet, it is more ruby-convenient and ruby-style to do it with the initialization block:
Or even like this:
When you have your migrations using your code, for example, like this:
you then have a problem when updating your code. In our example, if you remove the constant
Data::VOLUMES, you will have to either manually search for all the usages of this constant, or have a really intelliJent IDE ;)
Rather than using your existing code, stub it and copy-and-paste all migration-dependent code to the stubbing class:
Example with constant is rather stupid, whilst you may have some more critical code.
Lately I was a few times asked a question "what do we need abstract classes for?"
And today I've got one more question, which inspired me to write this.
First time I faced functional programming, I was impressed. Just a bit. That was in 2012. The second time, I was studying real functional programming at the university. Today was the final test.
We were taught many interesting things about functional programming and lot of things about Haskell. But there were only two lectures and two practices on Erlang. And nothing was told about its distributed programming abilities.
I was a bit disappointed by this fact. So, I turned on my girlfriend’s laptop, installed Erlang and created this short intro to distributed programming in Erlang.