Skip to content

Instantly share code, notes, and snippets.

@phdkiran
phdkiran / intel-nvidia.md
Created May 17, 2019 03:02 — forked from wangruohui/intel-nvidia.md
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@phdkiran
phdkiran / gist:ddbf527fb0fd8729f99faf6928f330d3
Created January 3, 2018 15:32 — forked from conormm/r-to-python-data-wrangling-basics.md
R to Python: Data wrangling with dplyr and pandas
R to python useful data wrangling snippets
The dplyr package in R makes data wrangling significantly easier.
The beauty of dplyr is that, by design, the options available are limited.
Specifically, a set of key verbs form the core of the package.
Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe.
Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R.
The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).
dplyr is organised around six key verbs
@phdkiran
phdkiran / useful_pandas_snippets.py
Created December 21, 2017 17:38 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
@phdkiran
phdkiran / snakecoin-server-full-code.py
Created November 15, 2017 22:19 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
@phdkiran
phdkiran / stackexchange-kaggle-submission.ipynb
Last active November 17, 2016 03:47
MLtext3/submissions/stackexchange-kaggle-Copy3.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Homework with Hacker News data\n",
"\n",
"## About Hacker News\n",
"\n",
@phdkiran
phdkiran / 04_intermediate_regex_homework-Copy1.ipynb
Last active November 4, 2016 03:56
MLtext3/submissions/04_intermediate_regex_homework-Copy1.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phdkiran
phdkiran / 03_basic_regex_homework.ipynb
Last active November 3, 2016 20:25
MLtext3/submissions/03_basic_regex_homework.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phdkiran
phdkiran / .gitignore
Created July 7, 2016 23:38 — forked from karmi/.gitignore
Example Nginx configurations for Elasticsearch
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
@phdkiran
phdkiran / centos_python_env_setup
Last active May 25, 2016 15:43 — forked from iDevPy/centos_python_env_setup
CentOS 7: Install Python 3.5.1, pip, virtualenv, and virtualenvwrapper on CentOS. Run this script as "root (sudo su -)" without sudo.
#!/bin/bash
#####################################################################
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
# Copyright (C) 2015 Ivan Rivera
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.