How To Check If Key Exists In Dictionary In Python

If you try to retrieve a non-existed key of a dictionary, you are gonna stuck an exception obviously. To be get safer, you should do check its existence before doing…

How to create a temporary file to store data

Your application has to write data out in a temporary file to reprocess them before rendering to users. The file will be created temporarily and swept our when the application…

Fastest way to get the first n elements of a List or an Array

Which is the fastest way to get the first n elements of a List or an Array? Let’s give a context where we want to extract some first elements from…

Checking existence of an element in an array with JavaScript

JavaScript is a loosely typed or a dynamic language. Variables in JavaScript are not directly associated with any particular value type, and any variable can be assigned (and reassigned) values…

How to find the mime type of a file in Python

A media type (also known as a Multipurpose Internet Mail Extensions or MIME type) is a standard that indicates the nature and format of a document, file, or assortment of bytes. It is defined…

Read and write with file CSV in Python

[dropcap]I[/dropcap]t is possible to read and write CSV (comma separated values) files using Python 2.4 Distribution. Like most languages, file operations can be done with Python. Writing a CSV file with Python can be…

How to loop a dictionary in Python

Dictionary is one of the most widely used data structures in programming, especially with Python. To understand how to loop on it, extract its keys as well as retrieve all…

ArrayList in Java

ArrayList class implements List interface and it is based on Array data structure. It is widely used because of the functionality and flexibility that it offers. Most of the developers…

What exactly is RESTful programming?

We have heard a lot of people talking about RESTful services. In order to explain it in the simplest way, we think it is a difficult task. This post aims…

How to implement an array with string index

I had shown you how to implement an array with string based index in Python programming language in the previous post. In this post, I will explain the same problem…