- Pentium 以降の世代の CPU なら問題なく実行できる
- VC++ (2005 以降?) なら
<intrin.h>
を#include
して、__cpuid()
および__cpuidex()
を使用する - gcc なら
<cpuid.h>
を#include
して、__get_cpuid()
,__cpuid_count()
を使用する - RDRAND を使ってみたかったのだけど、うちのは対応していなかった!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace MagicallyResolvedOverload | |
{ | |
/// <summary> | |
/// これまで、class だったら T、struct だったら T? を返す、みたいな処理書けなかったんだけど。 | |
/// ちょっと無理やりだけど、C# 7.3 でできなくはない状態に。 | |
/// </summary> | |
public static class EnumerableEx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle '2072/PHP-Indenting-for-VIm' | |
NeoBundle '29decibel/codeschool-vim-theme' | |
NeoBundle '5long/pytest-vim-compiler' | |
NeoBundle '5t111111/alt-gtags.vim' | |
NeoBundle '5t111111/markdown-preview.vim' | |
NeoBundle '5t111111/neat-json.vim' | |
NeoBundle 'Align' | |
NeoBundle 'AndrewRadev/inline_edit.vim' | |
NeoBundle 'AndrewRadev/multichange.vim' | |
NeoBundle 'AndrewRadev/splitjoin.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* brainfuck.s */ | |
.intel_syntax noprefix | |
.globl _start | |
_start: | |
lea edx, mem | |
lea esi, bfcode | |
loop: | |
mov al, [esi] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" This is a port of CC500 | |
" http://homepage.ntlworld.com/edmund.grimley-evans/cc500/ | |
" | |
"------------------------------------------------------------------------------- | |
" ORIGINAL HEADER | |
"------------------------------------------------------------------------------- | |
" Copyright (C) 2006 Edmund GRIMLEY EVANS <[email protected]> | |
" | |
" This program is free software; you can redistribute it and/or modify | |
" it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Check SSE/AVX support. | |
This application can detect the instruction support of | |
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX. | |
*/ | |
#include <iostream> | |
#ifdef _MSC_VER | |
#include <intrin.h> | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger ([email protected]) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fizz = function f() { | |
fizz = function () { | |
fizz = function () { | |
fizz = f | |
return "Fizz" | |
} | |
} | |
} | |
buzz = function f() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lisp interpreter in 90 lines of C++ | |
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second. | |
Just for fun I wondered if I could write one in C++. My goals would be | |
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly... | |
2. ...in no more than 90 lines of C++. | |
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake! |