Skip to content

Instantly share code, notes, and snippets.

View elvircrn's full-sized avatar

Elvir Crnčević elvircrn

  • Red Hat
  • Brno/Graz/Sarajevo
View GitHub Profile
# Level 1
disp (a) -> display a
a.' -> transponovano
a' -> transponovano konjugovano
feval(X, Y, f);

Level 1

disp (a) -> display a

a.' -> transponovano

a' -> transponovano konjugovano

feval(X, Y, f);

#include <vector>
#include <limits>
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <utility>
#include <iostream>
#include <fstream>
inline dec(int x) {
@elvircrn
elvircrn / test.js
Last active November 20, 2017 15:28
// Kod za validaciju ide ovdje
function testEmail() {
// Fakultetski email validation tests
console.assert(Validacija.validirajFakultetski('elvircrn@etf.unsa.ba') === true);
console.assert(Validacija.validirajFakultetski('elvircrnetf.unsa.ba') === false);
console.assert(Validacija.validirajFakultetski('elvircrn@etf.unsa') === false);
console.assert(Validacija.validirajFakultetski('@etf.unsa') === false);
console.assert(Validacija.validirajFakultetski('@etf.unsa.ba') === false);
console.assert(Validacija.validirajFakultetski('') === false);
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Full screen mode on start
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"run the command immediately when starting vim
autocmd VimEnter * call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
" activate/deactivate full screen with function key <F11>
map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
filetype on
; ubuntu@ubuntu:~/Desktop/usr/bin$ ./nasm -f elf hello.asm
; ubuntu@ubuntu:~/Desktop/usr/bin$ gcc -o hello hello.o
; ubuntu@ubuntu:~/Desktop/usr/bin$ ./hello
; a=5, eax=7
extern printf
SECTION .data ; Data section, initialized variables
a: dd 5 ; int a=5;
@elvircrn
elvircrn / hello.asm
Last active February 17, 2018 11:13
%define main_len 16
extern printf
extern scanf
global main
section .data
LIT_1: db "%d", 0
LIT_0: db "Da li je tvoj broj %d?", 10, "", 0
LIT_2: db "Trebalo mi je %d pokusaja da pogodim broj", 10, "", 0
section .text
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Auto reload on file change
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set autoread
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set t_Co=256
set background=dark
#pragma config FOSC = HS, WDTE = OFF, PWRTE = OFF, MCLRE = ON, CP = OFF, \
CPD = OFF, BOREN = OFF, CLKOUTEN = OFF
#pragma config IESO = OFF, FCMEN = OFF, WRT = OFF, VCAPEN = OFF, PLLEN = OFF, \
STVREN = OFF, LVP = OFF
#define _XTAL_FREQ 8000000
#include <xc.h>
volatile unsigned char id;
void init() {
@echo off
ghdl --clean --workdir=isim\work
ghdl --remove --workdir=isim\work
ghdl --clean --workdir=work
ghdl --remove --workdir=work
mkdir work
for /r %%i in (*.vhd) do ghdl -a --ieee=synopsys --workdir=work %%~ni.vhd
ghdl -e --ieee=synopsys --workdir=work tb_%1
ghdl -r --ieee=synopsys --workdir=work tb_%1 --vcd=%1.vcd
C:\gtkwave\bin\gtkwave %1.vcd