Getting the object type in a case statement
If you have a case statement and you need to determinate the type, you can’t use something like this: If you’ll run irb and try it with ==, it will work, but not in a […]
If you have a case statement and you need to determinate the type, you can’t use something like this: If you’ll run irb and try it with ==, it will work, but not in a […]
Every python programmer knows that basic print function:print(1) will print 1, print(“hello”) will print hello and so on. Here are a few tricks:To print a formatted string, you can use the string.format method, e.g”hello {}”.format(“world”) […]
Lets say we have a file class object with a file buffer, like so: This is not an uncommon pattern. Now, what do we need to do, if somewhere we’ve created a function like this? […]
So, this is an interesting topic. Again, about craftsmanship. While most c++ if not all using them, it seems that some basic knowledge is lacking; This time, I’ll touche some basic facts: the const pointer. […]