(function equality_or_assign(){
a = 0;
if(a = 1) console.log('assign', a);
else console.log('equality');
})();
function extract_task_arguments(n){ | |
task_table = document.getElementById('tasks-table'); | |
for(var i = 1; i < n + 1; i++) console.log(task_table.childNodes[3].childNodes[i].childNodes[3].childNodes[0].data + "\t" + task_table.childNodes[3].childNodes[i].childNodes[4].childNodes[0].data) | |
} |
lsof -aK -p pid |
In wikipedia website, coroutine is defined as followed.
Coroutines are computer-program components that generalize subroutines for non-preemptive multitasking, by allowing multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
In early Python, coroutine
is not natively supported, but only generator
which supports yielding and resuming. Normal generators are just used to return value one by one, rather than yielding to different other generators as cooperative tasks. There are two main methods, send
and throw
resume generator's execution with specified value or exception. Afterwards in some frameworks, such as Tornado, the generator
is used to implement framework level coroutine
like tornado.gen.coroutine
. However in ea
# initialize string array | |
FILES=(aaa bbb ccc) | |
# retrive array's all elements | |
for file in `${FILES[@]}` | |
do | |
echo $file | |
rewrite url prefix | |
rewrite /url_prefix(.*) /$1 break; |
#include "Python.h" | |
PyTypeObject * create_type(const char * name){ | |
PyObject * args, * dict, * value; | |
PyTypeObject * type; | |
args = PyTuple_New(3); | |
PyTuple_SetItem(args, 0, PyUnicode_FromString(name)); |
# get processes with related threads | |
ps -eLf |grep "process name" | |
# list all opened file descriptors in a process PID and under which thread | |
lsof -aKp PID | |
# trace syscalls in a process's main thread or other thread PID | |
strace -p PID |
--- | |
- name: "common task" | |
command: "{{item.cmd}}" | |
with_items: | |
- {cmd: "A", tag: ["projectA"]} | |
- {cmd: "B", tag: ["projectB"]} | |
when: item.tag | intersect(current_tag) | |
tags: | |
- projectA |