Skip to content

Instantly share code, notes, and snippets.

View mkim0710's full-sized avatar

mkim0710 mkim0710

View GitHub Profile
@mkim0710
mkim0710 / p1.r
Created March 22, 2017 23:17 — forked from Eunsol-Lee/p1.r
solve <- function(n) {
result <- largeSubtract(largeAdd(sumMultiple(n, 3), sumMultiple(n, 5)), sumMultiple(n, 15))
}
right <- function (string, char){
substr(string,nchar(string)-(char-1),nchar(string))
}
left <- function (string,char){
substr(string,1,char)
@mkim0710
mkim0710 / contract.py
Created July 19, 2017 05:00 — forked from 20chan/contract.py
The Fun of Reinvention 최종
_contracts = {}
class Contract:
@classmethod
def __init_subclass__(cls):
_contracts[cls.__name__] = cls
def __set__(self, instance, value):
self.check(value)
@mkim0710
mkim0710 / microbenchmark-blog-post.R
Created July 28, 2017 19:56 — forked from stephenturner/microbenchmark-blog-post.R
Code for GGD blog post on microbenchmark
# see blog post here:
# http://gettinggeneticsdone.blogspot.com/2015/01/microbenchmark-package-r-compare-runtime-r-expressions.html
library(dplyr)
library(nycflights13)
flights
# base
aggregate(flights$arr_delay, by=list(flights$carrier), mean, na.rm=TRUE)
@mkim0710
mkim0710 / MWEblogpost.Rmd
Created May 19, 2018 16:07 — forked from jknowles/MWEblogpost.Rmd
R Markdown of blog post on R minimal working examples (MWE).
How to Ask for Help using R
========================================================
The key to getting good help with an R problem is to provide a minimally working
reproducible example (MWRE). Making an MWRE is really easy with R, and it will
help ensure that those helping you can identify the source of the error, and
ideally submit to you back the corrected code to fix the error instead of sending
you hunting for code that works. To have an MWRE you need the following items:
- a minimal dataset that produces the error
# 셀레늄 패키지와 rvest 패키지를 설치합니다.
source("https://install-github.me/ropensci/RSelenium")
install.packages("rvest")
install.packages("dplyr")
# 패키지를 불러서 사용할 준비를 합니다.
library(RSelenium)
library(rvest)
library(dplyr)
@mkim0710
mkim0710 / saveRDS.Rmd
Created September 3, 2018 19:08 — forked from dgrtwo/saveRDS.Rmd
saveRDS speed and size
---
title: "Effect of compression type and file complexity on saveRDS size and speed"
author: "David Robinson"
date: "April 20, 2015"
output: html_document
---
```{r echo = FALSE}
knitr::opts_chunk$set(cache = TRUE, message = FALSE)
```
@mkim0710
mkim0710 / onedrive-ubu.sh
Created September 15, 2018 00:29 — forked from glmdev/onedrive-ubu.sh
A bash script to setup OneDrive integration with GNOME on Ubuntu.
#!/bin/sh
# onedrive-ubu.sh
# A BASH script to set up OneDrive integration with GNOME on Ubuntu
# Copyright (C) 2018 Garrett Mills ([email protected])
# This software is licensed under the MIT License.
# This sofware is provided without warranty or even any implied intent of purpose.
#
# OnedriveD: https://github.com/xybu/onedrived-dev
#
@mkim0710
mkim0710 / Stata-syntax-highlighting-notepad++.xml
Created October 23, 2018 06:30 — forked from bquistorff/Stata-syntax-highlighting-notepad++.xml
Notepad++ syntax highlighting file for Stata code
<NotepadPlus>
<UserLang name="Stata" ext="do ado" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="2" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="yes" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00// 00* 00/// 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@mkim0710
mkim0710 / fread-demo.R
Created January 3, 2019 06:59 — forked from wush978/fread-demo.R
decompress bzfile and remove null string and read in fread
fread(sprintf("bzcat %s | tr -d '\\000'", filename))
@mkim0710
mkim0710 / Experimenting with ChromeOS on VirtualBox.md
Created January 7, 2019 03:36 — forked from gerarldlee/Experimenting with ChromeOS on VirtualBox.md
Installing ChromeOS on VirtualBox using the NeverWare build

Installing ChromeOS on VirtualBox

  1. Download the NeverWare's ChromeOS build from http://www.neverware.com/freedownload

  2. Extract the *.bin.zip

  3. Convert it to VDI. vboxmanage convertdd chromiumos_image.bin chromiumos_image.vdi

  4. mv chromiumis_image.vdi C:\t\v\chromeos\