Skip to content

Instantly share code, notes, and snippets.

@linuxster
linuxster / ILP.ipynb
Last active August 9, 2023 16:43
ILP example in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davidrpugh
davidrpugh / conda_instructions.md
Last active January 28, 2025 17:58
Instructions for setting up a Conda development environment

Creating a Conda development environment

We recommend that you set up a Python environment for developing quantecon that is separate from the "default" Python environment that you use in your own research. This will allow you to contribute to quantecon without worrying about corrupting the Python environment on which your other work depends.

Below are instructions for building a separate development environment for contributing to the quantecon package using the Conda package management system which comes bundled with the Anaconda Python distribution provided by Continuum Analytics.

Step 1:

Fork and clone a copy of the quant-econ repository on to your local machine.

Step 2:

import socket
import sys
import time
import struct
host = 'localhost'
port = 8888
buffersize = 1024
N = 1000000
server_address = (host, port)
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active January 13, 2025 03:52
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@wesm
wesm / parquet-benchmark-20170210.py
Created February 10, 2017 18:07
Parquet multithreaded benchmarks
import gc
import os
import time
import numpy as np
import pandas as pd
from pyarrow.compat import guid
import pyarrow as pa
import pyarrow.parquet as pq
import snappy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@linar-jether
linar-jether / PySpark DataFrame from many small pandas DataFrames.ipynb
Created July 8, 2018 10:15
Convert a RDD of pandas DataFrames to a single Spark DataFrame using Arrow and without collecting all data in the driver.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andyweizhao
andyweizhao / cuda_installation_on_ubuntu_18.04
Last active October 11, 2021 17:56 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.3 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
#!/usr/bin/env bash
set -eu
PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SRC_DIR=$(realpath "${PWD}/..")
CXX_SRC=${SRC_DIR}/cpp
# The following can be set
: "${CMAKE:=cmake}"
@jasonrig
jasonrig / run_spark_cluster.sh
Created August 9, 2019 03:47
Example SLURM job script to start a Spark cluster
#!/bin/bash
#SBATCH --job-name spark-cluster
#SBATCH --account=qh82
#SBATCH --time=02:00:00
# --- Master resources ---
#SBATCH --nodes=1
#SBATCH --mem-per-cpu=1G
#SBATCH --cpus-per-task=1
#SBATCH --ntasks-per-node=1
# --- Worker resources ---