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
// Run this code here: https://coliru.stacked-crooked.com/a/1a9ad442077cd0f6 | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
#include <memory> | |
int main() | |
{ | |
std::vector<std::unique_ptr<int>> vec; |
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
( | |
// Look for strings like deg"1 2 ~ 4" for a \degree pattern with durations | |
var pattern = "(\\w{3})\"([^\"\n]*)\""; | |
preProcessor = { |code| | |
var curOffset = 0; | |
var pat = code.findRegexp(pattern).clump(3); | |
// pat.debug("pat"); | |
pat.do{ arg p; | |
var fullMatch = p[0]; | |
var patternType = p[1].last; |
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
PtimeChain : Pattern { | |
var <>patterns; | |
*new { arg ... patterns; | |
^super.newCopyArgs(patterns); | |
} | |
<< { arg aPattern; | |
var list; | |
list = patterns.copy.add(aPattern); |
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
Summary for simple looped calculation (details and code below): | |
- on OS X 10.10.3, Mac Pro: 3,7 GHz Quad-Core Intel Xeon E5 | |
Language Tested Version Best Time Relative Perf Notes | |
======== ============== ========= ============= ===== | |
Node.js v0.10.33 0.0028 1 | |
Lua v5.3.0 0.0098 3.5 | |
SuperCollider v3.6.6 0.0138 4.9 | |
Ruby v2.0.0p481 0.0143 5.1 | |
Python v2.7.6 0.0413 14.8 |