This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(inline) | |
library(microbenchmark) | |
car <- cfunction(c(x = "pairlist"), ' | |
if (x == R_NilValue) | |
return R_NilValue; | |
if (TYPEOF(x) != LISTSXP) | |
error("x must be a pairlist"); | |
return CAR(x); | |
') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from Queue import Queue | |
fibo_dict = {} | |
shared_queue = Queue() | |
input_list = [3, 10, 5, 7] | |
queue_condition = threading.Condition() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import string | |
import math | |
tokenize = lambda doc: doc.lower().split(" ") | |
document_0 = "China has a strong economy that is growing at a rapid pace. However politically it differs greatly from the US Economy." | |
document_1 = "At last, China seems serious about confronting an endemic problem: domestic violence and corruption." | |
document_2 = "Japan's prime minister, Shinzo Abe, is working towards healing the economic turmoil in his own country for his view on the future of his people." | |
document_3 = "Vladimir Putin is working hard to fix the economy in Russia as the Ruble has tumbled." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Hands-on with dplyr" | |
author: "Dmitry Grapov" | |
output: | |
html_document: | |
keep_md: yes | |
--- | |
## Introduction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs::File; | |
use std::path::Path; | |
use std::io::BufReader; | |
use std::io::BufRead; | |
use std::collections::HashMap; | |
use std::io::stdin; | |
fn sort_str(s: &String) -> String { | |
let mut v: Vec<char> = s.chars().collect(); | |
v.sort(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
live_loop :foo do | |
with_fx :echo, mix: 0.3 do | |
sample :elec_tick if spread(2,7).tick | |
pattern1 = (knit :a3, 1, :d3, 1, :g3, 1) | |
pattern2 = (knit :a3, 1, :d3, 1, :g3, 1, :a0, 1) | |
pattern3 = (knit :a3, 1, :d3, 1, :g3, 1, :a5, 1) | |
structure = (knit pattern1, 128, pattern2, 32, pattern3, 32).tick(:structure) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/ | |
USAGE: | |
ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() { | |
@Override | |
public void onItemClicked(RecyclerView recyclerView, int position, View v) { | |
// do it | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################### | |
## Sonic Pi Drum Machine | |
## coded by Darin Wilson | |
## changed by Xavier Riley | |
## | |
use_bpm 95 | |
in_thread(name: :drum_machine) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
GitHub User Repository Language Analyzer | |
Created By: Ben Reeves | |
Date: January 8, 2015 | |
Description: | |
This script uses the PyGithub library to access the Github API in order to perform some data analysis on a user's | |
repositories. Specifically, it will analyze all of the user's code and calculate the percentage of code written in | |
different programming languages. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define :bo do |idx| | |
"Users/xriley/Dropbox/Public/sounds/barack/b#{idx}.wav" | |
end | |
use_bpm 125 | |
live_loop :heartbeat do | |
sample :bd_tek, amp: 0, cutoff: (range 60, 90).mirror.tick | |
sleep 1 | |
end |