Posts

Cryptography introduction and cheatsheet

Image
Cryptography, an interesting word most people do not understand. It is nothing more than the art of sending messages which are protected from spies, you convert them into a secret code with the use of an algorithm called "cypher". It has altered the course of history because it has been decisive during war times. There are many cyphers out there, some of which have been used for centuries, some which are still being used today, specially when you use the internet, after all it is necessary to make sure you can access your bank account, send Whatsapp messages and shop online with security, we can't allow some hacker to tap into your internet transmission and steal all your data, therefore everything must be encrypted before it leaves your computer, and it must be decrypted as soon as it arrives at its destination, which could be someone else's computer or some data center. Although it seems complex, the principles are actually simple, all you need to do is to f

Computational art

Image
Are you a mathematician? A computer scientist? A programmer? An engineer? Or maybe just someone who really likes exact sciences? In this case you are reading the right article, here you will discover the hidden artist who lives inside you. If you are a member of any category mentioned above then chances are you haven't been fond of art during your life and probably doesn't have talent for it. After all you must think "what problems of the world would be solved by paintings and sculptures?", you are partially right, arts do not do much good in leveraging the resources of the planet for the betterment of humankind, nor can they help you answer questions such as "what is the shortes route between my house and my favorite pub?". However art is a part of human nature and culture, it is the demonstration of our creativity, which in turn is what allowed us to come up with each and every form of science and technology, which basically means

Graphs cheatsheet

Image
Here is a list with some of the most basic forms of graphs and how to implement them. Graphs are useful when implementing search algorithms. Edge list Create an array with subarrays. Each subarray will contain 2 numbers which represent the vertices that form the edge. It may contain a 3 rd number to represent the weight. It doesn't use much memory but the search time is long. Adjacency matrix Create a matrix with all the vertices x vertices . Add the number 1 when 2 vertices form an edge. Add the number 0 otherwise. It uses a lot of memory but the search time is super fast. Adjacency list Create an array with subarrays. Each subarray will represent a vertex. Fill each subarray with the vertices it forms edges with. This one doesn't use much memory and the search time is short.

Computer graphics introduction

Image
Today we will be learning about how your computer can make all of those beautiful and stunning images appear before your eyes every time you play a game or watch a video . First of all, h ow does the human eye work? The back of the human eye is called the retina, it contains thousands of cells to receive light, there is a nerve that passes through this wall , therefore one spot of your retina doesn't receive light because it is covered by a nerve , this is your blind spot. Your brain can process images in a speed of approximately 13 FPS, which means you should have at least that many FPS for a proper animation experience . Less than that and the film will be glitchy, a lot more than than and the film will look strange, it won't look like a natural movement . Unless you are working with VR goggles, your peripheral vision can process frames faster, unlike a movie where you only use your central vision, with VR goggles you use your peripheral vision as well, meaning the

Algorithms cheatsheet

Image
Here goes a list of useful and common algorithms explained in a way that is easy to understand and beside their names I have written their average case runtimes. Reading this article should give you insights about which algorithm to use and how to implement it.   Binary search (O(log2(n)), works in place) Let min = 0 and max = n - 1 . If max < min , then stop: target is not present in array . Return -1 . Compute guess as the average of max and min , rounded down (so that it is an integer). If array[guess] equals target , then stop. You found it! Return guess . If the guess was too low, that is, array[guess] < target , then set min = guess + 1 . Otherwise the guess was too high. Set max = guess - 1 . Go back to step 2. Uniform binary search (O(log2(n)), works in place) Let sizeArray be the size of the array we will search, now calculate the size of the lookup table with the fo