i should start going to gym.
why do i need to workout so hard.. cos it’ll keep me fit and healthy.
but who said that.
don’t know. everyone’s doing.. i should do. (oh! then you should)
i’ll go to gym from next week. that’s my b’day resolution.
but what about protein.. don’t you need protein.
yeah.. otherwise i’ll die. i’ll find some foods high on protein online.. or the trainer will tell me some good diet.
i’ll buy some protein supplement and take it after workout.. my favorite chocolate flavor.
oh.. forgot the workout playlist.. i definitely need some good…
Images can’t replace code
Iterators is the one thing that makes looping or iteration so easy and beautiful in python. Many of us use it all the time without noticing where and how it’s working.
Simple usage of iterators involves using a for loop to run through the elements of an iterable like a list, dictionary or any kind of type that supports iteration. Mostly you write something like this.
a = [1,2,3]
for v in a:
Below one shows explicit use of iterator.
a = [1,2,3]
for v in iter(a):
And without a
for loop, things look…
When I started out building my own website with wordpress, I struggled a lot! Somehow I managed to get a website up and running with features of HTTPS, SSL etc which all other websites have, but it didn’t take long when things started to break and had to be fixed before anything could be done further. In short there were multiple holes in my setup.
Now the question was how to make it free of any holes plus if I ever needed to setup again, do I need to go through all of this again? …
Before we start setup part let me tell you about the things that made me struggle the most:
One solution to all of the above problems was Docker. What we can do is use pre-built docker images where we just need to set some values and the job is done. It’s better if you read about docker and try to understand it. …
Cloudflare is one of the many DNS providers. They provide different kind of plans, of which we will obviously go for the free one 😉.
This part is not useful if you are not planning to buy and/or link any domain with your website. For testing purpose you can access it via IP Address as well.
First thing we need is a Cloudflare Account. So go here and sign-up for one. Other wise login to your account. After signing-up make sure you verify your email. Further steps will be quite important so make sure you don’t miss anything.
GCP is Google Cloud Platform; an offering from Google. It’s like AWS (Amazon Web Services) if you know of AWS. Why we are using GCP? It’s just that I picked it first and doesn’t require billing enabled in the beginning unlike AWS. Though AWS also offers free things.
GCP offers free trial credit of $300 for an year when you enable it for the first time. You will not be charged for anything for one…
There will always be controversies around both: kissing and shitting. And depending on the social background etc. people will have wildly varying opinions about each. For some it may feel what is even the need to write something about kissing in open and for some it might be something they would disgust.
This isn’t much about kissing your partner in open, it more on shitting.
Note: some of the things that I write are for purpose of sarcasm.
The three words highlighted there: shitting, open, kissing are the things we are going to think of here. And their relevance in…
Sorting if you have ever used in Python is as simple as
Lets explore in depth.
Warning: A lot of code coming in. All code snippets are images.
Please type code yourself. For reference a git link to the complete notebook is here.
Sorting a list of numbers looks as simple as this:
This is the last part and we will cover how to create a basic Complex class which would behave like the builtin complex class. We will start by adding just constructor and destructor and then go ahead with implementing remaining magic methods.
The built-in complex class is named
complex with the small ‘c’. We will also name our class
Complex but with the capital ‘C’.
For now we have only __init__ and __str__ methods. This allows us to create Complex objects and easy printing. Notice that the
init has default arguments as well. …
The previous one covered usage of built-in complex class. It’s time to write our own code to handle complex numbers. This story focuses on creating and handling complex numbers using functions only. So the OO(Object Oriented Treatment) will come in the next part.
Before we get our hands dirty, lets see what all we will do.
We are going to put the real and imaginary part of a complex number into a tuple. So or representation…
Developer, Trainer and Fitness & Yoga Enthusiast