Named Tuple & Enum in Python

Python has two very nice data structure called namedtuple and enum which are not that much been use in day to day python coding considering their usefulness. Let's start with namedtuple: namedtuple lib is part of collections package. As name suggest it's kind of tuple which is immutable(unchangeable) with named arguments. Let's see the syntax... Continue Reading →

Advertisements

There are different methods which we can use to get, create and update the django models. You can learn more about this in great detail from django documentation. This is more of summarization of methods which I usually use while developing models in django. Let's jump into the code without going much into details: We... Continue Reading →

Basic of Mocking Explained in Python

While writing the unit tests there are lot of instances when we would like to test the method which is calling third api's  or having dependency on different methods.This article if for beginners, who want to start testing using mocking. What is Mocking: When you test a method(Called A) which has dependency on different methods... Continue Reading →

PyCharm and Intellij KeyBoard Shortcuts

I use pycharm in my daily jobs. I love PyCharm IDE as it's one of the best in market if you do the programming in Python. I always find it easier and faster when I use the keyboard compare to mouse while writing, searching or navigating the code. Note: Use Mac 10.5+ Kyemapping -> Preference ->... Continue Reading →

Build Tiny Load Tool In Go Using Concurrency Model

One of the best thing in go is concurrency and channels and it's really useful while building the tools or application which need high concurrency. I have recently build the load application tool using golang which need to make multiple requests to server for certain time. What is concurrency: Ability to run multiple tasks concurrently... Continue Reading →

Different Ways to Reverse the String in Java

Using the toCharArray and swap the location of the char public static String firstWayToReverse(String str) { if (str == null) { return null; } char[] charStr = str.toCharArray(); for (int i = 0; i < charStr.length / 2; i++) { char temp = charStr[i]; charStr[i] = charStr[charStr.length - (i + 1)]; charStr[charStr.length - (i +... Continue Reading →

Different Ways to Mock Using Mockito in Java

Berief introduction about 'Mockito" => Mockito is a framework which allow to mock the objects and mock objects basically imitate the real world objects and their behavior. There are several Way to Mock object or method using Mockito. Let's jump straight into find out different ways to Mock using Mockito: First way: import org.mockito.Mockito; public class... Continue Reading →

UNIT Testing VS Integration Testing

There seem to be lot of confusion around Unit Testing Vs Integration Testing. So I thought, I should be writing something about it, to clarify on it: Unit Testing The main purpose of unit testing is testing the smallest part of logical unit or behavior of the system. Logical unit can extend to single method... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: