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
int solution(int A[], int N) { | |
int i = 0; | |
int * array = calloc(N + 1, sizeof(int)); | |
int sum = N * (N + 1) / 2; | |
int sum2 = 0; | |
for (; i < N; i++) { | |
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
int solution(int A[], int N) { | |
// write your code in C99 | |
int minimal = 1; | |
int i = 0; | |
int * array = calloc(N + 1, sizeof(int)); | |
for (; i < N; i++) { | |
if (A[i] > 0 && A[i] <= N && array[A[i]] == 0) { | |
array[A[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
struct Results solution(int N, int A[], int M) { | |
struct Results result; | |
// write your code in C99 | |
int * c = calloc(N, sizeof(int)); | |
int max = 0; | |
int latestMax = 0; | |
int i = 0; | |
int idx = 0; | |
for (; i < M; i++) { |
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
#!/bin/bash | |
#Jerry pushes dave in the elevator | |
for i in `seq 1 10` | |
do | |
clear | |
printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n" | |
awk "BEGIN {while (c++<$i) printf \"-\"}" | |
printf "|" |
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
#!/bin/bash | |
# | |
# ADB Connect android device for building via wifi | |
# Based on stack over flow answer: | |
# http://stackoverflow.com/questions/4893953/run-install-debug-android-applications-over-wi-fi | |
# | |
# Usage: | |
# | |
# 1. Make sure adb command is in executable path | |
# |
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 System.Environment | |
import Text.Printf | |
bz = 0.552284749831 | |
zero = read "0" :: Float | |
main = do | |
args <- getArgs | |
let c = parseArg 0 args |
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
#!/bin/bash | |
# | |
# Strict mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
set -euo pipefail | |
IFS=$'\n\t' | |
# | |
# Usage: script -f fileToPull -p packageName | |
# |
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
# Dave Thomas Oct 2015 | |
# I've added this function to my ~/.bash_profile | |
# It allows for quick one liner tests of java code from the command line | |
# Usage example: | |
# javai 'System.out.println("Hello, World!");' | |
# | |
# Second param can be import statements | |
# Eg: |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Please specify DB file name" | |
echo "usage $0 [Database File] [App Package]" | |
exit 1 | |
fi | |
if [ -z "$2" ]; then | |
echo "Please specify the package name to run as" |
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 interface IDynamicModule { | |
String getText(); | |
} |
OlderNewer