Intro to WebAssembly

Good article about current state of WebAssembly with examples and links to resources.
I like the idea of common low level language/runtime for web. Even here in my blog I did criticize state of Javascript, fragmentation and sloppy attempt to make native code run along/inside the browser with NaCL.
WebAssembly seemed and still seems to be the right way to go. There are exactly two things that still bother me though:
1. Speed of adoption and standard development, which is probably a false negative, because everything in web standards world is going slow.
2. Syntax… why braces again!? I bet committee was infiltrated by Lisp lovers. 😛

Here’s the article.


Go Garbage Collector

Good read on how GC is implemented and optimized in Go run-time. It goes through typical issues with GC at scale and real-time systems.
Sorry for posting another bookmark to the stream. I hope some of these posts are actually useful to others. 😛

Source code in Microsoft Word

Somebody finally did that! Somebody created Office add-on that allows to import source code with highlights and right format.
Check it out!

Another useful tool for source code copy/paste if you’re using Sublime Text:

There are even more ideas on how to insert source code into Word, Office, Excel or whatever here:

Running Windows 10 from external drive on Mac

Some time ago I was able to create bootable Windows 10 installation on external SSD drive. It worked perfectly and I was able to play all Windows only games. However, it all went south when I upgraded my Macbook Pro to new 2017 model… Well. Old USB drivers stopped working, so after boot I could not use either keyboard nor mouse. Apparently there are many step-by-step instructions on how to install Window 8 and 10 on external drive, but many of them are outdated or do not cover my specific problem. Luckily there’s a discussion thread on Apple’s own support forum on how to troubleshoot and fix similar issues.
In my case I had to download new set of drivers from Bootcamp Assistant and install them. Luckily I found external USB keyboard that worked with Macbook!
Here’s the thread you may find useful.
Another good tutorial on how to fix drivers issue using a VM (if you can boot your bootcamp in VM):

What’s new in Swift 4

There’s very good article on most important changes in Swift 4 by Ray Wanderlich here:

What’s New in Swift 4?

Most important changes are in containers. They promoted strings to containers finally! A lot of cleanups and improvements.
I found Generic Subscripts a good addition. I’ve tried to use generics in my custom class and ran into the fact that I can’t create a subscript. Now I can.
Check it out!

Fish shell intro

Came across great video tutorial/introduction to Fish shell. I’ve tried to switch to Fish couple times in my life and every time I got stuck somewhere. Third time is a charm, I guess? 🙂

Anyway, here’s a nice video you must watch before trying to abandon your bash (or zsh or whatever).

Lifehack: If you can’t compile old XCode project “There is no SDK with the name or path”

If your old project fails to compile with XCode with error like
error: There is no SDK with the name or path ‘/path/to/my/project/macosx10.6’

even if you changed target in the XCode Build Settings, then you stumbled upon silly bug in the XCode. It’s just unable to change SDKROOT in your pbxproject file. Edit it manually and remove all SDKROOT lines.

How to redirect std C++ streams to Visual Studio debug output

Discovered this trick for the first time. You can use AllocConsole() to redirect ANY std stream to debug console.

In most cases people use either TRACE() statement (but you have include MFC or ATL for that) or Win API OutputDebugString().

With AllocConsole() your code may look like this:

   freopen("CONOUT$", "w", stdout);

That’s it!

Learning something new every day. 😀

Home and End keys remap on Mac

Little hack which will make Home and End buttons work as they’re working in most OS’s except for Mac.

Windows 10 Power Management (again)

If you follow me on Twitter, you know how long I’ve been trying to fix the problem. I fixed it once, but then it started happening again. Windows 10 wakes up almost daily at random time. This problem is not unique to me.

Here’s what people usually do to fix unwanted wakes:

In command line run

powercfg -lastwake

In theory it should tell you, who woke your computer last time. Unfortunately, it did not work in my case.

My output was

Wake Source Count - 0
Wake Source - Unknown

I guess, Microsoft devs don’t follow specs exactly and “forgot” to register some sources with the Power Management service. Oh well…

In case if you saw something meaningful in output of previous command, then also run

powercfg -waketimers

There you can see services that can wake Windows.

Most likely, you have one of rogue devices which is permitted to wake computer. Then you have to go to Device Manager and find that device. In it properties uncheck this

Image is a courtesy of 🙂

Also it’s important to disable wake timers in Power Management itself. For that, go to Power Options -> Select your current plan -> Edit Plan -> Change Advanced Power Settings

You’ll see this:

In most cases, these two settings will make Windows sleep well.

As you can guess, it was not my case. Just by time when Windows was waking up, I guessed (correctly) that culprit is Windows Update service. It sets wake timers for late nights and early morning hours. In previous versions of Windows, it was possible manually disable wakes caused by update service. It does not seem to be the case for Windows 10, because WindowsUpdate service does not have rights to wake computer up by default. However, it still wakes up! Go figure! It turned out that there’s another service which is related to WindowsUpdate. To be Windows/UpdateOrchestrator. That one has wake timers!

Go to Task Scheduler app and find it there. Then click on “Conditions”. Uncheck “Wake the computer to run this task”.

Here we go. It helped me.

Upd: As it turned out, other people discovered the same thing and also found out that Windows updates once in a while check “wake the computer to run this task” again! Solution? So far, there are two. One is to uncheck this setting manually again. Second one is to write a script that uncheck it for you on every reboot.


Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.