Plus vs Minus In Objective-C

plus-minus-balance 3d MännchenWhenever you are working with an iOS app, you would have seen those functions and how they have a plus or a minus sign at the beginning. Ever wondered what they are? Objective-C requires that the interface and implementation of a class be in separate code blocks. That’s the reason you will see a .h and a .m file as a pair. Interface is the same as class definition in other languages. By convention, we place the interface in a header file and the implementation in a code file. In the header file, we declare functions with these ‘+’ and ‘-‘ signs. Do they make any real difference or do we have them just as part of the Objective-C language protocol? Well, they exist for a reason and there is a real difference between the signs.   Continue reading “Plus vs Minus In Objective-C”

Understanding Recursion: Part 4/4

mainIn the previous posts, we understood the basics of recursion, we discussed what happens when a recursive call is made and we saw some recursive code. But all that was from a programmer’s perspective. We looked at how we would see it. In this post, we will talk about about recursion from a machine’s perspective. We will see what happens inside when a recursive call is made. Don’t worry if you are not a hardcore coder, we will not be using too much jargon here. You will still be able to understand what we are about to discuss.   Continue reading “Understanding Recursion: Part 4/4”

Understanding Recursion: Part 3/4

recursive treeIn the previous post, we discussed about how we can deconstruct a programming problem to use recursion to our advantage. We will continue to discuss about programming in this post as well. If you are not prepared to look at code, you may want to skip this post and proceed to the next one in the series. If not, continue reading! Let’s continue to talk about trees then. By now, you understand enough about trees for me to not discuss the basics. If you want a refresher on trees, please read my previous post. In this post, we will look at some common recursive programming problems. You will see the problem and the recursive code to solve it, but not the explanation. We have already discussed how to understand a recursive function in full depth. It’s up to you to understand what’s happening inside these functions here.   Continue reading “Understanding Recursion: Part 3/4”

Understanding Recursion: Part 2/4

programming kidIn the previous post, we discussed about the general nature of recursion and recursive programming. We looked at a simple piece of code to understand how recursion happens under the hood. This post delves a bit deeper into recursive programming. Now that we understand recursion, how do we apply it to a real programming problem? We need to understand how we can deconstruct a programming problem so that we can use recursion. Figuring this part out can get tricky sometimes! It’s easier for some problems, but not so much for a few others. In this post, we will look at an abstract data type and see how we use recursion to our advantage. Let’s get out hands dirty, shall we?   Continue reading “Understanding Recursion: Part 2/4”

Understanding Recursion: Part 1/4

part 1Remember the initial days when you were forced to learn recursive programming? And how you were thankful that it’s all over and you don’t have to deal with the whole thing anymore? Well, why do you think that is? Recursion is not all that bad! A lot of beginners who start out with programming somehow end up hating recursion. The main reason is that people don’t really understand how to deconstruct a given problem to make it suitable for recursion. Recursive code, by itself, is nice and small. But understanding what exactly is the recursive part can be pretty confusing. If used correctly, recursion can be one of the best weapons in your programming arsenal. Let’s see what’s beneath all this!   Continue reading “Understanding Recursion: Part 1/4”

What Is A Galois Field?

mainA Galois Field is actually a corn field owned by any person named Galois! Too obvious? Alright, that was a joke. Anyway, the word ‘field’ is being used in the mathematical context here. Évariste Galois was a mathematical prodigy who laid strong foundations for abstract algebra. His collected works contain important ideas that have had far-reaching consequences for nearly all branches of mathematics, thus etching his name in mathematics forever. Unfortunately, he died at a tender age of 20. The work he did as a teenager is now being used by mathematicians around the world for their doctorate studies and related research work. Prodigy indeed! Just so we are clear, this blog post has nothing to do with corn fields. Well then, what else can it be about?   Continue reading “What Is A Galois Field?”

Transcendental Functions

mainTranscendentalism refers to the philosophical movement that developed in the 1800s. It taught people to believe in the inherent goodness of people and nature. It also said that religious organizations and political parties corrupt the purity of an individual. So obviously, any ceremonies or functions attended by transcendentalists should be called transcendental functions. Right? No, not really! That has actually nothing to do with what we will be discussing here. When we hear the term ‘function’ used in a scientific context, we immediately jump to mathematics. If you are somewhat familiar with mathematics, you know what a function is. If not, no worries; we will discuss it further soon. But for now, all we need to know is that real functions are divided into two groups: algebraic functions and transcendental functions. Wait, what? Aren’t all functions and equations ‘algebraic’? Well, not exactly. As it turns out, transcendentalism exists in mathematics!   Continue reading “Transcendental Functions”

Display Caller Of The Current Function In Python

python-logoIf you have spent enough time coding, then you know where I am going with this. As the code gets bigger, debugging gets trickier. Keeping track of everything becomes difficult, especially when you collaborate with others and your functions are being called by someone else’s functions. A lot of times, you may want see where your function is being called so that you can pinpoint where things went wrong. Luckily, Python has a neat way of doing it. You can get a list of all the locations where your function is being called, along with the line numbers.   Continue reading “Display Caller Of The Current Function In Python”

Exploring The Lesser Known Features Of Python – Part I

I have been fiddling with Python for some time now and I have to tell you, it just keeps getting better and better! Every time I interact with Python, I stumble across something new. There are so many things you can do with it. It is very well documented and most of the material is available out there. There are some of the lesser known features which are very useful, but you don’t see them often. There are quite a few and I have split it into two parts. You can find the second part here. I have listed the first few here:   Continue reading “Exploring The Lesser Known Features Of Python – Part I”