Skip to content

Instantly share code, notes, and snippets.

수치 미분 Numerical Differentitaion link

f(x) = ax^n f`(x) = anx^(n-1) = df/dx (x) // 구조적으로 미분하는 해석적 방법

하지만 컴터엔 무한소가 없기때문에 수치 미분을 함

df/dx (x) = ( f(x + dx) - f(x) ) / dx // forward differentiation

@brianhassel
brianhassel / PreventSleep.cs
Last active June 24, 2024 18:42
Prevent Computer Sleep in C#
internal static class NativeMethods {
public static void PreventSleep() {
SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired);
}
public static void AllowSleep() {
SetThreadExecutionState(ExecutionState.EsContinuous);
}
@leafbird
leafbird / fstream_utf8.cpp
Created June 25, 2013 15:25
std::fstream 계열로 파일 I/O를 할 때 utf-8인코딩을 사용하도록 설정하는 코드. 출처 : http://sockbandit.wordpress.com/2012/05/31/c-read-and-write-utf-8-file-using-standard-libarary/
#include <fstream>
#include <iostream>
#include <string>
#include <locale>
#include <codecvt>
...
// Write file in UTF-8
std::wofstream wof;
wof.imbue(std::locale(std::locale::empty(), new std::codecvt_utf8<wchar_t,0x10ffff,std::generate_header>));
@millermedeiros
millermedeiros / .vimrc
Last active December 11, 2023 14:44
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR