This file contains 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 function is supposed to return false when | |
// x+y overflows unsigned short. | |
// Does the function do it correctly? | |
bool IsValidAddition( unsigned short x, | |
unsigned short y) { | |
if (x+y < x) | |
return false; | |
return true; | |
} |
This file contains 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 hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java | |
index e6570f5..0144ac4 100644 | |
--- hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java | |
+++ hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java | |
@@ -20,6 +20,7 @@ | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.HashSet; | |
+import java.util.Iterator; | |
import java.util.Set; |
This file contains 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
curl -X POST -d 'Rebooting=1&RestoreFactoryDefault=0' 'http://192.168.100.1/goform/RgConfiguration.pl' |
Adapted from Austin Schwartz's scripts that he posted on project 2. https://gist.github.com/nawns/3befd88d5bdd39d43e96
These assume you'll be running from the root of the project (ie, alongside src
and bin
.) Have the tests inside p4tests/output
.
See the diagram at the bottom for the intended directory structure.
./test.sh t1.mj
Or a prettier version with side by side diff (requires sdiff)
This file contains 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 keywords = ["NYC", "New York"]; | |
var els = document.getElementsByClassName("athing"); | |
[].forEach.call(els, function(ele){ | |
var regex = new RegExp("\\b" + keywords.join("|") + "\\b"); | |
var elementText = ele.innerHTML; // probably a few false positives, oh well. | |
if (regex.test(ele.innerHTML)){ | |
ele.style.display = "block"; | |
} else { | |
ele.style.display = "none"; | |
} |
This file contains 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> | |
int main(){ | |
int i = 0; | |
int a = 3; | |
int b = 5; | |
{ | |
int c = 7; | |
printf(" c: %d\n", c); | |
printf("&c: %u\n", &c); | |
} |
This file contains 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.io.*; | |
import java.util.*; | |
public class Solution { | |
static boolean isAnagram(String A, String B) { | |
//Complete the function | |
if (A.length() != B.length()) | |
return false; |
I hereby claim:
- I am scottopell on github.
- I am scott_o (https://keybase.io/scott_o) on keybase.
- I have a public key whose fingerprint is 91BE AEDD 380A FB1E 0616 0057 16BF E230 853D 68F5
To claim this, I am signing this object:
This file contains 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
#!/bin/sh | |
user=scottopell | |
json=$(curl -s https://api.github.com/users/$user/repos\?type\=owner\&per_page\=300 | jq 'reduce .[] as $pair ( {}; . + { ($pair.name): { url: $pair.html_url } } )') | |
echo "\ | |
{ | |
\"max-concurrent-indexers\": 2, | |
\"dbpath\": \"data\", | |
\"repos\": $json | |
}" |
OlderNewer