Skip to content

Instantly share code, notes, and snippets.

View retorillo's full-sized avatar

Retorillo retorillo

View GitHub Profile

Solution1: dir

dir X: > NULL && echo Successfully reconnected!

Solution2: net use /delete

net use X: /delete && net use X: \\target_computer\target_dir

GDI+

Gdiplus Namespace

GDI+ identifiers are defined inside Gdiplus namespace.

If compiler said "undefined identifier" error message, Check identifier's namespace, or consider to use using directive.

GdiplusStartup and GdiplusShutdown

On Windows, most distributions uses dos as default format, and note that set fileformat=unix on vimrc cannot affect with newly created buffer. Use fileformats rather than fileformat.

" ~/.vimrc or ~/_vimrc (depends on distribution)
set fileformats=unix,dos
@retorillo
retorillo / arduino_uno+st7735_tft.md
Last active August 21, 2017 05:58
Arduino Uno + Adafurit ST7735 TFT で連装砲くんを走らせる

Arduino Uno + Adafurit ST7735 TFT で連装砲くんを走らせる

Video

要件

  • Arduino UNO
  • Adafurit ST7735またはGFXベースのTFT (今回はSainSmart 1.8 TFTを使用しました)

配線

バッチでセミコロン区切りのPATHをループ処理する

これら以外の方法でも不可能ではないと思われますが記述が非常に複雑になると思います。 シンプルな方法としては以下の2つがあるようです。

セミコロンを引用符でくくる

@echo off
for %%A in ("%PATH:;=";"%") do (

How to write your own build script by using benefit from MSBuild environment variables configuration corresponding specified platform (C++)

The following XML enables to resolve this challenge. SetBuildDefaultEnvironmentVariables is key of this.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="ManualBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PlatformToolset>v140</PlatformToolset> <!-- (Optional) only if want to explicitly specify platform toolset version -->
 8.1 
@retorillo
retorillo / cl.bat
Last active April 1, 2018 17:52
My commandline compiler and linkers settings for Windows x64
@"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe" %*
@retorillo
retorillo / Windows C Compiler.ps1
Created September 26, 2016 09:49
Minimal PowerShell Script for Windows C Compiler (Requires Windows 10 SDK & Visual Studio 2015 Community)
$sdkver = "10.0.14393.0"
$sdkdir = "${env:ProgramFiles(x86)}\Windows Kits\10"
$sdkincdir = "$sdkdir\Include\$sdkver"
$sdklibdir = "$sdkdir\Lib\$sdkver"
$vcdir = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\VC"
$env:path += ";$vcdir\bin\amd64;$sdkdir\bin\amd64"
$env:include += ";$vcdir\include" `
+ ";$sdkincdir\shared;$sdkincdir\ucrt;$sdkincdir\um;$sdkincdir\winrt"
$env:lib += ";$vcdir\lib\amd64;$sdklibdir\ucrt\x64;$sdklibdir\um\x64"
$env:libpath += "$vcdir\lib\amd64"
@echo off
setlocal
for /F %%a IN ('echo %1^|findstr /R ^[0-9][0-9]*$') DO set arg1num=%%a
IF "%1"=="%arg1num%" (
doskey /history | findstr /N /R .* | findstr /B %1: > %TEMP%\__history.tmp
FOR /F "delims=: tokens=1*" %%a IN (%TEMP%\__history.tmp) DO @echo %%b
) ELSE (
IF "%1"=="" (
doskey /history | findstr /N /R .*
) ELSE (

LaTeX memo

Math

  • Vector \overrightarrow{a} (wider) vs \vec{a} (shorter)
  • Matrix and Determinant \begin{pmatrix} ... \end{pmatrix} (parentheses) or begin{vmatrix} ... \end{vmatrix} (simple vertical bar). Each of elements are separated by ampersand &, each of rows are separated by //
  • Cofactor \widetilde{A} (wider) vs \tilde{A} (shorter)
  • Minor determinant \overline{A} (wider) vs \bar{A} (shorter)
  • other symbols: amssymb