Red Mill, Clinton

Sony ILCE-7RM2 • FE 24-70mm F2.8 GM
ƒ/8 • 24mm • 1/100s • ISO 100

It’s a good practice to go through years’ old photos now and then, review the collection again with the current mindset, and post-process a photo or two from the pile. As experience expands with the time and number of clicks, the definition of a killer photo also evolves. You will be surprised to see an entirely different photo rendered every time compared to what you had in your mind when you pressed the shutter release button.

Why the Pomodoro Technique Is Failing You

Tonya Dalton:

While the theory behind the Pomodoro Technique is solid – giving yourself focused, intentional blocks of time to dive into important work is extremely powerful – the problem is that the times are way too short. Research proves it takes an average of 23 minutes to get into our deep work zone where we are doing our best work. With the Pomodoro Technique, you interrupt yourself with a break just as you’re getting into that deep work zone.

cheat.sh - community driven cheat sheets

Want to access community-driven repositories of cheat sheets with the shell command? cheat.sh is the tool you are looking for. Fire up your terminal, and run curl cht.sh to start exploring cheat sheets maintain by various development communities. The command will provide a concise and comprehensive response to your queries instead of dumping multiple search results at you.

cheat.sh - Cmder

cheat.sh usage is pretty straight forward. Follow the query format:

$ curl cht.sh/{language}/{your query}

For example, if you want to refer cheat sheet of posting a JSON request in Go, command to query the cht.sh will be:

$ curl cht.sh/go/post-json
cheat.sh - Go Post Json

And similarly, for C#, command will be:

$ curl cht.sh/csharp/post-json
cheat.sh - C# Post Json

Show / Hide hidden items in File Explorer with a single shortcut Key

There is, unfortunately, no shortcut key available to toggle between showing and hiding files or folder in the File Explorer. Hence this AutoHotKey script. You can toggle the view in File Explorer to show or hide with the just a Win+h shortcut key.

This script is not that fancy, it just toggles between two different values of the specific registry key and will send F5 keystroke to refresh the view in File Explorer.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SetTitleMatchMode, 2
#IfWinActive ahk_class CabinetWClass
#h::
  RegRead, HiddenRegValue, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden

  if HiddenRegValue = 2 
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
  Else
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2

  WinGetClass, CabinetWClass
  Send {F5}
  return
#If

If you don’t prefer the above script, you can still toggle hidden items with the combination of multiple keystrokes in File Explorer. The key combination is Alt+v hh.

Customize object displays in the Visual Studio debugger YOUR way

Leslie Richardson on not so commonly used attribute DebuggerDisplay:

By writing DebuggerDisplay syntax at the top of a class, you can choose what strings and properties you want at the top of each object node in debugger windows. Besides displaying strings in debugger windows, adding curly brackets ({}) to the DebuggerDisplay attribute allows Visual Studio to display the value of a property or method that you specify.

I attempt to create a small console application below to follow the usage of DebuggerDisplay.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace ConsoleApp
{
  [DebuggerDisplay("{LastName}, {FirstName}")]
  public class Worker
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string Address { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string Zip { get; set; }
      public string Phone { get; set; }
  }

  class Program
  {
      static void Main(string[] args)
      {
          List<Worker> workers = new List<Worker>();

          List<Worker> workers = new List<Worker>();
          workers.Add(
              new Worker {
                  FirstName = "Michael",
                  LastName = "Springer",
                  City = "Atlanta",
                  Phone = "001-232-1233"
              });
          workers.Add(
              new Worker {
                  FirstName = "Lloyd",
                  LastName = "Bever",
                  City = "Fort Myers",
                  Phone = ""
              });
          workers.Add(
              new Worker {
                  FirstName = "Vincent",
                  LastName = "Covey",
                  City = "Chester Heights",
                  Phone = "888-232-1233"
              });

          Console.WriteLine(workers.Count);
          Console.ReadKey();
      }
  }
}
QuickWatch - Without DebuggerDisplay
QuickWatch - With DebuggerDisplay

You can also use nq (no quote) specifier if you don’t prefer to see quotes in debug values.

1
2
3
4
5
6
  [DebuggerDisplay("{LastName, nq}, {FirstName, nq}")]
  public class Worker
  {
    //...
  }
}
QuickWatch - DebuggerDisplay with No Quote Specifier

You can further extend DebuggerDisplay if you want to include an expression in debug values. Just add a private method or property in the target class, and provide that method or property to DebuggerDisplay.

1
2
3
4
5
6
7
8
9
[DebuggerDisplay("{DebuggerString(), nq}")]
public class Worker
{
  private string DebuggerString()
  {
      return string.Format($"{FirstName}, {LastName}. Has Phone: {!Phone.Equals(string.Empty)}");
  }
  //...
}
QuickWatch - DebuggerDisplay using Expression

A visual guide to Go Memory Allocator from scratch (Golang)

Ankur Anand has written an in-depth blog post to explain how memory management work in Go.

… the general idea of the Go memory management is to allocate memory using different memory structures using different cache level memory for objects of different sizes. Splitting a single block of consecutive addresses received from the operating system, into a multi-level cache improve the efficiency of memory allocation by reducing the locks and then allocating memory allocations according to the specified size reduces memory fragmentation and facilitates faster GC after the memory is released.