Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / challenge.md
Created February 19, 2012 08:22
5761455 prime numbers - SECCON CTF Challenge post-game discussion

問題

2以上30以下の素数は次の10個です。

2 3 5 7 11 13 17 19 23 29

これらの素数の中で一番多く出現する数字は1で、5個出現します。2番目に多く出現する数字は2と3がそれぞれ3個ずつ出現します。

2以上10000以下の素数は1229個あり、それらの素数の中で一番多く出現する数字の個数は1の681個です。また2番目は3の677個、3番目は7の652個です。

Voice Meeter Bananaを使ってビデオ会議のノイズ軽減をするメモ.md

自宅でビデオ会議をしていると、空調とか屋外のノイズなどをマイクが拾いがちなので、Voice Meeter Bananaを使ってノイズを軽減するための工夫をあれこれ試してみたメモ。

使うもの

@yoggy
yoggy / SharedMemorySample_read_main.cpp
Created August 22, 2012 05:55
SharedMemory Sample for WIN32
#include <SDKDDKVer.h>
#include <Windows.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
int shmem_size = 16; // 16byte
HANDLE shmem = INVALID_HANDLE_VALUE;
HANDLE mutex = INVALID_HANDLE_VALUE;
@yoggy
yoggy / SerialPort.cpp
Created August 11, 2012 10:58
SerialPort class sample using boost::asio::serial_port
#include "StdAfx.h"
#include <Setupapi.h>
#pragma comment(lib, "Setupapi.lib")
#include "SerialPort.h"
SerialPort::SerialPort(void) : end_of_line_char_('\n')
{
}
@yoggy
yoggy / gist:986333
Created May 23, 2011 06:52
いつも忘れるのでsqlite3でJOINの違いメモ
#
# いつも忘れるのでsqlite3でJOINの違いメモ
#
# 詳しい違いはこの辺参照のこと
#
# Join (SQL) - Wikipedia, the free encyclopedia
# http://en.wikipedia.org/wiki/Join_(SQL)
$ rm -rf a.db
$ sqlite3 a.db
@yoggy
yoggy / DoorBell.js
Last active January 20, 2024 07:41
const particle = $.subNode("particle");
const se1 = $.audio("EC5227CW-chime");
const se2 = $.audio("beep");
// 初期設定
$.onStart(() => {
$.state.lastUpdatedTime = 0;
$.state.remainingTime = 0;
});
@yoggy
yoggy / main.py
Last active January 13, 2024 04:46
#
# clusterのサーバから外部通信を受けるREST API
#
# 参考: https://docs.cluster.mu/script/interfaces/ClusterScript.html#callExternal
#
from firebase_functions import https_fn, options
from firebase_admin import initialize_app
import os
import json
@yoggy
yoggy / GetIpAddrTableSample.c
Created September 26, 2011 10:56
GetIpAddrTable() function sample (for IPv4 only)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include <stdio.h>
#include <winsock2.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
@yoggy
yoggy / get_exe_directory.cpp
Created December 19, 2011 10:53
GetModuleFileName() & boost::filesystem sample
std::string get_exe_fullpath()
{
char path[MAX_PATH];
::GetModuleFileName(NULL, path, MAX_PATH);
return std::string(path);
}
std::string get_exe_filename()
{
boost::filesystem::path path(get_exe_fullpath());
@yoggy
yoggy / GetAdaptersAddressesSample.cpp
Created September 26, 2011 10:28
GetAdaptersAddresses() sample code...
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include <stdio.h>
#include <winsock2.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "iphlpapi.lib")