Skip to content

Instantly share code, notes, and snippets.

View GaZ3ll3's full-sized avatar

Yimin GaZ3ll3

View GitHub Profile
@GaZ3ll3
GaZ3ll3 / vr_quad_rule.txt
Created April 16, 2017 20:18
vr_quad_rule.txt
1 2
0.500000000000000000000000000000 0.000000000000000000000000000000 -0.500000000000000000000000000000
-0.288675134594812865529434020573 0.577350269189625731058868041146 -0.288675134594812865529434020573
1.519671371303185081202968831349 1.519671371303185081202968831349 1.519671371303185081202968831349
2 4
0.000000000000000000000000000000 -0.725271359470687770887309397949 0.000000000000000000000000000000 -0.337845472747894670639823289093 0.725271359470687770887309397949 0.337845472747894670639823289093
0.837471229251854798469878460310 -0.418735614625927399234939230155 -0.390110349270986700442875871886 0.195055174635493350221437935943 -0.418735614625927399234939230155 0.195055174635493350221437935943
0.501271551173577800675218441029 0.501271551173577800675218441029 1.018399820129607391550052852836 1.018399820129607391550052852836 0.501271551173577800675218441029 1.018399820129607391550052852836
3 5
0.000000000000000000000000000000 0.786661016399677004429236149008 0.000000000000000000000000000000 0.300946768966
@GaZ3ll3
GaZ3ll3 / Pricer.h
Created September 19, 2016 23:45
Pricercode for RGM advisors
//
// Created by lurker on 3/27/16.
//
#ifndef PRICER_PRICER_H
#define PRICER_PRICER_H
#include <iostream>
#include <algorithm>
#include <map>
@GaZ3ll3
GaZ3ll3 / b.py
Created April 9, 2016 04:22
googlecodejam2016
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def solve(s):
l = len(s)
d = 0
t = s[0]
for i in range(1, l):
@GaZ3ll3
GaZ3ll3 / palindromic numbers
Created February 13, 2016 05:46
hbk_interview
#!/bin/python
import sys
import os
import math
"""
convert base-10 to base-17 in string
"""
@GaZ3ll3
GaZ3ll3 / armadillo_support.h
Created November 21, 2015 04:58
use VML/VSL/
/*
* armadillo_support.h
*
* Created on: Nov 20, 2015
* Author: lurker
*/
#ifndef SRC_ARMADILLO_SUPPORT_H_
#define SRC_ARMADILLO_SUPPORT_H_
/*
* GenericMatrix.cpp
*
* Created on: Nov 20, 2015
* Author: lurker
*/
#include "GenericMatrix.h"
namespace outverse {
@GaZ3ll3
GaZ3ll3 / Poisson.h
Last active September 6, 2016 05:05
mex fenics with matlab
// This code conforms with the UFC specification version 1.6.0
// and was automatically generated by FFC version 1.6.0.
//
// This code was generated with the option '-l dolfin' and
// contains DOLFIN-specific wrappers that depend on DOLFIN.
//
// This code was generated with the following parameters:
//
// convert_exceptions_to_warnings: False
// cpp_optimize: True
Stable build requested.
Starting build...
Downloading http://cython.org/release/Cython-0.19.2.tar.gz...
[=========================] 100.0% (1.3MB of 1.3MB) 0.340MB/s ETA 0s
[cython] Building cython/avukqxjtxt3d, follow log with:
[cython] tail -f /Users/elsie/.hashdist/tmp/cython-avukqxjtxt3d/_hashdist/build.log
Downloading https://pypi.python.org/packages/source/d/docutils/docutils-0.10.tar.gz...
[=========================] 100.0% (1.5MB of 1.5MB) 0.342MB/s ETA 0s
[docutils] Building docutils/7srggk6bdkqa, follow log with:
@GaZ3ll3
GaZ3ll3 / b.py
Created April 11, 2015 17:16
google code jam 2015 qround
import math
cases = int(raw_input())
for c in xrange(cases):
x = map(int, raw_input())
y = map(int, raw_input().split())
y = sorted(y, reverse=True)
m = y[0]
res = y[0]
for r in range(1, m + 1):
move = 0
@GaZ3ll3
GaZ3ll3 / d.py
Created April 11, 2015 07:50
google code jam 2015 qround
import sys
cases = int(raw_input())
for c in xrange(cases):
# read in misc problem constants
x, y, z = map(int, raw_input().split())
if x == 1:
print "Case #%d: GABRIEL" % ((c+1))
if x == 2: