Skip to content

Instantly share code, notes, and snippets.

View V0XNIHILI's full-sized avatar
🎯
Focusing

Douwe den Blanken V0XNIHILI

🎯
Focusing
View GitHub Profile
@laobubu
laobubu / ABOUT.md
Last active April 13, 2026 00:55
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@jcushman
jcushman / example.sql
Created February 9, 2017 19:40
Store JSON history with the fast-json-patch library and Postgresql triggers
-- Enable pl/v8:
CREATE EXTENSION plv8;
-- Create json history table:
CREATE TABLE json_history (id BIGSERIAL PRIMARY KEY, tstamp timestamp DEFAULT now(), table_name text, column_name text, target_id bigint, transform json);
-- Create test table:
CREATE TABLE test_json (id BIGSERIAL PRIMARY KEY, data JSON);
-- Enable history tracking on test_json.data:
@avalcarce
avalcarce / README.md
Created February 27, 2017 09:27
Solving MountainCar-v0 with DQN in the least possible number of learning episodes for a minimum average reward of -110.

Synopsis

This is a Deep Reinforcement Learning solution to some classic control problems. I've used it to solve MountainCar-v0 problem, CartPole-v0 and [CartPole-v1] (https://gym.openai.com/envs/CartPole-v1) in OpenAI's Gym. This code uses Tensorflow to model a value function for a Reinforcement Learning agent. I've run it with Tensorflow 1.0 on Python 3.5 under Windows 7.

Some of the hyperparameters used in the main.py script to solve MountainCar-v0 have been optained via Bayesian optimization with Scikit-Optimize. The optimized hyperparameters and their values are:

  • Size of 1st fully connected layer: 47
  • Size of 2nd fully connected layer: 197
  • Epsilon (as in greedy epsilon exploration) decay factor: 0.8513032459
  • Minimum epsilon: 1.872686e-05
@max-mapper
max-mapper / bibtex.png
Last active November 19, 2025 13:01
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
/*
* Verilog Simulator checker by predefined macro.
*
* Copyright (C) 2017 MURAMATSU Atsushi <amura@tomato.sakura.ne.jp>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
@helo9
helo9 / xfoil.py
Last active January 4, 2025 04:24
use python to run xfoil analysis
# -*- coding: utf-8 -*-
import os
import numpy as np
import subprocess as sp
import re
def polar(afile, re, *args,**kwargs):
"""calculate airfoil polar and load results
@naesheim
naesheim / buildWhenAffected.sh
Last active December 7, 2025 19:59
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
@m4kvn
m4kvn / aws_ec2_latex_setting.md
Last active December 24, 2019 11:44
AWS EC2 に LaTeX 環境を構築する

AWS EC2 に LaTeX 環境を構築する

[ec2-user ~]$ wget http://ftp.jaist.ac.jp/pub/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
[ec2-user ~]$ tar xzf install-tl-unx.tar.gz
[ec2-user ~]$ cd install-tl-2017xxxx
[ec2-user ~]$ sudo ./install-tl

Enter command に対して I を入力するとインストールが始まる

@ouwenshi
ouwenshi / brent_kung_adder.v
Last active October 25, 2024 20:29
An n-bit brent kung adder (parallel prefix adder) with user defined group size.
`define INPUTSIZE 64 //set the input size n
`define GROUPSIZE 8 //set the group size = 1, 2, 4 or 8
module Brent_Kung_Adder(A,B,S);
input [`INPUTSIZE - 1:0] A;
input [`INPUTSIZE - 1:0] B;
output [`INPUTSIZE:0] S;
wire [`INPUTSIZE / `GROUPSIZE * 2 - 1:0] r_temp;
@brandon1024
brandon1024 / BatteryStatusNotification.scpt
Last active October 5, 2024 04:07
Battery Percentage Boundary Notification Background Script for macOS
repeat
set chargeState to do shell script "pmset -g batt | awk '{printf \"%s %s\\n\", $4,$5;exit}'"
set percentLeft to do shell script "pmset -g batt | egrep -ow '([0-9]{1,3})[%]' | egrep -ow '[0-9]{1,3}'"
considering numeric strings
if chargeState contains "Battery Power" and percentLeft ≤ 40 then
display notification "Time to plug me in :)" with title "Battery Charge Boundary"
else if chargeState contains "AC Power" and percentLeft ≥ 80 then
display notification "Time to unplug me :)" with title "Battery Charge Boundary"
end if
end considering