This file contains hidden or 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
# python private/protected method test | |
class MyClass: | |
def __init__(self): | |
self.publicMember1 = "Public Member" | |
self._privateMember1 = "Private Member" | |
self.__protectedMember1 = "Protected Member" | |
def printPublic(self): | |
print ("This is Public Method") |
This file contains hidden or 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> | |
#include <vector> | |
//===================================================== | |
// V1 : Wraper class of vector ( has vector ) | |
//===================================================== | |
template < class T , int dim > | |
class MultiVector { | |
public: |
./run_tmux_remote [-boh] command
- w/o option : run (default) command on new tmux window and get in
- -b : run command on new tmux in batch mode
- -o : open last tmux window or new window
- -r : run without default command
- -w : generate example file for setup
- -ws : generate run_on_tmux script ( this may be slightly faster than default )
- -h : display this help
This file contains hidden or 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> | |
#include <vector> | |
#include <algorithm> | |
class Ranger { | |
public: | |
typedef int value_type; | |
struct iterator { | |
iterator(size_t counter) : counter(counter) {} | |
iterator operator++(){ return iterator(++counter); } | |
bool operator!=(iterator o) { return counter != o.counter; } |
This file contains hidden or 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 <string> | |
#include <iostream> | |
#include <sstream> | |
#include <iomanip> | |
#include <stdlib.h> | |
class SafeFormatter{ | |
public: | |
SafeFormatter( const char * s ):fForm(s),fIterator(fForm.begin()){} | |
void compile(){return ;} | |
template< typename T, typename ... A > |
This file contains hidden or 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/bash | |
brew cask info $(brew cask list) | perl -nlE'/^(\S+):\s+(\S+)/ and chdir"/usr/local/Caskroom/$1/" and !-d$2 and say "brew cask uninstall $1 && brew cask install $1"' | |
This file contains hidden or 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 python3 | |
def load_on_default( obj, pargs ): | |
for k, v in pargs.items(): | |
if( hasattr( obj, k ) ): | |
setattr(obj, k, v ) | |
else: | |
print( "WARNING: the key \"{}\" is wrong.".format(k) ) | |
class MyClass: | |
def __init__(self,**pargs): |
This file contains hidden or 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 <stdint.h> | |
#include <iostream> | |
template<int N> struct MustBeZeroInCompileTime {}; | |
template<> struct MustBeZeroInCompileTime<0> {enum{check};}; | |
template<int N> struct UnitType{}; | |
template<> struct UnitType<1>{ typedef uint8_t type; }; | |
template<> struct UnitType<2>{ typedef uint16_t type; }; | |
template<> struct UnitType<4>{ typedef uint32_t type; }; |