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" | |
#include "string.h" | |
#include "stdlib.h" | |
// HEADER_SIZE would help us to move pointer to and fro | |
// usually, sizeof(unsigned int) is 4 bytes | |
// so this will be 8 bytes | |
#define HEADER_SIZE 2 * sizeof(unsigned int) |
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" | |
#include "string.h" | |
#include "stdlib.h" | |
// HEADER_SIZE would help us to move pointer to and fro | |
// usually, sizeof(unsigned int) is 4 bytes | |
// so this will be 8 bytes | |
#define HEADER_SIZE 2 * sizeof(unsigned int) |
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
bubbleSort::(Ord a) => [a] -> [a] | |
bubbleSort [] = [] | |
bubbleSort ([a]) = [a] -- One element array | |
bubbleSort ([a,b]) = if a<b then [a,b] else [b,a] | |
bubbleSort (a:b:bs) = let res = if a < b then [a] ++ bubbleSort([b]++bs) else [b] ++ bubbleSort([a]++bs) in bubbleSort (init res) ++ [last res] |
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
def bubble_sort(ar): | |
if len(ar)<=1: | |
return ar | |
if len(ar)==2: | |
return ar if ar[0]<ar[1] else [ar[1],ar[0]] | |
a,b,bs=ar[0],ar[1],ar[2:] | |
res = [] | |
if a<b: |
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
def imperative_bubble_sort(ar): | |
for i in range(len(ar)): | |
for j in range(len(ar)-1-i): | |
if ar[j]>ar[j+1]: | |
ar[j],ar[j+1] = ar[j+1],ar[j] | |
return ar |
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
ssh -l username -n -N -i identity_file -R 6379:0.0.0.0:6379 mydroplet.domain.com |
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
ssh -l username -n -N -i identity_file -R 6379:127.0.0.1:6379 mydroplet.domain.com |
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
#ifndef 1_H | |
#define 1_H | |
void foo(){ | |
//Some code | |
} | |
#endif |
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
# 1 "3.c" | |
# 1 "<built-in>" | |
# 1 "<command-line>" | |
# 31 "<command-line>" | |
# 1 "/usr/include/stdc-predef.h" 1 3 4 | |
# 32 "<command-line>" 2 | |
# 1 "3.c" | |
# 1 "2.h" 1 | |
# 1 "1.h" 1 |
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"2.h" | |
#include"1.h" | |
void main(){ | |
foo(); | |
soo(); | |
} |
NewerOlder