Skip to content

Instantly share code, notes, and snippets.

View riemass's full-sized avatar
👋
Knock, knock. Race condition! Who's there?

Samir Halilčević riemass

👋
Knock, knock. Race condition! Who's there?
  • Bosnia and Herzegovina
View GitHub Profile
@riemass
riemass / main.cpp
Created July 13, 2024 12:34
Wx + CAF minimal
#include <caf/all.hpp>
#include <caf/net/middleman.hpp>
#include <memory>
#include <wx/wx.h>
class MyApp : public wxApp {
public:
bool OnInit() override;
// CAF actor system - Used as unique_ptrs to keep the system alive during the
@riemass
riemass / cmake-cxx-mold-linking-howto.md
Created February 1, 2024 09:40 — forked from MawKKe/cmake-cxx-mold-linking-howto.md
How to try out the new "mold" linker with your CMake C/C++ project

How to try out the new mold linker with your CMake C/C++ project

Here is a quick how-to if you want to try out the new (supposedly fast) C/C++ linker https://github.com/rui314/mold

In this document I used Ubuntu-22.04 docker container with

  • GCC version 11.2.0
  • Clang version 14.0.0

1. Install mold :

#include <algorithm>
#include <iostream>
#include <vector>
class Radnik {
public:
Radnik(std::string i, std::string p, int bstar, int bstaz, size_t plat,
std::string brojt)
: ime_{i}, prezime_{p}, godineStarosti_{bstar},
godineStaza_{bstaz}, plata_{plat}, brojTelefona_{brojt} {}
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
/* Program napisan ispod predstavlja upravljanje bankovnim racunom.
* Korisnik ima mogucnost da doda novu transakciju na racun koju je potrebno
* ubaciti u odredjenu strukturu.
* Transakcija se aplicira na stanje racuna tek kada korisnik zeli da aplicira
* transakciju.
#include <stdio.h>
struct student {
int broj_indeksa;
char ime[20];
char prezime[50];
int ocjena;
};
// Ako bi zeljeli da ne pisemo svaki put kljucnu rijec struct
// typedef struct student student_t;
#include <stdio.h>
#include <string.h>
struct student {
char ime[20];
char prezime[50];
int ocjena;
};
void unesi_studenta(struct student* stud);
#include <stdio.h>
/*
x | |
------------
| x |
------------
| o |
*/
void print_teren(char teren[][3]);
#include <stdio.h>
/*
x | |
------------
| x |
------------
| | x
*/
@riemass
riemass / clendar2.c
Created April 16, 2020 10:44
LV OP FET
#include <stdio.h>
// Napisati program koji treba da korisniku ispise koliko je dana proslo
// od pocetka nove ere do unesenog dan.
// Ispisati koji je dan u sedmici!
// 1. 1. 1900. je bio ponedeljak
// Deklaracija
int da_li_je_prestupna(int godina);
@riemass
riemass / calendar.c
Created April 15, 2020 08:10
Calendar OP LV
#include <stdio.h>
// Napraviti program koji od korisnika trazi unos datuma, te
// racuna koliko je dana proslo od pocetka nove ere do tog dana.
// Prestupna godina je godina koje je djeljiva sa 4, a nije djeljiva
// sa 100, osim ako je djeljiva sa 400
// godina % 4 == 0 // da je djeljiva sa 4
// godina % 100 != 0 // da nije djeljiva sa 100
// godina % 400 == 0 // da je djeljiva sa 400