Skip to content

Instantly share code, notes, and snippets.

View shouth's full-sized avatar
💭
🤩

Shota Minami shouth

💭
🤩
View GitHub Profile
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>,
}
#include <array>
#include <cstddef>
#include <variant>
#include <utility>
#include <iostream>
namespace brainfuck {
enum class error_reason {
MISMATCHING_SQUARE_PARENTHESIS,

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

// ==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

これは何

ソフトウェア工学の課題でHello, world!難読化の課題が出たので面白がってやってたら何個かできたので紹介するよ! 授業では課題の提出物から何個かピックアップされて紹介されてたけど,作者はこの課題の締切には間に合わせたけど提出が遅かったからピックアップの対象の中に入ってさえいなかったよ!ちょっと悲しいね!

各プログラムの解説を途中まで書いてたけどめんどくさくなってきたから各プログラムの紹介で読解のためのヒント出す程度に留めることにするよ!

ただ読解するにも通常とはやや異なる書き方をしている部分があるから先にそこの説明だけしておくよ!

C言語では

@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>
@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'