How to create a temporary file to store data

Print Friendly, PDF & Email

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 into an Array

Print Friendly, PDF & Email

def s = ‘Hello Groovy world!’ assert s.take(5) == ‘Hello’ assert s.drop(6) == ‘Groovy world!’ Python Let’s assume an arbitrary list/array: in_list = list(range(10)) // Python2: in_list = range(10) //…

Checking existence of an element in an array with JavaScript

Print Friendly, PDF & Email

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

Print Friendly, PDF & Email

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…

Đọc và viết dữ liệu với file CSV trong Python

Print Friendly, PDF & Email

[dropcap]N[/dropcap]hiều phần mềm bảng tính có thể mở được định dạng dữ liệu csv. Trong quá trình đưa kết quả ra màn hình, nhiều giá trị muốn được giữ lại…

Cách thực hiện vòng lặp trong từ điển với Python

Print Friendly, PDF & Email

Rất tiếc, mục này chỉ tồn tại ở Tiếng Anh.

(English) ArrayList in Java

Print Friendly, PDF & Email

Rất tiếc, mục này chỉ tồn tại ở Tiếng Anh.

Làm thế nào để tạo một danh sách với chỉ mục kiểu chuỗi trên C++

Print Friendly, PDF & Email

Trong một bài viết trước, tôi có giới thiệu với các bạn tạo danh sách/mảng với cách đánh chỉ mục bằng chuỗi kí tự trong lập trình Python.  Bài viết…

Array, List, etc. với chỉ mục là chuỗi kí tự

Print Friendly, PDF & Email

Trong lập trình, chúng ta cũng hay gặp nhiều trường hợp phải tạo một danh mục mà index của nó là các chuỗi kí tự. Có một khái niệm để mô tả loại đối tượng này, thường gọi là HashMap hay HashTable.

Tính số lần xuất hiện một chuỗi trong một danh sách

Print Friendly, PDF & Email

Trong bài viết hướng dẫn cách đếm số lần xuất hiện của một từ trong chuỗi kí tự, chúng ta đã làm quen với hàm count của đối tượng string.…