Skip to content

Instantly share code, notes, and snippets.

Procedure GenerateDraw ( n )
INPUT: n, the length of the random array
OUTPUT: result_array, the array contains unique random integers of length n
result_array <- CREATE and array of length n
loop n times {
current_rand = 0
check_pass = True
Procedure CountMatches ( test_arr, ref_arr )
INPUT: test_arr, the array use to compare with the reference array
ref_arr, the reference array
OUTPUT: match_array_count, the array length of the overlap between 2 sets
match_array_count = 0
for each each_test_int in test_arr {
for each_ref_int in ref_arr {
Procedure ComputeProfit ( lott_database, ref_arr )
INPUT: lott_database, the array of all customer lottery arrays
ref_arr, the reference of current week lottery array
OUTPUT: profit, the profit of current week lottery
earn_count = len(lott_database) * 2
give_out_count = 0
for each_lott_arr in lott_database {
match_count = CountMatches(each_lott_arr, ref_arr)
# -*- coding: utf-8 -*-
import random
def generate_draw(n):
result_array = []
for i in range(n):
current_rand = None
check_passed = True
while current_rand is None or check_passed is False:
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
/**
* Created by KanzakiMirai on 10/26/16.
*/
public class Test {
public static void main(String[] args) {
Demo tmp = new Demo();
@DickyT
DickyT / proxy.js
Last active January 4, 2018 03:26
docker hub dickyt/coinhive-proxy-nodejs startup file template
const Proxy = require("coin-hive-stratum");
const proxy = new Proxy({
host: "POOL_ADDR",
port: POOL_PORT,
pass: "POOL_PASSWD",
ssl: false,
user: "POOL_USER",
address: "WALLET_ADDR",
dynamicPool: false,
maxMinersPerConnection: MAX_CONN_LOAD,
@DickyT
DickyT / wildfly.sh
Last active March 13, 2018 13:48
stackv-deploy-docker
# Decription : The script to install Wildfly 10.0.0.Final
# Original script: https://gist.github.com/sukharevd/6087988
# This version is the only variable to change when running the script
WILDFLY_VERSION=10.0.0.Final
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION
WILDFLY_ARCHIVE_NAME=$WILDFLY_FILENAME.tar.gz
WILDFLY_DOWNLOAD_ADDRESS=http://download.jboss.org/wildfly/$WILDFLY_VERSION/$WILDFLY_ARCHIVE_NAME
# Specify the destination location
@DickyT
DickyT / wildfly.config.stackv.xml
Last active March 10, 2018 20:34
wildfly.config.stackv.xml
<?xml version="1.0" ?>
<server xmlns="urn:jboss:domain:4.0">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
<extension module="org.jboss.as.jaxrs"/>
package com.kmirai.kis.lib
import com.kmirai.kis.Gson
import org.hibernate.HibernateException
import org.hibernate.dialect.PostgreSQL95Dialect
import org.hibernate.engine.spi.SharedSessionContractImplementor
import org.hibernate.usertype.UserType
import org.springframework.util.ObjectUtils
import java.io.Serializable
import java.sql.PreparedStatement
@DickyT
DickyT / test.py
Last active December 21, 2018 03:12
UMD CMSC 216 (Prof. Larry Herman) Project Auto test tool
#!/usr/bin/env python
"""
UMD CMSC 216 Project local test tool
=====================================
This tool is ONLY being tested on Professor Larry Herman's CMSC 216 (18Fall).
=====================================