My name is George and I am studying Software Engineering. This is the place where I share my knowledge and experiences during the process of learning. With every distinct step forward, I'll let you know about the benefits or drawbacks of using or pursuing a certain technology or project idea, to let you know if that's a fruitful experience or not. I'm passionate about programming, music and calculus. Sometimes, I may post tutorial posts regardless the usage of a particular technology, so stay tuned.

Object Oriented Approach - Describe Complexity with Simplicity

Since this is raw insight regardless OOA, there are some things that I need to make clear before I continue. This isn't a programming related post. This is why you should consider using the specific approach. There's no right or wrong answer here. If you prefer to write the whole program in the main static function, you're very welcome to do so. First of all, the object oriented approach it's so widely used because (whether you realize it or not) essentially binds reality's concepts and makes us (programmers), able to obtain models, describing certain behaviors. The way you describe why a tree may have that particular height or a certain number of branches and what are some of its roles that basically assist the living of other organisms, the way we tweak parameters to force some kind of reaction between some chemical elements, or the way that we describe relationships between multi-versed systems, can all be done using that specific way of thinking. In college, we learn how to successfully construct and deconstruct scenarios that explain and model some of the things I've mentioned already. Sometimes, that model by itself (depending our experience) can lead us to a point to even predict or avoid certain outcomes. The better we form and give life to our hypothesis (in order to validate it given our experiments), the better will be for us to use it. Logic. Secondly, there's this notion that, object oriented code it's easy to maintain and scale. I tend to disagree. There are some important factors that we need to take into consideration. You don't know what were you, or the other guy(or girl) was thinking at the moment he or she wrote that particular module. You may see for example, a singleton pattern and just by that, for starters, you should be observant enough and well versed to patterns to even realize that it's been used, why it's been used this way and understand the way the programmer was thinking in order to build upon in. This is pretty annoying, speaking from experience. Oh and don't expect the comments to help you figure this spaghetti out. Finally, let's point something important (you'll be amazed) about nature. Nature, tends to display elements or sets of elements with simplicity, but in reality "she" hides the complexity. I'm not talking about solving dynamic systems of high-order differential equations. This is a small fraction of nature's complexity. I'm talking about dynamic and continuous probabilistic models that govern reactions, mutations, bio-protocols, multi-system cooperation and interactions, autonomous compatibility protocols that approve or reject foreign substances, passive bio-functionality etc. all the way from the micro up to the macro world. As programmers, we tend to do the opposite. (Please don't). We write insane code to describe a simple idea. It's like using balloons to steal bowling balls. It's illogical and unnecessary. Why? We shouldn't. The idea here is to use these tools (that we've invented inspired by nature - no doubt) to describe complexity with simplicity. Try to remember this, next time you're gonna brag about your class that implements N interfaces and spits out the number of bananas that Mrs.Jane bought from the store.

#object_oriented_approach #oop #object_oriented_programming #natureoop

Satellite Transmissions - Polarization (HV/LH-RH)

Let's provide a proper definition of what is polarization. Polarization is a transmission technique which accounts for a better overall concentration of signal's properties towards a specific broadcasting direction. There are four main ways to polarize a signal that we split into two main types. We have linear and circular polarization. The linear way includes two sub-types (horizontal and vertical) and the circular (left-hand or right-hand).

Fixed Satellite Services, or if we use the U.S classification, geostationary satellites use horizontal and vertical polarization for space radio-communication and other services. Direct Broadcast Satellites on the other hand, use left-hand and right-hand circular polarization. DBS satellites will receive signals directly from geostationary satellites (FSS - as mentioned above) to provide services such as satellite television towards subscribers' end-points.

We shouldn't forget to mention the matter of efficiency. Both linear and circular polarization can be applied simultaneously per channel or frequency. This way we can prevent possible interference per broadcasting frequency during transmissions. Evidently we have twice as many programs available to be transmitted per satellite. Consequently, via one and (almost) the same frequency the satellite can broadcast both a horizontal and a vertical polarized signal (H and V), or a left-hand and right-hand circular polarized signal (LH and RH).
Satellite Reception

#fss #satellitereception #dbs #polarization #linear #circular #HV #LHRH

Vanilla JS & Canvas Arcade Game

