It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
# =Split Reuters-21578 | |
# =(Found at: http://www.daviddlewis.com/resources/testcollections/reuters21578/) | |
# =SGML files into separate TXT files | |
# | |
# Documents selected are those from LEWIS SPLIT that have at least one topic. | |
# Documents (only the body of text) are put in directories according to their type (train/test) and topic. | |
# Documents with more than one topic are written in more than one folder. | |
# Only documents that have a topic listed in 'used_topics' Array are selected. | |
# This pre-processing is useful for text categorization applications. | |
# |
#!/usr/bin/env ruby | |
# A quick and dirty implementation of an HTTP proxy server in Ruby | |
# because I did not want to install anything. | |
# | |
# Copyright (C) 2009-2014 Torsten Becker <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, |
################################################################################ | |
# | |
# Copyright 1993-2006 NVIDIA Corporation. All rights reserved. | |
# | |
# NOTICE TO USER: | |
# | |
# This source code is subject to NVIDIA ownership rights under U.S. and | |
# international Copyright laws. | |
# | |
# NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE |
(* | |
Folder action to queue downloaded torrents in your uTorrent web gui. With a dyndns account you can initiate downloads on your file server from wherever you happen to be. | |
Gotta have uTorrent with web gui (Windows, Mac, or Linux with Wine). | |
Gotta have growl, too. | |
- Paste into Script Editor | |
- Edit the user, password, and server url below. | |
- Add as a folder action on your download directory |
The regex patterns in this gist are intended to match any URLs, | |
including "mailto:[email protected]", "x-whatever://foo", etc. For a | |
pattern that attempts only to match web URLs (http, https), see: | |
https://gist.github.com/gruber/8891611 | |
# Single-line version of pattern: | |
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) |
It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
""" | |
Determine IPv4 addresses on a Linux machine via the socket interface. | |
Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful | |
code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272 | |
This version has all comments removed for brevity. | |
""" | |
import socket | |
import array | |
import struct |
/* | |
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
so it's better encapsulated. Now you can have multiple random number generators | |
and they won't stomp all over eachother's state. | |
If you want to use this as a substitute for Math.random(), use the random() | |
method like so: | |
var m = new MersenneTwister(); |
import math | |
from time import clock | |
# Calculates all the primes from 0 to stop_at using a sieve on an array. | |
def primes(stop_at): | |
if stop_at is None: | |
print("This algorithm doesn't support unbounded ranges") | |
return [] | |
if stop_at <= 2: return [] |