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
| public int firstNegative(int[] numbers, int...i) { | |
| return ((i = (i != null ? i : 0)) > numbers.length()) | |
| ? 0 | |
| : ((numbers[i] < 0) | |
| ? numbers[i] | |
| : firstNegative(numbers, i+1)); | |
| } |
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
| (defn relay [x i] | |
| (when (:next x) | |
| (send (:next x) relay i)) | |
| (when (and (zero? i) (:report-queue x)) | |
| (.put (:report-queue x) i)) | |
| x) | |
| (defn run [m n] | |
| (let [q (new java.util.concurrent.SynchronousQueue) | |
| hd (reduce (fn [next _] (agent {:next next})) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Login</title> | |
| <link rel="stylesheet" type="text/css" media="screen, projection" href="screen.css"> | |
| </head> | |
| <body> | |
| <div class="dialog" id="new-session-dialog"> | |
| <h1>Login</h1> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Checkout details — Cloudchat</title> | |
| <link href="screen.css" media="screen, projection" rel="stylesheet" type="text/css"> | |
| </head> | |
| <body id="checkout"> | |
| <section class="dialog"> | |
| <header> |
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
| unction $bind1_0(fn, thisObj, scope) { | |
| return function() { | |
| return fn.call(thisObj, scope); | |
| } | |
| } | |
| function $bind1_1(fn, thisObj, scope) { | |
| return function(arg) { | |
| return fn.call(thisObj, scope, arg); | |
| } | |
| } |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <assert.h> | |
| #include "uv/uv.h" | |
| static uv_tcp_t server; | |
| void on_close(uv_handle_t* handle) { | |
| // release the handle | |
| free(handle); |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| gem "mongoid", ">= 2.0.0.beta9" | |
| gem "bson_ext", ">= 1.0.3" | |
| gem "haml", ">= 3.0.12" | |
| gem "rspec-rails", ">= 2.0.0.beta.15", :group => :test | |
| generators = <<-GENERATORS | |
| config.generators do |g| | |
| g.orm :mongoid | |
| g.template_engine :haml | |
| g.test_framework :rspec, :fixture => true, :views => false |
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
| var depth = 1, invocations = 0, substractions = 0, edge = 0; | |
| function f(x, y, z) { | |
| if(y < x) { | |
| // Increment the counters | |
| ++depth | |
| substractions += 3 | |
| if(depth > edge) edge = depth | |
| console.log("Recursion depth: %d", depth) | |
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
| var depth = 0; | |
| function f(x, y, z) { | |
| if(y < x) { | |
| ++depth | |
| console.log("Recursion depth: %d", depth) | |
| z = f(f(x - 1, y, z), f(y - 1, z, x), f(z - 1, x, y)) | |
| --depth | |
| } | |
| return z |