Skip to content

Instantly share code, notes, and snippets.

extern crate clap;
extern crate diesel;
extern crate diesel_demo;
extern crate log;
extern crate simple_logger;
use self::diesel::prelude::*;
use self::diesel_demo::*;
use self::models::*;
use clap::{App, Arg};
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace PhillyC1
{
struct Split
{
public int startIdx;
#include <iostream>
class word{
public:
virtual const std::string get() const = 0;
};
class word_decorator: public word{
public:
word_decorator(const word& inner) : m_i{inner}{}
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
class LineBuffer;
class Output{
public:
void refresh(void){
std::cout << "Output::refresh\n";
@geekskick
geekskick / composite.cpp
Last active February 11, 2018 15:22
Composite Pattern - Runnable
#include <iostream>
#include <deque>
void x(void){
std::cout << "Doing x" << std::endl;
}
void y(void){
std::cout << "Doing y" << std::endl;
}
//
// main.c
// Playground
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_TEXT 100
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
enum{TITLE_MAX = 1024};
typedef struct Story
{
@geekskick
geekskick / main.cpp
Created March 1, 2017 18:34
Lab Exerise 2
#include <iostream>
#include <vector>
#include "carbon_footprint.h"
#include "car.h"
#include "building.h"
#include "bicycle.h"
int main ()
{
{
@geekskick
geekskick / main.cpp
Created December 16, 2016 12:42
Apprentice Lab
/*
* Use the numbers 1-9 in that order to find all the ways of getting 100.
* You can't miss any of the numbers out and only use + and - operations
* No functions or classes allowed either!
*
* eg
* 1+2+3+4+5+6+7+8+9 = 100? Then show
* 123+456-789 = 100? Then Show
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include <math.h>
/// Uses luminosity to convert colour to greyscale
#define LUM_R 0.21F
#define LUM_G 0.72F
#define LUM_B 0.07F