git.s-ol.nu mmm / a192346
more sidenote/reference formatting s-ol 1 year, 11 months ago
5 changed file(s) with 32 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 import div, i from require 'mmm.dom'
0 import div, a, i, b from require 'mmm.dom'
1
2 title = (info) ->
3 assert info.title, "cite doesn't have title"
4 inner = i info.title
5 if info.url
6 a inner, href: info.url
7 else
8 b inner
19
210 {
311 converts: {
2331 for key, val in kv\gmatch '([a-z]-)%s*=%s*{(.-)}'
2432 info[key] = val
2533
26 div "#{info.author} (#{info.year}), ", (i info.title), ". #{info.publisher}"
34 tt = title info
35 dot, com = if info.title\match '[.?!]$' then '', '' else '.', ','
36 switch type
37 when 'book', 'article'
38 div "#{info.author} (#{info.year}), ", tt, "#{dot} #{info.publisher}"
39 when 'web'
40 -- note = if info.note then ", #{info.note}" else ''
41 div tt, "#{com} #{info.url} from #{info.visited}"
42 else
43 div "#{info.author} (#{info.year}), ", tt, "#{dot} #{info.publisher}"
2744 }
2845 }
2946 }
1717 but notably the type of data is generally not actually stored in the filesystem,
1818 but determined loosely based on multiple heuristics depending on the system and context.
1919 Some notable mechanism are:
20
21
2022 - Suffixes in the name are often used to indicate what kind of data a file should contain.
2123 However there is no standardization over this, and often a suffix is used for multiple incompatible versions of a file-format.
2224 - Many file-formats specify a specific data-pattern either at the very beginning or very end of a given file.
2325 On unix systems the `libmagic` database and library of these so-called *magic constants* is commonly used to guess the file-type based on
2426 these fragments of data.
25 - on UNIX systems files to be executed are checked by a variety of methods to determine which format would fit.
27 - <div class="sidenote"><mmm-embed raw path="../references/linux-exec"></mmm-embed></div>
28 on UNIX systems files to be executed are checked by a variety of methods to determine which format would fit.
2629 for script files, the "shebang" (`#!`) can be used to specify the program that should parse this file in the first line of the file.
27 [@TODO: src: https://stackoverflow.com/questions/23295724/how-does-linux-execute-a-file]
2830
2931 It should be clear already from this short list that to mainstream operating systems, as well as the applications running on them,
3032 the format of a file is almost completely unknown and at best educated guesses can be made.
00 xerox-star
11 unix
2 linux-exec
0 @web{23295968,
1 title = {How does Linux execute a file?},
2 url = {https://stackoverflow.com/a/23295724/1598293},
3 publisher = {stackoverflow.com},
4 note = {answered by osgx},
5 visited = {2019-12-18},
6 }
1717 color: $gray-dark;
1818 border-top: 1px solid $gray-dark;
1919 font-size: 0.8em;
20 word-break: break-word;
2021
2122 @include media-medium {
2223 width: initial;