View fibonacci.py
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
class Fib: | |
def __init__(self, max): | |
self.max = max | |
def __iter__(self): | |
self.a = 0 | |
self.b = 1 | |
return self | |
def __next__(self): |
View redmine gitlab sync
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 ruby | |
require 'faraday' | |
require 'json' | |
require 'gitlab' | |
module Redmine | |
Host = nil | |
APIKey = nil |
View timestamp.py
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
import datetime | |
# 2012-12-15 10:14:51.898000 | |
print datetime.datetime.utcnow() | |
# The now differs from utcnow as expected | |
# otherwise they work the same way: | |
# 2012-12-15 11:15:09.205000 | |
print datetime.datetime.now() |
View CameraCalibrator.cpp
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 file contains material supporting chapter 9 of the cookbook: | |
Computer Vision Programming using the OpenCV Library. | |
by Robert Laganiere, Packt Publishing, 2011. | |
This program is free software; permission is hereby granted to use, copy, modify, | |
and distribute this source code, or portions thereof, for any purpose, without fee, | |
subject to the restriction that the copyright notice may not be removed | |
or altered from any source or altered source distribution. | |
The software is released on an as-is basis and without any warranties of any kind. |
View CMakeLists.txt
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
# Copyright (c) 2012 Marwan Abdellah <abdellah.marwan@gmail.com> | |
# Minimum required CMake version | |
cmake_minimum_required(VERSION 2.6) | |
# FFT | |
PROJECT(FFT_CV) | |
# Add CMake modules | |
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake) |
View strassen.cpp
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 <iostream> | |
using namespace std; | |
const int N = 6; //Define the size of the Matrix | |
template<typename T> | |
void Strassen(int n, T A[][N], T B[][N], T C[][N]); | |
template<typename T> |
View speedup.py
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/python2 | |
''' | |
SYNOPSIS: | |
$ python speedup.py -f FILE | |
or | |
$ python speedup.py -d DIR | |
''' |
View raise.py
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/python | |
# Filename: raising.py | |
class ShortInputException(Exception): | |
'''A user-defined exception class.''' | |
def __init__(self, length, atleast): | |
Exception.__init__(self) | |
self.length = length | |
self.atleast = atleast | |
try: |
View hexo_compile.sh
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
#!/bin/zsh | |
CUR_DIR=$PWD | |
HEXO=/Users/wzpan/Documents/workspace/repositories/hexo-blog | |
PUBLISH=/Users/wzpan/Documents/workspace/repositories/wzpan | |
CSS=$HEXO/themes/bootstrap/source/css | |
JS=$HEXO/themes/bootstrap/source/js | |
DIST=$HEXO/themes/bootstrap/source/dist | |
PUBLIC=$HEXO/public |
View RobustMatcher.h
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 file contains material supporting chapter 9 of the cookbook: | |
Computer Vision Programming using the OpenCV Library. | |
by Robert Laganiere, Packt Publishing, 2011. | |
This program is free software; permission is hereby granted to use, copy, modify, | |
and distribute this source code, or portions thereof, for any purpose, without fee, | |
subject to the restriction that the copyright notice may not be removed | |
or altered from any source or altered source distribution. | |
The software is released on an as-is basis and without any warranties of any kind. |
NewerOlder