Skip to content

Instantly share code, notes, and snippets.

@lv7777
lv7777 / pointer.c
Created March 25, 2016 04:02
ブログ。cポインタ
#include <stdio.h>
int main(void) {
// your code goes here
char *str="ab";
printf("%p,%d\n",*str,*str);
printf("%p,%d\n",str,str);
printf("%p,%d\n",&str,&str);
return 0;
@lv7777
lv7777 / memo.js
Created April 2, 2016 03:51
javascriptのnew. memo.
var a=function(){this.a=4;return {}}
var aa=new a();
aa.a//undefined
/*
newは基本的にreturnを返しても意味ないけど返り値がobjectの場合はそいつが新しいインスタンスの範囲になる。
*/
@lv7777
lv7777 / nkc.html
Created March 4, 2016 11:57
名古屋エ学院専◯学校のランダム問題応用の回答。FEの時に比べてひどいぐらいのセキュリティ強化だw
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>国家試験ランダム出題</title>
<script language="javascript">
<!--
//クッキーから値を受け取る。(key:項目名) *項目が無い場合、ヌルストリングを返す。
function readcookie(key) {
tmp=document.cookie+";";
@lv7777
lv7777 / AccessModifiers.js
Last active May 8, 2016 15:06 — forked from gaogao-9/AccessModifiers.js
Symbolを利用したprivate/protectedのプロパティ及びメソッドを実装しました。Symbolを利用してるのでgetOwnPropertySymbolsでリフレクション出来ます
const classMap = new Map();
/*
MapとObjectの違い。
*/
//ES6では新しくsymbolという型が定義された。こいつの場合は名前なしシンボルで
//symbolの引数はそのシンボルの説明。そのsymbol自身にアクセスはできない。
const inheritPrototype = Symbol();
const isAccessModifiers = Symbol();
@lv7777
lv7777 / gomi.c
Created June 1, 2016 12:58
一日かけてゴミを作るとか最高にゴミだし死にたい。はあ・・・
#define DEBUG
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<stdbool.h>
#include "lib/MT.h"
@lv7777
lv7777 / mozconfig.txt
Last active June 2, 2016 09:04
mozillaソースコード(mozilla-central)のconfig(mozconfig)の設定一覧。ac_add_options --helpで見れる。解説はそのうち追加。
0:14.42 --enable-cpp-rtti Enable C++ RTTI
実行時に型情報を持って保持。C++における多様性の確保。
___
0:14.42 --enable-gold Enable GNU Gold Linker when it is not already
the default
goldリンカ。googleの人が作っためっちゃ早いリンカ。linux環境のみ?
@lv7777
lv7777 / app.js
Created June 7, 2016 16:10
vue.js memoapp
var express=require("express");
var app=express();
var strage=[];
/**
* wrap in {} in
* id:number
* title:string
* content:string
*
*/
var http=require("http");
var socketio=require("socket.io");//mandatory.
var fs=require("fs")
var server=http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type' : 'text/html'});
res.end(fs.readFileSync(__dirname + '/index.html', 'utf-8'));
});
server.listen(3000);
#include<stdlib.h>
#include<stdio.h>
// void dec2bin(int dec){
// char buf[100];
// printf("%s\n",itoa(dec, buf, 2));
// while(dec>0){
// // printf("%d",dec);
// if(dec%2){
// printf("1");
@lv7777
lv7777 / default_params.js
Last active July 22, 2016 17:14
default引数のテスト
//firefoxスクラッチパッド
var obj;
obj={
a:44,
d:4
};
//成功する
(function defaulttest({a,b}=obj){
console.log(a)
})()