Skip to content

Instantly share code, notes, and snippets.

View Mooophy's full-sized avatar
😏

Yue Wang Mooophy

😏
  • Auckland, New Zealand
View GitHub Profile
@Mooophy
Mooophy / 2014s3.cs
Created June 18, 2015 04:11
2014s3 q4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Reflection.Emit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public class Program
{
@Mooophy
Mooophy / test.rb
Last active August 29, 2015 14:23
1.upto(100){ |n| puts n%3 == 0 ? "face" : n }
#include "algorithm.h"
#include <cstring> // memset
using namespace std;
/*************************** global variables *****************************/
#define MAX_POSSIBILITY 362880
enum Direction{LEFT, RIGHT, UP, DOWN};
bool VisitedList[MAX_POSSIBILITY];
bool ExpandedList[MAX_POSSIBILITY];
bool IsExistInQueue[MAX_POSSIBILITY];
@Mooophy
Mooophy / gist:0e732c1f6b664720dcf2
Last active August 29, 2015 14:18
sql_for_assignment1
CREATE TABLE OFFICE (
OFF_ID NUMBER NOT NULL,
OFF_ADDR varchar2(20) NOT NULL,
OFF_NAME varchar2(10) NOT NULL,
PRIMARY KEY (OFF_ID));
CREATE TABLE EMPLOYEE (
EMP_ID NUMBER NOT NULL,
EMP_FNAME varchar2(20) NOT NULL,
EMP_LNAME varchar2(20) NOT NULL,
import unittest
# Here's our "unit".
def IsOdd(n):
return n % 2 == 1
# Here's our "unit tests".
class IsOddTests(unittest.TestCase):
@Mooophy
Mooophy / ReadFrom.cs
Created February 3, 2015 03:26
example for making reading line as Enumerable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace JuestForCshap
{
@Mooophy
Mooophy / ParseCsv.cs
Created January 26, 2015 03:16
example for how to parse csv file in c#, tested.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic.FileIO;
namespace JuestForCshap
{
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <iterator>
class FileReader
{
public:
#include <iostream>
#include <fstream>
#include <locale>
#include <sstream>
#include <string>
using namespace std;
/* implement your Queue class here */
////////////////////////////////////////////////////////////////////////
#define TIMEDELAY 3 //DO NOT CHANGE THIS VALUE!!!