Skip to content

Instantly share code, notes, and snippets.

View watasuke102's full-sized avatar
🤔
なにもしていない

Watasuke watasuke102

🤔
なにもしていない
View GitHub Profile
@watasuke102
watasuke102 / 0_question.md
Last active August 12, 2023 13:43
HumanLoaderContest
module cpu (
input reset,
input clk,
input[3:0] btn,
output[3:0] led,
output[3:0] adr,
input[7:0] dout
);
wire[4:0] op = dout[7:3];
wire[2:0] sss = dout[2:0]; // Instruction set (op is operator,sss is operalnd)
@watasuke102
watasuke102 / 0_ELF.md
Last active August 9, 2023 16:55
man page of ELF + elf.h

引用:https://linuxjm.osdn.jp/html/LDP_man-pages/man5/elf.5.html

概要

ヘッダーファイル <elf.h> は ELF 実行可能バイナリファイルのフォーマットを定義する。 これらのファイルとしては、通常の実行可能ファイル・ 再配置可能オブジェクトファイル・コアファイル・共有ライブラリがある。

ELF ファイルフォーマットを使う実行可能ファイルは、 ELF ヘッダーの後にプログラムヘッダーテーブルまたは セクションヘッダーテーブル (またはその両方) が続く構成である。 ELF ヘッダーは常にファイルのオフセット 0 にある。 プログラムヘッダーテーブルとセクションヘッダーテーブルの ファイル内でのオフセットは、ELF ヘッダーに定義されている。 この 2 つのテーブルはファイルの残りの部分の詳細を記述する。

このヘッダーファイルは上記のヘッダーを C 言語の構造体で記述し、 また動的セクション・再配置可能セクション・シンボルテーブルの構造体も 含んでいる。

/*
DMM英会話において、プロンプトで指定した時刻に予約できる講師を表示
プラスネイティブ限定講師は除外
javascript:void( (() => {const input = window.prompt('time (HH:MM)');const time = input.match(/^(\d\d):(\d\d)$/);if (time === null || time.length !== 3) {window.alert('Invalid type');return;}const time_str = `${time[1]}:${time[2]}`;window.location.href = `https://eikaiwa.dmm.com/list/?data[tab1][lesson_language]=en&data[tab1][start_time]=${time_str}&data[tab1][end_time]=${time_str}&data[tab1][standard_teachers]=on&data[tab1][country]=1,3,4,5,6,10,12,13,14,16,17,18,21,22,23,24,27,28,29,31,32,35,36,37,38,39,40,41,42,43,44,47,48,49,50,52,53,56,57,59,60,61,62,63,64,65,70,72,77,78,79,81,83,84,85,86,88,91,93,94,95,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,120,121,123,124,128,129,131,132,133,134,136,137,140,157,158,166,174,175,177,183,197,198,200,205,209,211,214`;})() )
*/
const input = window.prompt('time (HH:MM)');
const time = input.match(/^(\d\d):(\d\d)$/);
if (time === null || time.length !== 3) {
window.alert
@watasuke102
watasuke102 / keybindings.json
Last active April 28, 2023 00:08
VSCode keybind setting (for Linux?)
[
// General
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditorInGroup",
"when": "!activeEditorGroupEmpty"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditorInGroup",
@watasuke102
watasuke102 / settings.json
Last active June 23, 2023 02:19
VSCode Settings
{
"editor.tabSize": 2,
"editor.fontSize": 13,
"editor.codeLens": false,
"editor.fontFamily": "MyricaM, 'MyricaM M', Consolas, 'Courier New', monospace",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.tabCompletion": "on",
"editor.stickyTabStops": true,
//"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?_",
comp() {
file_list=""
exec_args=""
out_name=""
for arg_raw in $@; do
arg=${arg_raw/.*}
if [[ -e "${arg}.c" ]]; then
file_list="${file_list} ${arg}.c"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <wayland-server-core.h>
#include <xkbcommon/xkbcommon.h>
@watasuke102
watasuke102 / fifo.sv
Created June 7, 2022 13:37
seccamp 2022 課題
module fifo (
input wire clock, // クロック入力
input wire reset, // Active Highの同期リセット入力
input wire in_valid, // 入力VALID
output logic in_ready, // 入力READY
input wire [7:0] in_data, // 入力データ
output logic out_valid, // 出力VALID
input wire out_ready, // 出力READY
@watasuke102
watasuke102 / ExamForm.tsx
Created November 5, 2021 14:02
TAGetherメモ
// TAGether - Share self-made exam for classmates
// ExamForm.tsx
//
// CopyRight (c) 2020-2021 Watasuke
// Email : <watasuke102@gmail.com>
// Twitter: @Watasuke102
// This software is released under the MIT SUSHI-WARE License.
//
import React from 'react';
import { DragDropContext, Droppable, Draggable, DropResult } from 'react-beautiful-dnd';