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
| MonicSolve = function( | |
| order = 5, # the order of the monic polynomials being solved | |
| n = 5, # n, in (n,n-1,...,-n), the acceptable coefficient values | |
| iterations = 1000, # the number of equations to solve | |
| random = FALSE # if m!= FALSE, use randomly generated polynomial coefficients | |
| ) | |
| { |
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
| AutonomaGenerate = function( | |
| dims = 25 # the size of the autonomaton | |
| ) | |
| { | |
| # Ryan Grannell, 2012 | |
| # A function to generate random autonoma (tend to be square, |
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
| require(ggplot2) | |
| require(grid) | |
| shinyServer(function(input, output) { | |
| parameters <- NULL | |
| processs_follow <- function(input){ | |
| if(input$user_ids != ''){ | |
| paste0('follow=', gsub(' ', '', input$user_ids)) |
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
| monic <- function (max, order, a = 1, digits = 3) { | |
| P <- matrix(0, order-1, order-2) | |
| P[row(P)-1 == col(P)] <- 1 | |
| join_table <- function (a, b) { | |
| n <- intersect(names(a), names(b)) |
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
| forkbomb <- function (...) { | |
| # you probably shouldn't run this; your pc will crash | |
| require (parallel) | |
| parallel::mclapply(1:2, forkbomb, mc.cores = 2) | |
| } | |
| forkbomb() |
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
| (function () { | |
| sys.call() | |
| })() |
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
| prod <- function (coll) { | |
| # callCC lets you jump out of ANY function early, | |
| # by specifying a breakpoint function (often called 'k'). | |
| # if I used return instead of breakpoint here the | |
| # program would take a long time to terminate. | |
| # 1; breakpoint jumps up to this level if it is called, evalulating to zero | |
| callCC( | |
| function (breakpoint) { |
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
| signify <- function (package) { | |
| # environment -> [singatures: [string], params: [string]] | |
| # gets the type-signature of every function in | |
| # an environment, and every unique parameter. | |
| data <- Map( | |
| function (name) { | |
| func <- get(name) |
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
| # this script is poorly-written, so use at your own risk. | |
| # --------------------------------------------------------------- | |
| # | |
| # THIS HAS A VERY GOOD CHANCE OF COMPLETELY DESTROYING YOUR REPO; | |
| # ONLY RUN THIS ON A COPY OF THE REPO!!! | |
| # | |
| # ---------------------------------------------------------------- |
OlderNewer