Skip to content

Instantly share code, notes, and snippets.

View Sticksword's full-sized avatar
🎯
Focusing

Michael Chen Sticksword

🎯
Focusing
View GitHub Profile
@Sticksword
Sticksword / nba_player_stats_1989_2023.csv
Created November 2, 2023 07:18
nba player stats 1989 - 2023 download
We can't make this file beautiful and searchable because it's too large.
Rk,Player,Pos,Age,Tm,G,GS,MP,FG,FGA,FG%,3P,3PA,3P%,2P,2PA,2P%,eFG%,FT,FTA,FT%,ORB,DRB,TRB,AST,STL,BLK,TOV,PF,PTS,Season,MVP
1,Kareem Abdul-Jabbar*,C,41,LAL,74,74,22.9,4.2,8.9,.475,0.0,0.0,.000,4.2,8.9,.477,.475,1.6,2.2,.739,1.4,3.1,4.5,1.0,0.5,1.1,1.3,2.6,10.1,1989-90,False
2,Mark Acres,C,26,BOS,62,0,10.2,0.9,1.8,.482,0.0,0.0,1.000,0.9,1.8,.478,.487,0.4,0.8,.542,1.0,1.4,2.4,0.3,0.3,0.1,0.4,1.5,2.2,1989-90,False
3,Michael Adams,PG,26,DEN,77,77,36.2,6.1,14.1,.433,2.2,6.1,.356,3.9,8.0,.490,.509,4.2,5.1,.819,0.9,2.8,3.7,6.4,2.2,0.1,2.3,1.9,18.5,1989-90,False
4,Mark Aguirre,SF,29,TOT,80,76,32.5,7.3,15.9,.461,0.6,2.2,.293,6.7,13.7,.488,.481,3.6,4.9,.733,1.8,3.0,4.8,3.5,0.6,0.5,2.6,2.9,18.9,1989-90,False
4,Mark Aguirre,SF,29,DAL,44,44,34.8,8.5,18.8,.450,0.7,2.3,.293,7.8,16.6,.471,.467,4.0,5.5,.730,2.0,3.3,5.3,4.3,0.7,0.7,3.2,2.9,21.7,1989-90,False
4,Mark Aguirre,SF,29,DET,36,32,29.7,5.9,12.3,.483,0.6,2.1,.293,5.3,10.2,.522,.508,3.1,4.1,.738,1.6,2.6,4.2,2.5,0.4,0.2,1.9,2.8,15.5,1989-90,False
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}

notes on ML

decision trees

You can use decision trees for both classification and regression. The output leaf nodes would either contain a value (classification) or a number (regression). For regression, the number comes from the data and is an average of all data points that ended up at that leaf node. For classification, the label is the label of the majority of data points that ended up at that leaf node.

A "random" decision tree is where you force randomness when picking which attribute to split on.

A "random forest" is just a bunch of "random" decision trees. It reduces overfitting by aggregating the results of multiple trees. A random forest model is an ensemble model. In order to have different trees trained, you need multiple datasets. That's where bagging or bootstrap aggregating comes into play. Bagging creates many datasets from one dataset through sampling. Bagging reduces variance of the model since the results of each model are averaged together. Boosting takes this a step further by em

@Sticksword
Sticksword / Jenkinsfile
Created February 18, 2020 06:35 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@Sticksword
Sticksword / example.html
Last active February 1, 2020 00:39
here are some example graphs using the ChartJS library (wrapped as part of `ember-cli-chart`)
// example html portion
<div class="performance-dashboard">
<div class="performance-dashboard__row">
<div class="performance-dashboard__description">
Here is a bar chart.
</div>
<div class="performance-dashboard__chart">
{{ember-chart type="bar" data=BARCHARTDATA options=BARCHARTOPTIONS}}
</div>
</div>
@Sticksword
Sticksword / data-action.js
Created December 4, 2018 02:01 — forked from qborreda/data-action.js
JavaScript event hooking with data-action
// Set up HTML hooks without id or extra classes
<button data-action="openLogin">Login</button>
<a href="javascript:;" data-action="openEditor">Link</a>
// Using [data-action=""] selectors instead of class selectors when binding events in JavaScript
var actions = {
openLogin: openLoginWindow,
openEditor: function() { ... }
//....
};

Special thanks to amazing tutorial game - https://flexboxfroggy.com/

When using display: flex

  • Horizontally align items via justify-content:
    • flex-start: Items align to the left side of the container.
    • flex-end: Items align to the right side of the container.
    • center: Items align at the center of the container.
    • space-between: Items display with equal spacing between them.
    • space-around: Items display with equal spacing around them.
pg_ctl -D /usr/local/var/postgres status
pg_ctl -D /usr/local/var/postgres start
pg_ctl -D /usr/local/var/postgres stop

Magic words:

psql 'dbname=mimic user=michaelchen options=--search_path=mimiciii'

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

`2016-09-09 16:36:57.767 WARN 19999 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'todoController': Unsatisfied dependency expressed through method 'setTodoService' parameter 0: Error creating bean with name 'todoServiceImpl': Unsatisfied dependency expressed through method 'setTodoDAO' parameter 0: Error creating bean with name 'todoDAOImpl': Unsatisfied dependency expressed through field 'sessionFactory': No qualifying bean of type [org.hibernate.SessionFactory] found for dependency [org.hibernate.SessionFactory]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.hiber