var canvas, action;
var canvasContext;
var NPC_SCORE = 0;
var winScreen = false;
/* Ball Defines */
var ballX = 50;
var ballY = 50;
var ballRadius = 10;
var speedX = 7;
var speedY = 7;
var ballSizeX = 20;
var ballSizeY = 20;
/* Paddle Defines */
var paddleY = 250;
var paddleAI_Y = 250;
const PADDLE_HEIGHT = 100;
const THICKNESS = 10;
const WIN_SCORE = 20;

function getMousePos(event){
	var rect = canvas.getBoundingClientRect();
	var root = document.documentElement;
	var mouseX = event.clientX - rect.left - root.scrollLeft;
	var mouseY = event.clientY - - root.scrollTop;
	return {
		x: mouseX,
		y: mouseY
function computerMovement(){
	var npcCenter = paddleAI_Y + PADDLE_HEIGHT/2;
	if (npcCenter < ballY - 40){
		paddleAI_Y += 8;
	} else if (npcCenter > ballY + 40) {
		paddleAI_Y -= 8;

function ballReset(){
		NPC_SCORE = 0;
		winScreen = true;
	speedX = -speedX; 
	ballX = canvas.width/2;
	ballY = canvas.height/2;

window.onload = function(){
	canvas = document.getElementById("gameCanvas");
	canvasContext = canvas.getContext('2d');		
	var frames = 30;
	action = setInterval(function(){
	}, frames);
	canvas.addEventListener('mousemove', function(event){
		var mousePosition = getMousePos(event);
		paddleY = mousePosition.y - (PADDLE_HEIGHT/2);
So, this is the classic arcade game with the two paddles and the ball and the idea here is for one play to score towards other player's wall. As a second player, I'm using a pseudo-AI player. If you tweak some stuff in the code you won't be able to beat it, so proceed with caution. Anyway, assuming you've place a canvas element you gave it an id of "gameCanvas" let's analyze some key points in the source code. The first thing we need to consider, it's something called a game loop. This is simple an infinite loop which will help updating the movements of our game objects to the screen in order to have animations and other fun and exciting stuff. Inside the window.onload function, there's an variable called action which initializes an interval that calls the movement and draw functions using a fixed number called frames. That was easy. I'm not gonna go into a lot of detail since I'm providing code, but let's take a closer look on those 2 functions. Movement & Draw.
function drawRect(color, posX, posY, width, height){
	canvasContext.fillStyle = color;
	canvasContext.fillRect(posX, posY, width, height);
function drawCircle(color, centerX, centerY, radius){
	canvasContext.fillStyle = color;
	canvasContext.arc(centerX, centerY, radius, 0, Math.PI*2, true);

function draw(){
        /* Game Objects */
	drawRect('#680000', 0, 0, canvas.width, canvas.height); // environment 		
	if (winScreen){
		canvasContext.fillText('Click To Continue', canvas.width/2, canvas.height/2);
	drawRect('white', 0, paddleY, THICKNESS, PADDLE_HEIGHT); // left player paddle
	drawRect('white', canvas.width - THICKNESS, paddleAI_Y, THICKNESS, PADDLE_HEIGHT); // AI paddle
        drawCircle('white', ballX, ballY, ballRadius); 

canvasContext.fillText(PLAYER_SCORE,canvas.width - 600, canvas.height/2); // Player Score
canvasContext.fillText(NPC_SCORE,canvas.width - 200, canvas.height/2); // AI Score
The draw function, setups the canvas environment with a background color and creates all those secondary game objects. You may see some arbitrary functions that aren't part of the usual canvas-ish tool set. I wrote them for my own convenience.
function movement(){
	computerMovement(); // Activate AI 	
	ballX += speedX;
	ballY += speedY;
	/* X Axis */
	if (ballX < (THICKNESS + 5)){ // Left wall
		// Check if bounces to paddle 
		if (ballY > paddleY && ballY < paddleY + PADDLE_HEIGHT){
			speedX = -speedX;
			/* fix the angles after collision */
			var deltaY = ballY - (paddleY  + PADDLE_HEIGHT/2);
			speedY = deltaY * 0.40;
		} else {
			NPC_SCORE += 10; // must be BEFORE ballReset
	if (ballX > canvas.width - ballSizeX){ // Right wall
		if (ballY > paddleAI_Y && ballY < paddleAI_Y + PADDLE_HEIGHT){
			speedX = -speedX;
			/* fix the angles after collision */
			var deltaY = ballY - (paddleAI_Y  + PADDLE_HEIGHT/2);
			speedY = deltaY * 0.40;
		} else {
			PLAYER_SCORE += 10; // must be BEFORE ballReset
	/* Y Axis */
	if (ballY < 0){  // Top wall
		speedY = -speedY; 
	if (ballY > canvas.height - ballSizeY){ // Bottom wall
		speedY = -speedY;
The movement function controls pretty much everything apart from the mouse movement of the player. Has to do mainly with the ball movement and the collision system. Meaning, what happens when the ball hits either one of the paddles, how to bounce to the proper walls without crashing the game etc. This function gets to say who's the winner and who's the loser two. I encourage you to find the collision part in the code and play with it. To test the code, create an HTML file, put your canvas tag inside as I mentioned earlier and bellow, paste this code inside a script tag. You'll be able to figure most of it on your own. Happy coding!

#javascript #canvasarcadegame #howtomakeagame #vanillajavascript #vjs #html5jsgame

C Programming - LinkedLists

A LinkedList is essentially a data structure which allows dynamic storage capabilities. Since most implementations are quite simple when using other languages such as Python, Ruby, Java etc, we're gonna dive using the sensei-of-all languages, C. Having a certain familiarity with pointers and structs is essential in order to be able to understand what the heck is going on. Let me point out that if we want to consider ourselves engineers we need to actually plan ahead. The idea of diving in without initial planning can be catastrophic for most of the cases. So it's time to write some pseudocode! We'll start by defining our data type using the struct notation and its corresponding linking pointer in order to be able to traverse the list later on.
define a struct called dataNode with 2 fields (integer, dataNode link);
Moving on, we define a pointer of type dataNode and we'll make use of malloc in order to reserve the proper space we need in memory.
create a starting node pointing to null;
allocate memory space for a new node called temp;
set data field of temp to an integer;
fix next field to null;
At this point, we have a pointer of type dataNode pointing to null and a node temp that we just set its data chunk to 10 and its link to null. Next, we need to point the ptr to the address of temp. We do that by simply
ptr = temp
If we were to add another node to the list, we'd have to clear space using malloc, set its data field to something and fix its link to null, since it will be the last node in the linkedlist (or first if we're adding node in the beginning - implementing stack logic).
 allocate memory space for newNode;
 set data of newNode to an integer;
 fix next field to null;
To traverse the list with need to initialize a new pointer that points to the starting node and run a while loop in order to check each node's next element so we can access it later on. If that link field (next) becomes null, it means that we just hit the end of the list.
    /* create new dataNode and point it to starting node
    run a while loop until current link becomes null
    set the current link field to point to the next one  */
    while (node->next not null) 
          node = node->next
          print node->data // this is where you access the data field of current node
Here's a complete implementation of a linkedlist. In this example you insert element in the beginning of the list and you print the contents using a function which implements the traversal logic that we've already talked about.
# { includes } #

/* This is our data structure */
struct dataNode {
	int data;
	struct dataNode* next;

struct dataNode* start = NULL; /* Starting node */

/* adding to the beginning of the list*/
void addToList(int number){ 
	struct dataNode* element = (struct dataNode*)malloc(sizeof(struct dataNode));
	element->data = number;
	/* Cover the case when the list is empty */
	element->next = start;
	start = element;

/* Traversal */
void viewList(){
	struct dataNode* ptr = start;
	while (ptr != NULL){
		printf(" %d", ptr->data);
		ptr = ptr->next;

int main() {
	int N, i, num;
	printf("Type number of inputs\n");
	for (i = 0; i < N; i++){
		printf("Enter numbe\n");
		scanf("%d", &num); 
Don't forget to write pseudocode in order to have a solid implementation logic later on. Happy coding!

#cprogramming #linkedlists #traversal #stacklogic #implementinglinkedlists

Introduction to MPI (Message Passing Interface) - Distributed Programming

First of all, let's provide a proper definition. MPI is a specification which is used from developers in order to implement message-passing libraries. It is used following the parallel programming model which states how data is moved from process to some other process using some form of collective/singular operation. So what are those reasons to use this particular interface?

  • It is considered the only available standard and it is regularly reviewed by certain groups of people that are advancing its functionality and capabilities with further development
  • Offers portability because it is supported by a wide range of platforms
  • With 430 routines in its "arsenal" of the 3rd iterations along side the MPI-1 & 2, you can accomplish a significant functionality with a certain level of experience
  • Since there are many groups implementing its contents, the hardware itself may be compliant depending the vendor gaining a significant boost in the overall performance
  • It is widely available, since it has a public and a vendor domain

Writing your first MPI program in C

# { includes } #
int main(int argc, char ** argv) {
 int rank, size;
 char name[80];
 int length;
 MPI_Init(&argc, &argv);     
 printf("Hello MPI: processor %d of %d on %s\n",rank,size,name);

It is important to use MPI_Inti() and MPI_Finalize() because this is where you can write your mpi code. You can't execute MPI code outside of that defined "space". This is a very simple example and often you'll have to split your data properly before sending it. What is really interesting is that you can write a single program and it will run in all computers. What happens to the data through? Well, data is stored separately to each computer. This is where MPI kicks in. When a certain computer A wants to send data towards a computer B, it has to explicitly make use of the routines provided from the interface. Here's an example.

if ( A ) then:
          Call MPI routine to send data
else if ( B ) then: 
      Call MPI routine to receive data

The code above is pretty self explanatory. If current process it's A, then sends some chunks and if process B receives them, if the destination tag of the send routine matches the source tag of B. Visit this link: (All MPI Routines) Here's an example program of the Monte Carlo algorithm: MonteCarlo

Monte Carlo

Generate N random points in the unit square. Let M be the number of points that are in the quarter circle. Then PI is approximately equal to the ratio 4 * M / N. It's important that each processor uses DIFFERENT random numbers. One way to ensure this is to have a single master processor (leader) generate all the random numbers and then divide them up. A second way, not explored here, is simply to ensure that each processor uses a different seed, either chosen by a master processor, or generated from the processor ID.

Sources: MPI Examples | MPI Tutorial | CSERD

#mpi #sampleprogram #cmpi

Knowing HTML & CSS isn

Hello geeks out there and their loved ones. In order to avoid comments like "Wow, can I make my own facebook using HTML & CSS?" this post has to do with these two fellows, HTML and CSS and what you CAN actually do if you're well versed. So, HTML is simply a markup language. I don't know why is being described as a language since you only have to know specific tags to get your hands around its structure. You write your tag and you expect the browser to read it so you can see that paragraph content that you've been checking for 2 hours on your facebook home page. I'm just kidding. I know you did. You can't develop your own facebook because you can only create static content. Dynamic content (changes upon user's requests) requires some kind of a backend technology such as MySQL and PHP in order to store let's say, user's profile details indefinitely.

CSS is another story though. If we look into its latest developments I'd say you can do pretty neat stuff with that fellow. CSS is where design patterns and beauty starts. Let's say you're making a website and you want it to have that corporate spark in order to look good to potential clients of yours. Yes, you'd need CSS in order to have that fluid content, colors, futuristic design kind of vibe. You can't get away with plain HTML because by its own is quite ugly and not user friendly. Imagine visiting Google but instead of that wavy and smooth font they've set for us you only see the pixels from the letters' corners. Ugly, not cool, bye. See my point? Now with its newest updates, you can even advance to more technical and amazing stuff such as media queries. "What are those media queries?" You can style your app/website/whatever using a responsive abstract logic. It means that you can write CSS that will make your site look good on every device you choose.

Word of advice for new users joining the party. You need to understand that CSS and HTML is nothing but an iterative process of trial and error. You'll have to do thousands of refresh attempts on your browser before you can make something stick as you want it to stick. Please forget colors and shadows for one moment. I wish someone had told me that when I was joining the party. Work on your LAYOUTS. What do I mean by that? Learn how to use, margin, padding, position, float and when I say use I mean, be able to make every weird looking structure you can possibly think of.
Image Credit:
Image Credit:

#html #css #howyoustartwithhtmlandcss #learnhtml #learncss #layouts #google #staticwebpages #backend

Camelot - Python Developers - All in 40 Lines of Code

The Camelot algorithm was designed as a simple tutorial resource program that can provide non-linear intuition towards python and non-python users, who tend to struggle with already basic structures. We know, that programming has to do with a linear execution of specific commands. However, once objects came into play, that linear progression was reduced. Before OOP, applications weren’t readable or flexible for package updates and maintenance. With OOP, concepts like polymorphism and inheritance, took control. That’s because the program points and describes specific characteristics of an object. All those characteristics form the class and all those functions related to the interaction of the object are called methods. So what’s the main purpose of the Camelot algorithm? Simple. It will help you combine all those concepts you struggle with. If you have learned, let’s say, about control-flow statements and loops and having trouble connecting the pieces together, the algorithm will help you understand it. It has do with the trials of the knights during their selection to serve, with main star Lancelot. You can always modify the code furthermore if you want to fully extend or comprehend something more. Take a look: Camelot

Divide and Conquer

This is the a class which describes the corresponding knight. He has a name and certain abilities or combat techniques self.skills. The __init__ function is called constructor of the class. Every time a new object (knight) is created, we will pass him a name and a skill set number. The word self represents the object that we're referring to. Moving on, the knight (object) will have to pass (interact) trials in order to be accepted as a knight of the order. Since the the function trials contains only one parameter name self, we know that has to do with the object! The operation inside the function is quite simple. We return true if the number of his skills are greater or equal to 6, else we return false. (accepted - reject respectively).

Main App

We start with a loop, which will be infinite since we want to ask for new knights continuously. We initiate some data structures, the shield a dictionary and quests as a list of values and in this case, will contain the basic training and a training quest. The shield will be responsible for the rejection or not part. Then we generate a random (totalQuests) number from 80 up to 160 for the number of quests regardless our star knight, Lancelot, using the random module (import random). We then to the same for the gold but from 500 up to 1000. After all these we ask the user for input. The name of the knight and the number of techniques he knows. knight = camelot(name, techniques).That sweet line, creates the knight (object) we've mentioned before. We pass a name and a number of techniques referring implementing the camelot blueprint (class). If you can't understand the logic here, just take a look over the __init__ method. Self stays as it is because, yes, refers to our object, the knight is the name we pass and the techniques to combat respectively. Then we set the the == and the object.skills == self.skills to the corresponding variables. Since we've created our object we can check if the name of the knight is equal to Lancelot to act accordingly. Is he Lancelot, or not?! If he is, we create a for loop from 0 up to the random totalQuest variable we've made earlier and we append to the list additional quests up to that number (including those we've set earlier). After that, we print our the length of the list, which is the number of total quests. We're almost there! If the name isn't Lancelot, we create a new variable named flag and it's time to let the knight to pass the trials! knight.trials() calls the trials method. Whatever is returned, we store it inside that flag variable. Sounds simple, right? If the function returns true means that he's been accepted and we will create the corresponding pay for him using a tuple ('Gold', gold). Then we pass into the shield (our dictionary the name of the knight as a key and his status as a value value. Feel free to code it yourself and watch it execute if you're having any doubts. Happy coding!

#camelot #pythondevs #tutorialwithpython

edX & Online Courses

Well, the title itself it's something, isn't it? Have you ever wanted to learn anything outside the scope of standard education? You know, something like pseudo science, or programming with multiple languages, artificial intelligence or quantum theory etc?! I'm here to tell you it is possible. I've started taking courses in 2013 through edX, an educational platform developed by the MIT and Harvard with the goal to share and give access to knowledge across the world. It was a big initiative. There were few courses in place and those were highly experimental. I've managed to complete a dozen of them and I have to say that the outcome and the impact itself was huge. Not only made me capable of organizing my hours properly, but I should point out that, engaged my brain in a different way entirely. What do I mean by that? Simple. When you have to watch a series of lectures, complete multiple exercises with limited attempts (3 was the typical #) and within the corresponding deadline, well, it wasn't just a walk in the park. However, there's no way that anyone can describe properly the joy and confidence you'd receive once completing one of those course. I can still remember the day I got my first certificate. It was offered by the MITx system through MIT at the time, with main subject: Innovation and Commercialization. I highly recommend taking online courses. You should try one for fun. You'll become addicted!

#edx #onlinecourse #studyonline #mitx #harvardx #innovationandcommercialization #certificatesofmastery

Python - The best programming language yet?

You probably know that I'm a software developer by now. Recently I've been bouncing around languages and I don't think that I'll ever get bored of them. You see, after high school, the language of interest was Python. Now, 4 years later they actually teach python to students. That's lame cause I didn't get the chance back then, but good for them. I did actually got really far those years and I can't say that my experience with python is limited. Python was my initiation to programming. If you're looking for a language to start, use Python. The thing is, that, no matter how hard I try to learn a new language properly, python will always be there staring at me, saying: "Dude, I'm not done with you yet". Python requires you to actually be a good programmer. It will tell you how to write, how to nest, what you did wrong and sometimes you pray not to be that catastrophic. It's not the fastest, but the latest iterations are actually really fast. I'm talking comparing C. I mean if we're cutting the cr*p. When you are asked to write some code in python, you enjoy every minute of it. You don't have to declare variables like crazy, it has great object-oriented principles and the best thing is that it keeps it SIMPLE. The good thing with python is that it lets you actually work on the problem at hand. It provides you with a loose clean syntax to work with. Now you're probably thinking, "Loose? How's that the case. Each time I forget a fre*king white-space, it gets angry with me". Guys, it's strict. Every language has its pros and cons. Stop acting like you don't know. You just have to deal with that sh*t or pick another language. As I was saying, python's created with the mindset to let you think of the problem, not deal with syntax f*ck ups or segmentation faults. You can imagine python saying: "Describe the problem to me and I will solve it for you". Having that in mind, I encourage you start taking a few lessons. Python is used in Machine Learning, Cloud Computing, Big Data and other exciting topics. You just need to take a leap of faith.

#pythonprogramming #python3 #python2 #whycodeinpython #yougottalovepython

Nest Your Code, Neanderthals!

It's raining outside and since my outdoor activities have been postponed, I think it's appropriate to do some Java coding. Just made my warm cup of coffee and I'm ready to begin. You have to admit that Java is a great alternative...or not! Anyway, today I'm going to continue with the modification of the graphical engine for my game objects and main screen display (OpenGL crap). It's a lot of writing but I don't really mind the load since I'll have a strong backbone afterwards. The previous lesson was kinda confusing but after a long and painful review of the source produced, I finally got my sh*t together. The main reason for making this post is because I wanted to point out a SIGNIFICANT and rather DISTURBING matter regardless beginners. Developers (nerds, hotties, cats, dogs, dinosaurs or whatever life form you represent), please, NEST your cr*ppy code. It's really disturbing searching for algorithmic solutions or one-liners and getting a flat-lined-sh*tty text. We're not looking for Shakespeare! Keep that in mind please. What is nesting? Stop. Google it. If you don't know how to "google" something, here, I'll help you. Nesting is the process of organizing your code into layers or subsections. Yes, that "tab" hit before any new line of code. Yes, that crazy gap/space to the left of each line, it's called Nesting! Simple uh? Cool, try to remember what it looks like the next time you're going to upload your php sh*tty source code on StackOverFlow.

#nesting #nestyourcode #whydontyounestthecode #crappycodewithoutnesting #learntocode

Java - "May the force be with you"

The moment you start learning a new language, you can literally feel like you know how to read but you don't know why the hell you can't understand sh*t of what you're doing. This particular example is only for those you have no prior background with programming. When you do have familiarity, this sh*t is different. For some months now I've been working my hands around Java in order to learn its core concepts and really find out why the hell is the best there is out there. Gotta tell you. It's indeed the best out there, but, wait for it, you need to become mentally unstable at first. I have a python background and some knowledge of C/C++ and the idea of initializing everything messes me up big time. At least it did. So, my first "BIG" project is undergoing. It's about creating a basic game from complete source code. I'm learning how to use buffers, creating game objects, applying some rendering techniques and of course, engaging graphics with the presence of our beloved OpenGL. All these cr*p in unison can form really awesome material. I won't lie, no matter the sh*tty syntax or those long and boring expressions, every minute can worth even hours of struggling when you just reading about it, theoretically. My advice to you, users out there, is to SWITCH to OOP (Object Oriented Programming) as soon as possible. OOP is the future and always will be. Newbies have much to learn before OOP, so be patient and practice, practice, practice. That's the trick. Thank you for your time. Be cool and start your journey right away if you have a specific goal in mind!

#java #learningOOP #whytostartjava #javamotherofall #newbies

Copyright © 2018 - George Zafiris