Posts
Introduction to TSS - small tool for generating source code from templates
Sometimes, working with the code involves a lot of boilerplate snippets and source files. This often reduces creativity in development and causes developer to think more about framework API or language syntax rather than to think more about the problem they are trying to solve.
C++ Value categories - making your constructors time and memory optimal
Since C++11, a lot of effort is invested in optimizing code for performance. The bottleneck was always copying stuff around and making temporary objects. Since we do not want to come back to CC, in C++11 there is functionality to distinguish if we are passing temporary object or object we will use later.
Jekyll Web
Jekyll web is web application made in Django to manage static Jekyll sites from web admin interface.
Instant API
Today, we live in world of micro services. Now, it is important to make your application accessible to other applications more than ever. The problem is that this task is very often easier said than done. We often want to expose some kind of interface to our application. This is usually done using HTTP protocol because there are lot of libraries for making HTTP communication easy. This article is about Python library I’ve made to ease this process. The library is called Instant API and you can find it here.
Docker explained for getting things done
I have read a lot of guides on how to use Docker and lot of them start explaining Docker complicated way. From writing Dockerfiles and with docker-compose. The goal of this article is to explain Docker the easy way, such that someone can use it as soon as possible. I mean, at the end, Docker is just yet another tool and we should not spend rest of our lives masteerring it.
Neural networks are not too hard to understand theoretically - part 2
In previous article, I have described background between neural network training. Here I will just further investigate special types of neural networks.
Neural networks are not too hard to understand theoretically
Most “experts” today use neural networks like it is black box and think they are going to solve every problem they have. Deep learning and other concepts are considered as hard and advanced. Reason for this “advanced concept” thinking is because most programmers do not really understand neural networks as mathematical model. Neural network is just function which we fit to better represent our data. Neural network training is not different from, for instance, fitting linear function and in this article I am going to show why.
Python data structures
Python is very simple and high level language that everyone can learn to prototype their ideas. But this does not come without a price. Because of its high level library, it is much harder to know what is implemented inside it. I know that you can now say “well you don’t need to know, that’s beauty of encapsulation etc…” but when it comes to performance, you should really be careful of what data structures you use. Here in this article I am going to explore few builtin data structures in Python and explain how to implement missing ones.
Creating Facebook Messenger bots made simple
Every day there are more and more chat bots which are useful for various businesses and even individuals. Imagine that you have created simple app with few options and you do not want (or you are too lazy) to make frontend (or even REST API) for it. You have limited number of users which are willing to use your app and are happy with simple things that do not require install or registration. Chat bots come handy in this situation. In this article, I will explain how to set up your own chat bot on Facebook Messenger with library I have developed. Currently library only supports text messages which is enough in most applications but in the future I plan to introduce more functionality.
Powershell - next generation shell
Recently I started using Powershell which friend of mine recommended. Powershell is Microsoft’s product built on .NET platform which introduces .NET functionality in interactive interface. When I say interactive I mean both console and GUI but here we will consider only console aspects of powershell and I won’t discuss powershell host development. (maybe in future articles)
Uvod u finansijsku analizu - 2. deo
U prethodnom delu sam uveo neke osnovne termine i koncepte u finansijskoj analizi. Ovde ću nastaviti sa analizom još nekih finansijskih instrumenata koje možemo upotrebiti bilo direktno bilo u modelovanju.
Uvod u finansijsku analizu - 1. deo
Finansijska analiza je oblast koja spaja finansije, matematiku a od skoro i računarske nauke. Ona ne samo da nam može značiti kada je reč o novcu nego i bilo čemu što iziskuje procenjivanje vrednosti nečega u nekoj jedinici za koju smo se dogovorili da je jedinica vrednovanja. U praksi je najčešće to novac jer njime možemo kupiti proizvode i usluge i ceo svet se njime koristi ali se neka grupa ljudi interno može dogovoriti o svoj internoj jedinici vrednosti ali je važno da se ona može prikazati brojem.
Why some software projects fail? (and how to fix that)
after some time and many projects and books I have caught some reason why software projects fail. Let’s face it: our world depends on software more than ever before on anything before. However, software projects usually fail or they make it to the end of their development (version release) but they are broken in some way. Many software projects even do not make it to the final release and these which do, they are feature-short or have damaged performance.
Introduction to computing with CUDA
Recently I have worked on fluid simulation project developed for CUDA-enabled GPU. Here I am going to explain what is CUDA and to introduce few concepts needed to start programming on GPU.
Drejfusov model
Drejfusov model je jedan od modela koji mogu da se koriste u obrazovanju (na primer, u vrednovanju obrazovanja) kao i prilikom zapošljavanja i sličnih praksi gde je potrebno klasifikovati nečije znanje određene oblasti kako bi se utvrdili neki parametri (na primer, visina plate).
Parsing in Haskell
This article is going to explain some basic concepts in compiler design and to give practical implementation of lexical analysis and parsing in Haskell.
ETF vs FTN vs MATF vs PMF vs RAF vs ... vs studije u Njemačku
Bliži se i taj famozni prijemni. Loš termin za objavljivanje ovog članka jer je sasvim moguće da se većina budućih studenata već odlučila koji će fakultet da upiše. Ipak, zna se, na Internetu sve ostaje pa i ovaj članak. Zbog ovoga ovo može služiti svim budućim srednjoškolcima, mamama i tatama, učiteljima, nastavnicima i profesorima. Može služiti i bakama i dekama da prestanu da gnjave studente “zašto studiraš X godina” a naročito treba da služi onima koji su sa ne-tehničkih fakulteta kojima je čudno kako to da loši studenti na, recimo, ETF-u imaju veću platu nego oni sa desetkama. Zbog svega ovoga je nastao ovaj članak. Da odgovorim na stalno pitanje srednjoškolaca “a koji je fax najbolji” i da isto odgovorim na pitanje “a zašto se ne cimaš previše oko faksa?”.
Purescript - a nice path to web
Recently I have been playing with Haskell and functional programming. I’ve found a nice Haskell-like language which compiles to Javascript which means it is very suitable for web. It is PureScript and you can easily set up project with pulp and run it. It can be used to develop backend part or frontend part.
Easy widgets library for Python based on URWID
Recently I have been developing python library for handling interface in console. The best solution I have found was URWID which is used in WICD interface (WiFi manager in console). I wasn’t satisfied enough with library and I started developing from URWID base to make something easier to use and in this article I will explain basic usage of that library.
height3d
During one of my research projects in Petnica Science Center, I have developed small open source framework which adds C++ features to OpenGL and lays around it. I will give short introduction in this article how to use Height3D framework to make your job of creating small 3D apps easier.
Mako A-Z
This article explains all Mako’s functionality which is present in current version of time of this article. For introduction what is Mako and some basics, see this.
ArgumentStack
ArgumentStack is a small python library which helps you to make argument parsing easy. It is based on nice argument structure where your arguments are structured like a tree. Nice example of this is nmcli command for network manager, for instance you can do:
Functional JavaScript
In this article I will try to explain some aspects of JS which enable us to write more functional code and shorter code as well.
Algorithm analysis in functional programming
This article has purpose to demonstrate the way of reasoning when algorithm analysis comes for programs written in functional programming paradigm. I will give some examples in Haskell to demonstrate methodology and also explain some core theorems in algorithm analysis. Here I will focus especially to time analysis in asymptotic manner which is when we take limit where size of input goes to infinity.
A bit of functional programming by example in Haskell
Recently I’ve started reading about functional programming. When you have been programming using OOP principles since you were beginner, it sounds a little bit strange to change approach all the way around. It is scary and sometimes hard. As you are older and older, new experiences come hard to gain. In this article I will try to make some clarifications about this approach which starts to be a big deal in big software companies as well as startups. It was hard to me to change the way of thinking so I am willing to make this process easier for you. I know you’ve been doing Java or c# for a long time. I know you know the bad things in these languages. I know you are sick of OOP or you will eventually be sick of OOP. I will try to explain some pitfalls of OOP first and then continue by explaining functional approach and how it solves all of that. I will give examples in Haskell but you don’t need to be familiar with Haskell to understand examples since they’re pretty straightforward and I will give explanation for things which may seem strange.
Object-oriented design patterns
In software engineering you often need to make some design decisions such that your software is extendable and easily maintainable. After some time of software development, industry has come up with repeating patterns of design that makes sense for some application. Still, you need to choose particular design pattern but overall task is much simplified because you are deciding on finite number of patterns with small modifications if needed. I doubt you are trying to solve problem which is not solvable with these patterns described below. At least, in one part of your software you can use some of these patterns. The purpose of this article is to present some design patterns with explanation and examples where they are helpful. In this process, you also have to follow SOLID principles.
SOLID design principles
In this article it will be explained one design process which really fascinated me and held me awake during nights while thinking of how much is it cool and powerful. First of all, these principles are set of design decision during software development which are intended to boost maintainability of software and make software development continuous and easily adaptable to new specifications by its users.
Emacs org-mode
Već nekoliko godina koristim Emacs. Eto priznao sam. :D Ja sam Vim korisnik koji koristi Emacs. Emacs koristim samo u svrhu za koju ne koristim Vim a to je za sve ostalo što nije pisanje koda. Toliko ga koristim da sam napravio i Python biblioteku za parsiranje Emacs org dokumenata. Dakle, Emacs koristim prvenstveno za organizaciju i pisanje dokumenata. U tome mi pomaže Emacs org-mode. Ovaj dodatak za Emacs je postao must-have na mom računaru. Bez ovoga ne idem nigde. Toliko je važno da hoću da sve što imam ima integraciju sa ovim. Plan mi je da i ovaj blog krenem da pišem u njemu.
Tehnologija, posao i žene
Već duže vreme planiram ovaj tekst da napišem ali nekako uvek ima nešto preče. Krene faks, počnem da radim a evo sada kad mi je ceo dan popunjen ja napisah i ovaj tekst. :D
Jedna greška koju pravimo pri donošenju odluka
Tokom svog života, veliki deo vremena provedemo u odlučivanju. To nas prati od samog početka života. Još kao mali donosimo odluke koju igračku želimo da dobijemo, sa kim želimo da se igramo. Kada malo porastemo, kada krenemo u školu, tu dolazimo do odluka koju ćemo školu da upišemo. Posle fakulteta ili srednje škole, donosimo odluke čime želimo da se bavimo dalje. Tokom obavljanja posla, gde god radili, donosimo odluke o tome kako želimo da radimo i na čemu. Kada dobijemo decu, kada imamo porodicu, donoimo odluke od kojih zavisi i budućnost te dece. Posle e to prenosi i na naše unuke kad ostarimo. Zbog svega ovoga, pravilno donošenje odluka je jako važno. Ipak u školi nam nikad ne kažu jednu jako važnu lekciju a to je kako da odluke donosimo kako treba. To se indirektno provuče kroz život nekako mislimo da nam je to urođeno. Problem je što nije.
Bog vs Darvin - bitka bez pobednika ili kako nismo razumeli svrhu obrazovanja
Ovih dana se ponovo pojavila polemika o tome da li deca, uzrasta osmog razreda, treba da izučavaju teoriju evolucije. Da je vrag pojeo šalu, to pokazuje i činjenica da je ova peticija koju potpisuju akademici i doktori, stigla i do Ministarstva i do Skupštinskog odbora za obrazovanje. Pored ovih institucija, reagovali su i Univerzitet u Beogradu i Centar za promociju nauke.
Git + CMake + unit testovi = kako se softver pravilno razvija
Dosta godina se bavim programiranjem i mogu reći da sam video zaista dosta primera o tome kako se razvija softver. Dosta faktora utiče na razvoj softvera, pre svega utiču resursi poput finansija, ljudi, vremena i samog okruženja i konteksta. Pored ovih, postoje i tehnički razlozi zašto neki softver ugleda svetlost dana a zašto neki ne. Pored svih ovih resursa, tehnički resursi značajno mogu da umanje i troškove i vreme potrebno za razvoj i broj ljudi koji je potreban da razvija softver. Naravno, nekada dodatni slojevi u razvoju mogu i uvećati sve ove stavke ali to se uglavnom dešava zbog nesposobnosti da se dati tehnički alati koriste pravilno ili zato što ti alati ne zadovoljavaju potrebe onog ko razvija softver. Ova druga mogućnost je manje verovatna i ona se obično dešava u velikim kompanijama poput Gugla, Fejsbuka i sl.
Šta je GDB i kako se koristi?
Svako ko e ikada, bar malo, bavio programiranjem zna da prvi kod koji napišete nikada ne radi. Ako vam se desi da odmah proradi ili pišete nešto sitno ili mislite da vam radi a zapravo ne radi. Kada napišemo našu prvu verziju bilo kog programa, potrebno je da uočimo greške i da ih ispravimo. Proces traženja greške se naziva debagovanje i obavlja se alatom koji se naziva dibager (debuger).
Neke strukture podataka - heš tabele
Heš tabele su jedan od jako dobrih načina čuvanja podataka. Pretpostavimo da imamo ogromnu količinu podataka kojoj želimo da pristupamo jako brzo. Svaki element ima neku vrstu identifikacije. Na primer ako imamo podatke o osobama, identifikacija može biti JMBG osobe. Heš tabela je zapravo niz lista gde svaki element je lista koja sadrži elemente čiji se heš poklapa. E sada, šta nam je ovde heš? Iz primera sa osobama, znamo da imamo mnogo JMBG brojeva i znamo da sa običnom listom da bismo našli određenu osobu, treba da prođemo kroz celu listu dok je ne nađemo. Ovo može predstavljati problem ukoliko imamo veliki broj osoba. Drugo rešenje je da koristimo niz i da osobi pristupamo na osnovu njenog identifikacionog broja odnosno da identifikacioni broj osobe bude njen indeks u nizu. Ovo je ponovo teško realizovati ako se uzme u obzir veliki broj osoba pa samim tim bi i naš niz zauzimao mnogo memorije. Zbog ove dve činjenice, heš tabela predstavlja kompromis. Prvo, nemamo niz onoliko veliki koliko imamo osoba nego manji niz a svaka osoba ima svoj identifikacioni broj, mi kada želimo da pristupimo određenoj osobi mi njen identifikacioni broj transformišemo u indeks niza. Ovaj postupak se naziva heširanje. E sada, kako imamo mnogo osoba a manje mogućih indeksa, desiće se da dve osobe imaju isti indeks u nizu. Zbog ovoga svaki element niza je zapravo lista osoba koje imaju isti indeks u nizu (heš).
SSH reversni tunel
Ovaj članak objašnjava kako podesiti reversni SSH tunel i time omogućiti forvardovanje portova preko mreže. Ovo je izuzetno korisno iz dva razloga:
Neke strukture podataka - hip
Hip je struktura podataka koja nam omogućava da brzo i lako dođemo do maksimalnog elementa. Često se predstavlja kao stablo zbog lakšeg objašnjavanja ali se tokom implementacije koristi niz. Hip se predstavlja kao stablo na sledeći način: za svaki čvor, njegova deca su uvek manja od tog čvora. Ovakva reprezentacija podataka nam omogućava da nam na vrhu stabla (korenu stabla) uvek bude najveći element. Slično, možemo i obrnuti situaciju, da za svaki čvor su njegova deca manja od tog čvora. U ovom slučaju dobijamo strukturu gde nam je na vrhu uvek najmanji element. U implementaciji, za izvedbu hipa koristimo niz tako da nam element a(i) bude čvor a elementi a(2i+1) i a(2i + 2) su njegova deca. Isto tako, ako imamo čvor a(i) onda njegovom roditelju pristupamo kao elementu a((i-1)/2).
Neke strukture podataka
U ovom članku ću dati pregled nekih struktura podataka čije razumevanje je dosta važno za razumevanje algoritama i uopšteno za razumevanje dosta principa u računarstvu. Treba napomenuti da je dosta nabrojanih struktura opisano ovde.
ScaPy - analiza protokola upotrebom Python-a
ScaPy je biblioteka za Python koja pruža sastavljanje paketa od “parčića”. Na primer, možemo IP deo spojiti sa TCP delom i na kraju konkretan sadržaj paketa i to poslati serveru. Pored ovoga, ova biblioteka nam pruža i mogućnost “slušanja” dolazećih poruka i odgovaranje na njih.
Implementing file system with FUSE
During summer camp at Petnica Science Center you can get a chance to build something and work on your own research project. On computer science course, we usually do, well, computer science (sometimes it is multidisciplinary) so my friend decided to work on building her own file system. This is open source project and can be found here on GitHub. This is proof of concept of how file system work and it is built as stand-alone command-line application which has its own shell and uses RAM as its storage for data. Structure and organization of data is specific to project but it looks pretty much as first implementations of file systems.
Deploying your web application based on REST API
Well, you have developed your first version of your super-mega-giga web app and you want to deploy it. Your application consists of two parts: API (backend) and your java-script code (frontend). In this article, I am going to explain how to deploy your API written in Django and your frontend written in AngularJS with a little bit of help of NodeJS and npm.
A word about static sites
Recently I have had many discussions with web admins whether static or dynamic web site is better suiting some kinds of common needs for businesses and organizations. This question is not well defined because it depends, but on what?
Hello world!
Hello! I am Stefan and this will be place where I will express my ideas, experiences and thoughts. I have tried to write a blog few years ago and that blog is still alive. That blog has been written in Serbian which is my native language and has been hosted on WordPress. Since then, I have been a little busy so I couldn’t write anything useful on blog. I have been writing for LiBRE! magazine since 2013. and I cannot express enough how much I’m proud of these articles written there. The problem with magazine is that you cannot express your subjective opinion and you have to focus on objective articles. This is the reason why I started maintaining this blog, in English, hosted on github as github page, as static site. You may ask why this choice of technology. Simple answer is that I want minimalism in maintaining platform and I can use git well enough to make it work for this purpose. Another reason is because I’m building stuff. My friends like Git, I like Git and everyone should like Git because Git is great. Use it everywhere. GitHub is fantastic place to host your projects even if it is your own blog.
subscribe via RSS