diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404/index.html b/404/index.html new file mode 100644 index 0000000..ebd5e48 --- /dev/null +++ b/404/index.html @@ -0,0 +1,12 @@ +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/500/index.html b/500/index.html new file mode 100644 index 0000000..6d91585 --- /dev/null +++ b/500/index.html @@ -0,0 +1,12 @@ +500: Internal Server Error

500

Internal Server Error.

\ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/404.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/404.json new file mode 100644 index 0000000..ac8cc9a --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/404.json @@ -0,0 +1 @@ +{"pageProps":{"body":"

Inicio

\n\n
\nChildren\n
    \n
  1. Coding tips
  2. \n
  3. Math
  4. \n
","note":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}},"customHeadContent":null,"noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/500.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/500.json new file mode 100644 index 0000000..ac8cc9a --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/500.json @@ -0,0 +1 @@ +{"pageProps":{"body":"

Inicio

\n\n
\nChildren\n
    \n
  1. Coding tips
  2. \n
  3. Math
  4. \n
","note":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}},"customHeadContent":null,"noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/index.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/index.json new file mode 100644 index 0000000..ac8cc9a --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/index.json @@ -0,0 +1 @@ +{"pageProps":{"body":"

Inicio

\n\n
\nChildren\n
    \n
  1. Coding tips
  2. \n
  3. Math
  4. \n
","note":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}},"customHeadContent":null,"noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/403.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/403.json new file mode 100644 index 0000000..e10ac47 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/403.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"vault":{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},"fname":"403","id":"403","title":"This page has not yet sprouted","schemaStub":false,"type":"note","updated":1687108143352,"created":1687108143352,"desc":"","links":[],"anchors":{},"children":[],"parent":null,"data":{}},"body":"

This page has not yet sprouted

\n

Dendron (the tool used to generate this site) lets authors selective publish content. You will see this page whenever you click on a link to an unpublished page

\n

","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/4k7eb68p8o3ctljv6pl0g3q.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/4k7eb68p8o3ctljv6pl0g3q.json new file mode 100644 index 0000000..03674f2 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/4k7eb68p8o3ctljv6pl0g3q.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"4k7eb68p8o3ctljv6pl0g3q","title":"Stats","desc":"","updated":1685946339689,"created":1685946339689,"custom":{},"fname":"math.stats","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"f54a190589d2bb0e96eec42c44f13e92","links":[],"anchors":{},"children":["zmvhm0w2tjs2njii7b7nrm5"],"parent":"rzreoc67l24hzknyqbn3a9b","data":{}},"body":"

Stats

\n
\nChildren\n
    \n
  1. Stochastic Differential Equations
  2. \n
","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/631hw9oh0k8jhc0wlm0joyz.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/631hw9oh0k8jhc0wlm0joyz.json new file mode 100644 index 0000000..0d8b007 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/631hw9oh0k8jhc0wlm0joyz.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"631hw9oh0k8jhc0wlm0joyz","title":"Coding tips","desc":"","updated":1687107935898,"created":1685471254996,"custom":{},"fname":"code","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"29822a373853ee8f5e2f616b54430b41","links":[{"type":"wiki","from":{"fname":"code","id":"631hw9oh0k8jhc0wlm0joyz","vaultName":"Dendron"},"value":"code.python","position":{"start":{"line":37,"column":1,"offset":597},"end":{"line":37,"column":16,"offset":612},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code.python"}},{"from":{"fname":"root","id":"root","vaultName":"Dendron"},"type":"backlink","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"value":"code"}],"anchors":{"edit-git-remote-url":{"type":"header","text":"Edit Git Remote URL","value":"edit-git-remote-url","line":9,"column":0,"depth":1},"django-tests-not-running":{"type":"header","text":"Django tests not running","value":"django-tests-not-running","line":19,"column":0,"depth":1},"python":{"type":"header","text":"Python","value":"python","line":41,"column":0,"depth":1}},"children":["hwyvw05ski3srgkxy31ym7w","j9wmd96lxohstbdavjirhbo"],"parent":"root","data":{}},"body":"

Coding tips

\n

Edit Git Remote URL

\n
git remote set-url origin <new-url>\n\n
\n

Source

\n

Django tests not running

\n

Solution. Make sure you are writing your tests wrapped in classes that inherit from TestCase. Example:

\n
from django.test import TestCase\n\n\nclass FooTest(TestCase):\n    def setUp(self):\n        pass\n\n    def tearDown(self):\n        pass\n\n    def test_this_will(self):\n        print 'Win'\n
\n

Read more

\n

Python

\n

Python

\n
\nChildren\n
    \n
  1. Python
  2. \n
  3. Ruby
  4. \n
\n
\nBacklinks\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/6zw1kq25fhhqug5i45y1srj.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/6zw1kq25fhhqug5i45y1srj.json new file mode 100644 index 0000000..b1a726e --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/6zw1kq25fhhqug5i45y1srj.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"6zw1kq25fhhqug5i45y1srj","title":"Como extraer metadatos del volcado de una base de datos","desc":"","updated":1685478604651,"created":1684612996461,"custom":{},"fname":"code.python.sqlparse","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"c048ad49104154ba39e89c879d9baf55","links":[],"anchors":{"resultado":{"type":"header","text":"Resultado","value":"resultado","line":8,"column":0,"depth":2},"código":{"type":"header","text":"Código","value":"código","line":12,"column":0,"depth":2},"extrayendo-el-nombre-de-una-definición-de-tabla":{"type":"header","text":"Extrayendo el nombre de una definición de tabla","value":"extrayendo-el-nombre-de-una-definición-de-tabla","line":38,"column":0,"depth":2},"método-para-obtener-el-nombre-de-la-tabla":{"type":"header","text":"Método para obtener el nombre de la tabla","value":"método-para-obtener-el-nombre-de-la-tabla","line":165,"column":0,"depth":3},"extrayendo-una-lista-de-tablas-y-sus-nombres":{"type":"header","text":"Extrayendo una lista de tablas y sus nombres","value":"extrayendo-una-lista-de-tablas-y-sus-nombres","line":186,"column":0,"depth":2},"determinando-el-tipo-de-objeto-creado":{"type":"header","text":"Determinando el tipo de objeto creado","value":"determinando-el-tipo-de-objeto-creado","line":245,"column":0,"depth":3},"extrayendo-el-nombre-y-tipo-de-objeto-creado-de-un-volcado-completo":{"type":"header","text":"Extrayendo el nombre y tipo de objeto creado de un volcado completo","value":"extrayendo-el-nombre-y-tipo-de-objeto-creado-de-un-volcado-completo","line":296,"column":0,"depth":3},"referencias":{"type":"header","text":"Referencias","value":"referencias","line":343,"column":0,"depth":2}},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

Como extraer metadatos del volcado de una base de datos

\n

Resultado

\n

Consultar la base de datos Eleventa.

\n

Código

\n

Primero instalamos el paquete sqlparse. Desde pypy:

\n
pip install sqlparse\n
\n

Si utlizamos poetry:

\n
poetry add sqlparse\n
\n

Una vez instalado, en una sesión de python lo podemos importar de la manera usual

\n
from typing import Optional\nfrom sqlparse.sql import Statement\nfrom sqlparse.tokens import Keyword\nfrom dataclasses import dataclass\nimport sqlparse\n
\n

Extrayendo el nombre de una definición de tabla

\n

Vamos a utilizar el siguiente ejemplo de SQL para aprender a extraer la información que necesitamos

\n
TABLE = \"\"\"CREATE TABLE IF NOT EXISTS MY_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n\"\"\"\n
\n
parsed = sqlparse.parse(TABLE) # Devuelve una tupla de statements sql contenidos en la cadena\nstatement = parsed[0]\n
\n
print(statement)\n
\n
CREATE TABLE IF NOT EXISTS MY_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n
\n

statement es una variable tipo Statement que puede ser iterada por medio de índices o ciclos.

\n
token = statement[0]\nprint(type(statement), type(token))\n
\n
<class 'sqlparse.sql.Statement'> <class 'sqlparse.sql.Token'>\n
\n

Cada token define dos atributos: value y ttype, sin embargo el parser es flojo, al invocarlo evitará escanear recursivamente la cadena como se puede ver en los siguientes ejemplos.

\n
# En este caso, el primer token tiene un valor definido y un tipo.\ntoken.value, token.ttype\n
\n
('CREATE', Token.Keyword.DDL)\n
\n
# En este ciclo se puede ver que los tokens 11 y 13 no fueron analizados por el parser.\nfor i, token in enumerate(statement):\n    token_type = repr(token.ttype)\n    print(f\"{i+1:2d}. {token.value:50} {token_type:50} {type(token)}\")\n\n
\n
 1. CREATE                                             Token.Keyword.DDL                                  <class 'sqlparse.sql.Token'>\n 2.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 3. TABLE                                              Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 4.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 5. IF                                                 Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 6.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 7. NOT                                                Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 8.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 9. EXISTS                                             Token.Keyword                                      <class 'sqlparse.sql.Token'>\n10.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n11. MY_TABLE                                           None                                               <class 'sqlparse.sql.Identifier'>\n12.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n13. (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID)) None                                               <class 'sqlparse.sql.Parenthesis'>\n14. ;                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n
\n

El método Statement.flatten realizará el parseo de la cadena completa, devolviendo los tipos y valores de cada token encontrado.

\n
for i, token in enumerate(statement.flatten()):\n    token_type = repr(token.ttype)\n    print(f\"{i+1:2d}. {token.value:50} {token_type:50} {type(token)}\")\n
\n
 1. CREATE                                             Token.Keyword.DDL                                  <class 'sqlparse.sql.Token'>\n 2.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 3. TABLE                                              Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 4.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 5. IF                                                 Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 6.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 7. NOT                                                Token.Keyword                                      <class 'sqlparse.sql.Token'>\n 8.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n 9. EXISTS                                             Token.Keyword                                      <class 'sqlparse.sql.Token'>\n10.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n11. MY_TABLE                                           Token.Name                                         <class 'sqlparse.sql.Token'>\n12.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n13. (                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n14. ID                                                 Token.Name                                         <class 'sqlparse.sql.Token'>\n15.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n16. TLLAVE                                             Token.Name                                         <class 'sqlparse.sql.Token'>\n17.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n18. NOT NULL                                           Token.Keyword                                      <class 'sqlparse.sql.Token'>\n19. ,                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n20. \n                                                  Token.Text.Whitespace.Newline                      <class 'sqlparse.sql.Token'>\n21.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n22.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n23.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n24.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n25. CONSTRAINT                                         Token.Keyword                                      <class 'sqlparse.sql.Token'>\n26.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n27. PK_MY_TABLE                                        Token.Name                                         <class 'sqlparse.sql.Token'>\n28.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n29. PRIMARY                                            Token.Keyword                                      <class 'sqlparse.sql.Token'>\n30.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n31. KEY                                                Token.Keyword                                      <class 'sqlparse.sql.Token'>\n32.                                                    Token.Text.Whitespace                              <class 'sqlparse.sql.Token'>\n33. (                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n34. ID                                                 Token.Name                                         <class 'sqlparse.sql.Token'>\n35. )                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n36. )                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n37. ;                                                  Token.Punctuation                                  <class 'sqlparse.sql.Token'>\n
\n

Método para obtener el nombre de la tabla

\n

Las tablas que nos interesa analizar todas tienen siempre la siguiente estructura

\n
CREATE TABLE [IF NOT EXISTS] my_table_name ...\n
\n

por lo que para encontrar el nombre de la tabla necesitamos encontrar el primer token de tipo Identifier que encontnró el parser y extraer su valor, como se ve en el siguiente ejemplo:

\n
for token in statement:\n    if isinstance(token, sqlparse.sql.Identifier):\n        print(token.get_name().upper())\n        break\n
\n
MY_TABLE\n
\n

Extrayendo una lista de tablas y sus nombres

\n

El volcado SQL puede tener una mezcla de definiciones de estructuras de datos y otros tipos de código SQL, por ejemplo un query de búsqueda

\n
CREATE TABLE IF NOT EXISTS MY_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n\nSELECT * FROM ANOTHER_TABLE;\n\nCREATE TABLE IF NOT EXISTS MY_OTHER_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n
\n

lo que hacemos es utilizar sqlparse para encontrar cada statement y determiar si es de tipo CREATE de modo que para statements de este tipo aplicamos el algoritmo de la sección anterior para encontrar el nombre de la tabla.

\n
SQLDUMP = \"\"\"CREATE TABLE IF NOT EXISTS MY_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n\nSELECT * FROM ANOTHER_TABLE;\n\nCREATE TABLE IF NOT EXISTS MY_OTHER_TABLE (ID TLLAVE NOT NULL,\n    CONSTRAINT PK_MY_TABLE PRIMARY KEY (ID));\n\"\"\"\n\nparsed = sqlparse.parse(SQLDUMP)\nfor i, statement in enumerate(parsed):\n    print(f\"{i}. {statement.get_type()}\")\n
\n
0. CREATE\n1. SELECT\n2. CREATE\n
\n
def get_name(statement: Statement) -> Optional[str]:\n    for token in statement:\n        if isinstance(token, sqlparse.sql.Identifier):\n            return token.value\n    return None \n
\n
for i, statement in enumerate(parsed):\n    statement_type = statement.get_type()\n    if statement_type == \"CREATE\":\n        name = get_name(statement)\n        print(f\"{i}. {statement_type}: {name}\")\n
\n
0. CREATE: MY_TABLE\n2. CREATE: MY_OTHER_TABLE\n
\n

Determinando el tipo de objeto creado

\n

En un caso más general, podemos tener volcados sql con varios tipos de objetos, por ejemplo

\n
CREATE TABLE MY_TABLE (ID INTEGER NOT NULL);\n\nCREATE INDEX MY_INDEX ON MY_TABLE(ID);\n
\n

analizando los tokens de cada statement es posible determinar el tipo de objeto.

\n
SQL = \"\"\"CREATE TABLE MY_TABLE (ID INTEGER NOT NULL);\n\nSELECT * FROM MY_OTHER_TABLE;\n\nCREATE INDEX MY_INDEX ON MY_TABLE(ID);\n\"\"\"\n\nparsed = sqlparse.parse(SQL)\nstatement = parsed[0]\n\n\n
\n
type_found = False \nname_found = False \nfor token in statement:\n    if type_found and name_found:\n        break\n    elif token.ttype is Keyword and not type_found:\n        type_found = True \n        token_type = token.value\n    elif isinstance(token, sqlparse.sql.Identifier) and not name_found:\n        name_found = True \n        token_name = token.value\nprint (f\"tipo: {token_type}, nombre: {token_name}\")\n
\n
tipo: TABLE, nombre: MY_TABLE\n
\n

En el código anterior asumimos que todas las cláusulas son simples, es decir del estilo \"CREATE ....\", si estuvieran agrupadas, por ejemplo \"(CREATE ....)\" el algoritmo ya no es tan simple, pues debe de realizar el escaneo de manera recursiva, un ejemplo de este tipo de algoritmo se encuentra en el repositorio de sqlparse:

\n

https://github.com/andialbrecht/sqlparse/blob/master/examples/extract_table_names.py

\n

Extrayendo el nombre y tipo de objeto creado de un volcado completo

\n
SQL = \"\"\"CREATE TABLE MY_TABLE (ID INTEGER NOT NULL);\n\nSELECT * FROM MY_OTHER_TABLE;\n\nCREATE INDEX MY_INDEX ON MY_TABLE(ID);\n\"\"\"\n\n@dataclass\nclass Metadata:\n    type: str\n    name: str \n    \ndef get_metadata(statement: Statement) -> Metadata:\n    type_found = False \n    name_found = False \n    object_name = None \n    object_type = None \n    for token in statement:\n        if type_found and name_found:\n            break\n        elif token.ttype is Keyword and not type_found:\n            type_found = True \n            object_type = token.value\n        elif isinstance(token, sqlparse.sql.Identifier) and not name_found:\n            name_found = True \n            object_name = token.value\n    return Metadata(name=object_name, type=object_type)\n\n\nparsed = sqlparse.parse(SQL)\n\nfor i, statement in enumerate(parsed):\n    name_found = False \n    if statement.get_type() != \"CREATE\":\n        continue\n    metadata = get_metadata(statement)\n    print(i, metadata)\n
\n
0 Metadata(type='TABLE', name='MY_TABLE')\n2 Metadata(type='INDEX', name='MY_INDEX')\n
\n

Referencias

\n
    \n
  1. https://sqlparse.readthedocs.io/en/latest/
  2. \n
  3. https://github.com/andialbrecht/sqlparse/blob/master/examples/extract_table_names.py
  4. \n
","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/g4q8yp5c8b2h1nlehk01cxt.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/g4q8yp5c8b2h1nlehk01cxt.json new file mode 100644 index 0000000..d45b58d --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/g4q8yp5c8b2h1nlehk01cxt.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"g4q8yp5c8b2h1nlehk01cxt","title":"URL to title","desc":"","updated":1685733865624,"created":1685733525402,"custom":{},"fname":"code.python.url-to-title","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"a8d00487a01c67c50b4be90772a6fadc","links":[],"anchors":{"code":{"type":"header","text":"Code","value":"code","line":12,"column":0,"depth":1},"case-of-use":{"type":"header","text":"Case of use","value":"case-of-use","line":47,"column":0,"depth":1},"references":{"type":"header","text":"References","value":"references","line":67,"column":0,"depth":1}},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

URL to title

\n

Simple program that reads an url and prints the last part of the path as a title.

\n\n

Code

\n
from urllib.parse import urlparse\n\ndef get_last_path(url:str) -> str:\n    # Parse the URL\n    parsed_url = urlparse(url)\n\n    # Get the path from the parsed URL\n    path = parsed_url.path\n\n    # Split the path by slashes and get the last part\n    path_parts = path.split('/')\n    last_part = path_parts[-1]\n\n    return last_part\n\ndef path_to_title(path:str) -> str:\n    return path.replace(\"-\", \" \").title()\n\ndef main():\n    url = input(\"Enter the URL: \")\n    path = get_last_path(url)\n    title = path_to_title(path)\n    print(title)\n\nif __name__ == \"__main__\":\n    while True:\n        try:\n            main()\n        except KeyboardInterrupt:\n            break\n
\n

Case of use

\n

I use this to format references in my mardown documents. For example, given the url

\n
https://stackoverflow.com/questions/76392847/flutter-firebase-to-python-firebase\n
\n

The program outputs

\n
Flutter Firebas To Python Firebase\n
\n

which I use to link to the question, like so:

\n
[Flutter Firebas To Python Firebase](https://stackoverflow.com/questions/76392847/flutter-firebase-to-python-firebase)\n
\n

References

\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/gznvznjzcsize57jmnzk130.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/gznvznjzcsize57jmnzk130.json new file mode 100644 index 0000000..ed5a1a5 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/gznvznjzcsize57jmnzk130.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"gznvznjzcsize57jmnzk130","title":"How to use Argparse","desc":"","updated":1685387842919,"created":1685387710591,"custom":{},"fname":"code.python.argparse","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"9b12efb2ef1955529fe1f30b6a5d77ff","links":[],"anchors":{},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

How to use Argparse

\n

To use argparse in Python for creating a program that asks for a filename and an output directory, you can follow these steps:

\n
    \n
  1. Import the argparse module:
  2. \n
\n
import argparse\n
\n
    \n
  1. Create an instance of the argparse.ArgumentParser class:
  2. \n
\n
parser = argparse.ArgumentParser(description='Process input file and output directory.')\n
\n
    \n
  1. Define the command-line arguments you want to accept:
  2. \n
\n
parser.add_argument('filename', help='Input file name')\nparser.add_argument('output_dir', help='Output directory')\n
\n
    \n
  1. Parse the command-line arguments:
  2. \n
\n
args = parser.parse_args()\n
\n
    \n
  1. Access the values of the arguments entered by the user:
  2. \n
\n
filename = args.filename\noutput_dir = args.output_dir\n
\n
    \n
  1. Use the obtained values in your program as needed.
  2. \n
\n

Here's a complete example that puts it all together:

\n
import argparse\n\ndef main():\n    # Step 2: Create an ArgumentParser instance\n    parser = argparse.ArgumentParser(description='Process input file and output directory.')\n    \n    # Step 3: Define command-line arguments\n    parser.add_argument('filename', help='Input file name')\n    parser.add_argument('output_dir', help='Output directory')\n    \n    # Step 4: Parse the command-line arguments\n    args = parser.parse_args()\n    \n    # Step 5: Access the values of the arguments\n    filename = args.filename\n    output_dir = args.output_dir\n    \n    # Step 6: Use the obtained values\n    print(\"Input file:\", filename)\n    print(\"Output directory:\", output_dir)\n\nif __name__ == '__main__':\n    main()\n
\n

To run this program from the command line, you would provide the filename and output directory as arguments. For example:

\n
$ python your_program.py input_file.txt /path/to/output/\n
\n

Make sure to replace \"your_program.py\" with the actual filename of your Python script, \"input_file.txt\" with the desired filename, and \"/path/to/output/\" with the desired output directory.

\n
\n

Respueta generada automáticamente por ChatGPT4

","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/hwyvw05ski3srgkxy31ym7w.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/hwyvw05ski3srgkxy31ym7w.json new file mode 100644 index 0000000..dd3bb1e --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/hwyvw05ski3srgkxy31ym7w.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"hwyvw05ski3srgkxy31ym7w","title":"Python","desc":"","updated":1685476629841,"created":1685474715630,"custom":{},"fname":"code.python","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"588d5c5ace35f706fa1a0dddcafefdb8","links":[{"from":{"fname":"code","id":"631hw9oh0k8jhc0wlm0joyz","vaultName":"Dendron"},"type":"backlink","position":{"start":{"line":37,"column":1,"offset":597},"end":{"line":37,"column":16,"offset":612},"indent":[]},"value":"code.python"}],"anchors":{},"children":["gznvznjzcsize57jmnzk130","l0u48190oqzxwanw96fjofu","qpru2s8dnotjix9okh0haqe","xerksxa0wc8wxg4wymgrp0i","6zw1kq25fhhqug5i45y1srj","z2m9aey7liflnpmzo3gh61z","g4q8yp5c8b2h1nlehk01cxt"],"parent":"631hw9oh0k8jhc0wlm0joyz","data":{}},"body":"

Python

\n
\nChildren\n
    \n
  1. Como extraer metadatos del volcado de una base de datos
  2. \n
  3. How to use Argparse
  4. \n
  5. Password generator
  6. \n
  7. Projects
  8. \n
  9. Recomended tools to build python software
  10. \n
  11. Remove punctuation symbols from string
  12. \n
  13. URL to title
  14. \n
\n
\nBacklinks\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/j9wmd96lxohstbdavjirhbo.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/j9wmd96lxohstbdavjirhbo.json new file mode 100644 index 0000000..e57500a --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/j9wmd96lxohstbdavjirhbo.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"j9wmd96lxohstbdavjirhbo","title":"Ruby","desc":"","updated":1686590194134,"created":1686590134777,"custom":{},"fname":"code.ruby","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"4bee4e234aa2eb2004b0a5e73ad98b18","links":[],"anchors":{},"children":[],"parent":"631hw9oh0k8jhc0wlm0joyz","data":{}},"body":"

Ruby

\n

Difference between exec, system and backticks?

","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/l0u48190oqzxwanw96fjofu.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/l0u48190oqzxwanw96fjofu.json new file mode 100644 index 0000000..bc765ae --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/l0u48190oqzxwanw96fjofu.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"l0u48190oqzxwanw96fjofu","title":"Password generator","desc":"Como generar passwords","updated":1685387560892,"created":1685385500530,"custom":{},"fname":"code.python.password_generator","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"0de1e1a5b291543cce42965405a65fd4","links":[],"anchors":{"resultado":{"type":"header","text":"Resultado","value":"resultado","line":8,"column":0,"depth":3},"detalles":{"type":"header","text":"Detalles","value":"detalles","line":13,"column":0,"depth":3},"referencias":{"type":"header","text":"Referencias","value":"referencias","line":35,"column":0,"depth":3}},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

Password generator

\n

Resultado

\n\n

Detalles

\n

Necesitamos utilizar los paquetes string y secrets.

\n
from secrets import choice\nimport string\n
\n

A continuación definimos el alfabeto y la función generadora.

\n
ALPHABET = string.ascii_letters + string.digits + string.punctuation\n\ndef password_generator(len:int =10, alphabet: list[str] = ALPHABET) -> str:\n    return \"\".join(choice(alphabet) for i in range(len))\n
\n

Referencias

\n
    \n
  1. \n

    https://docs.python.org/3/library/secrets.html

    \n
  2. \n
  3. \n

    https://gist.github.com/renegarcia/2ba8eebc987ee99c2c4ce5ff2ee75081

    \n
  4. \n
","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/qpru2s8dnotjix9okh0haqe.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/qpru2s8dnotjix9okh0haqe.json new file mode 100644 index 0000000..fdf7ff6 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/qpru2s8dnotjix9okh0haqe.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"qpru2s8dnotjix9okh0haqe","title":"Recomended tools to build python software","desc":"","updated":1685733092275,"created":1685731303027,"custom":{},"fname":"code.python.pre-commit-black-flake8-isort","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"07abecae247c89b3e542bd05fe1e15aa","links":[],"anchors":{},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

Recomended tools to build python software

\n

How To Use Black Flake8 And Isort To Format Python Codes

","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/rzreoc67l24hzknyqbn3a9b.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/rzreoc67l24hzknyqbn3a9b.json new file mode 100644 index 0000000..2ffd0d7 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/rzreoc67l24hzknyqbn3a9b.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"rzreoc67l24hzknyqbn3a9b","title":"Math","desc":"","updated":1685946339687,"created":1685946339687,"custom":{},"fname":"math","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"c5ac822c67cde92807607d8ee7def615","links":[{"from":{"fname":"root","id":"root","vaultName":"Dendron"},"type":"backlink","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"value":"math"}],"anchors":{},"children":["4k7eb68p8o3ctljv6pl0g3q"],"parent":"root","data":{}},"body":"

Math

\n
\nChildren\n
    \n
  1. Stats
  2. \n
\n
\nBacklinks\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/xerksxa0wc8wxg4wymgrp0i.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/xerksxa0wc8wxg4wymgrp0i.json new file mode 100644 index 0000000..02bd674 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/xerksxa0wc8wxg4wymgrp0i.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"xerksxa0wc8wxg4wymgrp0i","title":"Projects","desc":"","updated":1685728709516,"created":1685727428092,"custom":{},"fname":"code.python.projects","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"93424eb32b319bbd7a49b05c8817b332","links":[],"anchors":{"how-to-specify-cli-scripts-in-a-pyproject-file":{"type":"header","text":"How to specify cli scripts in a pyproject file","value":"how-to-specify-cli-scripts-in-a-pyproject-file","line":9,"column":0,"depth":1},"using-poetry":{"type":"header","text":"Using poetry","value":"using-poetry","line":11,"column":0,"depth":2},"with-setup-tools":{"type":"header","text":"With setup tools","value":"with-setup-tools","line":70,"column":0,"depth":2},"references":{"type":"header","text":"References","value":"references","line":103,"column":0,"depth":1}},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

Projects

\n

How to specify cli scripts in a pyproject file

\n

Using poetry

\n

If you use poetry, assuming your project is organized as in this example

\n
[tool.poetry]\nname = \"packagename\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"finswimmer <finswimmer@example.org>\"]\n\n[tool.poetry.scripts]\ncli-script = \"packagename.cli:main\"\n\n[tool.poetry.dependencies]\npython = \"^3.6\"\n\n[tool.poetry.dev-dependencies]\npytest = \"^5.2\"\n\n[build-system]\nrequires = [\"poetry>=1.0\"]\nbuild-backend = \"poetry.masonry.api\"\n
\n

Simply call

\n
poetry install --only-root\n
\n

Where your project should be organized as

\n
packagename\n├── packagename\n│   ├── __init__.py\n│   └── cli.py\n├── tests\n│   ├── __init__.py\n│   └── test_packagename.py\n└── pyproject.toml\n
\n

And the content of the script should resemble this:

\n
#!/usr/bin/env python\n\ndef main():\n  print(\"Hello world\")\n\nif __name__ == '__main__':\n  main()\n
\n
\n

Source: https://stackoverflow.com/questions/62572961/how-to-organize-a-python-project-with-poetry-for-a-command-line-script

\n

With setup tools

\n

If your project is simple, for example like this,

\n
yourprojectdir/\n    setup.py\n    scripts/\n        myscript.sh\n
\n

you may only need to create or append to your setup.py the following:

\n
from setuptools import setup\n# you may need setuptools instead of distutils\n\nsetup(\n    scripts = [\n        'scripts/myscript.sh'\n    ]\n)\n
\n

Then in the shell type

\n
python setup.py install\n
\n
\n

Source: https://stackoverflow.com/questions/874521/python-install-script-to-system

\n

References

\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/z2m9aey7liflnpmzo3gh61z.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/z2m9aey7liflnpmzo3gh61z.json new file mode 100644 index 0000000..83b5014 --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/z2m9aey7liflnpmzo3gh61z.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"z2m9aey7liflnpmzo3gh61z","title":"Remove punctuation symbols from string","desc":"","updated":1685508624240,"created":1685507833820,"custom":{},"fname":"code.python.string_remove_punctuation","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"f09f1bec00c7fbf2ff230e5708240ec3","links":[],"anchors":{"the-problem":{"type":"header","text":"The problem","value":"the-problem","line":8,"column":0,"depth":1},"the-solution":{"type":"header","text":"The solution","value":"the-solution","line":14,"column":0,"depth":1},"references":{"type":"header","text":"References","value":"references","line":37,"column":0,"depth":1}},"children":[],"parent":"hwyvw05ski3srgkxy31ym7w","data":{}},"body":"

Remove punctuation symbols from string

\n

The problem

\n

Often a string with special characters like \"this \\\"string\\\"\" shall be used as input of another program\nwith all the special characters removed. A case of use could be for example if the input string is to be used as\na filename in another program.

\n

The solution

\n

We create a translation table that maps any punctuation symbol into None. Punctuation symbols in python are defined in the module string.

\n
import string\n\ndef remove_special_characters(input_string):\n    # Create a translation table mapping special characters to None\n    translation_table = str.maketrans(\"\", \"\", string.punctuation)\n\n    # Remove special characters using the translation table\n    cleaned_string = input_string.translate(translation_table)\n\n    return cleaned_string\n\n# Example usage\ninput_string = 'Hello! \"How are you?\"'\ncleaned_string = remove_special_characters(input_string)\nprint(cleaned_string)\n
\n

References

\n
    \n
  1. \n

    https://chat.openai.com/share/b634b9a2-42f9-4293-8626-1406122dab7a

    \n
  2. \n
  3. \n

    String module

    \n
  4. \n
","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/zmvhm0w2tjs2njii7b7nrm5.json b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/zmvhm0w2tjs2njii7b7nrm5.json new file mode 100644 index 0000000..0b604db --- /dev/null +++ b/_next/data/X7YNYBEDa6SjIJUoyfWrn/notes/zmvhm0w2tjs2njii7b7nrm5.json @@ -0,0 +1 @@ +{"pageProps":{"note":{"id":"zmvhm0w2tjs2njii7b7nrm5","title":"Stochastic Differential Equations","desc":"","updated":1685767136408,"created":1685765664047,"custom":{},"fname":"math.stats.stochastic-ode","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"daa96951f311f4a65898af30daedffdd","links":[],"anchors":{"stochastic-processes":{"type":"header","text":"Stochastic processes","value":"stochastic-processes","line":8,"column":0,"depth":1},"brownian-movement-or-wiener-process":{"type":"header","text":"Brownian movement or Wiener process","value":"brownian-movement-or-wiener-process","line":18,"column":0,"depth":2},"ito-integral":{"type":"header","text":"Ito integral","value":"ito-integral","line":29,"column":0,"depth":2},"notes":{"type":"header","text":"Notes","value":"notes","line":41,"column":0,"depth":3},"itos-stochastic-differential-equation":{"type":"header","text":"Ito's stochastic differential equation","value":"itos-stochastic-differential-equation","line":49,"column":0,"depth":2},"stochastic-maltus-model":{"type":"header","text":"Stochastic maltus model","value":"stochastic-maltus-model","line":75,"column":0,"depth":3},"numerical-methods":{"type":"header","text":"Numerical methods","value":"numerical-methods","line":97,"column":0,"depth":3},"i-euler-murayama-method":{"type":"header","text":"I. Euler-Murayama method","value":"i-euler-murayama-method","line":99,"column":0,"depth":4},"ii-milstein-method":{"type":"header","text":"II. Milstein method","value":"ii-milstein-method","line":108,"column":0,"depth":4},"references":{"type":"header","text":"References","value":"references","line":121,"column":0,"depth":1}},"children":[],"parent":"4k7eb68p8o3ctljv6pl0g3q","data":{}},"body":"

Stochastic Differential Equations

\n

Stochastic processes

\n

Let (Ω,B,P)(\\Omega, B, P)(Ω,B,P) be a measure space, with Borel σ\\sigmaσ-algebra B, and probability measure P.

\n

Definition A stochastic process is a parametrized collection of random variables:

\n

{Xtt0},\\{X_t \\mid t \\geq 0\\},{Xtt0},

\n

such that each XtX_tXt is a random variable in the measure space.

\n

Brownian movement or Wiener process

\n

Let {wtt0}\\{ w_t \\mid t \\geq 0 \\}{wtt0} be a stochastic process such that wtw_twt is continous in the weak sense with respect to ttt. wtw_twt is a Wiener process if:

\n
    \n
  1. 0t1t20 \\leq t_1 \\leq t_20t1t2 implies\nwt2wt1N(0,t2t1)w_{t_2} - w_{t_1} \\sim N(0, t_2 - t_1)wt2wt1N(0,t2t1)
  2. \n
  3. For any t1<t2<t3t_1 < t_2 < t_3t1<t2<t3, wt3wt2w_{t_3} - w_{t_2}wt3wt2 is independent of wt2wt1w_{t_2} - w_{t_1}wt2wt1.
  4. \n
  5. The probability w0=0w_0 = 0w0=0 satisfies P(w0=0)=1P(w_0 = 0) = 1P(w0=0)=1.
  6. \n
\n

Note: In general, wtw_twt is not differentiable in any point.

\n

Ito integral

\n

Let f(t,xt)=f(t)f(t, x_t) = f(t)f(t,xt)=f(t), with xtx_txt an stochastic process, such that

\n

abE(f(t))dt<.\\int_a^b E(f(t)) dt < \\infty.abE(f(t))dt<∞.

\n

We will say that f(t)f(t)f(t) is a random function. Let\n{a=t1<<tn+1=b}\\{a = t_1 < \\cdots < t_{n + 1} = b\\}{a=t1<<tn+1=b}\nbe a partition of [a,b][a, b][a,b], with equally spaced points, and let Δt=(ba)/n\\Delta t = (b - a)/nΔt=(ba)/n and Δwi=wti+1wti\\Delta w_i = w_{t_{i + 1}} - w_{t_i}Δwi=wti+1wti. Then, Ito's integral is

\n

abf(t)dwt=limi=1nf(ti)Δwi.\\int_a^b f(t) dw_t = \\lim\\sum_{i = 1}^n f(t_i) \\Delta w_i.abf(t)dwt=limi=1nf(ti)Δwi.

\n

Notes

\n\n

limnE((snI)2)=0.\\lim_{n \\to \\infty} E((s_n - I)^2) = 0.limnE((snI)2)=0.

\n\n

Ito's stochastic differential equation

\n

Definition: xtx_txt is a solution of the stochastic differential equation,

\n

dxt=α(xt,t)dt+β(xt,t)dwt,dx_t = \\alpha(x_t,t) dt + \\beta(x_t, t)dw_t,dxt=α(xt,t)dt+β(xt,t)dwt,

\n

if for any t>0t > 0t>0, xtx_txt satisfies

\n

xt=x0+0tα(xt,t)dt+0tβ(xt,t)dwt.x_t = x_0 + \\int_0^t \\alpha(x_t, t)dt + \\int_0^t \\beta(x_t, t)dw_t.xt=x0+0tα(xt,t)dt+0tβ(xt,t)dwt.

\n

Q. Under which conditions can it be proved that the solution to this equation is unique?.

\n

Teorem (chain rule) If xtx_txt is the solution of a stochastic differential equation, and F(x,t)F(x, t)F(x,t) is a real function such that the partial derivatives\ntF,xF,xxF\\partial_t F, \\partial_x F, \\partial_{xx} FtF,xF,xxF\nare continous functions, then

\n

dF(xt,t)=f(xt,t)dt+g(xt,t)dwt,dF(x_t, t) = f(x_t, t) dt + g(x_t, t) dw_t,dF(xt,t)=f(xt,t)dt+g(xt,t)dwt,

\n

where

\n

f(x,t)=tF+α(xt,t)xF+12β2(xt,t)xxFf(x, t) = \\partial_tF + \\alpha(x_t, t) \\partial_x F + \\frac{1}{2} \\beta^2(x_t, t) \\partial_{xx}Ff(x,t)=tF+α(xt,t)xF+21β2(xt,t)xxF

\n

and

\n

g(xt,t)=β(xt,t)xF.g(x_t, t) = \\beta(x_t, t) \\partial_x F.g(xt,t)=β(xt,t)xF.

\n

Stochastic maltus model

\n

Theorem The solution to the stochastic differential equation\ndxt=rxtdt+cxtdwtdx_t = r x_t dt + c x_t dw_tdxt=rxtdt+cxtdwt\nis

\n

xt=x0exp((rc2/2)t+cwt)x_t = x_0\\exp((r - c^2/2)t + c \\cdot w_t)xt=x0exp((rc2/2)t+cwt).

\n

Proof Let F=ln(x)F = \\ln(x)F=ln(x), by the chain rule:

\n

dln(xt)=(rxt1xt+12c2xt2(1xt2))dt+cxt1xtdwt,d\\ln(x_t) = \\left(rx_t\\cdot \\frac{1}{x_t} + \\frac{1}{2} c^2 x_t^2 \\left(- \\frac{1}{x_t^2}\\right)\\right) dt + c x_t \\cdot \\frac{1}{x_t} dw_t,dln(xt)=(rxtxt1+21c2xt2(xt21))dt+cxtxt1dwt,

\n

Simplifying the equation, we get

\n

dln(xt)=(rc22)dt+cdwt.d\\ln(x_t) = \\left(r - \\frac{c^2}{2}\\right) dt + c \\cdot dw_t.dln(xt)=(r2c2)dt+cdwt.

\n

It can be shown that the fundamental theorem of calculus is valid for the stochastic integral of a constant function, therefore, applying this result to the previous equation, we find,

\n

ln(xtx0)=(rc22)t+cwt,\\ln\\left(\\frac{x_t}{x_0}\\right) = \\left(r - \\frac{c^2}{2}\\right) t + c\\cdot w_t,ln(x0xt)=(r2c2)t+cwt,

\n

and the theorem follows.

\n

Numerical methods

\n

I. Euler-Murayama method

\n

dxi=Δxi,dwi=Δwi,dx_i = \\Delta x_i, \\qquad dw_i = \\Delta w_i,dxi=Δxi,dwi=Δwi,

\n

xi+1=xi+α(xi,ti)Δt+β(xi,ti)Δwi.x_{i + 1} = x_i + \\alpha(x_i, t_i) \\Delta t + \\beta(x_i, t_i) \\Delta w_i.xi+1=xi+α(xi,ti)Δt+β(xi,ti)Δwi.

\n

Note that in order to implement this method we should select Δwi\\Delta w_iΔwi randomly with distribution N(0,Δt)N(0, \\Delta t)N(0,Δt).

\n

II. Milstein method

\n

Modify the last equation into

\n

xi+1=xi+α(xi,ti)Δt+β(xi,ti)Δwi+12β(xi,ti)βx(xi,ti)((Δwi)2Δt).x_{i +1} = x_i + \\alpha(x_i, t_i) \\Delta t + \\beta(x_i, t_i) \\Delta w_i + \\frac{1}{2} \\beta(x_i, t_i) \\frac{\\partial \\beta}{\\partial x}(x_i, t_i) \\left((\\Delta w_i)^2 - \\Delta t\\right).xi+1=xi+α(xi,ti)Δt+β(xi,ti)Δwi+21β(xi,ti)xβ(xi,ti)((Δwi)2Δt).

\n

This last method resembles predictor-corrector methods in ordinary differential equations.

\n
\n

Originally published by the author in http://ixxra.github.io/mathannotations/sdes/2014/05/21/stochastic-differential-equations/

\n

References

\n","noteIndex":{"id":"root","title":"Inicio","desc":"","updated":1685946892733,"created":1595961348801,"custom":{"nav_order":0,"permalink":"/"},"fname":"root","type":"note","vault":{"fsPath":".","selfContained":true,"name":"Dendron"},"contentHash":"e61b300237deb393ece8248ab604975d","links":[{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"code","position":{"start":{"line":3,"column":3,"offset":4},"end":{"line":3,"column":11,"offset":12},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"code"}},{"type":"wiki","from":{"fname":"root","id":"root","vaultName":"Dendron"},"value":"math","position":{"start":{"line":4,"column":3,"offset":15},"end":{"line":4,"column":11,"offset":23},"indent":[]},"xvault":false,"sameFile":false,"to":{"fname":"math"}}],"anchors":{},"children":["631hw9oh0k8jhc0wlm0joyz","rzreoc67l24hzknyqbn3a9b"],"parent":null,"data":{},"body":"\n\n* [[code]]\n* [[math]]"},"collectionChildren":null,"customHeadContent":null,"config":{"version":5,"dev":{"enablePreviewV2":true,"enableSelfContainedVaults":true},"commands":{"lookup":{"note":{"selectionMode":"extract","confirmVaultOnCreate":true,"vaultSelectionModeOnCreate":"smart","leaveTrace":false,"bubbleUpCreateNew":true,"fuzzThreshold":0.2}},"randomNote":{},"insertNoteLink":{"aliasMode":"none","enableMultiSelect":false},"insertNoteIndex":{"enableMarker":false},"copyNoteLink":{"aliasMode":"title"},"templateHierarchy":"template"},"workspace":{"vaults":[{"fsPath":"dependencies/github.com/renegarcia/eleventa-db","remote":{"type":"git","url":"git@github.com:renegarcia/eleventa-db.git"},"selfContained":true,"name":"eleventa-db"},{"fsPath":".","selfContained":true,"name":"Dendron"}],"journal":{"dailyDomain":"daily","name":"journal","dateFormat":"y.MM.dd","addBehavior":"childOfDomain"},"scratch":{"name":"scratch","dateFormat":"y.MM.dd.HHmmss","addBehavior":"asOwnDomain"},"task":{"name":"task","dateFormat":"y.MM.dd","addBehavior":"asOwnDomain","statusSymbols":{"":" ","wip":"w","done":"x","assigned":"a","moved":"m","blocked":"b","delegated":"l","dropped":"d","pending":"y"},"taskCompleteStatus":["done","x"],"prioritySymbols":{"H":"high","M":"medium","L":"low"},"todoIntegration":false,"createTaskSelectionType":"selection2link"},"graph":{"zoomSpeed":1,"createStub":false},"enableAutoCreateOnDefinition":false,"enableXVaultWikiLink":false,"enableRemoteVaultInit":true,"enableUserTags":true,"enableHashTags":true,"workspaceVaultSyncMode":"noCommit","enableAutoFoldFrontmatter":false,"enableEditorDecorations":true,"maxPreviewsCached":10,"maxNoteLength":204800,"enableFullHierarchyNoteTitle":false},"preview":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enablePrettyRefs":true,"enableKatex":true,"automaticallyShowPreview":false},"publishing":{"enableFMTitle":true,"enableNoteTitleForLink":true,"enablePrettyRefs":true,"enableKatex":true,"copyAssets":true,"siteHierarchies":["root"],"writeStubs":false,"siteRootDir":"docs","seo":{"title":"Notes","description":"Personal Knowledge Space or Rene Garcia"},"github":{"enableEditLink":true,"editLinkText":"Edit this page on GitHub","editBranch":"main","editViewMode":"tree"},"enableSiteLastModified":true,"enableFrontmatterTags":true,"enableHashesForFMTags":false,"enableRandomlyColoredTags":true,"enableTaskNotes":true,"enablePrettyLinks":true,"searchMode":"search","enableHierarchyDisplay":true,"hierarchyDisplayTitle":"Children","duplicateNoteBehavior":{"action":"useVault","payload":["eleventa-db","Dendron"]},"siteUrl":"https://renegarcia.github.io","assetsPrefix":"/dendron","siteFaviconPath":"favicon.ico","siteIndex":"root"}}},"__N_SSG":true} \ No newline at end of file diff --git a/_next/static/X7YNYBEDa6SjIJUoyfWrn/_buildManifest.js b/_next/static/X7YNYBEDa6SjIJUoyfWrn/_buildManifest.js new file mode 100644 index 0000000..8633860 --- /dev/null +++ b/_next/static/X7YNYBEDa6SjIJUoyfWrn/_buildManifest.js @@ -0,0 +1 @@ +self.__BUILD_MANIFEST=function(s,e){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[s,e,"static/chunks/pages/index-8bd773551d30eee0.js"],"/404":["static/chunks/pages/404-b57e76d696787bc8.js"],"/500":["static/chunks/pages/500-74ddb8962212ea31.js"],"/_error":["static/chunks/pages/_error-a51993fe870ec2c8.js"],"/notes/[id]":[s,e,"static/chunks/pages/notes/[id]-78d472fa3b924116.js"],"/refs/[id]":[s,"static/chunks/pages/refs/[id]-0b8359e94343086b.js"],sortedPages:["/","/404","/500","/_app","/_error","/notes/[id]","/refs/[id]"]}}("static/chunks/935-4dee79e80b8641c6.js","static/chunks/6-50972def09142ee2.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/_next/static/X7YNYBEDa6SjIJUoyfWrn/_ssgManifest.js b/_next/static/X7YNYBEDa6SjIJUoyfWrn/_ssgManifest.js new file mode 100644 index 0000000..b5ccd8c --- /dev/null +++ b/_next/static/X7YNYBEDa6SjIJUoyfWrn/_ssgManifest.js @@ -0,0 +1 @@ +self.__SSG_MANIFEST=new Set(["\u002F","\u002F404","\u002F500","\u002Fnotes\u002F[id]","\u002Frefs\u002F[id]"]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/_next/static/chunks/213.a99245376cf52602.js b/_next/static/chunks/213.a99245376cf52602.js new file mode 100644 index 0000000..8f53a91 --- /dev/null +++ b/_next/static/chunks/213.a99245376cf52602.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[213],{60213:function(u,e,n){n.r(e);var s=n(41799),t=n(85893),c=n(3808).Z.SubMenu;e.default=function(u){return(0,t.jsx)(c,(0,s.Z)({},u))}}}]); \ No newline at end of file diff --git a/_next/static/chunks/540.4659a6b1cb5ab05f.js b/_next/static/chunks/540.4659a6b1cb5ab05f.js new file mode 100644 index 0000000..e06d09e --- /dev/null +++ b/_next/static/chunks/540.4659a6b1cb5ab05f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[540],{92540:function(u,e,n){n.r(e);var s=n(41799),t=n(85893),c=n(3808);e.default=function(u){return(0,t.jsx)(c.Z,(0,s.Z)({},u))}}}]); \ No newline at end of file diff --git a/_next/static/chunks/6-50972def09142ee2.js b/_next/static/chunks/6-50972def09142ee2.js new file mode 100644 index 0000000..6e196a8 --- /dev/null +++ b/_next/static/chunks/6-50972def09142ee2.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6],{37870:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var o=n(85893),r=n(67294);function i({id:e,host:t,repo:i,repoId:a,category:l,categoryId:p,mapping:c,term:s,strict:u,reactionsEnabled:h,emitMetadata:d,inputPosition:f,theme:g,lang:m,loading:v}){let[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{y||(n.e(891).then(n.bind(n,32891)),k(!0))},[]),y?(0,o.jsx)("giscus-widget",{id:e,host:t,repo:i,repoid:a,category:l,categoryid:p,mapping:c,term:s,strict:u,reactionsenabled:h,emitmetadata:d,inputposition:f,theme:g,lang:m,loading:v}):null}},88351:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var o,r,i=n(87462),a=n(4942),l=n(15671),p=n(43144),c=n(97326),s=n(32531),u=n(73568),h=n(67294),d=n(94184),f=n.n(d),g=n(30845),m=n(64019),v=n(71002),y=n(98423),k=n(48555),G=n(61975),b=n(74902),E=n(75164);function w(){return function(e,t,n){var o=n.value,r=!1;return{configurable:!0,get:function(){if(r||this===e.prototype||this.hasOwnProperty(t))return o;var n,i,a,l=(n=o.bind(this),(a=function(){if(null==i){for(var e,t=arguments.length,o=Array(t),r=0;re.top-n)return n+t.top}function O(e,t,n){if(void 0!==n&&t.bottom=0;l--)(r=e[l])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};function A(){return"undefined"!=typeof window?window:null}(o=r||(r={}))[o.None=0]="None",o[o.Prepare=1]="Prepare";var Z=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){var e;return(0,l.Z)(this,n),e=t.apply(this,arguments),e.state={status:r.None,lastAffix:!1,prevTarget:null},e.getOffsetTop=function(){var t=e.props,n=t.offsetBottom,o=t.offsetTop;return void 0===n&&void 0===o?0:o},e.getOffsetBottom=function(){return e.props.offsetBottom},e.savePlaceholderNode=function(t){e.placeholderNode=t},e.saveFixedNode=function(t){e.fixedNode=t},e.measure=function(){var t=e.state,n=t.status,o=t.lastAffix,i=e.props.onChange,a=e.getTargetFunc();if(n===r.Prepare&&e.fixedNode&&e.placeholderNode&&a){var l=e.getOffsetTop(),p=e.getOffsetBottom(),c=a();if(c){var s={status:r.None},u=x(c),h=x(e.placeholderNode),d=T(h,u,l),f=O(h,u,p);void 0!==d?(s.affixStyle={position:"fixed",top:d,width:h.width,height:h.height},s.placeholderStyle={width:h.width,height:h.height}):void 0!==f&&(s.affixStyle={position:"fixed",bottom:f,width:h.width,height:h.height},s.placeholderStyle={width:h.width,height:h.height}),s.lastAffix=!!s.affixStyle,i&&o!==s.lastAffix&&i(s.lastAffix),e.setState(s)}}},e.prepareMeasure=function(){e.setState({status:r.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e}return(0,p.Z)(n,[{key:"getTargetFunc",value:function(){var e=this.context.getTargetContainer,t=this.props.target;return void 0!==t?t:e||A}},{key:"componentDidMount",value:function(){var e=this,t=this.getTargetFunc();t&&(this.timeout=setTimeout(function(){N(t(),e),e.updatePosition()}))}},{key:"componentDidUpdate",value:function(e){var t=this.state.prevTarget,n=this.getTargetFunc(),o=(null==n?void 0:n())||null;t!==o&&(L(this),o&&(N(o,this),this.updatePosition()),this.setState({prevTarget:o})),(e.offsetTop!==this.props.offsetTop||e.offsetBottom!==this.props.offsetBottom)&&this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout),L(this),this.updatePosition.cancel(),this.lazyUpdatePosition.cancel()}},{key:"updatePosition",value:function(){this.prepareMeasure()}},{key:"lazyUpdatePosition",value:function(){var e=this.getTargetFunc(),t=this.state.affixStyle;if(e&&t){var n=this.getOffsetTop(),o=this.getOffsetBottom(),r=e();if(r&&this.placeholderNode){var i=x(r),a=x(this.placeholderNode),l=T(a,i,n),p=O(a,i,o);if(void 0!==l&&t.top===l||void 0!==p&&t.bottom===p)return}}this.prepareMeasure()}},{key:"render",value:function(){var e=this,t=this.context.getPrefixCls,n=this.state,o=n.affixStyle,r=n.placeholderStyle,l=this.props,p=l.prefixCls,c=l.children,s=f()((0,a.Z)({},t("affix",p),!!o)),u=(0,y.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange"]);return h.createElement(k.Z,{onResize:function(){e.updatePosition()}},h.createElement("div",(0,i.Z)({},u,{ref:this.savePlaceholderNode}),o&&h.createElement("div",{style:r,"aria-hidden":"true"}),h.createElement("div",{className:s,ref:this.saveFixedNode,style:o},h.createElement(k.Z,{onResize:function(){e.updatePosition()}},c))))}}]),n}(h.Component);function I(e){return null!=e&&e===e.window}function _(e,t){if("undefined"==typeof window)return 0;var n,o=t?"scrollTop":"scrollLeft",r=0;return I(e)?r=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?r=e.documentElement[o]:e&&(r=e[o]),e&&!I(e)&&"number"!=typeof r&&(r=null===(n=(e.ownerDocument||e).documentElement)||void 0===n?void 0:n[o]),r}Z.contextType=G.E_,S([w()],Z.prototype,"updatePosition",null),S([w()],Z.prototype,"lazyUpdatePosition",null);var H=h.createContext(null);function D(){return window}function W(e,t){if(!e.getClientRects().length)return 0;var n=e.getBoundingClientRect();return n.width||n.height?t===window?(t=e.ownerDocument.documentElement,n.top-t.clientTop):n.top-t.getBoundingClientRect().top:(0,n.top)}var M=/#([\S ]+)$/,V=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){var e;return(0,l.Z)(this,n),e=t.apply(this,arguments),e.state={activeLink:null},e.wrapperRef=h.createRef(),e.links=[],e.registerLink=function(t){e.links.includes(t)||e.links.push(t)},e.unregisterLink=function(t){var n=e.links.indexOf(t);-1!==n&&e.links.splice(n,1)},e.getContainer=function(){var t,n=e.context.getTargetContainer;return(e.props.getContainer||n||D)()},e.handleScrollTo=function(t){var n=e.props,o=n.offsetTop,r=n.targetOffset;e.setCurrentActiveLink(t);var i=e.getContainer(),a=_(i,!0),l=M.exec(t);if(l){var p=document.getElementById(l[1]);if(p){var c=W(p,i),s=a+c;s-=void 0!==r?r:o||0,e.animating=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getContainer,o=t.callback,r=t.duration,i=void 0===r?450:r,a=(void 0===n?function(){return window}:n)(),l=_(a,!0),p=Date.now(),c=function t(){var n,r,c,s,u,h=Date.now()-p,d=(n=h>i?i:h,u=e-l,(n/=i/2)<1?u/2*n*n*n+l:u/2*((n-=2)*n*n+2)+l);I(a)?a.scrollTo(window.pageXOffset,d):a instanceof HTMLDocument||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=d:a.scrollTop=d,h0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=[],o=this.getContainer();return(this.links.forEach(function(r){var i=M.exec(r.toString());if(i){var a=document.getElementById(i[1]);if(a){var l=W(a,o);le.top?t:e}).link:""}},{key:"render",value:function(){var e=this.context,t=e.getPrefixCls,n=e.direction,o=this.props,r=o.prefixCls,l=o.className,p=o.style,c=o.offsetTop,s=o.affix,u=o.showInkInFixed,d=o.children,g=o.onClick,m=this.state.activeLink,v=t("anchor",r);this.prefixCls=v;var y=f()("".concat(v,"-ink-ball"),{visible:m}),k=f()("".concat(v,"-wrapper"),(0,a.Z)({},"".concat(v,"-rtl"),"rtl"===n),void 0===l?"":l),G=f()(v,(0,a.Z)({},"".concat(v,"-fixed"),!s&&!u)),b=(0,i.Z)({maxHeight:c?"calc(100vh - ".concat(c,"px)"):"100vh"},p),E=h.createElement("div",{ref:this.wrapperRef,className:k,style:b},h.createElement("div",{className:G},h.createElement("div",{className:"".concat(v,"-ink")},h.createElement("span",{className:y,ref:this.saveInkNode})),d)),w=this.getMemoizedContextValue(m,g);return h.createElement(H.Provider,{value:w},s?h.createElement(Z,{offsetTop:c,target:this.getContainer},E):E)}}]),n}(h.Component);V.defaultProps={affix:!0,showInkInFixed:!1},V.contextType=G.E_;var B=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){var e;return(0,l.Z)(this,n),e=t.apply(this,arguments),e.handleClick=function(t){var n=e.context,o=n.scrollTo,r=n.onClick,i=e.props,a=i.href,l=i.title;null==r||r(t,{title:l,href:a}),o(a)},e.renderAnchorLink=function(t){var n=t.getPrefixCls,o=e.props,r=o.prefixCls,i=o.href,l=o.title,p=o.children,c=o.className,s=o.target,u=n("anchor",r),d=e.context.activeLink===i,g=f()("".concat(u,"-link"),(0,a.Z)({},"".concat(u,"-link-active"),d),c),m=f()("".concat(u,"-link-title"),(0,a.Z)({},"".concat(u,"-link-title-active"),d));return h.createElement("div",{className:g},h.createElement("a",{className:m,href:i,title:"string"==typeof l?l:"",target:s,onClick:e.handleClick},l),p)},e}return(0,p.Z)(n,[{key:"componentDidMount",value:function(){this.context.registerLink(this.props.href)}},{key:"componentDidUpdate",value:function(e){var t=e.href,n=this.props.href;t!==n&&(this.context.unregisterLink(t),this.context.registerLink(n))}},{key:"componentWillUnmount",value:function(){this.context.unregisterLink(this.props.href)}},{key:"render",value:function(){return h.createElement(G.C,null,this.renderAnchorLink)}}]),n}(h.Component);B.defaultProps={href:"#"},B.contextType=H,V.Link=B;var R=V},2962:function(e,t,n){"use strict";n.d(t,{PB:function(){return u}});var o=n(9008),r=n.n(o),i=n(67294);function a(){return(a=Object.assign||function(e){for(var t=1;t0&&e.languageAlternates.forEach(function(e){s.push(i.createElement("link",{rel:"alternate",key:"languageAlternate-"+e.hrefLang,hrefLang:e.hrefLang,href:e.href}))}),e.twitter&&(e.twitter.cardType&&s.push(i.createElement("meta",{key:"twitter:card",name:"twitter:card",content:e.twitter.cardType})),e.twitter.site&&s.push(i.createElement("meta",{key:"twitter:site",name:"twitter:site",content:e.twitter.site})),e.twitter.handle&&s.push(i.createElement("meta",{key:"twitter:creator",name:"twitter:creator",content:e.twitter.handle}))),e.facebook&&e.facebook.appId&&s.push(i.createElement("meta",{key:"fb:app_id",property:"fb:app_id",content:e.facebook.appId})),(null!=(t=e.openGraph)&&t.title||e.title)&&s.push(i.createElement("meta",{key:"og:title",property:"og:title",content:(null==(r=e.openGraph)?void 0:r.title)||u})),(null!=(n=e.openGraph)&&n.description||e.description)&&s.push(i.createElement("meta",{key:"og:description",property:"og:description",content:(null==(l=e.openGraph)?void 0:l.description)||e.description})),e.openGraph){if((e.openGraph.url||e.canonical)&&s.push(i.createElement("meta",{key:"og:url",property:"og:url",content:e.openGraph.url||e.canonical})),e.openGraph.type){var T=e.openGraph.type.toLowerCase();s.push(i.createElement("meta",{key:"og:type",property:"og:type",content:T})),"profile"===T&&e.openGraph.profile?(e.openGraph.profile.firstName&&s.push(i.createElement("meta",{key:"profile:first_name",property:"profile:first_name",content:e.openGraph.profile.firstName})),e.openGraph.profile.lastName&&s.push(i.createElement("meta",{key:"profile:last_name",property:"profile:last_name",content:e.openGraph.profile.lastName})),e.openGraph.profile.username&&s.push(i.createElement("meta",{key:"profile:username",property:"profile:username",content:e.openGraph.profile.username})),e.openGraph.profile.gender&&s.push(i.createElement("meta",{key:"profile:gender",property:"profile:gender",content:e.openGraph.profile.gender}))):"book"===T&&e.openGraph.book?(e.openGraph.book.authors&&e.openGraph.book.authors.length&&e.openGraph.book.authors.forEach(function(e,t){s.push(i.createElement("meta",{key:"book:author:0"+t,property:"book:author",content:e}))}),e.openGraph.book.isbn&&s.push(i.createElement("meta",{key:"book:isbn",property:"book:isbn",content:e.openGraph.book.isbn})),e.openGraph.book.releaseDate&&s.push(i.createElement("meta",{key:"book:release_date",property:"book:release_date",content:e.openGraph.book.releaseDate})),e.openGraph.book.tags&&e.openGraph.book.tags.length&&e.openGraph.book.tags.forEach(function(e,t){s.push(i.createElement("meta",{key:"book:tag:0"+t,property:"book:tag",content:e}))})):"article"===T&&e.openGraph.article?(e.openGraph.article.publishedTime&&s.push(i.createElement("meta",{key:"article:published_time",property:"article:published_time",content:e.openGraph.article.publishedTime})),e.openGraph.article.modifiedTime&&s.push(i.createElement("meta",{key:"article:modified_time",property:"article:modified_time",content:e.openGraph.article.modifiedTime})),e.openGraph.article.expirationTime&&s.push(i.createElement("meta",{key:"article:expiration_time",property:"article:expiration_time",content:e.openGraph.article.expirationTime})),e.openGraph.article.authors&&e.openGraph.article.authors.length&&e.openGraph.article.authors.forEach(function(e,t){s.push(i.createElement("meta",{key:"article:author:0"+t,property:"article:author",content:e}))}),e.openGraph.article.section&&s.push(i.createElement("meta",{key:"article:section",property:"article:section",content:e.openGraph.article.section})),e.openGraph.article.tags&&e.openGraph.article.tags.length&&e.openGraph.article.tags.forEach(function(e,t){s.push(i.createElement("meta",{key:"article:tag:0"+t,property:"article:tag",content:e}))})):("video.movie"===T||"video.episode"===T||"video.tv_show"===T||"video.other"===T)&&e.openGraph.video&&(e.openGraph.video.actors&&e.openGraph.video.actors.length&&e.openGraph.video.actors.forEach(function(e,t){e.profile&&s.push(i.createElement("meta",{key:"video:actor:0"+t,property:"video:actor",content:e.profile})),e.role&&s.push(i.createElement("meta",{key:"video:actor:role:0"+t,property:"video:actor:role",content:e.role}))}),e.openGraph.video.directors&&e.openGraph.video.directors.length&&e.openGraph.video.directors.forEach(function(e,t){s.push(i.createElement("meta",{key:"video:director:0"+t,property:"video:director",content:e}))}),e.openGraph.video.writers&&e.openGraph.video.writers.length&&e.openGraph.video.writers.forEach(function(e,t){s.push(i.createElement("meta",{key:"video:writer:0"+t,property:"video:writer",content:e}))}),e.openGraph.video.duration&&s.push(i.createElement("meta",{key:"video:duration",property:"video:duration",content:e.openGraph.video.duration.toString()})),e.openGraph.video.releaseDate&&s.push(i.createElement("meta",{key:"video:release_date",property:"video:release_date",content:e.openGraph.video.releaseDate})),e.openGraph.video.tags&&e.openGraph.video.tags.length&&e.openGraph.video.tags.forEach(function(e,t){s.push(i.createElement("meta",{key:"video:tag:0"+t,property:"video:tag",content:e}))}),e.openGraph.video.series&&s.push(i.createElement("meta",{key:"video:series",property:"video:series",content:e.openGraph.video.series})))}e.defaultOpenGraphImageWidth&&(p.defaultOpenGraphImageWidth=e.defaultOpenGraphImageWidth),e.defaultOpenGraphImageHeight&&(p.defaultOpenGraphImageHeight=e.defaultOpenGraphImageHeight),e.openGraph.images&&e.openGraph.images.length&&s.push.apply(s,c("image",e.openGraph.images,{defaultWidth:p.defaultOpenGraphImageWidth,defaultHeight:p.defaultOpenGraphImageHeight})),e.defaultOpenGraphVideoWidth&&(p.defaultOpenGraphVideoWidth=e.defaultOpenGraphVideoWidth),e.defaultOpenGraphVideoHeight&&(p.defaultOpenGraphVideoHeight=e.defaultOpenGraphVideoHeight),e.openGraph.videos&&e.openGraph.videos.length&&s.push.apply(s,c("video",e.openGraph.videos,{defaultWidth:p.defaultOpenGraphVideoWidth,defaultHeight:p.defaultOpenGraphVideoHeight})),e.openGraph.locale&&s.push(i.createElement("meta",{key:"og:locale",property:"og:locale",content:e.openGraph.locale})),e.openGraph.site_name&&s.push(i.createElement("meta",{key:"og:site_name",property:"og:site_name",content:e.openGraph.site_name}))}return e.canonical&&s.push(i.createElement("link",{rel:"canonical",href:e.canonical,key:"canonical"})),e.additionalMetaTags&&e.additionalMetaTags.length>0&&e.additionalMetaTags.forEach(function(e){var t,n,o;s.push(i.createElement("meta",a({key:"meta:"+(null!=(t=null!=(n=null!=(o=e.keyOverride)?o:e.name)?n:e.property)?t:e.httpEquiv)},e)))}),null!=(o=e.additionalLinkTags)&&o.length&&e.additionalLinkTags.forEach(function(e){var t;s.push(i.createElement("link",a({key:"link"+(null!=(t=e.keyOverride)?t:e.href)+e.rel},e)))}),s};!function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.title,n=e.titleTemplate,o=e.defaultTitle,a=e.dangerouslyDisableGooglebot,l=e.dangerouslySetAllPagesToNoIndex,p=e.dangerouslySetAllPagesToNoFollow,c=e.description,u=e.canonical,h=e.facebook,d=e.openGraph,f=e.additionalMetaTags,g=e.twitter,m=e.defaultOpenGraphImageWidth,v=e.defaultOpenGraphImageHeight,y=e.defaultOpenGraphVideoWidth,k=e.defaultOpenGraphVideoHeight,G=e.mobileAlternate,b=e.languageAlternates,E=e.additionalLinkTags;return i.createElement(r(),null,s({title:t,titleTemplate:n,defaultTitle:o,dangerouslySetAllPagesToNoIndex:void 0!==l&&l,dangerouslySetAllPagesToNoFollow:void 0!==p&&p,description:c,canonical:u,facebook:h,openGraph:d,additionalMetaTags:f,twitter:g,defaultOpenGraphImageWidth:m,defaultOpenGraphImageHeight:v,defaultOpenGraphVideoWidth:y,defaultOpenGraphVideoHeight:k,mobileAlternate:G,languageAlternates:b,additionalLinkTags:E,dangerouslyDisableGooglebot:void 0!==a&&a}))},t}(i.Component);var u=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.title,n=e.noindex,o=e.nofollow,a=e.robotsProps,l=e.description,p=e.canonical,c=e.openGraph,u=e.facebook,h=e.twitter,d=e.additionalMetaTags,f=e.titleTemplate,g=e.mobileAlternate,m=e.languageAlternates,v=e.additionalLinkTags,y=e.disableGooglebot;return i.createElement(r(),null,s({title:t,noindex:void 0!==n&&n,nofollow:o,robotsProps:a,description:l,canonical:p,facebook:u,openGraph:c,additionalMetaTags:d,twitter:h,titleTemplate:f,mobileAlternate:g,languageAlternates:m,additionalLinkTags:v,disableGooglebot:y}))},t}(i.Component)},4298:function(e,t,n){e.exports=n(20699)},99534:function(e,t,n){"use strict";function o(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}n.d(t,{Z:function(){return o}})}}]); \ No newline at end of file diff --git a/_next/static/chunks/798.742f113b527e9786.js b/_next/static/chunks/798.742f113b527e9786.js new file mode 100644 index 0000000..a8ebfbe --- /dev/null +++ b/_next/static/chunks/798.742f113b527e9786.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[798],{42798:function(e,u,n){n.r(u);var t=n(41799),s=n(85893),c=n(3808);u.default=function(e){return(0,s.jsx)(c.Z.Item,(0,t.Z)({},e))}}}]); \ No newline at end of file diff --git a/_next/static/chunks/891.679e09cefaa741ef.js b/_next/static/chunks/891.679e09cefaa741ef.js new file mode 100644 index 0000000..35b6bce --- /dev/null +++ b/_next/static/chunks/891.679e09cefaa741ef.js @@ -0,0 +1,42 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[891],{32891:function(t,e,i){i.r(e),i.d(e,{GiscusWidget:function(){return tP}});/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ let s=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;class o{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(s&&void 0===t){let i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}}let l=t=>new o("string"==typeof t?t:t+"",void 0,r),h=(t,...e)=>{let i=1===t.length?t[0]:e.reduce((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new o(i,t,r)},a=(t,e)=>{s?t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(e=>{let i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)})},d=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return l(e)})(t):t,c=window.trustedTypes,u=c?c.emptyScript:"",p=window.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?u:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},$=(t,e)=>e!==t&&(e==e||t==t),v={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:$};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let s=this._$Ep(i,e);void 0!==s&&(this._$Ev.set(s,i),t.push(s))}),t}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){let r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(d(s))}else void 0!==t&&e.push(d(t));return e}static _$Ep(t,e){let i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach(t=>t(this))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return a(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=v){var s,r;let n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){let o=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:_.toAttribute)(e,i.type);this._$El=t,null==o?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,e){var i,s;let r=this.constructor,n=r._$Ev.get(t);if(void 0!==n&&this._$El!==n){let o=r.getPropertyOptions(n),l=o.converter,h=null!==(s=null!==(i=null==l?void 0:l.fromAttribute)&&void 0!==i?i:"function"==typeof l?l:null)&&void 0!==s?s:_.fromAttribute;this._$El=n,this[n]=h(e,o.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||$)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1,i=this._$AL;try{(e=this.shouldUpdate(i))?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach(t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)}),this.update(i)):this._$Ek()}catch(s){throw e=!1,this._$Ek(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach(t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==p||p({ReactiveElement:g}),(null!==(tA=globalThis.reactiveElementVersions)&&void 0!==tA?tA:globalThis.reactiveElementVersions=[]).push("1.3.4");let f=globalThis.trustedTypes,m=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,A=`lit$${(Math.random()+"").slice(9)}$`,y="?"+A,S=`<${y}>`,E=document,b=(t="")=>E.createComment(t),w=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,U=t=>C(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,T=/-->/g,N=/>/g,O=RegExp(`>|[ +\f\r](?:([^\\s"'>=/]+)([ +\f\r]*=[ +\f\r]*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,M=/"/g,R=/^(?:script|style|textarea|title)$/i,H=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),k=H(1),x=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),z=new WeakMap,D=(t,e,i)=>{var s,r;let n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e,o=n._$litPart$;if(void 0===o){let l=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;n._$litPart$=o=new K(e.insertBefore(b(),l),l,void 0,null!=i?i:{})}return o._$AI(t),o},Y=E.createTreeWalker(E,129,null,!1),j=(t,e)=>{let i=t.length-1,s=[],r,n=2===e?"":"",o=P;for(let l=0;l"===d[0]?(o=null!=r?r:P,c=-1):void 0===d[1]?c=-2:(c=o.lastIndex-d[2].length,a=d[1],o=void 0===d[3]?O:'"'===d[3]?M:I):o===M||o===I?o=O:o===T||o===N?o=P:(o=O,r=void 0);let p=o===O&&t[l+1].startsWith("/>")?" ":"";n+=o===P?h+S:c>=0?(s.push(a),h.slice(0,c)+"$lit$"+h.slice(c)+A+p):h+A+(-2===c?(s.push(void 0),l):p)}let _=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(_):_,s]};class B{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,n=0,o=t.length-1,l=this.parts,[h,a]=j(t,e);if(this.el=B.createElement(h,i),Y.currentNode=this.el.content,2===e){let d=this.el.content,c=d.firstChild;c.remove(),d.append(...c.childNodes)}for(;null!==(s=Y.nextNode())&&l.length0){s.textContent=f?f.emptyScript:"";for(let E=0;E2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){let r=this.strings,n=!1;if(void 0===r)t=G(this,t,e,0),(n=!w(t)||t!==this._$AH&&t!==x)&&(this._$AH=t);else{let o=t,l,h;for(t=r[0],l=0;l"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}}:{...e,finisher(i){i.createProperty(e.key,t)}};function ts(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):ti(t,e)}null===(tb=window.HTMLSlotElement)||void 0===tb||tb.prototype.assignedElements;/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ let tr=t=>void 0===t.strings,tn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},to=t=>(...e)=>({_$litDirective$:t,values:e});class tl{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ let th=(t,e)=>{var i,s;let r=t._$AN;if(void 0===r)return!1;for(let n of r)null===(s=(i=n)._$AO)||void 0===s||s.call(i,e,!1),th(n,e);return!0},ta=t=>{let e,i;do{if(void 0===(e=t._$AM))break;(i=e._$AN).delete(t),t=e}while((null==i?void 0:i.size)===0)},td=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),tp(e)}};function tc(t){void 0!==this._$AN?(ta(this),this._$AM=t,td(this)):this._$AM=t}function tu(t,e=!1,i=0){let s=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size){if(e){if(Array.isArray(s))for(let n=i;n{var e,i,s,r;t.type==tn.CHILD&&(null!==(e=(s=t)._$AP)&&void 0!==e||(s._$AP=tu),null!==(i=(r=t)._$AQ)&&void 0!==i||(r._$AQ=tc))};class t_ extends tl{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),td(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,s;t!==this.isConnected&&(this.isConnected=t,t?null===(i=this.reconnected)||void 0===i||i.call(this):null===(s=this.disconnected)||void 0===s||s.call(this)),e&&(th(this,t),ta(this))}setValue(t){if(tr(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ let t$=()=>new tv;class tv{}let tg=new WeakMap,tf=to(class extends t_{render(t){return L}update(t,[e]){var i;let s=e!==this.Y;return s&&void 0!==this.Y&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=e,this.dt=null===(i=t.options)||void 0===i?void 0:i.host,this.rt(this.ct=t.element)),L}rt(t){var e;if("function"==typeof this.Y){let i=null!==(e=this.dt)&&void 0!==e?e:globalThis,s=tg.get(i);void 0===s&&(s=new WeakMap,tg.set(i,s)),void 0!==s.get(this.Y)&&this.Y.call(this.dt,void 0),s.set(this.Y,t),void 0!==t&&this.Y.call(this.dt,t)}else this.Y.value=t}get lt(){var t,e,i;return"function"==typeof this.Y?null===(e=tg.get(null!==(t=this.dt)&&void 0!==t?t:globalThis))||void 0===e?void 0:e.get(this.Y):null===(i=this.Y)||void 0===i?void 0:i.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var tm,tA,ty,tS,tE,tb,tw=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,tU=(t,e,i,s)=>{for(var r,n=s>1?void 0:s?tC(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(n=(s?r(e,i,n):r(n))||n);return s&&n&&tw(e,i,n),n};let tP=class extends tt{constructor(){super(),this.GISCUS_SESSION_KEY="giscus-session",this.GISCUS_DEFAULT_HOST="https://giscus.app",this.ERROR_SUGGESTION="Please consider reporting this error at https://github.com/giscus/giscus/issues/new.",this.__session="",this._iframeRef=t$(),this.messageEventHandler=this.handleMessageEvent.bind(this),this.host=this.GISCUS_DEFAULT_HOST,this.strict="0",this.reactionsEnabled="1",this.emitMetadata="0",this.inputPosition="bottom",this.theme="light",this.lang="en",this.loading="eager",this.setupSession(),window.addEventListener("message",this.messageEventHandler)}get iframeRef(){return this._iframeRef.value}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.messageEventHandler)}_formatError(t){return`[giscus] An error occurred. Error message: "${t}".`}setupSession(){let t=location.href,e=new URL(t),i=localStorage.getItem(this.GISCUS_SESSION_KEY),s=e.searchParams.get("giscus")||"";if(s){localStorage.setItem(this.GISCUS_SESSION_KEY,JSON.stringify(s)),this.__session=s,e.searchParams.delete("giscus"),history.replaceState(void 0,document.title,e.toString());return}if(i)try{this.__session=JSON.parse(i||"")||""}catch(r){this.__session="",localStorage.removeItem(this.GISCUS_SESSION_KEY),console.warn(`${this._formatError(null==r?void 0:r.message)} Session has been cleared.`)}}handleMessageEvent(t){if(t.origin!==this.host)return;let{data:e}=t;if(!("object"==typeof e&&e.giscus)||(this.iframeRef&&e.giscus.resizeHeight&&(this.iframeRef.style.height=`${e.giscus.resizeHeight}px`),!e.giscus.error))return;let i=e.giscus.error;if(i.includes("Bad credentials")||i.includes("Invalid state value")){if(null!==localStorage.getItem(this.GISCUS_SESSION_KEY)){localStorage.removeItem(this.GISCUS_SESSION_KEY),this.__session="",console.warn(`${this._formatError(i)} Session has been cleared.`),this.update(new Map);return}console.error(`${this._formatError(i)} No session is stored initially. ${this.ERROR_SUGGESTION}`)}if(i.includes("Discussion not found")){console.warn(`[giscus] ${i}. A new discussion will be created if a comment/reaction is submitted.`);return}console.error(`${this._formatError(i)} ${this.ERROR_SUGGESTION}`)}sendMessage(t){var e,i;null==(i=null==(e=this.iframeRef)?void 0:e.contentWindow)||i.postMessage({giscus:t},this.host)}updateConfig(){let t={setConfig:{repo:this.repo,repoId:this.repoId,category:this.category,categoryId:this.categoryId,term:this.getTerm(),number:+this.getNumber(),strict:"1"===this.strict,reactionsEnabled:"1"===this.reactionsEnabled,emitMetadata:"1"===this.emitMetadata,inputPosition:this.inputPosition,theme:this.theme,lang:this.lang}};this.sendMessage(t)}requestUpdate(t,e,i){if(!this.hasUpdated||"host"===t){super.requestUpdate(t,e,i);return}this.updateConfig()}getMetaContent(t,e=!1){let i=e?`meta[property='og:${t}'],`:"",s=document.querySelector(i+`meta[name='${t}']`);return s?s.content:""}_getCleanedUrl(){let t=new URL(location.href);return t.searchParams.delete("giscus"),t}getTerm(){switch(this.mapping){case"url":return`${this._getCleanedUrl()}`;case"title":return document.title;case"og:title":return this.getMetaContent("title",!0);case"specific":return this.term||"";case"number":return"";default:return location.pathname.length<2?"index":location.pathname.substring(1).replace(/\.\w+$/,"")}}getNumber(){return"number"===this.mapping&&this.term||""}getIframeSrc(){let t=this._getCleanedUrl().toString(),e=`${t}${this.id?"#"+this.id:""}`,i=this.getMetaContent("description",!0),s=this.getMetaContent("giscus:backlink")||t,r={origin:e,session:this.__session,repo:this.repo,repoId:this.repoId||"",category:this.category||"",categoryId:this.categoryId||"",term:this.getTerm(),number:this.getNumber(),strict:this.strict,reactionsEnabled:this.reactionsEnabled,emitMetadata:this.emitMetadata,inputPosition:this.inputPosition,theme:this.theme,description:i,backLink:s},n=this.lang?`/${this.lang}`:"",o=new URLSearchParams(r);return`${this.host}${n}/widget?${o}`}render(){return k` + + `}};tP.styles=h` + :host, + iframe { + width: 100%; + border: none; + color-scheme: normal; + min-height: 150px; + } + `,tU([ts({reflect:!0})],tP.prototype,"host",2),tU([ts({reflect:!0})],tP.prototype,"repo",2),tU([ts({reflect:!0})],tP.prototype,"repoId",2),tU([ts({reflect:!0})],tP.prototype,"category",2),tU([ts({reflect:!0})],tP.prototype,"categoryId",2),tU([ts({reflect:!0})],tP.prototype,"mapping",2),tU([ts({reflect:!0})],tP.prototype,"term",2),tU([ts({reflect:!0})],tP.prototype,"strict",2),tU([ts({reflect:!0})],tP.prototype,"reactionsEnabled",2),tU([ts({reflect:!0})],tP.prototype,"emitMetadata",2),tU([ts({reflect:!0})],tP.prototype,"inputPosition",2),tU([ts({reflect:!0})],tP.prototype,"theme",2),tU([ts({reflect:!0})],tP.prototype,"lang",2),tU([ts({reflect:!0})],tP.prototype,"loading",2),tP=tU([(tm="giscus-widget",t=>{var e,i;return"function"==typeof t?(window.customElements.define(tm,t),t):((t,e)=>{let{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(tm,t)})],tP)}}]); \ No newline at end of file diff --git a/_next/static/chunks/935-4dee79e80b8641c6.js b/_next/static/chunks/935-4dee79e80b8641c6.js new file mode 100644 index 0000000..37289a1 --- /dev/null +++ b/_next/static/chunks/935-4dee79e80b8641c6.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[935],{99960:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,(r=n=t.ElementType||(t.ElementType={})).Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype",t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},97790:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=d;var h=function(e){function t(t){return e.call(this,a.ElementType.Root,t)||this}return i(t,e),t}(d);t.Document=h;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var o=e.call(this,i,r)||this;return o.name=t,o.attribs=n,o}return i(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}})},enumerable:!1,configurable:!0}),t}(d);function g(e){return(0,a.isTag)(e)}function y(e){return e.type===a.ElementType.CDATA}function v(e){return e.type===a.ElementType.Text}function x(e){return e.type===a.ElementType.Comment}function b(e){return e.type===a.ElementType.Directive}function k(e){return e.type===a.ElementType.Root}function T(e,t){if(void 0===t&&(t=!1),v(e))n=new u(e.data);else if(x(e))n=new p(e.data);else if(g(e)){var n,r=t?E(e.children):[],i=new m(e.name,o({},e.attribs),r);r.forEach(function(e){return e.parent=i}),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=i}else if(y(e)){var r=t?E(e.children):[],l=new d(a.ElementType.CDATA,r);r.forEach(function(e){return e.parent=l}),n=l}else if(k(e)){var r=t?E(e.children):[],s=new h(r);r.forEach(function(e){return e.parent=s}),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else if(b(e)){var c=new f(e.name,e.data);null!=e["x-name"]&&(c["x-name"]=e["x-name"],c["x-publicId"]=e["x-publicId"],c["x-systemId"]=e["x-systemId"]),n=c}else throw Error("Not implemented yet: ".concat(e.type));return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map(function(e){return T(e,!0)}),n=1;n/i,c=//i,u=function(){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},p=function(){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var f=new window.DOMParser;u=p=function(e,t){return t&&(e="<"+t+">"+e+""),f.parseFromString(e,"text/html")}}if(document.implementation){var d=n(1507).isIE,h=document.implementation.createHTMLDocument(d()?"html-dom-parser":void 0);u=function(e,t){return t?(h.documentElement.getElementsByTagName(t)[0].innerHTML=e,h):(h.documentElement.innerHTML=e,h)}}var m=document.createElement("template");m.content&&(r=function(e){return m.innerHTML=e,m.content.childNodes}),e.exports=function(e){var t,n,f,d,h=e.match(l);switch(h&&h[1]&&(t=h[1].toLowerCase()),t){case i:return n=p(e),!s.test(e)&&(f=n.getElementsByTagName(o)[0])&&f.parentNode.removeChild(f),!c.test(e)&&(f=n.getElementsByTagName(a)[0])&&f.parentNode.removeChild(f),n.getElementsByTagName(i);case o:case a:if(d=u(e).getElementsByTagName(t),c.test(e)&&s.test(e))return d[0].parentNode.childNodes;return d;default:if(r)return r(e);return u(e,a).getElementsByTagName(a)[0].childNodes}}},14152:function(e,t,n){var r=n(38276),i=n(1507).formatDOM,o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(o);return n&&n[1]&&(t=n[1]),i(r(e),null,t)}},1507:function(e,t,n){for(var r,i=n(60885),o=n(97790),a=i.CASE_SENSITIVE_TAG_NAMES,l=o.Comment,s=o.Element,c=o.ProcessingInstruction,u=o.Text,p={},f=0,d=a.length;f1&&(u=h(u,{key:u.key||b})),y.push(u);continue}if("text"===o.type){if((c=!o.data.trim().length)&&o.parent&&!l(o.parent)||x&&c)continue;y.push(o.data);continue}switch(p=o.attribs,s(o)?a(p.style,p):p&&(p=i(p)),f=null,o.type){case"script":case"style":o.children[0]&&(p.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?p.defaultValue=o.children[0].data:o.children&&o.children.length&&(f=e(o.children,n));break;default:continue}k>1&&(p.key=b),y.push(m(o.name,p,f))}return 1===y.length?y[0]:y}},74606:function(e,t,n){var r=n(67294),i=n(41476).default,o={reactCompat:!0},a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw TypeError("First argument must be an object");var n,r,i="function"==typeof t,o={},a={};for(n in e){if(r=e[n],i&&(o=t(n,r))&&2===o.length){a[o[0]]=o[1];continue}"string"==typeof r&&(a[r]=n)}return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=i(e,o)}catch(n){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},18139:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g;function c(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var u=1,p=1;function f(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function d(){var e={line:u,column:p};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:p},this.source=s.source}h.prototype.content=e;var m=[];function g(t){var n=Error(s.source+":"+u+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=u,n.column=p,n.source=e,s.silent)m.push(n);else throw n}function y(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function v(){y(r)}function x(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=d();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return p+=2,f(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function k(){var e=d(),n=y(i);if(n){if(b(),!y(o))return g("property missing ':'");var r=y(a),s=e({type:"declaration",property:c(n[0].replace(t,"")),value:r?c(r[0].replace(t,"")):""});return y(l),s}}return v(),function(){var e,t=[];for(x(t);e=k();)!1!==e&&(t.push(e),x(t));return t}()}},83:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n