Questions tagged [literate-programming]

A literate program embeds source code in an essay documenting the program.

Literate programming was introduced by Donald Knuth as an alternative to the structured programming. Literate programming encourages programmers to structure their programs by the flow of their thoughts, i.e., in a way that makes it easy to present and document.

158 questions
2
votes
2 answers

using scons for literate programming

Using noweb, I would either like to generate a document file (or a source file) from a noweb input file **.nw From hand I would do something like that: notangle my_program.nw > my_program.cpp g++ -c my_program.o my_program.cpp ln -o myapp ...…
Leonard7E
  • 75
  • 5
2
votes
0 answers

Emacs org-babel auto-loading?

I'm currently learning Clojure, and I'm evaluating sample code from the book in begin_src/end_src blocks. Works quite well, as org adds structure to otherwise unrelated pieces of code. The problem starts when these pieces become related, i.e. sample…
abo-abo
  • 20,038
  • 3
  • 50
  • 71
2
votes
2 answers

Can org-mode babel tangle produce leiningen directories?

We want to automate the production of a Leiningen project tree entirely from an org-mode babel file. We want to do this so that we can also create beautiful, typeset documentation via org-latex-export-to-pdf. We want no less than full…
Reb.Cabin
  • 5,426
  • 3
  • 35
  • 64
2
votes
1 answer

How to diagnose emacs lisp problems involving indirect buffers?

I am using Dave Love's noweb-mode to edit a file that is a mix of LaTeX and C code. Love's mode uses his multi-mode to switch back and forth between modes. This switching is accomplished via indirect buffers. In Emacs 21, the mode appears to work…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
1
vote
1 answer

Can noweb create traversable links in latex like it does in HTML?

When you generate html documents with noweb each chunk of code can be clicked when referenced elsewhere and you can jump to this definition but I'm not able to get the same functionality with the generated Latex document. Can the generated latex…
tonicebrian
  • 4,715
  • 5
  • 41
  • 65
1
vote
2 answers

How to iterate a mixed of nested list and dict and filter items

I have an example object which is mixed of lists and dicts: { "field_1" : "aaa", "field_2": [ { "field_3" : "bbb", ..... "field_4" : "ccc", "field_need_to_filter" : False, }, { …
wawawa
  • 2,835
  • 6
  • 44
  • 105
1
vote
3 answers

Java - How to iterate over a list of hashmap?

I have a following response from a HTTP call which looks like this... [{"id": 1, "name" : abc, "above50" : true} , {"id": 2, "name" : "xyc", "above50" : false, "kids" : "yes"} ] I need to iterate through this list and find if there is a key…
1
vote
1 answer

I need to operate this loop in Matlab

function stainless_steel(~,~,~) clear,clc T_i = [0 0 12.5 25 37.5 50 0]; k = 0.0162; cp = 0.5; rho = 8000; dt = 3; dx = 0.0125; t = 120; q = 20000; Fo = (k*dt)/(((dx)^2)*rho*cp); e_gen = q*(dt)/(rho*cp); n = t/dt; p = n; T = zeros(n,7); …
1
vote
1 answer

Why does iterating through two dictionaries in python yield strange results?

I am iterating through the keys of one dictionary, finding the same key in a second dictionary, then trying to produce the first value of the list associated with the key in the second dictionary. When I look directly into the second dictionary it…
1
vote
1 answer

Literate programming: tool to extract and run a script from source in one pass?

I just started reading about literate programming and noweb - and I find it quite interesting. As far as I understand it, the 'notangle' step is the one that extracts (machine) source code (file), from the literal programming (source) file. Here,…
sdaau
  • 36,975
  • 46
  • 198
  • 278
1
vote
2 answers

Perl Hash : get keys if the value is in-between a range

I have a two dimensional hash with 100K keys(primary) like this and I need to get the primary key - the name of the fruit only if a particular condition is satisfied; like - if the price is between 35 and 55; Desired output is Orange and Grape. And…
1
vote
0 answers

Including line breaks in tufte_handout code blocks?

I'm using tufte::tufte_handout in rmarkdown. I would like to preserve newlines in code blocks, but these seem to disappear. When I use usual pdf_document, the spaces are preserved. Is there any workaround, so that I can use tufte_handout but still…
Krisrs1128
  • 311
  • 4
  • 8
1
vote
1 answer

Are there any examples of isabelle sources for academic papers?

I’ve completed the better part of a major development in Isabelle, and is wondering how best to go about writing the corresponding academic paper. From Isabelle sources I can generate a somewhat idiosyncratic take on such a paper. However, the…
Søren Debois
  • 5,598
  • 26
  • 48
1
vote
1 answer

Custom extension for haskell file

Is it possible to customize the extension that haskell files can have? That is, to tell GHC that a file with extension .yy.xxx should be accepted as a valid haskell file, and that a file with extension .yy.lxx should be accepted as literate haskell?
Ivan Perez
  • 582
  • 2
  • 17
1
vote
1 answer

How to setup up Pweave on Atom for Python 3?

I want to get into literate programming on my code editor, so I decided to try to set up Pweave for Atom (the code editor) by following the steps on this website: http://protips.maxmasnick.com/literate-python-setup-with-pweave-and-atom. But it still…