(cl-defstruct (org-roam-node (:constructor org-roam-node-create)
(:constructor org-roam-node-create-from-db
(title
id file file-title level todo
pos priority scheduled deadline
properties olp atime mtime tags
aliases refs))
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 dmg-test-function () | |
(org-roam-db-query | |
"SELECT | |
id, | |
file, | |
filetitle, | |
\"level\", | |
todo, | |
pos, |
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
#!/bin/bash | |
time sqlite3 /tmp/org-roam.db | wc <<EOF | |
SELECT | |
id, | |
file, | |
filetitle, | |
"level", | |
todo, | |
pos, |
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 org-roam-node-list () | |
(let ((rows (org-roam-db-query | |
"SELECT | |
id, | |
file, | |
filetitle, | |
\"level\", | |
todo, | |
pos, | |
priority , |
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
(setq dmg-roam-candidates-cache (make-hash-table :test 'equal)) | |
(defun org-roam-node-read--to-candidate (node template) | |
"Return a minibuffer completion candidate given NODE. | |
TEMPLATE is the processed template used to format the entry." | |
(let* ((args (list node template)) | |
(cached-result (gethash args dmg-roam-candidates-cache)) | |
) | |
(if cached-result |
(let ((startTime (float-time)))
(progn
; (print (length (org-roam-node-read--completions)))
(print (length (org-roam-node-list)))
(print (- (float-time) startTime)))))
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
function is_front_by_bundle_id(bundleID) | |
local currentWindow = hs.window.focusedWindow() | |
local currentBundle = nil | |
if currentWindow then | |
currentBundle = currentWindow:application():bundleID() | |
end | |
return currentBundle == bundleID | |
end | |
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
#!/usr/bin/bash | |
# replace the next line with the location of your addon | |
MDIR=/home/dmg/.local/share/Anki2/addons21/MecabUnidic/support | |
export LD_LIBRARY_PATH=$MDIR: | |
export DYLD_LIBRARY_PATH=$MDIR: | |
#$MDIR/mecab.lin --eos-format='\n' --unk-format='' -d $MDIR -r $MDIR/mecabrc "$1" | |
# MECAB_NODE_UNIDIC_22_PARTS = ['%f[7]', '%f[10]', '%m', '%f[6]', '%f[0]', '%f[1]'] | |
# i swapped the location of %m to first column | |
#$MDIR/mecab.lin -P | |
$MDIR/mecab.lin --eos-format='\t\t\t\tEOS\tEOS\n' --unk-format='%M\t%f[0]\t%M\t%f[1]\tunknown\tunknown\n' --node-format='%f[7]\t%f[10]\t%m\t%f[6]\t%f[0]\t%f[1]\n' -d $MDIR -r $MDIR/mecabrc "$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
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
std::vector < // I want a vector | |
std::vector<double> // each element of the vector is a vector | |
> variableName // name of the vector | |
(5, // how many elements in the frist dimension | |
std::vector<double>(2) // It knows each element is a vector (the subvectors. Here we say exactly | |
// what size each subvector to create |