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 / stl_queue.hpp
Created November 21, 2014 02:03
Gcc's implementation
// Queue implementation -*- C++ -*-
// Copyright (C) 2001-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
#include <iostream>
#include <vector>
#include <memory>
int main()
{
//! (*v).push_back(),这样对vector似乎并不适用。
//!
//! -- check the code blew
auto p = std::make_shared<std::vector<int>>();
#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!!!
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <iterator>
class FileReader
{
public:
@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
{
@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
{
import unittest
# Here's our "unit".
def IsOdd(n):
return n % 2 == 1
# Here's our "unit tests".
class IsOddTests(unittest.TestCase):
@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,
#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 / test.rb
Last active August 29, 2015 14:23
1.upto(100){ |n| puts n%3 == 0 ? "face" : n }