Step # | Illustration | State of Queue | Pool of workers | Description |
---|---|---|---|---|
1 | 1, | r,y,g,b | Initial state, node 1 is scheduled for processing | |
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "BetterTouchTool" | |
activate | |
update_trigger "EAE52DEC-26DA-40DC-8BB1-62A102FE676C" json "{\"BTTEnabled\" : %d}" | |
update_trigger "7C3BC3BC-2B93-4674-8A5F-6697FDC6E723" json "{\"BTTEnabled\" : %d}" | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun copy-current-line-position-to-clipboard (p) | |
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'" | |
(interactive "sAbsolute path y/n?: ") | |
(let ((path-with-line-number) (file-name (buffer-file-name))) | |
(when (and (not (string= p "y")) (projectile-project-root)) | |
(setq file-name (file-relative-name buffer-file-name (projectile-project-root))) | |
) | |
(setq path-with-line-number (concat file-name ":" (number-to-string (line-number-at-pos)))) | |
(x-select-text path-with-line-number) | |
(message (concat path-with-line-number " copied to clipboard")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _is_node_rdy(task, graph): | |
tasks = session.query(Task).filter(Task.id.in_(list(graph.predecessors(task.id)))).all() | |
for dep_task in tasks: | |
if not dep_task.celery_task_uid or \ | |
not AsyncResult(dep_task.celery_task_uid).state == SUCCESS: | |
return False | |
return True | |
@app.task(bind=True) | |
def run(self, workflow_id, cur_task_id=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _is_node_rdy(task, graph): | |
tasks = session.query(Task).filter(Task.id.in_(list(graph.predecessors(task.id)))).all() | |
for dep_task in tasks: | |
if not dep_task.celery_task_uid or \ | |
not AsyncResult(dep_task.celery_task_uid).state == SUCCESS: | |
return False | |
return True | |
@app.task(bind=True) | |
def run(self, workflow_id, cur_task_id=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun read-file-as-string (file-path) | |
(with-temp-buffer | |
(insert-file-contents file-path) | |
(mapcar 'string-trim (split-string (buffer-string) "," t)) | |
) | |
) | |
(defun calculate-dist (x y z) | |
(/ | |
(+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- lexical-binding: t -*- | |
(defun dowrap (list beg_i l lambd) | |
(let (i) | |
(dotimes (j l) | |
(setq i (+ beg_i j)) | |
(setq i (% i (length list))) | |
(apply lambd (list i j)) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun calculate-score (str) | |
(let ((list (split-string str "" t)) garbage (depth 0) (s 0) (g-count 0) ch) | |
(loop | |
for i from 0 to (1- (length list)) | |
do | |
(progn | |
(setq ch (nth i list)) | |
(cond | |
((string= ch "!") | |
(setq i (+ i 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defstruct statement instruction condition) | |
(defstruct instruction reg value op) | |
(defstruct condition reg value con) | |
;; 1. Parse each line as Instruction | |
;; 2. Create Memory hash table with regs name - value (default of each reg is 0) + | |
;; 3. Execute each Instruction populating Memory + | |
;; 4. The largest reg value in Memory + | |
;; Part 2 | |
;; 5. Add eval-after-statement hook for eval-statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defstruct node name weight parent) | |
(defun split-and-trim-each (&rest args) | |
(mapcar 'string-trim (apply 'split-string (append args (list t)))) | |
) | |
(defun parse-weight (str) | |
(string-to-number (substring str 1 -1)) | |
) |
NewerOlder