Skip to content

Instantly share code, notes, and snippets.

@ylyhlh
ylyhlh / movieLens_import.sql
Created June 16, 2014 19:24
MovieLens Imported into MySQL
# http://grouplens.org/datasets/movielens/
DROP TABLE IF EXISTS movies.ratings;
DROP TABLE IF EXISTS movies.users;
DROP TABLE IF EXISTS movies.movies;
CREATE TABLE IF NOT EXISTS movies.users (
userID INT PRIMARY KEY,
age INT,
gender TEXT,
@ylyhlh
ylyhlh / const.cpp
Created June 8, 2014 13:48
Testing the use of conceptional constance.
#include <iostream>
#include "MoneyChanger.h"
//Testing conceptional constance with 'mutable' keyword
class testClass {
/* make it mutable then callable by const fucntion.
* It's better to make memberfunction called by this class
* be const function. In that way you do not need mutable
* funciton here. But some time you cannot modify it,
* for example you are using prebuild library */
@ylyhlh
ylyhlh / BoostInt.h
Last active August 29, 2015 14:02
Code challenged for dynamic programming. I solved using Boost's multiprecision library and test it using Boost's unit test.
//---------
//Question:
//---------
/*Assume the US dollar is available in denominations of
*$100, $50, $20, $10, $5, $1, $0.25, $0.10, $0.05 and
*$0.01. Write a function to return the number of
*different ways to exactly represent an arbitrary value
*less than $1,000.00 using any number or
*combination of these denominations.
*/
@ylyhlh
ylyhlh / pythonLearning.py
Last active August 29, 2015 14:02
Python Learning
###################################################
#Here are some codes I wrote in python for learning
###################################################
# A prefix Calculator
import prefixCalclulator
prefixCalclulator.test()
@ylyhlh
ylyhlh / SQL_Quiz
Last active January 10, 2024 17:10
My answer for SQL_Quiz of Stanford Database course
These quizs are very interesting and helpful. It's for query and data manipulation. Two small databases used to demonstrate basic query syntax, various subquery syntax and some DML.