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
;;; hn.el --- convert hacker news post into org-mode buffer -*- lexical-binding: t -*- | |
;; Copyright (C) 2018- Free Software Foundation, Inc. | |
;; Author: Johan Ponin <johan.ponin.pro@gmail.com> | |
;; Version: 0.0.1 | |
;; Package-Version: 20181103.0001 | |
;; Keywords: hackernews, org-mode | |
;; This program is free software; you can redistribute it and/or modify |
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
(defun read-journal (path) | |
(with-temp-buffer | |
(insert-file-contents (concat "~/notes/journal/" path)) | |
(split-string (buffer-string) "\n" t))) | |
(defun read-first-three-lines (list) | |
(cond ((>= (length list) 4) (subseq list 1 3)) | |
((>= (length list) 1) (nthcdr 1 list)) | |
(t list))) |
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
(require 'hideshow) | |
(define-key hs-minor-mode-map (kbd "C-^") 'hs-toggle-hiding) | |
(add-hook 'python-mode-hook 'hs-minor-mode) | |
(defun display-code-line-counts (ov) | |
(when (eq 'code (overlay-get ov 'hs)) | |
(overlay-put ov 'display | |
(format " ... [%d]" | |
(count-lines (overlay-start ov) | |
(overlay-end ov)))) | |
(overlay-put ov 'face '(:foreground "yellow green")))) |
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
# This is a very simple Python 2.7 implementation of the Information Set Monte Carlo Tree Search algorithm. | |
# The function ISMCTS(rootstate, itermax, verbose = False) is towards the bottom of the code. | |
# It aims to have the clearest and simplest possible code, and for the sake of clarity, the code | |
# is orders of magnitude less efficient than it could be made, particularly by using a | |
# state.GetRandomMove() or state.DoRandomRollout() function. | |
# | |
# An example GameState classes for Knockout Whist is included to give some idea of how you | |
# can write your own GameState to use ISMCTS in your hidden information game. | |
# | |
# Written by Peter Cowling, Edward Powley, Daniel Whitehouse (University of York, UK) September 2012 - August 2013. |
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
import org.apache.hadoop.hbase.util.Bytes | |
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration} | |
import org.apache.hadoop.hbase.client._ | |
import org.apache.spark.SparkContext | |
import scala.collection.JavaConversions._ | |
/** | |
* HBase 1.0.0 新版API, CRUD 的基本操作代码示例 | |
**/ | |
object HBaseNewAPI { |
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
#-----------------------------------------------# | |
# oathtool totp google 2 factor | |
#-----------------------------------------------# | |
# if you have already set up 2 factor authentication with your phone | |
# you need to remove it from your phone and google authenticator app | |
# this wont invalidate your backup codes or application codes | |
# login to your google account go to 2 factor authentication, |