Skip to content

Instantly share code, notes, and snippets.

View shyouhei's full-sized avatar

卜部昌平 shyouhei

View GitHub Profile

ASUS ZenBook 3 ファーストインプレッション

前使ってたSony VAIO Pro 11が壊れた。

"Sony"は勘違いではなく、実際まだVAIOが分社化する前に買ったものだ。なのでかなりながらく使っていたと思う。すぐ壊れるという前評判と経験則をおおいに裏切って延長保証が切れるまでなんの問題もなく動き続けてくれた。買ってよかったと思う。

とはいうものの壊れてしまったので、別のものを買わなければいけないのだが、残念ながら今回はVAIOは選択肢に入らない。VAIO Pro 11に相当する後継製品がないからだ。なおS11はキーボードがNG。

色々と調べた限りでは国内で買える選択肢は少なそう。しょうがないので、ASUS ZenBook 3 UX390UAKを個人輸入でUS Amazonで買った。

@shyouhei
shyouhei / gist:266178ffedab5767a5b69b972c76f88a
Created September 27, 2017 07:31
優秀なプログラマーになるためのコツ

優秀なプログラマーになるためのコツ

重要な順で

優秀なプログラマーになるには非常に長い時間がかかるという現実を直視すべし

優秀なプログラマーというのは寝ている間に異世界に召喚されて無双するのとはわけが違うんですよ。

自分の例で言うとプログラミングを始めた中学生の時から優秀なプログラマだったかって、そんなわけない。みんなヘッポコからスタートしているに決まってるわけです。以来二十余年、地道に生き恥を晒し続けてきた結果として、現在いちおう業界の末席を汚すところまで来ている。このプロセスから目を背けるべきではないです。優秀なプログラマーに生まれる人間なんかいない。優秀なプログラマーに「育つ」んだし、それには時間が必要。今日から無双したいと思うな。

From ad69876f1cb22a7330e19a73fe5760c06ef92d32 Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <[email protected]>
Date: Mon, 11 Dec 2017 16:25:23 +0900
Subject: [PATCH] R.I.P OPT_CALL_THREADED_CODE (2005-2017)
Not me, but revision r60763 killed this feature. It seems no one
has bothered that silent breakage so far. I cannot but conclude
that it has no practical usage. Let us delete the macro and
related codes to make things simpler.
/* -*- mode:c; style:ruby; coding: utf-8; indent-tabs-mode: nil -*- */
/* This is an auto-generated file and is a part of the programming language
* Ruby. The person who created a program to generate this file (``I''
* hereafter) would like to refrain from defining licensing of this generated
* source code.
*
* This file consist of many small parts of codes copyrighted by each authors,
* not only the ``I'' person. Those original authors agree with some
* open-source license. I believe that the license we agree is the condition
diff --git a/tool/ruby_vm/scripts/insns2vm.rb b/tool/ruby_vm/scripts/insns2vm.rb
index b1c604b570..ca857aacc4 100644
--- a/tool/ruby_vm/scripts/insns2vm.rb
+++ b/tool/ruby_vm/scripts/insns2vm.rb
@@ -22,7 +22,7 @@ def router argv
def generate_parser
OptionParser.new do |this|
- this.on "-I", "--srcdir=DIR", <<~'end'
+ this.on "-I", "--srcdir=DIR", <<-'end'
zsh % git svn dcommit
Committing to svn+ssh://[email protected]/ruby/trunk ...
M include/ruby/ruby.h
Committed r61905
M include/ruby/ruby.h
r61905 = 2453ad5cc2cb94d9d446feaff2aa8b49feef365d (refs/remotes/svn/trunk)
M include/ruby/ruby.h
Committed r61906
M include/ruby/ruby.h
r61906 = e7ac1c60436023bd9ff7ae99cca11fe3c16e1ed1 (refs/remotes/svn/trunk)
--- before.txt 2018-01-26 13:38:32.000000000 +0900
+++ after.txt 2018-01-26 13:38:57.000000000 +0900
@@ -719,15 +719,15 @@ miniruby[0x1002259d7] <+3223>: movq %r
miniruby[0x1002259da] <+3226>: movq %r15, %rsi
miniruby[0x1002259dd] <+3229>: vzeroupper
miniruby[0x1002259e0] <+3232>: callq 0x100218b00 ; vm_trace at vm_insnhelper.c:3805
-miniruby[0x1002259e5] <+3237>: leaq 0x8(%r14), %rax
-miniruby[0x1002259e9] <+3241>: movq %r14, %rcx
-miniruby[0x1002259ec] <+3244>: movq %rax, (%r15)
-miniruby[0x1002259ef] <+3247>: movq %rax, %r14
Index: trunk/compile.c
===================================================================
--- trunk/compile.c (revision 63362)
+++ trunk/compile.c (working copy)
@@ -8929,7 +8929,7 @@
dump_body.ci_entries = ibf_dump_ci_entries(dump, iseq);
dump_body.cc_entries = NULL;
dump_body.variable.coverage = Qnil;
- dump_body.variable.original_iseq = Qnil;
+ dump_body.variable.original_iseq = NULL;
diff --git a/string.c b/string.c
index 435954d313..8a264acef4 100644
--- a/string.c
+++ b/string.c
@@ -9220,11 +9220,9 @@ rb_str_crypt(VALUE str, VALUE salt)
{
#ifdef HAVE_CRYPT_R
VALUE databuf;
- struct crypt_data *data;
-# define CRYPT_END() ALLOCV_END(databuf)