Monday 25 September 2023

WIN32_LEAN_AND_MEAN and DuckDB

This keeps striking me every other year when building something from sources.

Got a ton of windows.h-related errors when compiling C++ sources is a typical sign.

The correct way would be to define WIN32_LEAN_AND_MEAN when building:

git clone git@github.com:duckdb/duckdb.git --branch v0.8.1 --single-branch
cd duckdb
python scripts/amalgamation.py
md build
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Debug -DAMALGAMATION_BUILD=ON -D CMAKE_CXX_FLAGS="/D WIN32_LEAN_AND_MEAN" ..
cmake --build . --config Debug

Wednesday 6 September 2023

Friday 1 September 2023

Friday 9 June 2023

Color coding for Visual Studio

https://marketplace.visualstudio.com/items?itemName=ryzngard.Carnation2022020
https://studiostyl.es/schemes/notepad2-c
https://studiostyl.es/schemes/search?q=notepad
https://studiostyl.es/schemes/github-light-for-notepad

Monday 22 May 2023

Saturday 20 May 2023

Windows startup locations

Shell:startup
Shell:common startup
%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup


Saturday 13 May 2023

Favourite .style.yapf

[style]
based_on_style = pep8
column_limit = 100
indent_width = 4
allow_split_before_dict_value = false
split_before_named_assigns = false
split_before_closing_bracket = true
split_before_first_argument = false
split_before_expression_after_opening_paren = false
split_arguments_when_comma_terminated = true
COALESCE_BRACKETS = true
DEDENT_CLOSING_BRACKETS = true
INDENT_CLOSING_BRACKETS = false
JOIN_MULTIPLE_LINES = true
SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES = false
SPLIT_COMPLEX_COMPREHENSION = true
SPLIT_ALL_COMMA_SEPARATED_VALUES = false
EACH_DICT_ENTRY_ON_SEPARATE_LINE = false
BLANK_LINES_AROUND_TOP_LEVEL_DEFINITION = 1

Wednesday 8 February 2023

PyCall in Julia to work on Windows with Anaconda

Julia ships its own Miniconda distro and uses to it by default. It actually tries to install this distro, and fails in my case. It fails to many other people too. It cannot know you already have another Python setup available. Help it with the following, when building PyCall. Note that you need to build PyCall manually before using it, or you'll get ERROR: LoadError: PyCall not properly installed. Please run Pkg.build("PyCall").

In Julia prompt, execute:

import Pkg
ENV["PYTHON"] = raw"C:\Users\YOUR_USER\anaconda3\python.exe"
Pkg.build("PyCall")

Tuesday 7 February 2023

Jupyter Lab shortcut, dir listing in a current folder

Make a regular shortcut in a directory where you want Jupyter Lab to open with this target:

C:\WINDOWS\system32\cmd.exe /K "call %HOMEDRIVE%%HOMEPATH%\Anaconda3\Scripts\activate.bat & call jupyter lab && exit"

Set "Start in" as %cd%, and "Run" as Minimized. Done!