Skip to content

Instantly share code, notes, and snippets.

View kumagi's full-sized avatar
:octocat:
Fine.

Hiroki KUMAZAKI kumagi

:octocat:
Fine.
View GitHub Profile
@kumagi
kumagi / virtual_memory_limit.c
Last active October 29, 2023 07:39
mmap_max
#include <memory.h>
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/mman.h>
#include <stdint.h>
#include <stdio.h>
#include <climits>
#include <algorithm>
int main() {
@kumagi
kumagi / LICENSE.txt
Last active August 23, 2023 00:43
spinlockのベンチマーク
Copyright 2023 Hiroki Kumazaki
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, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@kumagi
kumagi / LICENSE.txt
Last active August 4, 2023 15:33
とても簡単なリングバッファ
Copyright 2023 Hiroki Kumazaki
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, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O

Name

JP: 熊崎 宏樹 EN: Kumazaki Hiroki

Department

search, Google

Title

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
class BIT {
public:
explicit BIT(size_t n) : tree(n + 2) {}
@kumagi
kumagi / blue_particle.go
Created June 14, 2021 02:27
青い●がいっぱい動くサンプル
package main
import (
"log"
"time"
"image/color"
"golang.org/x/image/font"
"golang.org/x/image/font/opentype"
"math/rand"
@kumagi
kumagi / code_reading.md
Created March 12, 2019 17:30 — forked from taichi/code_reading.md
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
# config valid only for current version of Capistrano
lock "3.8.2"
set :application, "my_application"
set :repo_url, "git@github.com:kumagi/my_application"
set :branch, 'master'
set :deploy_to, "/opt/my_application"
set :format, :airbrussh

Sign up Link

<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
  <%= link_to "Sign up", new_registration_path(resource_name) %><br />
<% end -%>
#include <papi.h>
#include <stdio.h>
#include <iostream>
#include <vector>
int main() {
std::vector<int> Events = {
PAPI_BR_MSP,
PAPI_BR_NTK,
PAPI_TLB_IM