http://effbot.org/zone/import-confusion.htm
import random
random.choice(string.ascii_letters)
http://effbot.org/zone/import-confusion.htm
import random
random.choice(string.ascii_letters)
Với công nghệ ảo hóa này, ta có thể chạy nhiều hệ điều hành cùng lúc trên một máy. Toàn bộ hệ thống từ phần cứng (RAM,CPU,HDD..) cho đến hệ điều hành đều được "ảo hóa".
Tuy nhiên việc ảo hóa nảy sinh các vấn đề sau:
Từ những yếu điểm trên mà công nghệ Operating System/Container Virtualization ra đời.
Tales of a Software Craftsman
PYTHON: A QUICK INTRODUCTION TO THE CONCURRENT.FUTURES MODULE
The concurrent.futures module is part of the standard library which provides a high level API for launching async tasks. We will discuss and go through code samples for the common usages of this module.
This module features the Executor class which is an abstract class and it can not be used directly. However it has two very useful concrete subclasses – ThreadPoolExecutor and ProcessPoolExecutor. As their names suggest, one uses multi threading and the other one uses multi-processing. In both case, we get a pool of threads or processes and we can submit tasks to this pool. The pool would assign tasks to the available resources (threads or pools) and schedule them to run.
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)vagrant status
-- outputs status of the vagrant machinevagrant halt
-- stops the vagrant machinevagrant reload
-- restarts vagrant machine, loads new Vagrantfile configurationvagrant provision
-- forces reprovisioning of the vagrant machineENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt' | |
Vagrant.configure("2") do |config| | |
config.vm.provider :libvirt do |libvirt| | |
libvirt.host = 'asterisk_sip' | |
libvirt.uri = 'qemu+unix:///system' | |
libvirt.driver = 'kvm' | |
# libvirt_pool_name = 'SPool1' | |
end |
{ | |
"scope": "text.html, ", | |
"completions": | |
[ | |
{ "trigger": "blk", "contents": "{% block $1 %} $2 {% endblock %}" }, | |
{ "trigger": "blu", "contents": "{% url '$1' %}" }, | |
{ "trigger": "bls", "contents": "{% static'$1' %}" }, | |
{ "trigger": "bl", "contents": "{% $1 %}" }, | |
{ "trigger": "blv", "contents": "{{ $1 }}" }, | |
] |
var c = $("#comments .comment"); // 4,649 ms | |
// jQuery 2.0 | |
var c = $(".comment"); // 3,437 ms | |
// native querySelectorAll | |
var c = document.querySelectorAll("#comments .comment"); // 1,362 ms | |
// native querySelectorAll | |
var c = document.querySelectorAll(".comment"); // 1,168 ms | |
// native getElementById / getElementsByClassName | |
var n = document.getElementById("comments"); | |
var c = n.getElementsByClassName("comment"); //107 ms |