
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

179 Views
Suppose we have a 2048 game board representing the initial board and a string direction representing the swipe direction, we have to find the next board state. As we know in the 2048 game, we are given a 4 x 4 board of numbers (some of them are empty, represented in here with 0) which we can swipe in any of the 4 directions ("U", "D", "L", or "R"). When we swipe, all the numbers move in that direction as far as possible and identical adjacent numbers are added up exactly once.So, if the input is likedirection = "L", then ... Read More

1K+ Views
Understanding Process -When you code and execute a program on Windows, MAC or Linux, your Operating System creates a process(single).It uses system resources like CPU, RAM, Disk space and also data structures in the operating system’s kernel. A process is isolated from other processes—it can’t see what other processes are doing or interfere with them.Note: This code has to be run on Linux like sytems. When executed on windows might throw exceptions.Goals of Operating System -The main twin goals of OS are to spread the work of the process fairly and be responsive to the user. These are acheived by ... Read More

351 Views
IntroductionList comprehensions make it easy to take a source list and get a derived list by applying an expression. For example, say that I want to multiply each element in a list with 5. Here, I do this by using a simple for loop.a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] multiply_by_5 = [] for x in a: multiply_by_5.append(x*5) print(f"Output *** {multiply_by_5}")Output*** [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]With a list comprehension, I can achieve the same outcome by specifying the expression and the input sequence to loop over.# List comprehension multiply_by_5 ... Read More

281 Views
IntroductionPython has different approaches like using threads, subprocesses, generators and other tricks for concurrent programming.Before we go on and implement threads, let us understand what exactly is concurrency.Concurrency is a piece of logic Within a single program that allows to open up many distinct paths of execution, including separate streams of I/O, running SQL queries, so on in a way that the execution seems to be both simultaneous and independent of each other.How to do it..First we create a single thread to go through the site urls and later look at how to use threading concepts to speed up the ... Read More

518 Views
Suppose we have a 2D matrix of numbers, now for each zero in the given matrix and replace all values in its row and column with zero, and return the final matrix.So, if the input is like matrix, then the output will be matrix as the 0th, 2nd and 3rd rows contain 0 and the final matrix contains 0 in those rows. Similarly 0th, 1st and 2nd columns contain 0 and the final matrix contains 0 in those columns.To solve this, we will follow these steps:n := row count, m := column count res := make a matrix of size ... Read More

3K+ Views
IntroductionIt seems that the world is ruled by Excel. I've been surprised in my data engineering work to see how many of my colleagues are using Excel as a critical tool for making decisions. While I'm not a big fan of MS Office and their excel spread sheets, i will still show you a neat trick to handle large excel spread sheets effectively.How to do it..Before we jump into the program directly, let us understand few basics on dealing excel spreadsheets with Pandas.1. Installation. Go ahead and install openpyxl and xlwt. If you are unsure if it is installed or ... Read More

326 Views
ProblemYou need to implement immutable data structures in Python.Introduction..Immutable data structures are very handy when you want to prevent multiple people modifying a piece of data in parallel programming at same time. Mutable data structures( e.g. Array) can be changed at any time while immutable data structures cannot be.How to do it..Let me show you step by step how to deal with immutable and mutable data structures.Example# STEP 01 - Create a Mutable array. # Define an array atp_players = ['Murray', 'Nadal', 'Djokovic'] print(f" *** Original Data in my array is - {atp_players}")*** Original Data in my array is ... Read More

12K+ Views
ProblemYou want to create a compress files in python.IntroductionZIP files can hold the compressed contents of many other files. Compressing a file reduces its size on disk, which is useful when transferring it over the internet or between the systems using Control-m AFT or Connect direct or even scp.Python programs creates ZIP files using functions in the zipfile module.How to do it...1. We will be using zipfile and io packages. Install them with pip if any of the packages are missing on your system. If you are unsure, use pip freeze command to validate the packages.2. We will write a ... Read More

683 Views
How to append new rows to DataFrame using a Template In Python Pandas.IntroductionBeing a data engineering specialist, i often end up creating more derived columns than rows as the role of creating and sending the data to me for analysis should be taken care of other database specialists. However, it is not true during all time.We have to create sample rows rather than waiting for data specialists team to send us the data. In this topic i will be showing the neat tricks for creating rows.How to do it..In this recipe, we will begin by appending rows to a small ... Read More

828 Views
ProblemYou need to extract the HTML tables from a web page.IntroductionThe internet, and the World Wide Web (WWW), is the most prominent source of information today. There is so much information out there, it is just very hard to choose the content from so many options. Most of that information is retrievable through HTTP.But we can also perform these operations programmatically to retrieve and process information automatically.Python allows us to do this using its standard library an HTTP client, but the requests module helps in obtaining web pages information very easy.In this post, we will see how to parse through ... Read More