Skip to content

Instantly share code, notes, and snippets.

View brooksbp's full-sized avatar

Brian Brooks brooksbp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am brooksbp on github.
  • I am brianbrooks (https://keybase.io/brianbrooks) on keybase.
  • I have a public key ASA5a3fZtznODrd1LE-B46TBq0440f6YbHGBeGbVnee_4Ao

To claim this, I am signing this object:

#include <algorithm>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <assert.h>
using namespace std;
bool Find2SumSorted_Slow(const vector<int>& numbers, int target, int* a, int* b) {
bool found = false;
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index d02ed7c..11af436 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -15,8 +15,10 @@ macro_rules! panic {
panic!("explicit panic")
);
($msg:expr) => ({
- static _MSG_FILE_LINE: (&'static str, &'static str, usize) =
- ($msg, file!(), line!() as usi
#include <iostream>
#include <vector>
#include <algorithm>
#include <thread>
#include <mutex>
using namespace std;
mutex m;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solve() {
int W, H, P, Q, N, X, Y, a, b, c, d;
cin >> W >> H >> P >> Q >> N >> X >> Y >> a >> b >> c >> d;
#include <iostream>
#include <string>
#include <cstring>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <vector>
// Implement an algorithm to determine if a string has all unique characters.
// What if you cannot use additional data structures?
#include <iostream>
#include <string>
#include <assert.h>
#include <unordered_map>
using namespace std;
@brooksbp
brooksbp / of-init-sw.hs
Created November 19, 2012 20:08
haskell-nettle openflow example
import Nettle.Servers.Server
import Nettle.OpenFlow
import Control.Concurrent
import System.Environment
getPortNumber :: IO ServerPortNumber
getPortNumber = do
args <- getArgs
if length args < 1
then error "Requires one command-line argument specifying the server port number."