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 <cstdio> | |
#include <cstdlib> | |
#include "cycle.h" | |
const short NFUNCS = 24; | |
template<int N> | |
int fN(int x) { | |
return fN<N-1>(fN<N-1>(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
// gcc callbench.c -o callbench -O1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "cycle.h" | |
int f0( int x ) | |
{ | |
/* The details of this calculation are not important */ | |
return 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
diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapterTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapterTest.java | |
index c5a165c..8f7e29c 100644 | |
--- a/codec-http2/src/test/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapterTest.java | |
+++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/InboundHttp2ToHttpAdapterTest.java | |
@@ -54,7 +54,11 @@ import io.netty.util.NetUtil; | |
import java.net.InetSocketAddress; | |
import java.util.List; | |
import java.util.concurrent.CountDownLatch; | |
+import java.util.concurrent.Executor; | |
+import java.util.concurrent.TimeUnit; |
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 java.util.concurrent.Executor; | |
import java.util.concurrent.ForkJoinTask; | |
import java.util.concurrent.RunnableFuture; | |
public class EventLoop implements Runnable { | |
final Executor executor; | |
final AdaptedRunnable pool[] = new AdaptedRunnable[2]; | |
volatile int cnt; | |
EventLoop(Executor executor) { |
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
/* | |
* Copyright 2014 The Netty Project | |
* | |
* The Netty Project licenses this file to you under the Apache License, | |
* version 2.0 (the "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
// The problem of associating tasks to channels could be solved by | |
// having the developer tell us, which channel a task belongs to | |
// this would make filtering the tasks on migration very easy. | |
// The downside is that it is subject to user errors. | |
// | |
// null if it doesn't belong to any particular channel | |
execute(ch, new Runnable() { | |
@Override | |
public void run() { | |
ch.flush(); |
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
// Hi there! I just want to let you know that I have neither compiled nor run | |
// this code. | |
EventLoopGroup workerGroup = new NioEventLoopGroup(32, new CustomEventExecutorChooser()); | |
public interface EventExecutorChooser { | |
void addExecutor(EventExecutor executor) | |
MetricsProvider newMetricsProvider(); | |
EventExecutor 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
// Welcome back! I just wrote down this code from the top of my head to express the main ideas. | |
// I didn't compile or run it. It's mostly pseudocode anyway. | |
// The problem of associating tasks to channels could be solved by | |
// having the developer tell us, which channel a task belongs to | |
// this would make filtering the tasks on migration very easy. | |
// The downside is that it is subject to user errors. | |
// | |
// null if it doesn't belong to any particular channel |
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
package palantir; | |
import java.util.Comparator; | |
public class FileNameComparator implements Comparator<String> | |
{ | |
/* | |
* DESCRIPTION: | |
* Numbers in the string are compared by their natural order | |
* and not their ASCII order. (2 < 10) |
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 java.util.Arrays; | |
import java.util.Scanner; | |
public class Solution { | |
private static int discoverSink(int[][] farmland, int[][] basins, int nextbasin, int i, int j) { | |
if (basins[i][j] != 0) { | |
return basins[i][j]; | |
// perform a dfs starting at i,j searching for a sink | |
} else { | |
int minaltitude = farmland[i][j]; |