After programming a bit in flutter and dart here are some of my thoughts which I would love to share with the people who are yet to start and for those who are looking for a start (just like me!)

Who am I?

I am a Python Developer by profession and have been actively doing a lot of web development using Django/flask, system level development for cloud-native technologies as well as coding for automating jobs such as Ansible, terraform etc. I also occasionally code in Julia and Golang.

However, little did I know about mobile application development, leave alone coding for Android or iOS. Also, I will any day prefer coding for one codebase rather learning 3–4 languages (Java/Kotlin for Android Or Objective-C /Swift for iOS) to cater apps for both of these platforms. …


Image for post
Image for post
Julia 1.0

Julia is a great new programming language that’s been in the news lately because of its all-new stable 1.0 release as well as great computational features that had made it rank 39th at the TIOBE index for September 2018!

Now since I come from an engineering and software development background, I will keep things simple and hence jump in straight into a detailed examination of how the new package manager for Julia 1.0 looks like and why you should be excited to try it too :)

First off, let’s see how the Pkg manager used to work in the past versions of Julia. …


Image for post
Image for post

S o recently I had an interesting opportunity to talk to a technology enthusiast and his first question was about Django middleware! I answered it well and sufficiently to make him believe that I knew the fundamentals, as with any highly experienced engineer is the case, he moved on to another discussion with a satisfying agreement. But then, after I was done chitchatting, I thought, well.. how about writing this out , coz many developers may just be too ignorant, while some others may still be trying to figure it out!

To start off with some introduction to middleware in general, Here is what our very Wikipedia has to say about. …


I gave a brief introduction over decorators in my previous post. I will truly recommend to check that out.
So lets move on from where we finished.I will like to start by giving a small refresher of a decorator in a simple example below.

The output that we get here is 8. Ummm, Okay..Cool!

For those familiar with django REST framework, you must have seen the @api_view (for function based views :-) decorators which seem to take in parameters ‘method’ when they are passed. Like:

@api_view(method =[“GET”,”POST”])
def my_api(request):
pass

So what if I say that I want to create something similar?? I assume that you would say, “Yeah y not!”. …


Before we start off with generators, I would like to introduce Iterators first.

Iterators

Iterators is a python type on which we can loop upon.This means inbuilt data types like lists, dicts, tuples, and sets are iterators by default. All the iterators follow the iterator protocol.

Every iterator object uses two methods (or Magic methods)
__iter__ This returns the iterator object itself
__next__ this returns the next value from the iterator

Now lets see this thing with an example in action.
Suppose we have a list of number ranging from 10 to 20, and we want to iterate over that list.

>>> my_list = [10,11,12,13,14,15,16,17,18,19]
>>> for i in my_list:
print…


Searching, as we know is the process of finding out a particular element from a collection of elements.
There are two main ways to perform a search on a collection(or a list) of data.

Linear Search Algorithm

In linear search, we start off with implementing probably the easiest and the dumbest approach.
That is to traverse the complete list of objects right from the starting till the end.

Here is a rough layout of how to implement Linear Search.
1. start from the first Item of the list.
2. compare the current item to the item we want to search.
3. if the current item value is equal to the target item value, we stop.
4. …


This blog post particularly,will be more on the practical side of things.
Something more of like “learning by doing” kind of stuff.So lets jump onto it right away!

First off, we have * being passed alongside with a parameter.
Now we all know of what are parameters or arguments.

def my_function(arg):
print arg
>>>my_function(“rahul”)
rahul

We need to see HOW * changes (or modifies) this simple process.
Suppose we have a function that takes in two values and adds them.

def add_function(a,b):
return a+b

If we were to keep it plain simple and easy, we could have typed in

>>>add_function(1,2)…


The virtualenvwrapper is a great tool for people who work on a lot of different projects, and even for those who want more power over their overall setup.This not only provides a way to manage different virtualenvironments on a single system but also saves a lot of time.

To start with, lets install it first.

pip install virtualenvwrapper

Once this is done, go ahead on open your .bashrc file located in your home directory.

rahul@ubuntu:/$ cd ~
rahul@ubuntu:~$ vim .bashrc

Once the file is opened type in these 2 lines at the end of the file

export WORKON_HOME=”$HOME/.virtualenvs”
source /usr/local/bin/virtualenvwrapper.sh

Note:

For those having issues with vim editor, here are two quick steps,
(shift + g) to go the end
(escape + i) to get into insert…


Going to start a new python project??Have you heard about the python package virtualenv?

If yes, then you may skip the article and wait for my next one!
But if a “NO”, then read this before you do anything else.(A “Don’t press that red button” moment!)

A Virtual environment is a space within which you can install or keep all the “dependencies” of a specific project on which you will be working on.
Considering that larger projects use lots of libraries and site packages,
its importance goes on increasing as the project becomes larger in size.

So where to start and what all to know? Lets install it, start by typing this in your terminal…


For a complete newbie, using these functions is not usual, unless they discover about them one day.
Well this post is intended to make readers get their hands down and dirty with all of these.

List Comprehensions

To start with, List comprehension provide a “shorthand” way to create lists.
Didn’t get me?
Ohk, how will you print 10 numbers starting from 0 in the form of a list? You would do something like this.

>>>my_list = []
>>>for i in range(10):
my_list.append(i)

Seems very easy and you may have done or seen this numerous times.
What if I did this..

>>>my_list = [i for i in…

About

Rahul Lakhanpal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store