Skip to content

Instantly share code, notes, and snippets.

View corlin's full-sized avatar

corlin corlin

View GitHub Profile
@bsweger
bsweger / useful_pandas_snippets.md
Last active November 13, 2024 19:55
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@cestella
cestella / dga.py
Created August 15, 2016 14:45
Mock DGA Service
from flask import Flask
from flask import request,jsonify
import socket
app = Flask(__name__)
@app.route("/apply", methods=['GET'])
def predict():
h = request.args.get('host')
r = {}
if h == 'yahoo.com' or h == 'amazon.com':
@liangzai-cool
liangzai-cool / 20microsoft-win10.patch
Created September 19, 2016 06:19
a patch for os-prober, to resolve centos 7 + win10 dual system, but boot menu show 'Windows 7...'
--- /usr/libexec/os-probes/mounted/20microsoft 2016-09-19 00:09:25.917283774 -0400
+++ 20microsoft 2016-09-19 00:55:38.750505997 -0400
@@ -31,7 +31,9 @@
for boot in $(item_in_dir boot "$2"); do
bcd=$(item_in_dir bcd "$2/$boot")
if [ -n "$bcd" ]; then
- if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
+ if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
+ long="Windows 10 (loader)"
+ elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
@eshelman
eshelman / latency.txt
Last active October 9, 2024 09:23 — forked from jboner/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@sarmbruster
sarmbruster / run_docker_neo4j_bloom.sh
Last active October 3, 2024 07:10
Run Neo4j in a docker container together with apoc and Bloom installed.
#!/bin/sh
# start a neo4j docker container with apoc and bloom (server variant) configured
# this requires to have
# * curl, unzip and jq being installed
# * having a valid bloom license file
# released under the WTFPL (http://www.wtfpl.net/)
# (c) Stefan Armbruster
@kuzeko
kuzeko / README.md
Last active August 10, 2024 17:46
Import DBpedia 2020 into Neo4j v4 with Neosemantics

Import DBpedia 2020 into Neo4j v4 with Neosemantics

  1. Prerequisite: OpenJDK 11. If you run ubuntu with root you can use

    apt-get install default-jdk
    

    Otherwise, consider using docker : https://hub.docker.com/_/openjdk

# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software