Skip to content

Instantly share code, notes, and snippets.

View shouth's full-sized avatar
💭
🤩

Shota Minami shouth

💭
🤩
View GitHub Profile
@shouth
shouth / kit-proxy-for-gnome.bash
Created January 4, 2020 19:26
Detect Wi-Fi connection to KITnet and switch proxy variables of gnome desktop.
#!/bin/bash
user=$(users | cut -d ' ' -f1)
user_gnome_pid=$(pgrep -U $user gnome-session | head -n 1)
user_gnome_dbus_session=$(strings "/proc/$user_gnome_pid/environ" | grep DBUS_SESSION_BUS_ADDRESS)
export $user_gnome_dbus_session
host='proxy.cis.kit.ac.jp'
port='8080'
namespace shouth
{
struct Bool { };
struct True : public Bool { };
struct False : public Bool { };
namespace detail
{
#include <iostream>
#include <optional>
#include <tuple>
#include <type_traits>
#include <utility>
namespace shouth
{
namespace detail
{
#pragma once
#include <algorithm>
#include <initializer_list>
#include <numeric>
#include <memory>
#include <new>
#include <stdexcept>
#include <cstdint>
#include <cstddef>
use std::marker::PhantomData;
trait Nat { }
struct _0 { }
impl Nat for _0 { }
struct Suc<T: Nat> {
n: PhantomData<T>,
}

プロジェクト実習2で作成したCPUシミュレータを置いてます.

#include <array>
#include <cstddef>
#include <variant>
#include <utility>
#include <iostream>
namespace brainfuck {
enum class error_reason {
MISMATCHING_SQUARE_PARENTHESIS,
// ==UserScript==
// @name AtCoder Better Highlighter
// @name:en AtCoder Better Highlighter
// @namespace https://shouth.net/
// @version 0.5.4
// @description highlight.jsを使用してAtCoderの提出コードの表示を置き換えるUserScriptです.
// @description:en Better syntax highlighting for AtCoder using highlight.js.
// @author shouth
// @resource css https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/styles/default.min.css
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/highlight.min.js
@shouth
shouth / sudoku_solver.c
Last active July 16, 2020 23:23
Sudoku solver with Dancing Links and Knuth's Algorithm X.
/**
* @file sudoku_solver.h
* @brief Dancing Linksで数独をExact Cover ProblemとしてKnuth's Algorithm Xで解くプログラムです.
* @note 課題の提出からしばらく経ってポインタの理解が深まってから書き直したバージョンです.
* @author Shota Minami
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<chrono>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<fstream>
#include<string>
#include<utility>
#include<gmpxx.h>
#include<omp.h>
#include<unistd.h>