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
defmodule ListOps do | |
# Please don't use any external modules (especially List) in your | |
# implementation. The point of this exercise is to create these basic functions | |
# yourself. | |
# | |
# Note that `++` is a function from an external module (Kernel, which is | |
# automatically important`) and so shouldn't be used either. | |
@spec count(list) :: non_neg_integer |
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
; random - programa que imprime uma letra e um digito aleatório em Linux/x86 | |
; para compilar: | |
; nasm -f elf -g -F dwarf -l random.lst random.asm32 | |
; ld -o random random.o | |
; syscalls | |
%define sys_exit 1 | |
%define sys_read 3 | |
%define sys_write 4 | |
%define sys_open 5 |
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> | |
/* | |
* Para compilar e executar | |
* gcc -std=c11 % && time ./a.out | |
*/ | |
/* isto aqui é magica pra mim. Magia negra */ | |
unsigned long long int nexthi_same_count_ones(unsigned long long a) { | |
/* works for any word length */ | |
unsigned long long int c = (a & -a); |
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> | |
void printhex(signed char c) { | |
printf("%x %d\n", c , c ); | |
} | |
int main(){ | |
printhex(0x0); /* => 0 0 */ | |
printhex(0x30); /* => 30 48 */ | |
printhex(0x1f); /* => 1f 28 */ |
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
#!/usr/bin/python3 | |
def idempotent(other): | |
myset={1,2,3} | |
return myset.union(other) | |
def non_idempotent(other): | |
mylist=[1,2,3] | |
mylist.extend(other) | |
return mylist |
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
cd /home/horacio/Documentos/temp/license-vision | |
while read user ; do | |
echo $user | |
cp *.ucl /mnt/appusu/"$user"/Systex5 | |
cp *.uvz /mnt/appusu/"$user"/Systex5 | |
cp *.jar /mnt/appusu/"$user"/Systex5/shell/ | |
cp *.[dD][Ll][Ll] /mnt/appusu/"$user"/Systex5/shell/funcoes/ | |
done < /home/horacio/Downloads/all.bat |
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
iex(1)> l = [1, 2, 3] | |
#=> [1, 2, 3] | |
iex(2)> l2 = tl(l) | |
#=> [2, 3] | |
iex(3)> l2 = [ 0 | l2 ] | |
#=> [0, 2, 3] | |
iex(4)> IO.inspect l | |
[1, 2, 3] | |
#=> [1, 2, 3] | |
iex(5)> IO.inspect l2 |
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
###### JADE #### | |
1 doctype html | |
2 html(lang=en, ng-app="myApp") | |
3 head | |
4 title= "titulo 2" | |
5 body | |
6 h1 This is a test | |
7 ng-view | |
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
class Style1 | |
def some_public_method | |
end | |
def another_public_method | |
end | |
private |
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
defmodule ListOps do | |
# Please don't use any external modules (especially List) in your | |
# implementation. The point of this exercise is to create these basic functions | |
# yourself. | |
# | |
# Note that `++` is a function from an external module (Kernel, which is | |
# automatically important`) and so shouldn't be used either. | |
NewerOlder