Skip to content

Instantly share code, notes, and snippets.

View GINK03's full-sized avatar
🌴
On vacation

catindog/nardtree GINK03

🌴
On vacation
View GitHub Profile
-- Feature engineering BigQuery SQL queries for the kaggle talkingdata competition by tkm2261
-- it may acheve 0.9823 on the public LB with simple GBDT.
-- destination table: takling.test2
SELECT
CASE WHEN t.click_id is null THEN -1 ELSE t.click_id END as click_id,
o.*
FROM
`talking.test_supplement` as o
LEFT OUTER JOIN
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 15, 2024 16:21
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@ericremoreynolds
ericremoreynolds / bisect_key.py
Last active August 9, 2022 20:44
Key-like functionality recipe for Python's bisect functions
class KeyifyList(object):
def __init__(self, inner, key):
self.inner = inner
self.key = key
def __len__(self):
return len(self.inner)
def __getitem__(self, k):
return self.key(self.inner[k])
import numpy as np
def circumcenter(vert1, vert2, vert3):
# H/T: wikipedia.org/wiki/Circumscribed_circle
Ax, Ay = vert1
Bx, By = vert2
Cx, Cy = vert3
D = 2 * (Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By))
@YoshihitoAso
YoshihitoAso / gist:9048005
Last active December 18, 2018 05:30
[Python][Mecab]ubuntu環境にmecabをインストールする方法

Ubuntu環境にMecabをインストールする方法

インストール手順

$ sudo apt-get install mecab libmecab-dev mecab-ipadic
$ sudo aptitude install mecab-ipadic-utf8
$ sudo apt-get install python-mecab

SAMPLE

@natritmeyer
natritmeyer / mount_smbfs.sh
Created September 19, 2013 09:40
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:[email protected]/share_name share_name/
@esehara
esehara / simpleoptiontype.py
Created July 30, 2013 04:30
Option型のPython的実装
# -*- coding: utf-8 -*-
class SimpleOption(object):
NOTHING = False
SOME = True
def __init__(self, is_some, value=None):
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active November 14, 2024 18:34
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@hrldcpr
hrldcpr / tree.md
Last active September 1, 2024 07:04
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!