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 =)
Just as a small addition to my previous article on abstract classes vs interfaces.
Wneh we declare an interface, we can’t tell how to create an object, implementing that interface. E. g., we can not define even a default constructor.
Thus, when we need to have at least one constructor of a defined signature, we must use abstract classes.
Check it out:
and compare it to this:
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.
Robo. Created in a Cinema 4D two and half years ago.
© “Игры демиургов”, Петр Бормор
-Чего?! Погоди, ты серьёзно? Вот эта жуткая бесформенная баба - покровительница красоты?!
-Ну, когда она выбилась на этот пост, её стали изображать иначе. И потом, что здесь такого? Министр иностранных дел не обязан быть иностранцем, а министр тяжёлой промышленности, как правило, не проводит время у станка. Их дело - управлять, и только. Так что богиня любви и красоты может быть распоследней гулящей коровой, лишь бы администратор была хороший.