Skip to content

Instantly share code, notes, and snippets.

@catawbasam
catawbasam / updated_word_count.jl
Created March 5, 2014 10:41
Update to Julia word count test
# Updated Word Count performance test.
#
# See https://groups.google.com/forum/?fromgroups=#!topic/julia-users/hxfR70Ro-lI
using DataStructures
import Base.hash
hash{T<:ByteString}(s::SubString{T}) = ccall(:memhash, Uint64, (Ptr{Void}, Int), pointer(s), sizeof(s))
@catawbasam
catawbasam / gist:9335068
Created March 3, 2014 21:33
Julia String->Float64 conversion times superlinear?
{
"metadata": {
"language": "Julia",
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@catawbasam
catawbasam / gist:7028568
Last active December 25, 2015 19:29
IJulia Notebook: String basics
{
"metadata": {
"language": "Julia",
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@catawbasam
catawbasam / fds_specimen_notebook.ipynb
Last active December 25, 2015 19:19
Sample IPython notebook using FDS Specimen Flight and FlightDataAnalyzer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@catawbasam
catawbasam / gist:3858529
Created October 9, 2012 12:31
Autohotkey file to use NotePad++ with the Julia console for REPL-oriented development
;RGUI-like AutoHotKey macros for copying code from Notepad++ to Julia console for REPL-oriented development
; control-F5 will select the current line of text in Notepad++
; control-F6 pastes the clipboard contents into the Julia console, presses <Enter>
; then re-activates Notepad++ and moves the cursor down a line.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;
@catawbasam
catawbasam / julia_npp.xml
Created October 9, 2012 12:23
Julia language syntax highlighting for Notepad++. Goes in /users/{username}/AppData/Roaming/Notepad++.
<NotepadPlus>
<UserLang name="Julia" ext="jl">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;00&quot;00</Keywords>
<Keywords name="Folder+">begin function type for while if</Keywords>
@catawbasam
catawbasam / test1.jl
Created September 19, 2012 12:58
first crack at Julia
##############################################################
# julia first test = test.jl
# running on Windows 64 with Commit 7076ab06f1 (2012-10-15)
#
# Julia runs in the crappy Windows terminal (autohotkey is one way out)
# - make sure QuickEdit is on
# - select with mouse and <enter> to copy
# - right click with mouse to paste
# AutoHotKey script -- ctl-F5 copies cur line; ctl-f6 pastes clipboard to console
#
@catawbasam
catawbasam / pandas_dbms.py
Last active February 17, 2024 15:16
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,