Skip to content

Instantly share code, notes, and snippets.

View suensummit's full-sized avatar
🚀
Liftoff

Summit Suen suensummit

🚀
Liftoff
View GitHub Profile
World cup data analysis script!!
The data in cup.txt is taken from wikipedia(http://en.wikipedia.org/wiki/2014_FIFA_World_Cup_squads). the script cup.r analyses the data to create interesting charts about the 2014 world cup squads. Charts include boxplots og age, number of home/foreign based players for each country, clubs with more than 4 players in the world cup and leagues with more than 10 players in the World cup.
The data shows that the youngest team is the Netherlands(Dutch) team is the youngest. Only Mexico, Netherlands, Spain, England, Italy, Russia, germany and Iran have more home-based players than foreign based players. Most teams have less players based in their home countries. The European clubs dominate the number of clubs with the most players in the worls cup (gaian not a suprise)!! The world cup 2014 appears to be a sort of "European Cup"!!
/**
* Fetching data from BigQuery and present it in our sheet
* Author: Ido Green
* Date: 14/12/2013
*
* See: http://wp.me/pB1lQ-19i
* Misc: https://developers.google.com/bigquery/
*/
//

##TUNING##

Configuration

System: set file descriptors to 32K or 64K

vim /etc/security/limit.conf

@suensummit
suensummit / meteor.cheatsheet.coffee
Last active August 29, 2015 14:27 — forked from LeCoupa/meteor.cheatsheet.coffee
Meteor Cheatsheet: Meteor Core, Publish and Subscribe, Method, Server Connections, Collections, Session, Accounts, Passwords, Templates, Match, Timers, Deps, EJSON, HTTP, Email, Assets, Command Line. More: http://journal.gentlenode.com/meteor-5-cheatsheet/
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@suensummit
suensummit / moneydj_pdf_parser_example.py
Created March 2, 2017 09:42
Python PDF Parser example code.
import os, csv
from urllib2 import Request, urlopen
from StringIO import StringIO
from PyPDF2 import PdfFileReader
# Get the moneydj urls into a list.
with open('/money_url_list.csv', 'rb') as money_url_list:
reader = csv.reader(money_url_list, delimiter = ',')
moneydj_list = list(reader)
# Load data
# ips <- read.csv("https://lookaside.fbsbx.com/file/ipdatas.csv?token=AWyvZbsOT-DxjUjUySQf4vqWu9VSj7WTKytXNHkow4054oYjLFN_7FW0FPNwDtmUbQXXzJyCm99cQoRV6c-xS-Clpc7ss0lw-C04A41hBtFP3Yy2d4sR_W31BNrLip_XcqyuJbOxhjC9xKBq32jQ8zfxnDO3OdbSdq4-SbOnWnMQSLcjWrx6hfqbKo1a3gVttSZLhKqna7TpJhOm8uKdUvde")
ips <- read.csv("ipdatas.csv")
# 如果已安裝則省略
# install.packages("maps")
# install.packages("ggplot2")
library(ggplot2)

Training MNIST using Kubeflow, Minio, and Argo on Azure

This example guides you through the process of taking an example model, modifying it to run better within Kubeflow, and serving the resulting trained model. We will be using Argo to manage the workflow, Minio for saving model training info, Tensorboard to visualize the training, and Kubeflow to deploy the Tensorflow operator and serve the model.

Prerequisites

Before we get started there a few requirements.

Deploy an AKS Cluster

@suensummit
suensummit / kMeans_in_BQ.sql
Created December 5, 2018 10:40 — forked from smrgit/kMeans_in_BQ.sql
kMeans using JavaScript UDFs in BigQuery
CREATE TEMPORARY FUNCTION
-- In this function, we're going to be working on arrays of values.
-- we're also going to define a set of functions 'inside' the kMeans.
-- *heavily borrowing from https://github.com/NathanEpstein/clusters* --
kMeans(x ARRAY<FLOAT64>, -- ESR1 gene expression
y ARRAY<FLOAT64>, -- EGFR gene expression
iterations FLOAT64, -- the number of iterations
@suensummit
suensummit / main.py
Created December 13, 2018 03:17 — forked from khanhnamle1994/main.py
FCN - Full Code
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
num_classes = 2
image_shape = (160, 576)
EPOCHS = 40
BATCH_SIZE = 16
@suensummit
suensummit / eigenvectors_from_eigenvaluies.R
Created November 16, 2019 15:46
A demo R script of [the paper EIGENVECTORS FROM EIGENVALUES](https://arxiv.org/pdf/1908.03795.pdf), modified from [Yu-Chen Shu](https://www.facebook.com/yuchen.shu/posts/10157876738839228) rewritten in R.
# Generate random matrix with dim = N
N <- 3
A <- matrix(runif(N*N), N, N, byrow=TRUE)
A <- A+t(A)
# Setting up eigenvalues lambda, true eigenvector V and derived eigenvector U
ev <- eigen(A)
(lambda <- ev$values)
(V <- ev$vectors)
U <- matrix(0L, N, N)