Ne v kontakte Antisocial programmer's blog

Comment branching in C++

Comment branching in C++

    c++     programming     tricks

Recently I’ve stumbled upon a code snippet in my C++ code, which I’d call “comment branching”. For example, you are experimenting with two implementations of the same functionality represented by a relatively small pieces of code and you need to switch between them back and forth until you decide which one will end up in final version.

Consider following snippet:

   

   

<>

If you simply remove first slash from the second line, it turns into this:

Read more →

Hosted by GitHub

Hosted by GitHub

    blog     github     eomy     goodby

Finally, I’ve completed transition of this blog to GitHub pages, planned over two years ago. I did the first step — migration to a static site engine (specifically, Acrylamid) — back in March 2014. And since than I’ve been saying to myself “one day I must move it to a GitHub as it’s a best free hosting for a static site”.

I couldn’t tell for how long I’d continue slacking like this, but now I had to do this. This site was hosted at free hosting service provided by EOMY.net since it’s very beginning and recently I’ve received a notification, that EOMY shuts down it’s shared hosting, completely focusing on VDS. It’s a bit sad news, as EOMY managed to provide fantastically stable and reliable hosting for all this years, so great thank you for them and good luck with VDS business!

By the way, I have plans on implementing an automated process of site generation and deployment using TravisCI the way it’s done for GCB-JS. If i do this, I’d be able to blog right from GitHub interface, which would be pretty cool :-)

Rogue Ninja support in CLion

Rogue Ninja support in CLion

    c++     clion     cmake     ninja     projects     dev

In a past few years I’ve been using C++ as my main programming language and during this time I’ve been in constant search for better IDE for it which would run on Linux. I was very happy when Jetbrains released CLion IDE and immediately gave it a try. Though there is a lot to improve yet, I’d say that it has best autocompletion and modern C++ support among C++ IDEs on Linux. The only problem I had with it was a build toolchain which it uses.

Currently CLion supports only CMake projects (with is totally fine for me) with GNU Make generator (which is sad). When using CMake, I always preferred Ninja build system, especially for large projects like one I work on as my main job. For some reason Make does not a very good job at incremental builds. For example, even if there is nothing to rebuild, it spends 5 seconds to only verify this fact, which is pretty annoying. On other hand, Ninja does this in like 200 ms.

Unfortunately, CLion developers currently have no plans on supporting Ninja (I realize that they have many things to do way more important than Ninja support), so I decided to solve this problem by myself.

CMake-Ninja wrapper for CLion

Read more →

В День Победы

В День Победы

    notes     life

В виде исключения этот пост будет на русском, поскольку он касается в первую очередь русскоязычной аудитории.

9 мая, День Победы — один из самых главных праздников в странах бывшего СССР. По массовости празднования он может соперничать разве что с Новым Годом. Однако, мне кажется, с течением лет акцент этого праздника становится все более и более неправильным. Он превращается в символ военной доблести, военной мощи, величия. Бесспорно, все это было, и это сыграло важнейшую роль для победы как таковой. Честь и память всем, кто сражался за свободу наших родин, и тех, кто трудился в тылу и в оккупации.

Но вот чем этот праздник так и не стал — это символом Большой Ошибки. Победа может быть только тогда, когда есть война. Чтобы была победа должны погибнуть люди — неважно, кто именно победил, кто агрессор и кто больше виноват. Погибнут люди с обеих сторон. Большая Ошибка — это начинать войну. Да, если враг ступил на нашу землю, то он должен быть изгнан. Если в его руках оружие, оно должно быть и в наших руках. Но, начав войну, мы, как человечество, делаем ошибку, за которую будем дорого платить.

Боюсь, что в современном мире у нас нет права на еще одну такую же ошибку, ибо мы не сможем выплатить ее цену. Поэтому я хочу пожелать всем, независимо от национальности и убеждений, одно: помните уже совершенные Ошибки и не дайте совершить еще одну.

Read more →

Crowd funding EaxCast podcast

Crowd funding EaxCast podcast

    podcast     IT     notes     crowd funding

I’ve never really mentioned this on the Internet, but I’m podcast-addicted kind of person. At the moment I have about 20 different podcasts in my subscription list and I enjoy them very much. Actually, it turned out that listening to podcasts does two important things:

  1. You don’t fall completely bored while doing some monotonic work like house cleaning or dish washing.
  2. It delivers you most of the important news, keeping you up-to-date at no time cost. You know, you have to wash dishes at some point…

In my list there are two categories of podcasts: general tech news and hardcore-geeky-programming stuff. And actually I love latter the most. This kind of discussions make me thinking, directs me while exploring new technologies, teaches about things far beyond of my scope and so on. Unfortunately, there are not so many shows of this kind.

One of the young and promising podcasts is EaxCast and at this time they are raising funds for second season of the show. I’m not a kickstarter kind of person, but what makes these campaign special, is that collected money would be spent on creating text transcripts of the show. Actually, I know only about two tech podcasts, which make these transcripts. First is Security Now and the second is EaxCast.

Read more →