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
<script type="text/javascript"> | |
function iteration(max, callback){ | |
var ins = []; | |
var n = 0; | |
var r = 0; | |
do{ | |
while(n <= max){ | |
ins[r] = n; | |
callback(ins); | |
n++; |
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
object getProp(object source, string name) | |
{ | |
var type = source.GetType(); | |
var prop = type.GetProperty(name); | |
return prop.GetValue(source); | |
} |
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
/// <summary> | |
/// Create SqlException for unit test(Reflection). | |
/// taken from: http://blog.gauffin.org/2014/08/how-to-create-a-sqlexception/ | |
/// </summary> | |
/// <param name="number">This number will be at exception.number</param> | |
/// <param name="error_message">message</param> | |
/// <returns>new SqlException</returns> | |
private SqlException CreateSqlException(int number, string error_message = "the mock error message") | |
{ | |
var collectionConstructor = typeof(SqlErrorCollection) |
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
centered <- function(centreted_data_frame, var_names){ | |
centreted_data_frame[var_names] = lapply(var_names, function(name_var){ | |
centreted_data_frame[name_var]-mean(centreted_data_frame[[name_var]]) | |
}) | |
return(centreted_data_frame) | |
} |
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
using System; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
namespace ExampleSimpleWebserver | |
{ | |
class HttpAsyncServer | |
{ |
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 math | |
class SequencePermutation(object): | |
def __init__(self, plenty_object, count_item): | |
self.plenty_object = list(plenty_object) | |
self.count_item = count_item | |
self.power_plenty = len(plenty_object) | |
@staticmethod |
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 BinaryNode(object): | |
def __init__(self): | |
self.right_node = False | |
self.left_node = False | |
def to_brackets_string(self): | |
result = "(" | |
if self.left_node is not False: | |
result += self.left_node.to_brackets_string() | |
result += ")" |
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
[ | |
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,2,0,2,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,4,0,0,0,4,0,0,0,2,0,2,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,8,0,0,0,0,0,0,0,2,0,2,0,0, |
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
FROM ubuntu | |
RUN apt-get update -y | |
RUN apt-get upgrade -y | |
RUN apt-get install -y build-essential cmake gfortran git pkg-config | |
RUN apt-get install -y python-dev software-properties-common wget vim | |
RUN apt-get autoremove -y | |
RUN apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libopencv-dev |
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
template <class T> | |
class Links{ | |
public: | |
list<T*> childs; | |
T *parent; | |
}; | |
class Node{ | |
public: | |
Links<Node> rights; |
OlderNewer