This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.10) | |
# Set your project name and version | |
project(MyClangProject VERSION 1.0) | |
# Specify the C++ standard | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_CXX_STANDARD_REQUIRED True) | |
# add_link_options("-fuse-ld=lld") | |
set(NO_RTTI "-fno-rtti") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IO(object): | |
@classmethod | |
def ret(cls, x): | |
return IOReturn(x) | |
def bind(self, f): | |
return IOBind(self, f) | |
class IOBind(IO): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE UnicodeSyntax #-} | |
type ℝ = Float | |
data ℝ³ = ℝ³ !ℝ !ℝ !ℝ deriving (Show) | |
(⋅) ∷ ℝ³ → ℝ³ → ℝ | |
(ℝ³ x1 x2 x3) ⋅ (ℝ³ y1 y2 y3) = x1 * y1 + x2 * y2 + x3 * y3 | |
main = | |
let x = ℝ³ 2 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection, models | |
class PrefetchIDMixin(object): | |
def prefetch_id(self): | |
# <https://djangosnippets.org/snippets/2731/> | |
cursor = connection.cursor() | |
cursor.execute( | |
"SELECT nextval('{0}_{1}_{2}_seq'::regclass)".format( | |
self._meta.app_label.lower(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import inspect | |
def record_point(name=''): | |
pid = os.getpid() | |
f = inspect.currentframe() | |
# redis.set ... | |
print('{} = {}:{}:{}'.format( | |
pid, | |
f.f_back.f_code.co_filename, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% funkcja pierwotna | |
f = @(x1,x2) 10*(2*x2.^2-x1).^2+(x2-2).^2; | |
% gradient | |
df = @(x) [ | |
20*x(1) - 40*x(2)^2; | |
2*x(2) - 80*x(2)*(x(1) - 2*x(2)^2) - 4 | |
] | |
% macierz drugich pochodnych |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat ~/.tmux.conf | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" | |
set -g mode-mouse on | |
set -g mouse-resize-pane on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g base-index 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set shell=/bin/sh | |
" vundle | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
" paczki | |
Bundle 'tpope/vim-fugitive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
char* logo = | |
" ____ ____ ____ ____\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VTKFile type="UnstructuredGrid"> | |
<UnstructuredGrid> | |
<!-- kawal danych --> | |
<Piece NumberOfPoints="3" NumberOfCells="1"> | |
<!-- wartosci w punktach --> | |
<PointData Scalars="Coolness"> | |
<DataArray Name="Coolness" type="Float32"> | |
1.0 | |
1.0 | |
1.2 |
NewerOlder