Skip to content

Instantly share code, notes, and snippets.

Avatar
🌾
チョットモデキナイ

Yuki MIZUNO mzyy94

🌾
チョットモデキナイ
View GitHub Profile
View 3Dmodel.js
if(!Detector.webgl) Detector.addGetWebGLMessage();
function modelView(objName){
var path = 'models/';
var suffix = '_LOW';
var extension = '.js';
var renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false, premultipliedAlpha: false });
var s_x = window.innerWidth;
var s_y = window.innerHeight;
View dl-gunzip.js
if (process.argv.length != 3) {
console.error('usage:',
process.argv[0],
process.argv[1],
'<archive url>');
process.exit(1);
}
var url = process.argv[2];
var http = require(url.split(':')[0]);
View capture_raw_frames.c
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
View Output
Driver Caps:
Driver: "omap3"
Card: "omap3/mt9v032//"
Bus: ""
Version: 0.0
Capabilities: 04000001
Camera Cropping:
Bounds: 752x480+0+0
Default: 752x480+0+0
Aspect: 1/1
@mzyy94
mzyy94 / steamos-1.0-118_config.patch
Last active Aug 29, 2015
SteamOS kernel configuration patch [v1.0 118]
View steamos-1.0-118_config.patch
--- linux-3.10.11/.config 2014-06-27 16:07:13.094523227 +0900
+++ /boot/config-3.10-3-amd64 2014-05-14 09:53:56.000000000 +0900
@@ -55,10 +55,10 @@
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_GZIP is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
View honda-3d.css
* {
margin: 0;
padding: 0;
overflow: hidden;
user-select: none;
-webkit-user-select: none;
}
body {
font-family: 'Lato' !important;
font-style: normal;
@mzyy94
mzyy94 / bus_error_test.c
Last active Dec 31, 2015
Bus error: 10 の再現性を確認するためのテスト
View bus_error_test.c
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
int mode = 0;
jmp_buf jb;
static const char* label[] = {"auto/set", "auto/read",
"const/read", "static/set", "static/read",
"register/set", "register/read", "volatile/set",
"volatile/read", "normal/set", "normal/read"};
@mzyy94
mzyy94 / output
Created Dec 18, 2013
bus_error_test.cの出力結果
View output
Last login: Wed Dec 18 11:19:03 on ttys001
mzyy94:~ mzyy94$ cd /Volumes/RamDisk/
mzyy94:RamDisk mzyy94$ gcc bus_error_test.c
mzyy94:RamDisk mzyy94$ ./a.out
ARRAY
mode: [auto/set]
Segmentation fault: 11
mode: [auto/read]
Segmentation fault: 11
mode: [const/read]
@mzyy94
mzyy94 / bus_error.c
Last active Dec 31, 2015
Segmentation faultとBus errorを再現するためのもの
View bus_error.c
int main(int argc, char* argv[]) {
unsigned char c[1];
static unsigned char s[1];
char mode = argc == 2 ? argv[1][0] : '\0';
for(int i = 0; ; i++){
switch(mode) {
case '0':
c[0] = s[i];
break;
View disassemble_bus_error
(lldb) settings set target.run-args 0
(lldb) run
There is a running process, kill it and restart?: [Y/n]
Process 31576 launched: '/Volumes/RamDisk/a.out' (x86_64)
Process 31576 stopped
* thread #1: tid = 0x61fc2, 0x0000000100000f43 a.out`main(argc=2, argv=0x00007fff5fbff838) + 115 at bus_error.c:9, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=2, address=0x100005000)
frame #0: 0x0000000100000f43 a.out`main(argc=2, argv=0x00007fff5fbff838) + 115 at bus_error.c:9
6 for(int i = 0; ; i++){
7 switch(mode) {
8 case '0':