/images/avatar.png

A software developer with 14+ years of experience.

I focus on Windows desktop application development in C/C++ with Visual Studio.

Setting up Cloudflare DDNS in Synology

In order to host a web server at home using Cloudflare’s DNS service, I found a docker timothyjmiller/cloudflare-ddns quite convenient for configuring. And here’s the steps to set up in a Synology DSM: 1 Prepare files for the docker 1.1 Creating a folderSSH to the DSM, then create this directory: /volume1/docker/cloudflare-ddns 1.2 Prepare a docker-compose.yml 1 2 3 4 5 6 7 8 9 10 11 version: '3.9' services: cloudflare-ddns: image: timothyjmiller/cloudflare-ddns:latest container_name: cloudflare-ddns security_opt: - no-new-privileges:true network_mode: 'host' volumes: - /volume1/docker/cloudflare-ddns/config.

Setting up Portainer in Synology with a web portal and custom domain

I know there are already a lot of posts online that describe how to setup a Portainer on a Synology DSM, but I am writing this for my own reference. 1 Create the docker imageSSH to the Synology, then run the following commands: 1 2 3 4 5 sudo -i mkdir -p /volume1/docker/portainer docker create --name=portainer --privileged --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce 2 Enable web portalOn Docker app, find the portainer container, then check Enable web portal via Web Station

Implementing LSP

1 What is LSPLSP stands for Language Server Protocol. Here’s an excerpt from Microsoft’s documentation for it: Implementing support for features like autocomplete, goto definition, or documentation on hover for a programming language is a significant effort. Traditionally this work must be repeated for each development tool, as each provides different APIs for implementing the same features. The idea behind a Language Server is to provide the language-specific smarts inside a server that can communicate with development tooling over a protocol that enables inter-process communication.

Just spent one Saturday and implemented this Goto Related Symbols thing

I’ve always wanted a feature like this in our built-in code editor, it can make understanding code structure a simpler job. The recorded gif above is pretty straightforward and tells everything without me saying too much to explain why it is so useful. Anyway, I decided to implement this context menu for quickly jumping to related classes/functions at type of current caret position. I thought this should be an easy job, one Saturday afternoon would be enough.

The window-resizing-flickering nightmare, part 2

We have a expand/shrink button on this particular dialog when users click on it, it expands or shrinks the dialog, but the tab control “remains” at the original position relative to the screen coordinates. Notice the significant flickering here, what is happening? Let’s slow it down: As you see, the tab control was “moved” (actually, here it simply stayed at the original distance to the left edge of the dialog, this is done by windows manager) to the right side of the dialog when the dialog is shrunk, and then later it was moved (this time, an actual SetWindowPos call) back to the left side.

The window-resizing-flickering nightmare, part 1

1 The issueA user complained that some dialog appears too big, specifically, on his/her high DPI screen (150%, 1920x1080), too high that the buttons on the bottom of the dialog are simply out of the screen, as shown below: Bottom part of the dialog is outside of the screen As you see, the dialog almost takes up the whole screen, users will have to move the dialog around a bit to be able to click on the buttons at the bottom of the dialog.

I just finished QuickFind, a replacement of CFindReplaceDialog!

I really like the design and look of Quick Find box in Visual Studio, it give you the impression of instant result, automatically jumps to the first match, and it does not block you active editor UI. Quick Find in Visual Studio Recently I needed to add the missing regular expression option in Find and Replace dialog, so I figured why not try to implement my own version of Quick Find, see how it goes, and even better: I can add some features that are not available in VS.