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
// BEGIN CUT HERE | |
// END CUT HERE | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> |
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
// use closure to avoid global nemespace pollution | |
var opentimetable = (function() { | |
// load libraries as pseudo global constants | |
const LIB = {}; | |
Components.utils.import("resource://opentimetable/Preferences.js", LIB); | |
Components.utils.import("resource://opentimetable/StringBundle.js", LIB); | |
Components.utils.import("resource://opentimetable/Console.js", LIB); | |
const prefs = new LIB.Preferences("extensions.opentimetable."); | |
const strings = new LIB.StringBundle("chrome://opentimetable/locale/opentimetable.properties"); | |
var loglevel = prefs.get("loglevel"); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<?xml-stylesheet href="chrome://opentimetable/skin/opentimetable.css" type="text/css"?> | |
<!DOCTYPE overlay SYSTEM "chrome://opentimetable/locale/opentimetable.dtd"> | |
<overlay id="opentimetable-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | |
<script src="opentimetable.js" type="application/javascript"/> | |
<statusbar id="status-bar"> | |
<statusbarpanel id="opentimetable-statusbarpanel" class="disabled" | |
tooltiptext="&opentimetable.statusbarpanel.tooltip;" | |
onclick="opentimetable.togglePanel();"> |
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
var EXPORTED_SYMBOLS = ["Console", "debug"]; | |
const Cc = Components.classes; | |
const Ci = Components.interfaces; | |
const Cr = Components.results; | |
const Cu = Components.utils; | |
function isArray(v) v && typeof v=="object" && v.constructor.name=="Array"; | |
function isObject(v) v && typeof v=="object" && v.constructor.name=="Object"; |
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
グローバル汚染を避ける方法(ブロックスコープ)について | |
グローバル変数を避けるには単純な命名規則を用いるか、スコープ変数を利用するかどちらかが可能。 | |
スコープは関数による関数スコープ、with 文によるスコープ、let によるブロックスコープがある。 | |
1. _ で始まるオブジェクトプロパティを利用する | |
利点: 単純。シンプル。簡単。 | |
欠点: 内部のみで利用する変数や関数に命名規則が必要。そのアクセス時は this を付ける必要がある。特にイベントハンドラや setTimeout, Array.filter などに渡すコールバック関数の内部では this が切り替わるため不便。 | |
また、変数やメソッドの定義末尾の , を書き忘れて構文エラーによくなる。 |
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
window.addEventListener('load', function() { recommend.init(); }, false); | |
window.addEventListener("unload", function() { recommend.uninit(); }, false); | |
var recommend = { | |
recommendListUrl: 'https://secure.mozilla-japan.org/fxce/recommended-addons/rules.json', | |
firstRunPageUrl: 'https://dev.mozilla.jp/campusedition/recommend-howto/', | |
recommendNumber: 3, | |
htmlns: 'http://www.w3.org/1999/xhtml', | |
iconUri: 'https://addons.mozilla.org/en-US/firefox/images/addon_icon/', | |
linkUriPre: 'https://addons.mozilla.org/ja/firefox/addon/', |
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
CV_IMPL int | |
cvRunHaarClassifierCascade( const CvHaarClassifierCascade* _cascade, | |
CvPoint pt, int start_stage ) | |
{ | |
int result = -1; | |
int p_offset, pq_offset; | |
int i, j; | |
double mean, variance_norm_factor; | |
CvHidHaarClassifierCascade* cascade; |
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
#include "precomp.hpp" | |
#include <stdio.h> | |
/*#if CV_SSE2 | |
# if CV_SSE4 || defined __SSE4__ | |
# include <smmintrin.h> | |
# else | |
# define _mm_blendv_pd(a, b, m) _mm_xor_pd(a, _mm_and_pd(_mm_xor_pd(b, a), m)) | |
# define _mm_blendv_ps(a, b, m) _mm_xor_ps(a, _mm_and_ps(_mm_xor_ps(b, a), m)) | |
# 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
function() { | |
alert("hello"); | |
} |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
tcget.py | |
Kosei Moriyama <[email protected]> | |
''' | |
import BeautifulSoup |
OlderNewer