I hereby claim:
- I am DanGe42 on github.
- I am dge (https://keybase.io/dge) on keybase.
- I have a public key whose fingerprint is 5647 BAF2 14D7 AE03 3D6E 5AF1 916F EE0D A965 FA3A
To claim this, I am signing this object:
| public class SyncTest { | |
| public void test1(int x) throws InterruptedException { | |
| synchronized (this) { | |
| System.out.println("Entered guarded block"); | |
| if (x != 42) { | |
| wait(); | |
| } | |
| System.out.println("Done!"); | |
| } | |
| } |
I hereby claim:
To claim this, I am signing this object:
| def ((defined?(Moped::BSON) ? Moped::BSON : BSON)::ObjectId).legal?(s) | |
| /\A\h{24}\z/ === s.to_s | |
| end |
| var toArray = function(orig) { | |
| var arr = []; | |
| for (var i = 0; i < orig.length; i++) { | |
| arr.push(orig[i]); | |
| } | |
| return arr; | |
| } | |
| var find_child_by_class = function(root, klass) { | |
| var queue = toArray(root.children); |
| # Start an HTTP server from a directory, optionally specifying the port | |
| function server() { | |
| # Default to port 8000 | |
| local port="${1:-8000}" | |
| # Since the one-liner blocks, we open the browser beforehand. However, we want to | |
| # wait just a couple of seconds since the server will not be ready just yet. | |
| # Also, I think Linux users should be able to use 'xdg-open' ('open' is for OS X). | |
| ( sleep 2; open "http://localhost:${port}/" ) & | |
| #!/bin/bash | |
| trap "echo ' Batman!'; exit" SIGINT SIGQUIT | |
| while (true) | |
| do | |
| echo -n "Na" | |
| sleep 0.1 | |
| done |
| --- context_hello_world.c 2013-10-23 19:47:07.000000000 -0400 | |
| +++ context_hello_world1.c 2013-10-23 19:47:13.000000000 -0400 | |
| @@ -7,8 +7,11 @@ | |
| #define STACKSIZE 4096 | |
| +ucontext_t main_context; | |
| + | |
| void f(){ | |
| printf("Hello World\n"); |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| int poly1(int x) { | |
| return x*x - 3*x + 4; | |
| } | |
| int poly2(int x) { | |
| return x*(x - 3) + 4; |
| .section __TEXT,__text,regular,pure_instructions | |
| .section __TEXT,__literal8,8byte_literals | |
| .align 3 | |
| LCPI0_0: | |
| .quad -4609434218613702656 ## double -3 | |
| LCPI0_1: | |
| .quad 4616189618054758400 ## double 4 | |
| .section __TEXT,__text,regular,pure_instructions | |
| .globl _poly1a | |
| .align 4, 0x90 |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <ucontext.h> | |
| #define STACKSIZE 4096 | |
| ucontext_t foo_context, main_context; | |
| void foo() { | |
| printf("Executing foo!\n"); |