This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function starts_with(str, start) | |
return str:sub(1, #start) == start | |
end | |
function Image(el) | |
if starts_with(el.identifier, "fig:") and starts_with(el.title, "fig:") then | |
return pandoc.Image(pandoc.Span(el.caption, pandoc.Attr(el.identifier)), el.src, el.title, pandoc.Attr("", el.classes, el.attributes)) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <numeric> | |
#include <array> | |
template<class T, size_t Ndim> class arrNd { | |
const std::array<const size_t, Ndim> _size; | |
std::array<size_t, Ndim-1> _strides; | |
std::vector<T> _data; | |
T& get(std::array<size_t, Ndim> ix) const { | |
return const_cast<T&>(_data.at( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Text.Pandoc.JSON | |
import Data.List | |
main :: IO () | |
main = toJSONFilter myfilter | |
myfilter (Link _ text (url, _)) | |
| '#':ref <- url | |
= Span nullAttr $ | |
text <> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Math(el) | |
if el.mathtype == "InlineMath" then | |
if el.text:sub(1,1) == '`' and el.text:sub(#el.text) == '`' then | |
local text = el.text:sub(2,#el.text-1) | |
return pandoc.Math(el.mathtype, text) | |
else | |
local cont = pandoc.read(el.text) | |
return { pandoc.Str("$") } .. cont.blocks[1].content .. { pandoc.Str("$") } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
max=10 | |
end="" | |
t=" " | |
echo "interface Bind {" | |
echo "${t}<T extends (...args: any[]) => any>(this: T, thisArg: any): T$end" | |
for i in `seq 1 $max`; do | |
echo -n "${t}<T extends (" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SubsString<T extends (...args: any[]) => any> = | |
T extends (x1: infer U1,) => any ? (x1: U1,) => string: | |
T extends (x1: infer U1,x2: infer U2,) => any ? (x1: U1,x2: U2,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,) => any ? (x1: U1,x2: U2,x3: U3,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,x4: infer U4,) => any ? (x1: U1,x2: U2,x3: U3,x4: U4,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,x4: infer U4,x5: infer U5,) => any ? (x1: U1,x2: U2,x3: U3,x4: U4,x5: U5,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,x4: infer U4,x5: infer U5,x6: infer U6,) => any ? (x1: U1,x2: U2,x3: U3,x4: U4,x5: U5,x6: U6,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,x4: infer U4,x5: infer U5,x6: infer U6,x7: infer U7,) => any ? (x1: U1,x2: U2,x3: U3,x4: U4,x5: U5,x6: U6,x7: U7,) => string: | |
T extends (x1: infer U1,x2: infer U2,x3: infer U3,x4: infer U4,x5: infer U5,x6: infer U6,x7: infer U7,x8: infer U8,) => any ? (x1: U1,x2: U2,x3: U3,x4: U4,x5: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
captionIndexTemplate: $$ri$$ | |
captionTemplate: '$$title% $$$$i$$$$titleDelim$$$$t$$' | |
codeBlockCaptions: False | |
collectedCaptionDelim: ',' | |
collectedCaptionItemDelim: '--' | |
collectedCaptionTemplate: $$i$$$$collectedCaptionItemDelim$$$$t$$ | |
crossrefYaml: 'pandoc-crossref.yaml' | |
defaultSectionPrefix: sec | |
lastDelim: ',' | |
linkReferences: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dcraw.cc b/dcraw.cc | |
index 88c8068..c49d654 100644 | |
--- a/dcraw.cc | |
+++ b/dcraw.cc | |
@@ -9242,7 +9242,7 @@ canon_a5: | |
if (make[0] == 'O') { | |
i = find_green (12, 32, 1188864, 3576832); | |
c = find_green (12, 32, 2383920, 2387016); | |
- if (abs(i) < abs(c)) { | |
+ if (i < c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Functor<T> { | |
map<U>(f: (x: T) => U): Functor<U> | |
} | |
class Box<T> implements Functor<T> { | |
value: T | |
constructor(x: T) { | |
this.value = x | |
} | |
map<U>(f: (x: T) => U): Box<U> { |