Links about useful stuff.

Combinations with sum

To find all the possible combination for a given sector in a killer sudoku or in a “between 1 and 9” sudoku.

Find all combinations for a between 1 and 9 that sums to 18 with 3 cells

from itertools import combinations
print [c for c in combinations([2,3,4,5,6,7,8], 3) if sum(c) == 18]

Find all combinations in a killer for a sum of 22 in 3 cells

from itertools import combinations
print [c for c in combinations([1,2,3,4,5,6,7,8,9], 3) if sum(c) == 22]

Init git submodules

git submodule update --init --recursive
git submodule update --recursive
git submodule update --recursive --remote

Clean PowerShell history

  • Clear Windows 10 (Server 2016) history “feature” Remove-Item (Get-PSReadlineOption).HistorySavePath
  • Reset the console buffer ALT+F7
  • Clear PSReadline’s session history [Microsoft.PowerShell.PSConsoleReadLine]::ClearHistory()
  • Clear PowerShell’s own history Clear-History

Commands taken from this stackoverflow article