https://github.com/colorbox/kaomoji_storage の開発中に見つけた謎挙動
Chrome Version 94.0.4606.71 (Official Build) (x86_64)
Safari Version 15.0 (15612.1.29.41.4, 15612)
で確認
/* | |
下記のようなエラーが出る。 | |
``` | |
Line 173: Char 16: runtime error: reference binding to misaligned address 0xbebebebebebec0b6 for type 'ListNode *', which requires 8 byte alignment (stl_deque.h) | |
0xbebebebebebec0b6: note: pointer points here | |
<memory cannot be printed> | |
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_deque.h:182:16 | |
``` | |
*/ |
https://github.com/colorbox/kaomoji_storage の開発中に見つけた謎挙動
Chrome Version 94.0.4606.71 (Official Build) (x86_64)
Safari Version 15.0 (15612.1.29.41.4, 15612)
で確認
#include<bits/stdc++.h> | |
#define rep(i,n) for(int i = 0; i < (n); i++) | |
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--) | |
#define rep1(i,n) for(int i = 1; i <= (n); i++) | |
#define rrep1(i,n) for(int i = (n); i > 0; i--) | |
#define ll long long | |
#define pi pair<int, int> | |
#define pll pair<ll, ll> |
def split_num(num) | |
("%04d" % num).split('').map(&:to_i) | |
end | |
def split_num_f(num) | |
split_num(num).map(&:to_f) | |
end | |
def twined(nums, symbols) | |
nums.zip(symbols).flatten.compact.map(&:to_s).join('') |
class PriorityQueue | |
attr_accessor :data | |
def initialize(arr=[]) | |
@data = arr | |
end | |
def push(e) | |
@data.push(e) |
eval File.read('doukaku.rb').scan(/gemfile do\n(.*?)\nend/m)[0][0] |
class Hoge | |
attr_accessor :body | |
def initialize(body) | |
@body = body | |
end | |
def squisher | |
pp "i squished #{@body}" | |
@body.squish |
curl -X POST -H "Content-Type: application/json" -H "Authorization: token <your GitHub token>" --data '{"commit_id":"8ae911bfd368794ba8955793faff475dcf0b81b7","body":"test","path":"app/models/space_include_ _file_name.rb","position":2}' https://api.github.com/repos/colorbox/kata/pulls/3/comments |
require 'RMagick' | |
original = Magick::Image.read('original.jpg').first | |
image = original.crop(0, 0, 10, 10) | |
image.write('cropped.jpg') |
import os | |
import shutil | |
import numpy as np | |
from PIL import Image | |
from skimage import data | |
from sklearn.cluster import KMeans | |
cluster_count = 4 | |
feature = np.array([data.imread("./icons/" + path) for path in os.listdir('./icons')]) |