Skip to content

Instantly share code, notes, and snippets.

View HYPJUDY's full-sized avatar
🌌
(๑>◡<๑)

Yupan Huang HYPJUDY

🌌
(๑>◡<๑)
View GitHub Profile
@HYPJUDY
HYPJUDY / Poker.cpp
Created May 18, 2017 12:59
design a method for shuffling poker
/* design a method for shuffling poker (include complexity analysis)
*
* 1. define a c++ class for a deck of playing cards with
* 4 suits (e.g., hearts, diamonds, spades, clubs) and 52 cards
* 2. design a function to shuffle a poker in an array
* 3. design a Boolean function to verify whether a poke has been shuffled
*
* by HYPJUDY
*/
@HYPJUDY
HYPJUDY / List.h
Last active May 18, 2017 12:55
Detect a loop and find the beginning in a linked list
/*
* This file "List.h" is the source code of book 《剑指offer》
* I download it from https://github.com/yunshouhu/InterviewQuestions/tree/master/Utilities
*/
#pragma once
#include "list.h"
#include <stdio.h>
#include <stdlib.h>
struct ListNode
@HYPJUDY
HYPJUDY / CPM_trained_FLIC.prototxt
Last active May 3, 2017 04:14
Network definition of Architecture of CPMs
name: "CPM_trained_FLIC"
input: "data"
input_dim: 1
input_dim: 4
input_dim: 368
input_dim: 368
layer {
name: "image"
type: "Slice"
bottom: "data"
@HYPJUDY
HYPJUDY / split-kmp.cpp
Last active May 3, 2017 04:17
Pattern search: Splitting a string per the given seperator/delimiter similar to split() funtion in Python with KML algorithm.
/*
* Description: Splitting a string per the given seperator/delimiter
* similar to split() funtion in Python with KMP algorithm.
*
* Function: vector<string> split(const string &s, const string &sep)
* Refer to https://docs.python.org/2/library/stdtypes.html str.split([sep[, maxsplit]]):
* - Return a list of the words in the string, using sep as the delimiter string.
* - If sep is given, consecutive delimiters are not grouped together
* and are deemed to delimit empty strings. The sep argument may consist
* of multiple characters. Splitting an empty string with a specified
@HYPJUDY
HYPJUDY / test12_query.prototxt
Created April 15, 2017 11:34
Test phase of the a 12-bit deep neural network hashing.
name: "CIFAR10_full"
layer {
name: "cifar"
type: "Data"
top: "data/cifar"
data_param {
source: "../cifar_hash_dataset/cifar_query_lvdb"
batch_size: 100
}
transform_param {
@HYPJUDY
HYPJUDY / train12.prototxt
Last active April 15, 2017 11:34
Train phase of the a 12-bit deep neural network hashing.
name: "CIFAR10_full"
layer {
name: "cifar"
type: "Data"
top: "data/cifar"
data_param {
source: "../cifar_hash_dataset/cifar_triplet_train_lvdb"
batch_size: 100
}
transform_param {