Skip to main content

Posts

Showing posts from September, 2014

Entropy and physics for idiots

There's a big online industry on explaining scientific concepts. Most of them fail. The award for the most misunderstood and poorly explained concept is ... *drum roll* ENTROPY!!!. But thanks to a bunch of rowdy guys and girls we have physics for idiots dot com. Let me link you to their thermodynamics and entropy article and be amazed: IDIOTS FOR THERMODYNAMICS   A very weak analogy would the configurations of Rubik's cube when you're solving it. From one configuration to the final desired configuration you have a certain amount of configurations you have to go through. With each and every new state you know more about the past and future configurations.

How a computer language compiler works

The programs that are written in languages like C++ or C are just text. Computers don't understand that text as it is. The program (the text) has to be compiled (translated into another language) into machine language which is the actual language that the CPU understands. Why ? you ask. Well it's because development in pure machine language is slow and prone to errors. And machine language doesn't look like our spoken language which makes it hard to learn and understand.And because it takes a long time to learn machine language. And because people after a long time programming in machine language have observed some patterns emerging and they gave those patterns names like : for loops, do while loops, while loops, if decisional blocks, functions etc. Like spoken languages, computer programming languages have an alphabet(lexicum) of words that mean(do) something. So the first thing that a compiler does is to analyze the words of a program, that's lexical analysis. A...

The memory layout of a computer program and how a computer works.

A computer program that is loaded into a computer's RAM has a distinct layout. Before we dive into how a computer program looks in memory we need to understand what is the computer offering us when it comes to memory management. A computer's RAM memory is a long array of bits. Instead of reading and writing 1 bit at a time we read and write in chunks of 8 bits called bytes. If we want to read or write a location we need to know it's address. If our computer supports 32 bit addresses than we can work with:  2^32 = 4294967296 bytes which is 4294967296/1024=4194304 Kilo Bytes, which is 4194304/1024= 4096 Mega Bytes which is 4 Giga Bytes. Adresses start at 0 and go all the way to 2^32-1. You can think of a RAM memory as a long string of beads, each bead containing 8 bits. A computer program is composed out of data and instructions. Instructions tell the CPU what to do with data from memory. The only operations that a CPU does to data are mathematical/logical opera...

Linux "-f" or linux "-z" or linux "-eq" or linux "-gt" ... ?

Often friends and people that I know that start to have an interest in Linux end up doing shell scripting and they get their ears caught. I usually get e-mails with questions like this: What is linux "-f" or linux "-z" or linux "-eq" or linux "-gt" or linux "-rf" or linux "-le" ? The short answer for the above is that those are number and file tests/comparisons of korn/bash shells. Linux shells are the primary ways the users interact with Linux operating systems. With shells you can interact with the file system and execute programs. You can chain shell commands in scripts in a programmatic way. Number and file tests/comparisons occur in shell scripting constructs such as : if [ true ] then # do something here fi You can replace the "true" between the [] with expressions that evaluate to true or false, for example: if [ 5 -eq 5 ] then echo "5 equals 5" fi The above decisional block in ...

Why we need to conquer space and how rockets work?

   Space, the final frontier.    Just why do we need to make space travel a common thing?    Well there a lot of reasons but the main reasons are: Energy  Technological advancement Human species survival     1. We owe our current civilization to the fact that we always want to travel faster and further. We always want to ease our work by means of machines. Travelling and machines require energy.     Our everyday appliances and devices run on electrical energy, which is obtained from fossil fuels or other types of fuels. Our cars run on fossil fuel energy. Our bodies rely on chemical energy and so on. Everything in our world that we have today is based on energy. With the invention of agriculture we were able to achieve more food which is more energy for our bodies and minds. That gave us more free time to think about ways to better ourselves.     To travel into space efficiently we have to hav...

Why modern art is bad, stinks and sucks in general ?

  This 5 minute video covers the reasons why the modern art sucks. Compared to days past art, modern art is just ugly. I don't understand why people enjoy modern art. It's soulless and made just to shock you. The so called modern art has been pushed because some people want to make money.

OBJECT ORIENTED PROGRAMMING IN A NUT SHELL... ALMOST

So you want to learn object oriented programming?! Good choice .But before you start learning with the style of an enraged spanish bull  you should understand its premises. Object oriented programming (OOP) is a programming paradigm,that means a style of coding(google for paradigm). Its purpose is to solve problems faced by coders and to make efficient the time spent coding. Let's understand a computer programming language. Computer programming languages are cataloged in to 4 generations. The first generation is the machine code,pure CPU instructions.The 2nd generation are the assembly languages . The third generation are languages like C/C++,C#,Java,Delphi. The 4th generation doesn't matter right now. The generations appeared because when you do complex stuff using tiny,finite and simple bricks(machine instructions) you observe  patterns. And if you give those code patterns a simple human readable name, you can make another program ( a compiler) to replace that ...

Nature's hardcore mating problems or the weird way nature reproduces.

  When you think about reproduction (or mating, or the act of copulation that spawns new individuals of a species) you think about two constituents of the same species of different sexes coming close for some time . One individual is a male and the other is a female, both are equiped with specialized reproduction organs.   Well... there are some species that lack external reproduction organs in one of the sexes. Also there are species that really don't like touching each other...     Our first case of weird mating habits comes from the ocean, the deep ocean. The deep sea squid is cannibalistic, that means they eat each other. That's one impediment, the other impediment is that the male is quite small compared to the female.     So how does a species that practices cannibalism that has small males compared to females reproduce ?   The male has dart like spermatophores that it shoots at the females. Exactly, the male comes close enough a...