Skip to content

Instantly share code, notes, and snippets.

View yudataguy's full-sized avatar

Sam Yu yudataguy

  • Los Angeles, California
View GitHub Profile
@yudataguy
yudataguy / .gitignore
Last active June 27, 2018 03:37
Udaicty D3 Project
.DS_Store
@yudataguy
yudataguy / README.md
Last active March 9, 2018 18:58
Udacity D3 Project

Graph: World Oil Consumption by major nations (OECD and nonOECD), between 1990 and 2016

Summary: In this graph, it shows the annual consumption of major nations. It is categorized by OCED and nonOECD. In this graph, it clearly shows the growth by some nonOECD nations, such as China and India, with fast growing oil consumption.

Design: The initial design was centered around region, such as Asia, Africa and so on. After initial graph, based on data, it makes more sence to compare OECD and nonOECD nations. Additionally, the earlier graph suggested data with different grouping maybe able to show a better trend in the last decades. Since it shows the fast growing by OECD nations more clearly, as comparison to OECD nations. Other graph type was explored bar chart, but deemed different to interpret due to the large number of nations. Also, Scaling Y-axis was introduced due to the large difference between different nations. Since a small oil consumption nation data would be hard to view on the same sc

Gridline sample

@yudataguy
yudataguy / .block
Created April 11, 2018 21:55
Japan Prefectural Map
license: mit
@yudataguy
yudataguy / index_01.html
Created April 12, 2018 16:55
Japan population growth
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script src="https://unpkg.com/[email protected]/build/d3-simple-slider.js"></script>
<title>Japanese Population Trend After WW2</title>
<style>
.keys.selected {
font-weight: bold;
@yudataguy
yudataguy / d3.slider.css
Created April 15, 2018 15:48
Japan Population Trend
.d3-slider {
position: relative;
font-family: Verdana,Arial,sans-serif;
font-size: 9;
border: 0.5px solid #827878;
z-index: 2;
fill: black;
}
.d3-slider-horizontal {
@yudataguy
yudataguy / d3.min.js
Last active June 27, 2018 23:59
Japan Prefecture Population Change Since WW2
!function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(n){return aa+n in this}function o(n){return n=aa+n,n in this&&delete this[n]}function a(){var n=[];return this.forEach(function(t){n.push(t)}),n}function c(){var n=0;for(var t in this)t.charCodeAt(0)===ca&&++n;return n}function s(){for(var n in this)if(n.charCodeAt(0)===ca)return!1;return!0}function l(){}function f(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function h(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=sa.length;r>e;++e){var u=sa[e]+t;if(u in n)return u}}function g(){}function p(){}function v(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new u;return t.on=function(t,u){var i,o=r.get(t);return arguments
@yudataguy
yudataguy / permutationsArray.js
Last active March 12, 2019 18:17 — forked from md2perpe/permutations.js
Function for generating permutations of a list.
function permutations(list)
{
// Empty list has one permutation
if (list.length == 0)
return [[]];
var result = [];
for (var i=0; i<list.length; i++)
@yudataguy
yudataguy / README-Template.md
Created April 12, 2019 03:47 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@yudataguy
yudataguy / sevenish_algorithm_problem_solution.py
Created December 3, 2019 08:57 — forked from basilwong/sevenish_algorithm_problem_solution.py
Let's define a sevenish number is a number that is one of a power of 7, or a number that is the sum of unique power of 7s
'''
Let's define a sevenish number is a number that is one of a power of 7, or a number that is the sum of unique power of 7s
From the beginning the first few sevenish are:
1, 7, 8, 49, 50 and so on
You are to create an algorithm that finds the i'th sevenish number
'''