Archive

Archive for the ‘Other’ Category

Nanotechnology may be near

22.09.2017 Leave a comment

If you’ve heard the term “nanotechnology” you may have heard it used incorrectly as a marketing buzzword. The term leads back to K. Eric Drexler, who wrote in 1986 in his book “Engines of Creation” how nanotechnology will revolutionize our civilization by giving us the ability to construct materials and entire products molecule by molecule.

Scientists from The University of Manchester reportedly finally built a molecular robot which has such capability.

On the plus side, that may be the most profound breakthrough of the 21st century. Not only will it revolutionize our lives along with 3D printing and machine learning, but it may also help us better understand the nanoscale world leading to improvements in medicine and other areas.

Advertisements
Categories: Other

C type system strikes back

9.06.2016 Leave a comment

Today is one of those days when C++ surprises me. Here is a snippet:

#include <stdint.h>
#include <stdio.h>

int main()
{
    const int64_t a = 3;
    if (a < -0x80000000)
        printf("%lld is negative\n", a);
    return 0;
}

This time the surprise comes from the intricacies of the C type system.

Hint: -0x80000000 is mathematically INT_MIN.

In case you’re wondering, it is not about improving the above snippet. It is about actually seeing a piece of code like this in the wild. It looks correct. But it is incorrect.

Categories: Other

Learn Polish

1.02.2016 Leave a comment

If you have some spare time and want to learn another language, I recommend Polish. Polish is a lot of fun! For a start, here are a few words in Polish and their meaning in English:

 

Polish word Meaning in English
no yes
do to
to this
go him
pies dog
much flies
bat whip
paw peacock
but shoe
wanna bath tub
pan mister
baby women
was you (plural)
my we
we on (a day)
on he
one they (women)
ten this one
grab hornbeam
bark shoulder
jest is
fart luck

Enjoy!

Categories: Other

New Year’s Resolution

4.01.2016 2 comments

One of my New Year’s resolutions is to keep this blog more active. While my activity has been low during the year 2015, I have not abandoned the blog. I was simply spending most of my free time working on my personal project. In the mean time I’ve gathered several ideas for new posts, it will be great if these posts finally see the daylight this year!

Hopefully my personal project will also reach a publishable state this year. Here’s an interesting detail about this project.

C++ has been the primary programming language for me in my professional career. Over the years, I’ve used many programming paradigms provided by this versatile language. However, to the surprise of many, my new project is currently written in pure C!

Why C? Out of admiration for a coworker, who writes programs in C, which are of high quality, and which are readable, maintainable and extensible. And also as a personal challenge. Writing *good* quality software in C requires more skills than in C++, because the language is much simpler and doesn’t have mechanisms provided by C++, which help avoid certain classes of bugs. To be fair, I’ve seen a lot of bad C++ source code which fails to use these mechanisms, but that’s another story.

So here are my impressions about going back to C so far. First of all, RAII, which is the cornerstone of C++, is not available. This makes cleanup more tedious. Again to be fair, C++98 without lambdas also makes cleanup more tedious by requiring you to write or use classes just for the purpose of cleanup, which makes the code scattered or complicated. Secondly, handling error conditions in C is more tedious. Exceptions in C++ can provide a great way of signaling exceptional errors, if used carefully(!), together with RAII, which makes returning from functions easier without the need to babysit allocated resources. Mildly missed are classes, which can help to logically organize functions, although in many C++ programs they are abused by implementing unnecessary OO designs, which lead to too much boiler plate code and eventually hamper readability. One of the most missed features are container templates, which greatly simplify memory management in C++.

On the bright side, some of the advantages include better portability due to unencumbered linkage. Because the language is so simple, it also leads to simpler code, which can in turn be easier to read, maintain and extend, contingent on the type of program and the way in which it is written, of course!

Surprisingly, it is possible to write readable code in C without drowning it in macros! Many C projects I’ve seen overflow with macros, which impact readability. But this can be said about C++ projects, too.

Now back to the editor. Let us see what the New Year brings!

Categories: Other

Interview question: Which browser do you use?

17.03.2015 Leave a comment

Big Data says, that employees who use a non-default browser, such as Firefox or Chrome, stay with the job 15% longer than those using a default browser, such as IE or Safari.

Well, if Big Data says it, it must be true!

(There – I finally said it. 😉

Categories: Other

Job interview question idea

30.09.2014 Leave a comment

I doubt that everybody realizes, that job interviews are for both the company trying to fill in an open position as well as the potential employee trying to find a job. A usually small, but important part of an interview is when the person being interviewed asks the questions.

This idea is for those who have the chance to speak to their potential future manager. How do you know if a particular manager will be right for you?

The question to ask your future manager is: Do you prefer cats or dogs?

The explanation follows.

Dogs are followers, they need their master to tell them want to do, to give them direction. Cats on the other hand are soloists. They do what they want, whenever they want. If they want to be tapped, they come to you.

Of course, this is an approximation, a generalization.

Similarly, there are two groups of employees. Ones which need to be told what to do, and the others, who don’t need and don’t like encouragement, but rather pursue tasks on their own. This is universal regardless of the job type. Obviously, the first kind can be compared to dogs, while the other to cats.

Before going to a job interview, you need to ask yourself honestly, whether you are a follower and need to be told exactly what to do, or whether you like taking complete control over what you are doing. This has nothing to do with whether to like cats or dogs, it is completely orthogonal.

If you are more like a dog, probably a manager who prefers dogs would be better for you. Similarly, if you are more like a cat, a cat-person would manage you better.

It’s just a theory. As silly as it sounds, I wonder if there exists any statistical data which would help test it.

Categories: Other

Cursing

10.07.2013 Leave a comment

We’re trying to avoid cursing at home as much as possible and so far our children did not pick up any curse words.

But for some time now our three-year old son has been using the word “poop” quite often. He finds it very amusing. I think it all started when our kids were practicing joking and this word was said in an innocuous,  funny context. He picked it up and it stuck.

Now he’s using it often at numerous occasions. Sometimes to get attention. Sometimes to make people laugh. And sometimes when he’s angry. Especially when he has to do something he does not want to or when he’s punished. Then he repeats or exclaims it multiple times, or says “you are a poop!”.

Because he hasn’t been exposed to cursing before, I think he invented cursing on his own. Cursing is apparently natural and as some studies indicate, brings relief in some situations, e.g. reduces pain.

Interestingly we’ve never had such problem with our daughter. This is one of the many examples we’ve noticed of the differences between males and females.

Categories: Other