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
;to change your directory colors, open up your ~/.bashrc file with your editor | |
;and make the following entry at the end of the | |
LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS |
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> | |
#define __repeat__ do | |
#define __until__(COND) while(!(COND)) | |
int isPrime(int n) { | |
if( n == 0 || n == 1 ) return 0; | |
if( n == 2 || n == 3 ) return 1; | |
int i = 2, |
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 euclid_it a, b | |
while b != 0 | |
r = a % b | |
a, b = b, r | |
end | |
a | |
end | |
def euclid_rec a, b | |
if b == 0 |
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 sys | |
def _euclid(a,b): | |
if(b==0): | |
return a | |
else: | |
return _euclid(b,a%b) | |
def _euclid_it(a,b): | |
while(b): | |
r = 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
#include <stdio.h> | |
#include <malloc.h> | |
#define FIN "ssm.in" | |
#define FOUT "ssm.out" | |
struct Arr { | |
int size; | |
int *data; | |
}; | |
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
use std::fs::File; | |
use std::io::{BufRead, BufReader, Write}; | |
fn gcd(mut x: i32, mut y: i32) -> i32 { | |
assert!(x != 0 && y != 0); | |
while y != 0 { | |
let t = x % y; |
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
alias lf="ls -l | egrep -v '^d'" | |
alias ldir='ls -d */' | |
alias ld="ls -l | egrep '^d'" | |
source .bash_profile | |
lancia@adonix.cs.unibuc.ro: $ld | |
lancia@adonix.cs.unibuc.ro: $lf | |
lancia@adonix.cs.unibuc.ro: $ pdftex filename.tex | |
lancia@adonix.cs.unibuc.ro: $ evince filename.pdf #open file PDF |
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
let str = "adrianstatescu" | |
console.log(str) | |
let arr = [...str.toString()] | |
let finished = 0, swapped, size = arr.length; | |
while(!finished) { | |
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
/* | |
An Armstrong number is a number that is equal to the sum of digits raise to the power total number of digits in the number. | |
Some Armstrong numbers: 153, 370, 1634 | |
*/ | |
#include <stdio.h> | |
#define LL long long | |
int countDigits(int n) { | |
int count = 0; |
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> | |
#define SIZE 1000 | |
struct TSet { | |
unsigned int n; | |
int arr[SIZE]; | |
}; | |
typedef struct TSet Set; |