This file contains hidden or 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
| 1. Plug-in wifi, usb keyboard, power cord. Power up Pi. | |
| 2. Login with: pi/raspberry | |
| 3. Follow steps to install RetroPi at http://www.emulationstation.org/gettingstarted.html#install_rpi_retropie | |
| sudo apt-get update | |
| sudo apt-get install git dialog | |
| cd | |
| git clone --depth=0 https://github.com/petrockblog/RetroPie-Setup | |
| cd RetroPie-Setup | |
| chmod +x retropie_setup.sh | |
| sudo ./retropie_setup.sh |
This file contains hidden or 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
| # | |
| # [2016-02-16] Challenge #254 [Easy] Atbash Cipher | |
| # https://www.reddit.com/r/dailyprogrammer/comments/45w6ad/20160216_challenge_254_easy_atbash_cipher/ | |
| # Demo: http://www.r-fiddle.org/#/fiddle?id=OBWeefV6&version=1 | |
| # | |
| # Atbash encodes a string by reversing the alphabet and then substituting the letters in the string with the reversed form alphabet. | |
| # Example | |
| # Plain: abcdefghijklmnopqrstuvwxyz | |
| # Cipher: zyxwvutsrqponmlkjihgfedcba | |
| # foobar -> ullyzi |
This file contains hidden or 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
| # | |
| # [2016-02-17] Challenge #254 [Intermediate] Finding Legal Reversi Moves | |
| # https://www.reddit.com/r/dailyprogrammer/comments/468pvf/20160217_challenge_254_intermediate_finding_legal/ | |
| # Demo: http://www.r-fiddle.org/#/fiddle?id=qBVAmIPB&version=2 | |
| # | |
| # Find all valid moves on a board in Othello (Reversi). | |
| # | |
| # Kory Becker 2/20/2016 | |
| # http://primaryobjects.com | |
| # |
This file contains hidden or 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
| packages <- c('caret') | |
| if (length(setdiff(packages, rownames(installed.packages()))) > 0) { | |
| install.packages(setdiff(packages, rownames(installed.packages()))) | |
| } | |
| library(caret) | |
| # Download dataset, if it does not exist. | |
| fileName <- 'winequality-red.csv'; | |
| if (!file.exists(fileName)) { | |
| download.file(paste0('https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/', fileName), fileName, method="curl") |
This file contains hidden or 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
| library(markovchain) | |
| text <- readLines('text.txt') | |
| text <- text[nchar(text) > 0] | |
| text <- gsub('.', ' .', text, fixed = TRUE) | |
| text <- gsub(',', ' ,', text, fixed = TRUE) | |
| text <- gsub('!', ' !', text, fixed = TRUE) | |
| text <- gsub('(', '( ', text, fixed = TRUE) | |
| text <- gsub(')', ' )', text, fixed = TRUE) |
This file contains hidden or 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
| var SlackBot = require('slackbots'); | |
| BotManager = { | |
| bot: null, | |
| initialize: function() { | |
| // Get token at https://my.slack.com/services/new/bot. | |
| BotManager.bot = new SlackBot({ token: 'slack-api-token', name: 'mybot' }); | |
| BotManager.bot.on('start', BotManager.start); |
This file contains hidden or 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
| var chatskills = require('chatskills'); | |
| var SlackBot = require('slackbots'); | |
| var bot = new SlackBot({ token: 'your-slack-token', name: 'awesome' }); | |
| // Set bot name. | |
| chatskills.name('awesome'); | |
| // Create a new skill. | |
| var hello = chatskills.add('hello'); |
This file contains hidden or 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
| # | |
| # [2016-03-14] Challenge #258 [Easy] IRC: Making a Connection | |
| # https://www.reddit.com/r/dailyprogrammer/comments/4ad23z/20160314_challenge_258_easy_irc_making_a/ | |
| # | |
| import socket | |
| input = """chat.freenode.net:6667 | |
| dude1267 | |
| dude1267 |
This file contains hidden or 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
| # https://www.kaggle.com/fsimond/santander-customer-satisfaction/santander-starter/run/172126/files | |
| library(xgboost) | |
| library(Matrix) | |
| set.seed(1234) | |
| train <- read.csv("train.csv") | |
| test <- read.csv("test.csv") | |
| ##### Removing IDs |
This file contains hidden or 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
| library(caret) | |
| library(doParallel) | |
| registerDoParallel(cores = 2) | |
| # Read data. | |
| data <- read.csv('train.csv') | |
| test <- read.csv('test.csv') | |
| # Set classification column to factor. |