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 / Yahoo知恵袋にスクレイピング.ipynb
Created May 7, 2023 22:30 — forked from jshirius/Yahoo知恵袋にスクレイピング.ipynb
Yahoo知恵袋のスクレイピングのPythonサンプルプログラム
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yudataguy
yudataguy / convert_pdf.py
Created May 2, 2023 21:32 — forked from rguliev/convert_pdf.py
Python 3: pdfminer code to convert pdf to text, html or xml
# Use `pip3 install pdfminer.six` for python3
from typing import Container
from io import BytesIO
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter, XMLConverter, HTMLConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
@yudataguy
yudataguy / simulate.py
Created November 12, 2021 12:48
roulette simulation
import math
import random
start = 0
end = 36
def createList(r1, r2):
# Testing if range r1 and r2
# are equal
@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
'''
@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 / 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 / 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 / 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 / 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 / .block
Created April 11, 2018 21:55
Japan Prefectural Map
license: mit