\nHow Nike Run Club led me to write my first AI project\n\n\n\n\nFor a long time I’ve wanted to start learning how to use AI as part of my code flow. Whereshould I start? Well, I don’t have B.Sc and definitely don’t have the math fundamentals to understand all the equations and calculations behind it. But then, I have came across this amazing article of Jason Brownlee and I’ve started believing again!\n\nAfter reading many times this article and understanding it I can finally tell that I’m fluency with KNN algorithm. Let’s talk about KNN a bit.\n\n# KNN Algorithm\n\nImagine you are in the World Cup. You see three pubs of different fans: England, Sweden and France. You are welsh, whom would you celebrate with? of course England because you are both in Great Britain!\n\nThat is the meaning of KNN: K Nearest Neighbors. \nOur data will be classified to the nearest type in the same dimension:\n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Minimal UI | |
(scroll-bar-mode -1) | |
(tool-bar-mode -1) | |
(tooltip-mode -1) | |
(menu-bar-mode -1) | |
(add-to-list 'default-frame-alist '(font . "Inconsolata Bold")) | |
(add-to-list 'default-frame-alist '(height . 24)) | |
(add-to-list 'default-frame-alist '(width . 80)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
greet = function(person) { | |
switch(person, | |
Nick = { | |
# fast and smart | |
Sys.sleep(3); 'Hello!' | |
}, | |
Yihui = { | |
# slow and shy | |
Sys.sleep(15); '你好!' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ts-playground", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"scripts": { | |
"run": "webpack --mode development --display none && node dist/bundle.js", | |
"start": "webpack --mode development", | |
"build": "webpack --mode production" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
func main() { | |
A := []int{32, 38, 8, 1, 9} | |
B := []int{68, 92} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
str := "hello" | |
for _, c := range str { | |
fmt.Println(c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
s := "leetcode" | |
fmt.Println(firstUniqChar(s)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func binaryGap(N int) int { | |
count := 0 | |
max := 0 | |
isPreviousOne := false | |
for N > 0 { | |
// fmt.Println(N % 2) | |
if N%2 == 1 { | |
if count > max { | |
max = count | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
nums := []int{2, 7, 11, 15} | |
target := 9 | |
fmt.Println(twoSum(nums, target)) // [1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Metadata": { | |
"AWS::CloudFormation::Designer": { | |
"7b463913-5e19-4c74-898a-2220105ccd41": { | |
"size": { | |
"width": 60, | |
"height": 60 | |
}, | |
"position": { |