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
require 'set' | |
require 'json' | |
require 'tree' | |
require 'fileutils' | |
# convert C globals to structures using clang ast json dump | |
# algorithm description | |
# - get AST with clang | |
# - convert AST into ruby tree |
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
//usr/bin/make -s "${0%.*}" CFLAGS="-O2 -Wall -Werror" && ./"${0%.*}" "$@"; s=$?; rm ./"${0%.*}"; exit $s | |
#include <stdio.h> | |
#include <stdbool.h> | |
enum option_tag { OPTION_SOME, OPTION_NONE }; | |
#define option_type(T) { enum option_tag tag; T some; } | |
#define SOME(S) { .tag = OPTION_SOME, .some = S } | |
#define NONE() { .tag = OPTION_NONE } |
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 React, { useState } from 'react'; | |
import { withStyles } from '@material-ui/core/styles'; | |
import TextField from '@material-ui/core/TextField'; | |
import Button from '@material-ui/core/Button'; | |
import Dialog from '@material-ui/core/Dialog'; | |
import DialogActions from '@material-ui/core/DialogActions'; | |
import DialogContent from '@material-ui/core/DialogContent'; | |
import DialogContentText from '@material-ui/core/DialogContentText'; | |
import DialogTitle from '@material-ui/core/DialogTitle'; | |
import axios from 'axios'; |
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
msys2 vs msys vs msysgit | |
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin | |
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows. | |
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only | |
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation. | |
MinGW provides headers and libraries so that GCC (a compiler suite, | |
not just a "unix/linux compiler") can be built and used against the Windows C runtime. |
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
#!/usr/bin/env python3 | |
from __future__ import annotations | |
import json | |
class CompactJSONEncoder(json.JSONEncoder): | |
"""A JSON Encoder that puts small containers on single lines.""" | |
CONTAINER_TYPES = (list, tuple, dict) |
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
# in a terminal | |
# python -m pip install --user opencv-contrib-python numpy scipy matplotlib ipython jupyter pandas sympy nose | |
import cv2 | |
import pandas as pd | |
import numpy as np | |
import imutils | |
from scipy.spatial import distance as dist | |
from imutils import perspective |
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.8) | |
project(tsProject) | |
# Managing translations require LinguistTools module | |
# The cmake function is defined in the Qt installation tree: | |
# i.e. Qt5.9.1/5.9.1/gcc_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake | |
# Reference: https://doc.qt.io/qt-5/cmake-manual.html#qt5linguisttools-macros | |
find_package(Qt5 COMPONENTS Widgets LinguistTools) | |
set (CMAKE_CXX_STANDARD 11) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
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
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [{ | |
"taskName": "Run Python", | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
}, |
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
node_modules | |
dist/ | |
yarn.lock | |
wwwroot |
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
/* | |
* Demo of libpq. | |
* Build: g++ libpq-demo.cc -o libpq-demo -lpq | |
* Run: ./libpq-demo | |
*/ | |
#include <arpa/inet.h> | |
#include <iostream> | |
#include <libpq-fe.h> | |
#include <sstream> |
NewerOlder