LiteratePrograms:Public forum/Archive 1

From LiteratePrograms
Jump to: navigation, search

Contents

[edit] Preview Feature

I miss the feature to preview the resulting code in the web browser. Marc van Woerkom 03:41, 3 March 2006 (PST)

That's a good idea, Marc. It's a bit tricky since a single article can emit multiple files, and since we probably wouldn't want the license notice in the preview, but it would be easier than having to save just to see the code. I appreciate your suggestion. Deco 04:11, 3 March 2006 (PST)
Update: you can now do this using the "code" tab (although not with the Preview button just yet). Deco 14:16, 4 March 2006 (PST)

[edit] File Extension Mechanism

I couldn't get the file extension mechanism (<<xxx>>+=) to work on the AspectJ hello world page Hello World (AspectJ). Is my markup wrong or is this a bug? Adrian Colyer 06:17, 3 March 2006 (PST)

Hi Acolyer, this is my fault. It turns out my understanding of += was incorrect. Just use "=" for each chunk, and chunks of the same name are automatically concatenated in the listed order. I've updated LiteratePrograms:How to write an article. Deco 11:36, 3 March 2006 (PST)

[edit] Which version of language to use

Code is nice, but there are many schemes, lisps, c-compilers, etc. It would be nice to have some standard slots to run code. It might be nice if you had some pointers to help out 'yum' or some other update utillity to help prepare the machine to run the code.

Language

    needs brand of language : gcc  
  needs version of language : greater than 3.4.3
             available from : www.mr_loopy.com
                tested with : fc4 linux, win98

Libs
          non standard libs : pil, squid, anteater
        libs available from : www.squid_libs.org
    time lib was downloaded : june 7, 1999

--mrloopy 3-3-2006

Hi mrloopy. This is a good point. Most code has just been standard so far, but it seems quite reasonable to specify these kind of restrictions in some reasonable way. Unfortunately I don't believe yum or any other package tool like dpkg or portage is portable. For now I'm just going to say make sure you describe your prerequisites in the article text in the level of detail that you give. Deco 11:41, 3 March 2006 (PST)

[edit] Policy on tabs

What's the policy on tabs? I think they're problematic, as they can't be inserted directly from the edit window in many browsers. There's also the issue of nonstandard tab widths, though it may not be significant in practice. Fredrik 14:12, 3 March 2006 (PST)

I'd prefer space characters over tabs. It avoids the nonstandard tab width and browser problems, and makes it more likely that downloaded code retains whatever formatting was originally intended. Just my 2c. --Allan McInnes (talk) 14:38, 3 March 2006 (PST)
Generally, I think we should avoid them, for consistency of presented and downloaded materials, but there is no policy yet. Tabs are significant in some languages, such as Makefiles, so we can't just do away with them entirely as I would like to do. Noweb currently uses tabs to indent chunks, though - I plan on forking noweb to fix this. Deco 15:14, 3 March 2006 (PST)

[edit] Changes to interface

Based on some suggestions from User:Mikekucera, I've modified the interface so that now there is a "code" tab instead of a "download code" tab. Clicking on it will show you the code for your article right on the web, with the option to download as .zip, .tar.gz, or .tar.bz2. This does increase the number of clicks to download though, so I'd like to get your feedback on how you like it. I'm thinking this will be the best place to show compiler errors and that sort of thing (right now they're just shown in a build.log file with line numbers, but eventually I can parse that and do stuff). I also added a "linenumbers" attribute to codeblock tags which displays line numbers next to each line, which is used on the code page. Deco 01:01, 4 March 2006 (PST)

A quick test with the Merge sort (Haskell) page revealed a couple of possible problems:
  • The tab still appears to read "download code";
  • Clicking on the .tar.gz and .tar.bz2 links produces files with a .zip extension (although the file provided by the .tar.gz link appears to be actually be a gzipped tarball despite the filename; I haven't tested the .tar.bz2 file).
Aside from those issues, my initial reaction to the changes is basically positive. Being able to see the code is nice; seeing the build log is handy; having multiple options for download format is also a very good idea, IMHO. I don't see having to make one extra click to download the code being that big an impediment. --Allan McInnes (talk) 02:05, 4 March 2006 (PST)
To fix the tab, you need to bypass your browser cache (CTRL+F5). The other thing is a real bug and I fixed it. Thanks! Deco 02:29, 4 March 2006 (PST)
I've additionally made it now so that you can click on any file header to download just that file. If there is just one file, a "single file" download option will appear at the top to grab that one file. Deco 07:32, 4 March 2006 (PST)

[edit] Abuse prevention

The code is peer-reviewed. However, what's to stop users from posting malicious, poorly implemented or incorrect code? Dmitriid 01:08, 4 March 2006 (PST)

Hi Dmitriid, thanks for checking out the wiki. The short answer is: nothing, and that's why we have a disclaimer. In fact, we want users to post incorrect and poorly implemented code so others can collaborate with them in fixing it up.
The longer answer is, we'd really like to help prevent people somehow from downloading and running malicious code that they don't realize is malicious. Right now I don't have a good story for this other than to tell people to be careful and read what you run. I expect such changes to be reverted quickly, but there's still a window. Maybe some kind of article validation scheme could help. Deco 01:17, 4 March 2006 (PST)
Ok. That's pretty much what i figured out anyway. Thought may be other ideas could appear. Dmitriid 03:30, 5 March 2006 (PST)
It doesn't appear that the code actually is peer-reviewed, at least not in any formal fashion. The Open Source mantra that "many eyes make all bugs shallow" applies, of course, but even some of the oldest, most-read Open Source code has had long-lurking security exposures. It might be interesting to design some sort of code review and rating facility. One could imagine a 1-to-5-star rank, with some sort of weighted averaging system to ensure that a 5-star rating from 100 edits ago counts for less than 3-star rating on the current version, and possibly only available to logged-in users (Wikipedia has a lot more trouble with anonymous users than with logged-in users). RossPatterson 18:41, 15 November 2006 (PST)

[edit] Pseudocode

Should we request users to additionally supply pseudocode for algorithms and devote a separate section to algorithms in pseudocode? Dmitriid 01:08, 4 March 2006 (PST)

That's a good question. Pseudocode would have to be checked by hand, of course, and isn't standardized so that there could potentially be multiple - and quite different - pseudocode implementations of the same algorithm. It's also not clear what benefit there is to downloading it if you can't compile or run it. One option is to just put pseudocode in the category articles like Category:Insertion_sort, which contain implementations in real languages. Another option is just to rely on links to pseudocode implementations on Wikipedia and not have any of our own. This is something to think about. Deco 01:20, 4 March 2006 (PST)
I'm in favor of going with the 2nd option (links to Wikipedia). It doesn't make much sense to me to duplicate content. Not to mention the fact that WP articles will probably have a much larger readership (for the present at least :-) than LP articles, so the likelihood of a pseudocode-based algorithm article being well-maintained is much higher on WP. That said, I don't think there's anything wrong with including some pseudocode in a particular literate program, if it clarifies the exposition. --Allan McInnes (talk) 01:41, 4 March 2006 (PST)
I second the motion to post links to wikipedia or similar sources :) Dmitriid 03:31, 5 March 2006 (PST)

[edit] Matlab

Should it be possible to have an extention for Matlab syntax ? --Charles(talk), 4 March 2006

Hi lehalle, and welcome. Currently the tool I use does not have regular expressions defined for syntax highlighting in Matlab, but if this is something you want I'll sure put it on my list of things to do. Thanks for your suggestion. Deco 03:02, 4 March 2006 (PST)
Hi Deco, I can garantee you that if you provide this feature, I will heavily contribute to LP. I'm creating a "matlab users group for quantitative finance", if it's possible, we will use LP to store our contributions.
I appreciate that! Keep in mind that the literate programming syntax here is language-neutral - only the syntax highlighting and generated comment blocks depend on language. I'm going to look at adding highlighting for several new languages, and I'll keep Matlab in mind. Deco 04:59, 4 March 2006 (PST)
Perhaps it would be easier to make the syntax highlighting regexps available on a wiki-page, in the same way the comment delimiter definitions are (I think this might even be on your to-do list). There are several languages I'd like to see have syntax highlighting as well. With the regexps available in wiki form, we could move some of burden off of you. --Allan McInnes (talk) 12:36, 4 March 2006 (PST)
That is my plan, actually. Only thing I have to do is migrate the tool to PHP first, which I have to do anyway eventually for scalability (can't be invoking external programs many times for each page render). Deco 14:09, 4 March 2006 (PST)

[edit] Codeblock language declaration

Is the language declaration inherited when one codeblock includes another? Or can each block be legally declared to be in different programming languages? Thanks -- Salimma 09:53, 4 March 2006 (PST)

Can you give me an example of where you're using this? I find it hard to imagine a case in which you'd want to nest codeblocks. Deco 14:14, 4 March 2006 (PST)
Complex examples, like those involving web services or other RPC-like mechanisms, often require either pieces in multiple langages (e.g. Java and C for JNI) or meta-files (e.g., WSDL, IDL). On a more mundane scale, some programming paradigms involve mutiple languages within the same file (e.g., Java Server Pages are a mix of XML, HTML, Java, and occasionally Javascript) and would really benefit from both the physical-separation aspects of LP and separate syntax-highlighting rules. RossPatterson 18:50, 15 November 2006 (PST)
Ah, good point. The answer is, in any case, that this works currently, since the language is only used for syntax highlighting and noweb ignores it. Deco 12:36, 16 November 2006 (PST)

[edit] Intended audience

Which audience should the articles address? I mean, should we address people with no programming experience? People who have programming experience, but want to have a look at different languages? If so, a few articles about programming in general, and syntax explanations (or at least links to online tutorials) for the various languages might be useful. I'm thinking about a page for each language that tells you what an assignment, a loop or a function declaration/call looks like. The preceding unsigned comment was added by Nikie (talk • contribs).

We probably don't want to get too carried away in terms of scope here. Wikipedia has good articles on pretty much any language we might include here, many of which include syntax examples and pointers to tutorials. Those articles are likely to be better maintained than anything here, just because their readership is larger. So it's probably sufficient to provide pointers to the appropriate Wikipedia language articles. Similarly, I don't think it's a good idea to get involved in writing articles on "programming in general" - there're plenty of other places that do that already, and probably do it better than we'll be able to manage here. IMHO what we should focus on is the things LP can do that that aren't done elsewhere: literate code that clearly explains what it's doing and why, and can be downloaded and executed. --Allan McInnes (talk) 12:47, 4 March 2006 (PST)
The short answer is, it depends on the article, but we can make a lot of assumptions. An article like Hello World (C Plus Plus) could reasonably use some explanation, since it's intended for C++ beginners, while an article like Turing machine simulator (C) pretty much assumes you know C and you know what a Turing machine is. I try to explain anything tricky with links to external explanations where possible, or else in the text. Each language is linked to Wikipedia and most subject areas and individual topics too, and when there isn't a good source like this for a subject you can just put some explanation on the category page (which is language-neutral). Hope this helps. Deco 14:13, 4 March 2006 (PST)

[edit] Syntax highlighting now on-wiki

I've replaced the external code2html Perl script with an internal set of PHP classes that perform the same task. The new classes are entirely data-driven based on two MediaWiki messages:

  • MediaWiki:SyntaxHighlightingRegexps: An XML file describing regular expressions for various components in each language and the associated style used to mark them up. The current extensive set of expressions is taken from the code2html source. Each rule can have subrules which are applied to pieces of the text matching the larger rule. For example, in C, string escape sequences are a subrule of the rule for strings. This is pretty complicated and I'll try to document it on the talk page.
  • MediaWiki:SyntaxHighlightingStylesheet: A list of styles used in the above message. Each style is associated with a piece of HTML placed before and a piece of HTML placed afterwards. There is currently only a single stylesheet, but in the future we might have multiple stylesheets with an associated user preference. In particular, I'm thinking of creating a black-and-white stylesheet for B&W printing.

I don't have a great debugging story yet - if there's an error in a new regular expression, you'll get PHP errors on the page when trying to use it. Problems may still arise due to slight differences between the PHP PCRE and real Perl regexp interpretation, so please keep me posted on any issues that arise. Thanks everybody. Deco 02:33, 5 March 2006 (PST)

Nice! My quick attempt at a highlighting mode for occam seems to have worked without any problems (at least so far). --Allan McInnes (talk) 10:01, 5 March 2006 (PST)

[edit] Downtime

From about 3:15am to 4:15am Eastern Standard Time a connection outage caused a temporary loss of service. Currently LiteratePrograms is hosted under a desk on a Verizon Business DSL line, but I'm looking into converting this tower into a 1U for colocation in a nearby facility. There was also a shorter downtime later in the night due to a machine freeze that I was investigating (still not sure why this server occasionally freezes). I apologise for any inconvenience. Deco 02:13, 7 March 2006 (PST)

Just an update: I've got a 1U server platform on the way. The CPU, memory, and IDE disks from the current server will be transplanted into it and sent to colo. I'll give some warning in the days prior to the move, as I'm not sure how long setup will take. Deco 13:39, 7 March 2006 (PST)

[edit] Newlines

I now allow you to download code with either Windows or UNIX newlines, at your discretion. I realise a lot of programs support both anyway, but a lot of commonly used ones such as Notepad and bash shell don't. Plus, I'm sure emacs users got sick of seeing all those ^Ms in their buffer. :-) Deco 13:46, 8 March 2006 (PST)

[edit] What coding style is prefered at LP?

I'm a bit curious if code submitted to LP should follow some general layout. I personaly prefer the Allman style when it comes to placing curly braces. I'm also happy with tab=2. But there are many ways to format code and many things that make code more or less readable. How should we do spaces around parantheses for example ( blabla(x=1, y=2) blabla( x=1, y=2 ) blabla( x = 1, y = 2 ) )?! I bet there are about as many opinions on this as there are users here ;) IMHO LP should accept code formatted using any (readable) style but I still think there would be nothing wrong in adding a little something describing prefered coding style.

IMHO it's probably best to remain as style-agnostic as possible, in order to avoid religious battles. Not to mention that trying to lay down formatting guidelines for every language likely to show up here would probably be a mammoth effort. About the only thing I'd insist on is that the code in a given article remain reasonably consistent throughout that article.
In practice, if someone objects to the way something is formatted they're welcome to change it (this is a wiki :-). Of course, others are also welcome to do the same. If there's disagreement over styles, then the disagreeing parties will simply have to "take it to the talk page", and hammer out a compromise there. Perhaps we'll eventually converge on a "house style" based on such disagreements... --Allan McInnes (talk) 14:06, 8 March 2006 (PST)
A good question, and one I've been thinking about. While consistency is an important goal, I agree with Allan that laying down a wiki-wide style convention for each language is both difficult and could cause unnecessary conflict. In real life, programmers are frequently forced to assume the styles of others in order to contribute to existing code. Just be consistent within each article. That said, if you're unsure what style to use, for an expository work like those on LP I personally prefer not putting opening braces on their own lines (for brevity) and using indentions of at least 3 spaces. Deco 14:27, 8 March 2006 (PST)

[edit] Don't like to see metacode

<<Quine1.pl>>=
$quine = <<'END';
$quine = <<'END';
%s
%s
($quine2) = $quine =~ /(.*)\n$/s;
printf $quine, $quine2, 'END';
END
($quine2) = $quine =~ /(.*)\n$/s;
printf $quine, $quine2, 'END';

Why do I have to see the "<<Quine1.pl>>=" statement? This interrupts my understanding of the code, as it is not native syntax. Can you filter it, or move it to the headline of the surrounding display box? --Marc van Woerkom 09:12, 10 March 2006 (PST)

This is pretty standard noweb-style syntax for literate programming, which LiteratePrograms has inherited. Filtering or removing it is not really an option since more complex literate programs use the block designators to show how blocks are nested within other blocks — eliminating block designators would make it impossible to identify blocks. I suppose moving the designators outside the display box might be an option, but it's not going to fix the "non native syntax" problem for any code which nests blocks inside other blocks (such as the turing machine example). Note that if you wish to see the code without any literate programming constructs, you can click the Code tab at the top of the page. --Allan McInnes (talk) 09:45, 10 March 2006 (PST)
The document rendering of the literate source (here: article view) should be as user friendly as possible. In this form they disturb. For those cases, where the meta information is needed to indicate how stuff is plugged together, I would look for another solution. Like a title, or at least a different colour. In the document rendering view one has really a lot of graphical means to express this. --Marc van Woerkom 16:58, 11 March 2006 (PST)
Just had a look at the more complex literate programs example. Those should work like hyperlinks (click on them and jump to the point of use). I still believe one could render them graphically much nicer in the article view than using that editor view rendering/syntax 1:1. --Marc van Woerkom 17:11, 11 March 2006 (PST)
The presence and formatting of these tags was intended to emulate how noweb renders these tags in its output documentation. One could imagine other ways of rendering them, but this particular rendering has the benefit that it's transparent to the editor. Deco 10:53, 10 March 2006 (PST)
I just don't like them and would prefer to keep them mostly to the literate source (here: wiki source). --Marc van Woerkom 16:58, 11 March 2006 (PST)

How about such a rendering style as quick hack?

Quine1.pl (1 of 1)

$quine = <<'END';
$quine = <<'END';
%s
%s
($quine2) = $quine =~ /(.*)\n$/s;
printf $quine, $quine2, 'END';
END
($quine2) = $quine =~ /(.*)\n$/s;
printf $quine, $quine2, 'END';

--Marc van Woerkom 17:19, 11 March 2006 (PST)

I'd be happy to entertain another rendering option, but how would you propose rendering the chunk references that appear inside other chunks? You mentioned linking them, which is a great idea and is on my list of things to do. I used a different font to try to visually separate them from the code, but maybe you find the angle brackets distracting? Maybe we could put a box around it or something. Deco 17:29, 11 March 2006 (PST)
Yep. The angle brackets look ugly. I would put box around them. I think two operations would make sense: 1) jumping to the original definition (which can be consisting of several parts, which are aggregated by noweb, so perhaps one jumps to the first one "(1 of n)") 2. expansion at the use location - displaying the total definition in place - which would need a nice piece of javascript/dynamic html/ajax. --Marc van Woerkom 17:47, 11 March 2006 (PST)
Follow up: I've added some very simple hyperlinks among the chunks, you can see a demo at Insertion sort (C, simple). These aren't quite perfect, in that sometimes a chunk is added to in multiple parts in different places, and I'll need to do something special and less local for these. Deco 17:44, 11 March 2006 (PST)
Wow. Fast. :-) Some remarks:
 
<<helper functions>>=
void checkThatArrayIsSorted (int array[], int length)
{
    int i;
    for (i = 1; i < length; i+=1)
    {
       if (array[i-1] > array[i])
       {
          printf("The array is not in sorted order at position %d\n", i-1);
       }
    } 
}

<<check that the array is sorted>>=
checkThatArrayIsSorted(a, sizeof(a)/sizeof(*a));
should IMHO be rendered as
 
<<helper functions>>=
void checkThatArrayIsSorted (int array[], int length)
{
    int i;
    for (i = 1; i < length; i+=1)
    {
       if (array[i-1] > array[i])
       {
          printf("The array is not in sorted order at position %d\n", i-1);
       }
    } 
}
<<check that the array is sorted>>=
checkThatArrayIsSorted(a, sizeof(a)/sizeof(*a));
or better :-) as

helper functions (1 of 1)

 
void checkThatArrayIsSorted (int array[], int length)
{
    int i;
    for (i = 1; i < length; i+=1)
    {
       if (array[i-1] > array[i])
       {
          printf("The array is not in sorted order at position %d\n", i-1);
       }
    } 
}

check that the array is sorted (1 of 1)

checkThatArrayIsSorted(a, sizeof(a)/sizeof(*a));
You jump from a place of usage to the place of definition. I would also try to do the other way: jump from a place of definition to the first place of usage. If several targets are there, one needs to visuale display what part it is, and give jump points to the other parts (back and forth). --Marc van Woerkom 17:55, 11 March 2006 (PST)
That's a good idea. Right after the chunk I can have something like "1 of 3" with little up/down arrows around it or next to it. When they're next to a definition, they take you to other parts of that definition, while when they're next to a use, they take you to other uses of the same chunk. This seems workable. Deco 18:00, 11 March 2006 (PST)
Thanks for considering the suggestions. I believe the idea of a LP Wiki is great, because it frees one from the task of installing special software. As one uses the web browser for rendering the literate programs one should use the possibilities. I hope none of the suggestions breaks printing. Otherwise another tab or menu point with a "PDF view" will be necessary. :-) --Marc van Woerkom 18:27, 11 March 2006 (PST)

[edit] In-chunk rendering

I like the new hyperlinking capability! Very handy! Excellent suggestion, Marc! For the rendering of in-chunk identifiers, perhaps we could consider italics. This would visually distinguish them from the code, but eliminate the angle-brackets to which Marc objects. Here's a mock-up (chunk names in blue because I'm assuming hyperlinking):

test main

int main(void)
{
    test main variable declarations
    int a[] = {5,1,9,3,2};
    insertion_sort(a, sizeof(a)/sizeof(*a));
    print out a
    check that the array is sorted
    return 0;
}

Look ok? Or would something else be preferable? Deco, how hard would it be to implement something like this? Oh, and one other question: would it be possible to reduce the vertical spacing between the chunk name and the codeblock (assuming that we're going to place chunk names outside the block)? --Allan McInnes (talk) 19:35, 11 March 2006 (PST)

Follow-up: I've modified the syntax highlighting stylesheet to make the chunks names and chunk headers italic, just to see how it looks. Not sure how to eliminate the angle-brackets from the rendered text yet though. --Allan McInnes (talk) 19:51, 11 March 2006 (PST)
You can't from the wiki. I can, but I don't think italics by themselves create sufficient visual differentiation. It needs to be obvious that they're not part of the code. I initially used italics, actually, but found it made them more difficult to read (at least for me). I like the idea of wrapping the references in a little box, like the Visual Studio editor does with collapsed regions, but haven't figured out how to do this yet. Deco 20:00, 11 March 2006 (PST)
You can't from the wiki. So I just discovered :-( I put in place a stylesheet rule to make the anglebrackets invisible. But it appears that there's a nasty interaction with the hyperlink-generation feature, which results in all sorts of weirdness. --Allan McInnes (talk) 20:23, 11 March 2006 (PST)
Sorry about that - really the stylesheet is somewhat inflexible. If you really want the angle brackets gone I could kill them, but I really think it needs some kind of separation from the surrounding text. I'll look more at this a bit later. Deco 20:28, 11 March 2006 (PST)
Wow, you made boxes work. Cool. I'll kill the angle brackets. Deco 20:36, 11 March 2006 (PST)
That part was easy :-) Killing the angle-brackets... that's harder. I leave that in your capable hands. BTW, I've made the box a fairly nondescript color at this point (taking a cue from VS). But if someone wants to change it, be my guest. --Allan McInnes (talk) 20:42, 11 March 2006 (PST)
Cool. I just have to figure out now how to deal with chunk headers. I don't really like section headers, because those normally start a new section. I was thinking maybe like a box with a header cell with the name in it. I don't know. Deco 20:56, 11 March 2006 (PST)
I don't like section headers either. Some kind of box with a header cell sounds good to me. --Allan McInnes (talk) 21:04, 11 March 2006 (PST)

[edit] Folding?

I know that the wiki here follows the "The Book is the master, and the code is the derivative" style of literate programming invented by Knuth, but it really is very hard to write in. I'ld like to suggest turning the paradigm around and writing code where the code is the master and can be compiled without being run through a pre-processor. I have a 'semi-literate programming' system which goes a small way towards what I'm thinking of. Mine is basically just a way to put code folding on a web page, but I think there are some ideas that can be taken from my system and from yours that would make a new design that's better than either. The major limitation of my pages for a site like this is that I don't do code reordering; on the other hand I've looked at your sources with the code all over the place and I find it really hard to follow. I spend far more time working on code than I do reading it all nicely formatted when it's complete.

I took your quicksort.c page and coded it up in my style this evening. Have a look at http://www.gtoal.com/utils/examples/quicksort.c.html and see if you think there is anything there that you might be able to apply here. Even if you don't like the semi-literate style, I think the cold-folding alone could be used here for your code blocks.

[edit] Computer Architecture

What's about architectures? My wishes are "Computer architecture" on main page.

Example: Assembly/Linux/i386/hello_world.asm vs Assembly/Linux/MIPS/hello_world.asm.

--Skim 10:38, 10 March 2006 (PST)

I'm not sure about this. There should be an assembly language category for each different assembly language, but some machines can be different and still have the same assembly language. We could put it under environment, and then include both the hardware and software environment categories, but this would also kinda jumble things together. I guess I'll think more about this. Deco 10:51, 10 March 2006 (PST)

[edit] Multiple natural languages?

One question that might naturally occur to a Wikipedia user is whether we should have multiple LiteratePrograms wikis for different natural languages, each at their own subdomain. For example, a German LiteratePrograms would have the interface, article text, and symbol names (variables/functions/classes) in German. Right now there's probably not enough users around to support these other languages (any of you guys multilingual?) but it would be interesting. It makes me wonder if, to prepare for this, we should move this site to http://en.literateprograms.org. Deco 21:40, 10 March 2006 (PST)

I've gone ahead and changed the URL of this site. For now http://literateprograms.org still redirects here (if we ever get more languages it may become a portal site like http://www.wikipedia.org). You may experience strange issues until you log out and back in, so do this now. Deco 22:17, 10 March 2006 (PST)
I would stick with a single language version (bad-en). :-) Translation is nice, but it eats resources one would rather stick into the subject. --Marc van Woerkom 17:04, 11 March 2006 (PST)
I agree. I don't think spreading out our resources too thin too soon is a good idea. This is a super long term thing - I'm hoping eventually multilingual people will come along who are interested in leading a project in their own language. The domain name change is just to be ready and to make it clear that the opportunity is there. Deco 17:32, 11 March 2006 (PST)

[edit] Discussion on Literate Programming

I would like to see a section where the concepts behind LP are discussed. I think it is great that this site will have many living examples of noweb LiteratePrograms, but this site also seems like the ideal space to discuss ideas, directions, and tools for LP. Unsigned comment by Ozten (talk).

Hi Ozten. Remember, you can sign your comments using four tildes (~). I appreciate your suggestion, but frankly I think other sites like http://literateprogramming.com/ do a pretty good job of discussing tools and other resources for LP, and I think the scope here is already fairly ambitious without expanding it. That said, concrete suggestions about LP extensions that could be made and experimented with right here on the site would be welcome and interesting, and might end up contributing back to future LP development. I hope this makes sense. Deco 14:40, 11 March 2006 (PST)
I do agree, it would be nice if there would be a separate section for discussing these kind of things. I've got some ideas in my head for future LP systems I've started writing down but I'm not finished yet. It would be good to know if others consider them useful or if it's not worth implementing them. So I'd be interested in participating in such discussions. Alternately, the comp.programming.literate newsgroup also offers a place for discussions. I prefer not to post on usenet, though. Ruediger Hanke 11:46, 12 March 2006 (PST)
Deco, Not getting to ambitious by expanding the scope of LP wiki is wise. I guess I was thinking about how literateprogramming.com is much more of a read only site. To Ruediger's point the wiki has a different feeling and quality than newsgroup or IRC. Deco I agree with your idea that one could make experiments, as a LP article, where the code product concerns aspects of literate programming itself. I was imagining a ( category ?) page where one can discuss the role of modularity, macros, code generators, etc in the context of LP. Thanks again for starting this wiki, I think it will be a great showcase for LP. Ozten 14:13, 12 March 2006 (PST)
If by "...a section where the concepts behind LP are discussed..." you mean some kind of forum where LP users could gather to talk about literate programming issues, then I agree that such an area would be nice. Probably something in the LiteratePrograms namespace (much like this forum). If you're suggesting that LP should carry articles about literate programming then I am a little more hesitant to agree. I think Deco is right about not getting too ambitious in scope here. --Allan McInnes (talk) 16:00, 12 March 2006 (PST)


[edit] Downloaded files

Hi! Would it be possible that, when unpacking the .tar.gz or .zip files, the files would end up in a sub-directory? The directory could have the name of the article, or some other semi-unique name. Ahy1 09:28, 14 March 2006 (PST)

Well, it's tricky. On UNIX, this is conventional, but on Windows the opposite is the convention. But I already have separate archives for Windows and UNIX newlines, so I could just have separate Windows and UNIX downloads, and for the UNIX ones put them in a subdirectory. I should probably also just have .zip for Windows, since .zip is the only archive format used on Windows in practice. Deco 10:24, 14 March 2006 (PST)
I can see you have allready done it. Thanks! Ahy1 08:33, 18 March 2006 (PST)


[edit] Idea: technique/style categories

I think there is a lot of value to add another classification axis to the programs: that of general techniques or styles used to solve a problem, that can be used in many different languages. I don't have an very rigorous or complete classification in mind here, but a small list of examples might be:

  1. Imperative programming
  2. Functional programming
    • Common and/or useful higher-order combinators (map, fold, etc.)
  3. Logic programming
  4. Recursion vs. iteration
    • Explicit use of stacks to rewrite recursive algorithms iteratively
    • Uses of continuations in functional programming
  5. Object-oriented programming
    • Design patterns

Again, the point here is that there are many techniques that can be used in many languages, and that a literate program describing and illustrating the technique in one language may be useful for people who want to apply the technique in other languages.

Another possibility is to show multiple solutions for the same problem using the same language, but different techniques. This is particularly good for multi-paradigm languages that have good support for different programming styles. 209.204.188.184 16:08, 18 March 2006 (PST)

That sounds good. Until this point I was planning to just separate out multiple presentations in the same language in an ad hoc sort of way, but the "paradigm classification" could be a somewhat generally applicable way of splitting this up, especially as you say for multiparadigmic languages. Deco 16:14, 18 March 2006 (PST)

[edit] Create/Edit button

I added this button because, unlike Wikipedia, red links are not the usual method of creating articles on LP. Now it's easy to create an article from anywhere, instead of the old three step and not-terribly-obvious method. Deco 13:55, 20 March 2006 (PST)

[edit] New home!

LiteratePrograms has moved from my old Gentoo Linux box to a new 1U Ubuntu Linux server box. This box will be used only for servers, so it should be more stable and have less interruptions, and because it's a 1U it's ready to go into a rack at any data center at a moment's notice. I hope you all like it. Some things might not work right away, so please tell me if you encounter any issues. Deco 19:19, 2 April 2006 (EDT)

Nice :-) Sorry for not contributing in the last few weeks, by the way; I'm not dead, but continually busy. Fredrik 02:48, 3 April 2006 (EDT)
That's okay, there's no time limit. Thanks for stopping by. In case you do die, train your children to contribute. :-P Deco 04:06, 3 April 2006 (EDT)
I'd like to second Fredrik's comment (all of it - must...work...on...dissertation). --Allan McInnes (talk) 09:11, 3 April 2006 (PDT)

[edit] Document Layout

Has anyone come across a discussion or artile regarding a literate programming document layout? I'm looking for a little guidance on how to organize the document. I'm used to organizing a program by classes but I don't know that that is a good organization for a book/article. A couple templates would be ideal. --Dave--67.40.246.171 07:26, 3 April 2006 (PDT)

Hi Dave. That's a good question - I think the answer is, any way you want, and that's the point. If you look at just a few different articles on here you'll see many differences in presentation, such as top-down versus bottom-up, whether code is shown before or after the code that uses it, whether certain methods are shown before others and whether those are primary or helper methods, and so on.
One way to go about it is to start by writing it just in classes, in the usual linear order. Then, as you write, ask yourself whether you can rearrange things so that they'll make more sense. For example, if you have a method called "stripBackslashes", and it's the first thing you present, there's no motivation for it - why would you want to strip backslashes anyway? As you rearrange things you'll tend towards a better LP document.
Finally, I wouldn't be a good site owner if I didn't exploit this opportunity to point out that you can learn much about document layout just by writing a couple short articles for this wiki. :-) Deco 08:11, 3 April 2006 (PDT)

[edit] General request to everyone

Please, please, please provide edit summaries with your edits! You may not read the edit histories or recent changes, but some of us do. Edit summaries make it a lot easier for those of us who look at recent changes to figure out what's been done, and whether a particular change is worth taking a look at. Thanks! --Allan McInnes (talk) 11:16, 11 April 2006 (PDT)

Perhaps the interface could be modified in some way to encourage edit summaries. I never liked the idea of mandatory edit summaries though. Perhaps automatic edit summaries based on diffs, in the case they don't provide one? Deco 14:57, 12 April 2006 (PDT)
I like the idea of automatic edit summaries. Would it be hard to implement? --Allan McInnes (talk) 20:28, 12 April 2006 (PDT)
I'm not sure. A single small change is easy to autosummarize, but it's difficult when a person makes many changes. You can imagine for each change in the diff adding "+whatever" for additions, "-whatever" for removals, and "foo->bar" for changes, which is common practice on Wikipedia anyway, although this doesn't provide very much context. Deco 08:33, 13 April 2006 (PDT)

[edit] Question on 'Download Code' function

While writing Complex numbers (Java), I met a problem in 'download code' function. I cannot figure out why I got an error message such as 'input.nw:2: unescaped << in documentation chunk' at [1] I appreciate any input. --Crypto 20:34, 6 May 2006 (PDT)

The problem appears to have been caused by placing too many '=' symbols after each codeblock name. That is, you were (inadvertently?) typing <<block_name>>==, when you should have been typing <<block_name>>=. I went through and fixed all of these typos. That got rid of all but one error. The last error appears to have been caused by putting a couple of spaces before the block identifier <<Polar_Form>>=. I didn't have any idea that could cause problems. However, making that identifier flush left seems to have cleared up the last error message. Hope that helps! --Allan McInnes (talk) 22:16, 6 May 2006 (PDT)
Thank you very much. -- Crypto 22:38, 6 May 2006 (PDT)

[edit] Simplified code upload

When a new user wants to contribute, I think it might be a little "scary" to have to create a new wiki-page with markup and everything. Maybe there could be a simple code-upload page, where the user just clicks a button to add a file (like in web-mail systems), and the page is automatically generated. The generated page could be in Category:New or something like that, and more experienced users can look in that category to find pages needing cleanup, moving, "literate"-ing, etc.

I suspect this is not a simple thing to implement, but I think this would lower the bar significantly for new contributors. Ahy1 07:42, 9 May 2006 (PDT)

That's an interesting idea. On the other hand, even now they can just paste a bunch of code into an article. It won't look pretty, but we'll know what they meant. Also, although it would lower the bar for new contributors, I have to wonder whether it would encourage uploading of code under incompatible licenses without credit or code that doesn't compile cleanly on its own (e.g., a single file from a project). Deco 14:32, 9 May 2006 (PDT)
There's an interesting aspect of the MediaWiki file upload facility: license and sourcing claims. Wikipedia puts this to very good use for tracking what files (images mostly) are uploaded from what sources under what licensing basis. I don't know how flexible that facility is, but I recently worked on UUencode (C) and found myself wondering just where the code originated, and I wish there had been some sort of initial attribution. I did exactly that myself when creating Soundex (Rexx), putting the status (Public domain) and source (http://wherever/whatever.html) into the edit summaries, but that's not a universal practice. RossPatterson 20:27, 1 December 2006 (PST)
When uploading code that is copied from other places, it is probably a good idea to mention where it comes from and why it can be uploaded to LiteratePrograms and released under the MIT/X11 license.
I wrote the original code in UUencode (C) from scratch so I don't think any attribution is necessary. The code was not written in a vacuum, however, and the encoding algorithm used is the one presented in code form in this WP article, which is a copy of this copyrighted text. Nothing was copied from that article to UUencode (C), but the code was used as a refernce when writing it. I don't think that is a problem, but I don't know too much about copright. If this is a problem, I will remove it and try to find a completely different algorithm. Ahy1 17:52, 2 December 2006 (PST)
I know more about code ownership than I ever wanted to, thanks to almost 30 years writing the stuff for a living and managing others who do so as well. What you did is fine, and the code you created is yours and yours alone, free for you to do whatever you like, including uploading it here and by implication releasing it under the MIT/X11 license. RossPatterson 20:21, 2 December 2006 (PST)

[edit] Article dependencies design

On my talk page Leland McInnes raised the issue of dependencies between articles. While there are a number of issues with article dependencies, most importantly changes to one article breaking another, I think this will be important for constructing complex programs that really need other articles' facilities to use as building blocks. Here's the first idea that popped into my head:

Each article can include tags of the form Dependency:Blah, which will cause all files emitted from Blah and its dependencies to be included in the downloaded package. I want to avoid specific chunk references, since these are more fragile - the language's mechanisms should be used to import and use the functionality. It should work with redirects, so that if Dependency:Blah redirects to Dependency:Woo, it would correctly include the files of the latter.

Each article has its direct dependencies listed at the bottom (or top?), sorta like categories, and also the toolbox would have a new "View dependencies" link, which would produce two trees: one, the tree of articles that the current article depends upon directly or indirectly, and two, the tree of articles that depend on the current article, directly or indirectly. This would allow a careful user to make changes to an article and exhaustively verify that dependencies are not broken by visiting them all.

Despite all this, I would still discourage dependencies and prefer the use of standard library functionality or simple included implementations wherever this is feasible. What do you all think? I'd also welcome any additional suggestions or comments. Thanks. Deco 07:01, 12 May 2006 (PDT)

Some articles include test-code with main() or similar in the same file as the rest of the code. This could cause linker problems when combining it with code from other articles. It could be solved with some kind of preprocessing, but I think that would be messy.
Maybe there should be a "policy" of putting test-code in a separate file, with a unique file name (possibly based on the article name).
Another solution could be having an extra attribute on codeblocks, indicating that this code should not be automatically downloaded as a dependency. Ahy1 08:24, 12 May 2006 (PDT)
I thought about this, but it seems like the "lazy" approach works fine: someone wants to use another article as a dependency, so they split out the test code into its own uniquely named file if necessary and then use it. The extra files do litter the archive somewhat, though. To avoid filename conflicts it might be useful to put each dependency in its own subfolder. Deco 08:37, 12 May 2006 (PDT)
I agree that it should be up to whoever wants to depend on an article to make the code in that article suitable for compilation with the dependent code. --Allan McInnes (talk) 10:09, 12 May 2006 (PDT)
The Dependency:Blah concept sounds like a reasonable idea. But I agree that it would be better to discourage dependencies - preventing changes in one article from breaking another article could get difficult. One thing we might consider is having the Dependency:Blah links specify a particular revision of the article to which they're linking. That would mean that articles that have a dependency may be using an old version of the article they're linked to, but at least it will guarantee that the code has been tested with that linked version. For example, if I depend on a C insertion sort, I might link specifically to http://en.literateprograms.org/Insertion_sort_%28C%2C_simple%29?oldid=2360 - the version I've tested with - rather than the current version. Following the principle of laziness, it would be up to article authors to test their code with newer version of a dependency, and update the revision number in the Dependency:Blah link accordingly. --Allan McInnes (talk) 10:15, 12 May 2006 (PDT)
This would prevent major breakage. It could result in bug fixes having to be painstakingly propagated, where before they'd get them for free, but if they didn't miss it before it can't be that bad. Deco 11:57, 12 May 2006 (PDT)

[edit] Tip on subject-area category tags

When adding a subject-area category tag to your article, place a vertical bar after the category name, and then add the name of the programming language used in the article. For example, if you wrote an article describing an implementation of the Quicksort algorithm in Eiffel, instead of using the category tag

[[Category:Quicksort]]

you would use the tag

[[Category:Quicksort|Eiffel]]

Adding the language name in this way ensures that the corresponding category page separates out its articles alphabetically by language name instead of article name (see Category:Quicksort for an example), making the category page much easier to navigate. See LiteratePrograms:How to write an article# Subject-area category tags for further information. --Allan McInnes (talk) 17:34, 12 May 2006 (PDT)

Thanks, Allan. This is a great idea. Having everything under a single letter isn't really useful at all. On the other hand, it's also a pain to remember to do it manually. I wonder if the software should be doing something here. Deco 19:36, 12 May 2006 (PDT)
Having the software do something would sure help. I'm assuming that you could extract the language from the article title somehow... --Allan McInnes (talk) 19:44, 12 May 2006 (PDT)

A further note on this: lower-case letters at the start of language names seem to result in the category page including a separate breakout for lower-case letters (e.g. a listing for both 'B' and 'b'). This ends up looking a little odd. I've adopted the convention of listing such languages with an upper-case first letter in the category tag. For example, instead of

[[Category:Fibonacci numbers|bc]]

I use

[[Category:Fibonacci numbers|Bc]]

This seems to keep things better organized on the category page. --Allan McInnes (talk) 13:18, 14 May 2006 (PDT)

[edit] Can I request a specific algorithmn?

Hi, I'm a new user. This is my first time on this site. Can I request that an article for a specific algorithm to be written? - anonymous

Hi there! You sure can, and you can also request what language you want it to be written in. I've created LiteratePrograms:Requested articles where you can ask us to write about a particular topic and someone with experience in that area will hopefully notice and do so. Please ask if you have any other questions. Deco 06:22, 18 May 2006 (PDT)

[edit] MediaWiki 1.6.5 upgrade

Hi all. I integrated the MediaWiki changes between 1.5.8 and 1.6.5 today. This included a substantial bunch of changes, and was a bit painful to integrate, so please tell me if anything isn't working quite right. On the plus side, you get a bunch of new and exciting stuff that comes with the new MediaWiki, including the following:

User interface:
  • The account creation form has been separated from the user login form.
  • Page protection/unprotection uses a new, expanded form
Templates:
  • Categories and "what links here" now update as expected when adding or removing links in a template.
  • Template parameters can now have default values, as default value
Uploads:
  • Optional support for rasterizing SVG images to PNG for inline dislay
Feeds:
  • Feed generation upgraded to Atom 1.0
  • Diffs in RSS and Atom feeds are now colored for improved readability.
Anti-spam extension support:
Numerous bug fixes and other behind-the-scenes changes have been made; see the file HISTORY for a complete change list.

Hooray! Deco 21:27, 18 May 2006 (PDT)

[edit] Recent downtime

An issue on the web server today is causing some connections to be rejected. The log message looks like this:

[Tue May 30 17:43:20 2006] [error] server reached MaxClients setting, consider raising the MaxClients setting

I've increased the MaxClients setting to 1000, but considering how small the load is I'm betting the workers are being consumed by some flaky piece of code. Will keep an eye on this. Deco 18:13, 30 May 2006 (PDT)

I've determined now that it's the number of workers that is exceeding the maximum. All of the workers must be stuck past that point. Stuck doing what I'm not sure. Argh. Deco 19:14, 30 May 2006 (PDT)

After I configured the server to use a Squid cache it seems to not be freezing up anymore. Which is odd, because the cache doesn't seem to be getting very many hits, and it still seems to be using the maximum number of workers. Oh well. On the plus side images seem to be getting cached. Deco 21:13, 30 May 2006 (PDT)

Okay, I've figured this out now. The very large page that I created was taxing the server with its current settings (especially since I encouraged everyone to visit it). I've reconfigured Apache to have a larger maximum number of servers and a larger spare number of servers. This should generally decrease latency in page loading and allow the big page to work without swamping the server. Deco 22:06, 30 May 2006 (PDT)

I've also enabled the file cache for quick display of the most recent article version to readers that aren't logged in, which should decrease resource competition with readers. Deco 22:23, 30 May 2006 (PDT)

Sorry all, it looks like my fix yesterday only delayed the problem, didn't fix it. Attaching to the hanging apache2 processes show hanging of php4 inside php_execute_script and python_cleanup, so I suspect a possibility of some interaction between the php4 and python Apache mods. I've disabled the Python mod - beyond that I can only guess that I'll have to turn on some kind of debug tracing to see what PHP is being executed. Deco 10:32, 31 May 2006 (PDT)

It turns out some apache2 workers are hanging onto session file locks indefinitely. Those workers appear to be doing something with output buffer compression. I've disabled this feature in LocalSettings.php - we'll see how that goes. Deco 11:39, 31 May 2006 (PDT)

Okay, turns out that didn't fix it either. On a hunch I rolled back the changes from the recent upgrade from MediaWiki 1.6.5 to MediaWiki 1.6.6. So far lsof isn't reporting any hanging sessions. Deco 11:50, 31 May 2006 (PDT)

That didn't fix it either. Uninstalled and reinstalled the php4 apache2 mod. Crossing my fingers. Deco 12:05, 31 May 2006 (PDT)

Okay, I upgraded PHP4 to the very latest release (which is safe, since PHP4 is a stable branch of PHP). Going to see if it still repros. Deco 13:15, 31 May 2006 (PDT)

This bug has not repro'ed since the last reboot. If it does, at least I got debug symbols now and the most recent version so I can file a proper bug with the PHP folks. Deco 13:42, 31 May 2006 (PDT)

[edit] Other implementations header

I've added a header to the top of any article with multiple language versions giving prominent links to the other versions. It is currently based on the article names rather than the category. I think this will be handy for allowing one-click navigation between versions and drawing attention to the existence of alternate versions up-front, which is the best time for someone to choose their language. There are two new MediaWiki templates associated with it, MediaWiki:implementationlistheader and MediaWiki:languagenamemapping. The latter serves to map long names used in titles like "C_Plus_Plus" to a suitable short name. Any feedback is appreciated. Deco 19:34, 31 May 2006 (PDT)


[edit] Categories for APIs

Would it make sense to add categories for APIs, libraries and frameworks? I'm thinking of for example a "Category:API:Gtk" for File Manager (Perl Gtk2) and other articles using GTK. Alternatively, the "Category:Environment:..." structure could be used, but it would maybe be a little messy to mix non-standard APIs into that. Any thoughts? Ahy1 13:30, 1 June 2006 (PDT)

I was thinking of having something for APIs/libraries. Categories seem to make sense since a single article can depend on multiple libraries. For something like Xlib I think environment is probably the best way to describe it, but for others like Gtk, GMP, GSL, Boost, etc. this doesn't seem appropriate. The only issue is that I also want to discourage library dependencies, especially on proprietary or copyleft libraries which could limit the scope of who can use the program. But I also recognize that some programs won't be written at all without such dependencies.
Short answer is: yeah, another set of categories seems appropriate, although it need not have a listing on the welcome page like the others. I'm thinking something like Category:Uses library:Gtk2. What do you think? Deco 13:52, 1 June 2006 (PDT)
I agree on discouraging dependencies on proprietary libraries. I think copylefted libraries (GPL etc.) would be impossible to use on this site, because the MIT/X11 code cannot be linked against it (I think).
Using non-proprietary, non-copylefted libraries shouldn't be a problem, as long as there is a real use for it.
"Category:Uses library:..." looks ok to me. Ahy1 14:29, 1 June 2006 (PDT)
Well, it can be linked again LGPL code, which is the point of LGPL, but not GPL. I saw that you created the first "uses library" category, looks good. One of these days I'm going to write something using the GMP and create a cat for that too. Thanks for bringing it up. Deco 16:31, 1 June 2006 (PDT)
AFAIK there's no problem with linking against GPL libraries, as the MIT/X11 license is compatible with GPL[2]. -- Coffee2theorems 15:48, 8 August 2007 (PDT)

[edit] LP namespace abbreviation

I made a small code change so that you can now abbreviate in the Go box and in links any project page using the namespace "LP" instead of spelling out "LiteratePrograms", as in LP:Public forum, LP:Copyrights, and so on. I'm really not sure why Wikipedia never did this for WP. Deco 16:46, 1 June 2006 (PDT)

Oops, temporarily broken. Deco 16:54, 1 June 2006 (PDT)
There, fixed now. Hooray. Deco 17:08, 1 June 2006 (PDT)
Could we have a namespace for Wikipedia too? I find I often want to reference Wikipedia articles when writing verbiage on LiteratePrograms, and right now I'm using hand-entered or cut-and-pasted urls (e.g. [http://en.wikipedia.org/wiki/Soundex Soundex]). Something like [[Wikipedia:Soundex]] (and [[WP:Soundex]] too?) would be much easier on my tired old fingers :-) RossPatterson 20:33, 1 December 2006 (PST)
A suggestion I've already considered - I elect not to include this feature for political reasons. It would emphasise the already too-strong impression that LiteratePrograms is affiliated with the Wikipedia and the Mediawiki Foundation, which I wish to avoid. Deco 15:39, 3 December 2006 (PST)

[edit] Some research on what people are looking for

I found this very interesting and relevant informal study suggesting some of the algorithm and data structure topics that web searchers were interested in in October 1999:

Most interesting is Table 3, which I reproduce here for the purpose of comment:

Table 3: Most and least popular algorithmic problems, by repository hits.
Most Popular Problems Hits Least Popular Problems Hits
shortest-path 3660 generating-subsets 854
kd-trees 3198 edge-coloring 817
dictionaries 3022 satisfiability 792
traveling-salesman 2963 independent-set 789
convex-hull 2963 cryptography 786
nearest-neighbor 2936 text-compression 767
minimum-spanning-tree 2922 maintaining-arrangements 727
voronoi-diagrams 2815 set-packing 703
triangulations 2786 planar-drawing 678
sorting 2734 median 671
graph-data-structures 2596 bandwidth 629
string-matching 2304 factoring-integers 628
suffix-trees 2213 shortest-common-superstring 520
priority-queues 2208 determinants 520
geometric-primitives 2162 feedback-set 483

Although times have changed since 1999, many of these still surprise me - for example, I would expect factoring integers to be near the top, not the bottom. It's no surprise that sorting and basic data structures are up so high, with all the attention they receive in classes and industry, but I'm surprised by the interest in Voronoi diagrams, convex hulls, and KD-trees, relatively advanced computational geometry topics. The interest in travelling salesman is interesting and we could surely publish some well-known approximation algorithms for this problem, such as the one based on the minimum spanning tree.

Finally, the peculiarly high rank of the shortest path problem is interesting - I've gone ahead and created Category:Dijkstra's algorithm. It'd be great if we could cover at least Dijkstra's algorithm (C Plus Plus), Dijkstra's algorithm (C), Dijkstra's algorithm (Java), Dijkstra's algorithm (Visual Basic), and maybe Dijkstra's algorithm (Perl).

I also found this:

This provides a rough feeling of what mainstream working programmers used in 2004 based on a rough analysis of job websites. The only really significant percentages are Java, Visual Basic, C++, Perl, Javascript, and C#. I'm not telling everyone they should drop what they're doing and write articles in these languages instead - but I'd like to make sure that the site as a whole starts to cover these. In particular, we have no VB programs or VB.NET programs, which is a big deal considering the huge number of VB programmers out there. I think this is an issue that could be addressed with carefully targetted recruitment. Deco 01:09, 2 June 2006 (PDT)

[edit] References are here!

I implemented basic references between articles today. It works like this:

<codeblock language=c>
<<foo>>=
<<Insertion sort (C)#5735#insertion_sort>>
</codeblock>

The most important part is the number in the middle, which is the oldid indicating a specific version of a specific article. You see it in the URL when visiting an old version of the article, or when you click on the "Permanent link" link at the bottom of the toolbar on the left hand side. You can include files from other articles by just doing this:

<codeblock language=c>
<<build_and_run.sh>>=
<<Insertion sort (C)#5735#build_and_run.sh>>
</codeblock>

There's currently not a way to view which articles depend on which others, although I realise this is important. Any feedback is appreciated. Deco 12:49, 6 June 2006 (PDT)

You can now view a real demo of cross-article chunks in action at Miller-Rabin primality test (C), which uses most of Arbitrary-precision integer arithmetic (C) for its arithmetic. I realise that clicking on the reference chunks should take you to the right place in the right version of the other article, but it doesn't do this yet. Any comments appreciated. Deco 17:31, 9 June 2006 (PDT)
Looks nice! This will be really helpful for articles describing algorithms on specific data structures that are not included in the language (lists, graphs, ...).
This is not important, but maybe there should be a way to leave out the article version number in the chunk references, so that the current version is automagically filled in when saving the page? In most situations, it is natural to link to the current version. Ahy1 18:09, 9 June 2006 (PDT)
That's a good idea, actually. I don't want it to always link to the most current version, since that risks breakage, but choosing the version at the time of saving seems like it works out pretty well in most cases. Deco 18:12, 9 June 2006 (PDT)

[edit] New download code link at bottom

I've added a link to the bottom of articles linking their download code page. There are a few motivations for this:

  • If a user reads an article, once they finish they're probably sufficiently interested to download the code and try it out.
  • Other sites routinely place download links near the bottom of the page, creating user expectation of this.
  • The bottom is far from the top and it's easier to use it than to scroll back up to the top (at least using the mouse).

However, currently all I could come up with for formatting is some big, bold text. It isn't separated very cleanly from other elements on the page and looks somewhat out of place. Anyone have ideas on how to better format? Deco 14:13, 13 June 2006 (PDT)

You can now edit the style of this link at Mediawiki:Downloadcodebottom. Deco 20:24, 14 June 2006 (PDT)

[edit] "Hello World"

Some articles in Category:Hello World include a loop printing numbers from 1 to 10. While not a big issue, this is not technically a part of a "Hello World" program.

I propose we create a new category for simple language constructs, and move these loops into articles in that category. These new articles could have a common structure with sections on how to do loops, branches, create functions/procedures, simple I/O, command line handling, etc. This way, we have a place where a visitor can go and get a general impression of a language's syntax, semantics, idioms, etc. This would also be a natural place for new users to start contributing Ahy1 10:01, 14 June 2006 (PDT)

I agree. This started with one of the examples doing it and the others sort of followed suit, but it doesn't fit the strict definition of Hello World. An alternative is to have a "Basic constructs" article for each language. Hello World is a very small program and wouldn't really expand very well into a longer article, and neither would the looping article. On the other hand, Hello World is also a familiar and often-searched-for term. Deco 14:55, 14 June 2006 (PDT)
The "Basic contsructs" for each language was what I was thinking of, but I didn't manage to formulate it well. I am not proposing to delete "Hello World" articles, but to keep them as pure "Hello World" aricles, and in addition have _one_ article for each language collecting basic constructs.
I think there is a point in trying to have a similar structure in those articles, to make it easy to compare the different languages. Ahy1 08:30, 15 June 2006 (PDT)
Ah, I see. Just two then, one for Hello World and one for other basic constructs. This might be a good idea. Deco 13:44, 16 June 2006 (PDT)

[edit] Build/install instructions

I think we should have separate articles with build/run instructions for each programming language. Since we provide a "download code" link, it is also natural to explain how to run the code. These articles should probably not go into the main namespace. An automatically generated link from an article to the instructions for the relevant language would be nice. Ahy1 10:01, 14 June 2006 (PDT)

Yes, this is something I've been thinking about. This depends on environment and language, and there might be several options. Maybe there can be an "Installation:" namespace or something.
One simple and more flexible way of addressing this without code changes is to have a template for each language that is added to the end of the article that adds it to the language categoryand links any necessary resources. Deco 14:58, 14 June 2006 (PDT)
I have created Template:Programming language:C as an example. Is this what you had in mind? Ahy1 16:07, 14 June 2006 (PDT)
I'm uncertain as to whether all that info should be in each article or whether it should just contain a link to another article with the details. I rather like the idea of including a section for this in categories like Category:Programming language:C, since the same could be useful for "Uses library" and "Environment" categories. Deco 16:36, 14 June 2006 (PDT)
Yes it is probably too much information to put in each article, and this example was not even close to be complete (lacking info. on makefiles, other platforms ...).
Putting it in the category pages could also be a little messy. If this text got bigger, the list of articles and sub-categories wouldn't be visible with normal resolutions, without scrolling (unless there is a trick to force those lists to stay on the top). Having a separate article, linked from program articles, category and possibly download pages, would solve this problem. Ahy1 08:15, 15 June 2006 (PDT)
I'd suggest doing one of the following:
  1. link to an external website (such as a language website) that already has "build and run" instructions
  2. establish a "build and run" help page for each language, probably in the Help namespace
--Allan McInnes (talk) 13:04, 15 June 2006 (PDT)
Okay, how about this. I suggest we have a page Help:Building and running with a subpage for each language or library that needs its own page (as in Help:Building and running/C, Help:Building and running:OpenSSL). These pages will have sections for each platform. An article can link any number of building and running pages. The Building and running page will link any appropriate external sources as well as provide any information specific to LP, and will be linked from appropriate categories as well. Deco 13:40, 16 June 2006 (PDT)
I agree. That is probably the best solution. Ahy1 16:12, 16 June 2006 (PDT)
I have created Help:Building and running and Help:Building and running/C. I also added a link from Category:Programming language:C.
I had a little problem with linking from the main page to the subpage when using just /C, as described in [3]. Also, the automatic link from subpage to parent page doesn's show. So, what did I do wrong? Ahy1 17:06, 17 June 2006 (PDT)
Thanks for setting these up! Subpages might only work in the main article space. I'll look more into this tomorrow. Deco 00:04, 18 June 2006 (PDT)

[edit] Power users

I've modified the interface so that what were previously called administrators or sysops are now referred to as power users. Although this seems like just a silly name change, it reflects a policy. Jimbo Wales once said that promoting users to admins on Wikipedia "shouldn't be a big deal", but it is, and the reason is because the admin status comes with an implicit responsibility, authority, and status. My hope is that the change in terminology will emphasize that this is really not a big deal, just some extra software features given to users who seem to be not eradicating the site. Being a bureaucrat is a big deal, and for now this will only be given to users who I personally know and trust. Deco 19:30, 20 June 2006 (PDT)

I agree with this one hundred percent. -- Derek Ross | Talk 22:23, 9 August 2006 (PDT)

[edit] Downloading programs - documentation improvement?

I notice that when one downloads a page (at least in the .tar.gz format), no documentation appears to accompany the actual source code. Is this intentional, or just an unintended side-effect of using noweb? If the latter, perhaps a HTML file of the article would be nice. As it is, if I want to see the comments on the Sierpinski triangle, for instance, I have to be online. --69.113.106.8 16:10, 21 June 2006 (PDT)

How about adding a optional download to allow to download code with comments (/* like this */) Waxhead 16:18, 21 June 2006 (PDT)
This is a good point. The problem of comments and literate programming has always been a little bit tricky, since if you explicitly write them in the literate presentation, they just look redundant, and the literate programming text itself is much more verbose than typical comments. One potential solution that I've considered is automatically inserting the chunk names above each chunk as summary comments. I think including an HTML version of the page in the archive, along with its image dependencies and so on, would also be a good idea. Deco 17:05, 21 June 2006 (PDT)
The other problem with turning literate text into comments is of course that the code chunks in a literate program often appear in a different order than in the code-only program. Making the literate text into comments would mean either disassociating the text from the code it describes (hardly useful), or rearranging the text to match the code (likely to produce disjointed and incomprehensible comments). In my opinion the best solution is probably to provide the HTML version as part of the archive. --Allan McInnes (talk) 21:08, 21 June 2006 (PDT)
Some browsers allows you to save the web-page. In Mozilla Firefox, it is at File->Save Page As. Images are stored in a sub-directory, and linked from the saved HTML file. This would allow you to read it offline. Ahy1 06:41, 22 June 2006 (PDT)

[edit] Permission changes

I've made a few small changes to permissions. All registered users now have the rollback function, which I believe is useful and largely harmless. I've also given anonymous users the move command, since this is easy to detect and reverse and they may be tempted to copy-paste move otherwise, which would be worse. I'm considering moving "block" up to bureaucrat, since this is probably the most dangerous power user command, but I'm leaving it for now. There's no clear and present need for these changes, but I think these will be useful in the long run. Deco 17:37, 21 June 2006 (PDT)

These are very sensible changes. I wish that they would do the same on Wikipedia. Thanks. -- Derek Ross | Talk 22:20, 9 August 2006 (PDT)

[edit] How to deal with OS revision specific code?

Say I want to submit a piece of code that uses a spesific API funciton that only exists on a particular revision of a operating system (for example WinXP SP2). I'm not sure if it would be a smart choise to add a new cathegory for that spesific service pack or if it would be enough to make a note that this code requires SP1 for example. I don't think it's a good idea to over cathegorize but then again perhaps it might be easier when it's millions of literate programs here. And what to do if a piece of code behaves diffrently on a spesific revision (service pack)? Any bright ideas? Waxhead 12:36, 22 June 2006 (PDT)

That's a good question. I certainly wouldn't create categories for individual hotfixes/patches, but these usually don't add functionality. At least at the current time, it's relatively common for software to state for example that it "requires Windows XP with Service Pack 2", almost as though it were a separate product. I think in the case of notable service packs that add significant functionality, it makes sense to create a suitable subcategory; this category might not be added to the template on the Welcome page, but still be available (some languages do this). If the service pack becomes subsumed in practice by a future release, then it might be retired. Deco 14:57, 22 June 2006 (PDT)
Well from Windows XP SP0 to SP1 and SP2 there's been added many new API's. GetSystemTimes(), BluetoothAuthenticateDevice(), WinHttpWriteData(), NeedCurrentDirectoryForExePath() etc... etc... just to name a few. Also there's a load of new constants and stuff (after all it's Windoze). So I'm not sure I fully agree that Windows XP service pack 2 for example is not a separate product from service pack 1. Ofcourse this depends on how much new stuff a service pack introduces (I think I won't classify SP1 as a "new" product but maybe SP2). For now I can't se the point in creating a sub cathegory just for one program but it might save some work later when literateprograms becomes the larges server in this region of the universe =) ... Another problem is ofcourse when a certain program requires SP2 of for example WindowsXP and SP3 of Win2K and SP1 of Win2k3 how do we deal with that?! Perhaps the simplest thing would be to just split the Windows part in 9x/Me and NT/2k/XP/2k3/Vista or whatever and just hope that everyone who submits a piece of code states clearly at the top what OS(and SP) it requires or what kind of OS(and SP) the program is tested under. And btw: yes, I know I'm picky ;) Waxhead 12:49, 23 June 2006 (PDT)
Yeah, I agree, let's expand as necessary - the base categories should be fine for now as long as the article clearly states what it requires. Deco 18:51, 23 June 2006 (PDT)

[edit] Syntax highlighting: later definition of subpatterns

We could write clearer and better syntax highlithing by specifying named subpatterns (PHP 4.3.3+, PCRE library) defined later in subsequent xml elements within SyntaxHighlightingRegexps xml file. It can be made by using an element tagged 'subpatt' with an attribute 'name' which when found you would only need to replace the first occurrence of the use of the named subpattern in the regex value (?P>name) with the subpattern definition (?P<name>subpatt contents). Here is an example for scala type parameters [...] with recursion (?R) to match the nested braces enclosed expression in "[A <% Ordered[A], List[Pair[Int, String]]]":

 <regex><![CDATA[\[(?P>type_expr)(, *(?P>type_expr))* *\]]]></regex>
 <subpatt name="type_expr"><![CDATA[(?P>ident)(?R)?( *(?P>type_op) *(?P>ident)(?R)?)*]]></subpatt>
 <subpatt name="ident"><![CDATA[[a-zA-Z][a-zA-Z0-9_]*]]></subpatt>
 <subpatt name="type_op"><![CDATA[(<:|<%|>:)]]></subpatt>

We could do great highlightings with this stuff! G. Riba 14:32 9 Jul 2006 (CET).

Evidently you know PHP patterns better than me, Griba. this is an interesting idea but I'll have to study it more closely. Thanks for the suggestion. :-) Deco 16:29, 9 July 2006 (PDT)

[edit] Page move vandalism

Recently User:Willy on Wheels vandalized many pages by moving them to titles ending in "...on Wheels". Ahy1 took care of most of the cleanup (and don't worry, Ahy, you didn't accidentally delete any good articles), and I took care of the rest. I don't think a database rollback will be necessary. This is an attention-seeking vandal, so with the mess cleaned up, it's best we get on with the editing and show him no further attention - in particular, do not block him. Thanks. Deco 12:41, 11 July 2006 (PDT)

[edit] Online Compiling, Unit Testing and Interpretation

I am not sure why not one has suggested this but why don't we have some kind of ability to compile, interpret or execute programs online. I guess because it involves security problems, it is difficult to implement etc. But it would be really cool if it could be done. It looks like this site is just meant to be used to document algorithms. However it could go much further. It could be used as something like a wiki-based collaborative ide.

This is what I'm hoping for as well. I guess only Deco can answer :-) Fredrik 13:46, 8 August 2006 (PDT)
Yes, in short, the main problems are security issues and the inability to compile and interpret programs for all platforms (since the server runs only one particular platform, and many toolsets are proprietary and cost money). A sandbox could be constructed for a few particular environments, and some projects have done things like this, but it would have to be done very carefully. I apologise for the slow response. Deco 16:38, 10 August 2006 (PDT)
Thinking more about unit testing, even if we currently lack online unit testing, there's no reason we can't have it offline. In fact, many of our "test mains" already do rudimentary unit testing. In the interest of keeping articles relatively self-contained, I think this is preferable to having some kind of shared unit testing framework. But certainly having more comprehensive unit testing in our test mains is a good idea. Deco 14:19, 16 August 2006 (PDT)
Certainly some aspects of the test interface could be standardized without relying on a particular framework. With this in mind, at least in Python's case, I could easily write a script that automatically fetches a program from LP and tests it. But I'm too exam-stressed to contribute at the moment. Fredrik 07:16, 17 August 2006 (PDT)
How about a mechanism for JavaScript programs to be published embedded in a web page so they could be interpreted directly on the client browser? It might not work for all languages, but JavaScript has an easily accessible execution environment. --Setikites 08:25, 15 September 2006 (PDT)

[edit] Custom stylesheet issue

I've created a custom stylesheet (User:Fredrik/monobook.css), but I can't change the formatting of <<>> directives since it is defined using raw HTML. Would it be possible to implement it with CSS classes instead? Fredrik 05:39, 11 August 2006 (PDT)

Hmm. This might be possible by editing the MediaWiki:SyntaxHighlightingStylesheet page to use a CSS class for each kind of thing, then placing the current style for these classes in the standard stylesheets. This seems like a good idea and I'll look into it when I get a chance. Deco 13:52, 11 August 2006 (PDT)

[edit] Syntax across languages

I recently found out about a list that compares syntax across languages, a very valuable resource IMHO. It would be nice if you'd provide a link to it in the navigation bar or wikified the list altogether with the consensus of it's author...--Joris Gillis 13:15, 16 September 2006 (PDT)

[edit] Codeblock code

Hi -- I'm wondering if the codeblock code is open source? This is the best implementation I've seen of code highlighting in a wiki and I was wondering if it's availble for other projects, or if it's only available on LP. Thanks for the great work! -206.160.140.2 09:25, 29 September 2006 (PDT)

Sorry for the delay. Yes, I should add an explicit license statement to the file. I'll probably be compelled to release it under the GPL, since it interacts in an intimate way with the GPLed Mediawiki code. Deco 15:24, 4 October 2006 (PDT)

[edit] Licence differences between Wikipedia and LiteratePrograms

Hi there! I appreciate your contribution of this interesting program, but unfortunately we cannot accept text from Wikipedia due to differences in license. Nevertheless I hope this program will be developed into an illustrative literate program. Deco 15:33, 4 October 2006 (PDT)

Can someone elaborate? Surely you mean copywrite not licence.

Hypothetically speaking, what if an author wrote a text on Wikipedia and wrote exactly the same text on LiteralPrograms. Does the licence belong to the author or Wikipedia?

It's license, not copyright. The license, which is applied by the copyright-holder, is what gives you permission to copy and alter text. Text on Wikipedia is licensed under the GFDL. Text (and code) on LiteratePrograms is licensed under the MIT/X11 license. The two licenses are not compatible, so GFDL text cannot be added to this wiki.
As for your hypothetical: as copyright holder, you could presumably license the same text in different ways on different wikis. But you would need to make sure that the text you used didn't include any modifications made by other editors (who hold copyright to the changes they've made).
--Allan McInnes (talk) 22:22, 4 October 2006 (PDT)
Hey anonymous person. Allan's response is 100% accurate. Some details and justification are available at LiteratePrograms:Copyrights#Compatibility. Although it might seem nice to have WP content explaining an algorithm, in practice this creates a forking problem where our incomplete, static copy of the content diverges from the original and needs continual updating. A simple hyperlink is much more robust. Deco 01:24, 5 October 2006 (PDT)

[edit] Google Code Search

Would it be possible to make Google Code Search index LiteratePrograms programs? Fredrik 07:26, 5 October 2006 (PDT)

According to their FAQ, "[w]e're crawling as much publicly accessible source code as we can find, including archives (.tar.gz, .tar.bz2, .tar, and .zip), CVS repositories and Subversion repositories." Since the Download Code button is a direct link to an archive containing the source code, it seems logical to suppose that their crawler will index it. If they don't I might e-mail them and ask why they think it's not being. Deco 18:49, 5 October 2006 (PDT)

[edit] script tags in HTML

Over at the data URI quine I code dumped, it seems that the javascript part is missing, having been chopped out of the source and replaced by "UNIQ18a7b6d1123ec2d1-HTMLCommentStripa37c1de65c307b400000001". Any suggestions for workarounds? Dave 08:09, 12 October 2006 (PDT)

This appears to be a feature of Mediawiki performed before the extensions are run (before the codeblock extension can get to it). I'm not sure if it's important, but for now I've disabled it. Your article should be fine. Deco 20:50, 12 October 2006 (PDT)

[edit] .tar.gz downloads doubly gzipped?

The .tar.gz downloads seem to been gzipped an extra time. If I gunzip, then I can tar xvfz the result. Could be an artifact of Safari downloads; the zip and tar.bz2 work as expected. Dave 11:07, 15 October 2006 (PDT)

I just tried a .tar.gz from a random page with Mozilla and did not experience this. It might have something to do with your browser, or maybe the particular article you were looking at. Deco 23:54, 15 October 2006 (PDT)

[edit] Account renaming

Is it possible to rename accounts? I'm not sure what's involved in this, but Wikipedia allows it. hircus 18:04, 16 November 2006 (PST)

Yes. It involves me doing things directly to the database. :-) Just drop a message at User talk:Deco. Deco 03:10, 17 November 2006 (PST)

[edit] Spammers

I feel that the best way to deal with spammers is to block them for a long time. However I don't know how strongly Deco wants us to handle this, so if any of the other contributors have thoughts on the matter let's hear them. In particular if any other admin thinks I've been too lenient or overly harsh, I'd appreciate the feedback. -- Derek Ross | Talk 01:25, 10 December 2006 (PST)

I don't think there is such a thing as being 'overly harsh' against spammers. Most spam edits are probably made by bots anyway. The problem is that banning generally isn't effective since these edits typically come from anonymous IP:s that are only used once. Fredrik 22:24, 10 December 2006 (PST)
Good point. Unfortunately blocking them as they pop up is all I can do. At least it's a token even if it's not that effective. -- Derek Ross | Talk 13:43, 11 December 2006 (PST)
Unfortunately, in addition to being rather ineffective, spammers also often use dynamic IP blocks that are shared with legitimate users. There might be a better solution here but I don't know what it is. Deco 00:24, 12 December 2006 (PST)
Maybe this extension could take care of most of the spam? Ahy1 08:15, 12 December 2006 (PST)

Of course, it's up to Deco, but MediaWiki can limit access in a bunch of ways, including preventing unregistered (aka anonymous) users from editting or creating pages. Spam almost always comes from unregistered users, and it's not much to ask of someone who wants to contribute here that they register a userid. RossPatterson 08:08, 30 December 2006 (PST)

For now I think the problem is managable. I'll use the blacklist if I have to. I won't disable anonymous editing, as I believe that anonymous editors that would not register make useful contributions, and conversely that vandals would often register if compelled to. Deco 09:39, 2 January 2007 (PST)

The spammers behind 89.208.*.* are becoming extremely annoying and far too persistent. Can anything more be done to discourage them short of a range block ? -- Derek Ross | Talk 22:07, 4 June 2007 (PDT)

I think this page should be protected ("Block unregistered users"). While not effective against spammers with a user-id, it would stop the current attacks.
The impression visitors get when looking at "Recent changes" is currently not good. They might think that spam is the only thing happening in this wiki. Ahy1 11:05, 6 June 2007 (PDT)
I agree. We need to do something more than we're doing just now. -- Derek Ross | Talk 13:32, 6 June 2007 (PDT)
Agreed. And thank you both for your tireless efforts in reverting spam (I'd help more, but you two always seem to get there before I do). --Allan McInnes (talk) 23:02, 6 June 2007 (PDT)
Ok, no protests so far, so I have protected the page. We can try to unprotect it after a period to see if the spambot has given up. Ahy1 02:03, 7 June 2007 (PDT)

[edit] More Languages

How exactly do you decide on a candidate to add? Is it just what anyone decides to add, or does it have to be specific (i.e. widely used, etc.)

I don't know if there is a policy on this, but it seems like most programming languages are accepted. Ahy1 14:02, 29 December 2006 (PST)
Any language is accepted here. There is no requirement that the language be notable, useful, or widely used. If we get too many languages we may start trimming the template on the Welcome page, but they will still all be accessible through Category:Programming languages. Of course, I expect most articles to be in mainstream and/or practical languages, as a matter of contributor experience. If anyone disagrees with this general policy I'd welcome dissent. Deco 09:37, 2 January 2007 (PST)

[edit] Anonymous editing and 127.0.0.1

Due to the server's present circumstance, a rather bizarre setup involving SSH forwarding, wifi, and a multihomed laptop, all anonymous edits will appear to have come from the localhost IP 127.0.0.1. When I get wired Internet hooked back up to the server things will be back to normal. Deco 06:43, 3 January 2007 (PST)

After some trouble, the server is on wired Internet again now and should be operating as usual. Deco 15:49, 15 January 2007 (PST)

[edit] Update copyright date?

Time for 2007 in the copyright headers? Dave 10:43, 3 January 2007 (PST)

You can edit this yourself at Mediawiki:Copyrightcomment. I'm currently updating the code to insert the current year in place of $4. Deco 16:36, 3 January 2007 (PST)
Done. Year will always be up to date now. Deco 16:45, 3 January 2007 (PST)

[edit] Comments for REXX

Can someone please update MediaWiki:Commentsbyextension to add "rex" and "rexx" to the list of c-style comment languages? I don't have the necessary permissions. Thanks! RossPatterson 19:35, 3 January 2007 (PST)

Done Ahy1 22:54, 3 January 2007 (PST)

[edit] Codeblocks

Is the code blocks code released under GPL?--RyanB88 17:04, 16 January 2007 (PST)

MIT/X11, according to the LiteratePrograms:Copyrights page. The exact terms should be available from the header that gets prepended to downloaded source files. Dave 12:05, 3 February 2007 (PST)

[edit] Slashdot

FYI, LiteratePrograms has been referenced on Slashdot in a posting about another code-in-various-lanugages wiki, RosettaCode [4]. The reference is well-buried, so hopefully we'll survive :-) RossPatterson 08:37, 22 January 2007 (PST)

[edit] Spammers Again

How difficult would it be to run a sanity check that LiteratePrograms:Public forum edits only add, and don't delete (much) content? That seems like it would have caught most of the recent forum spam. (it looks like the last few have all inserted themselves just about 32k in — which might be fairly suspicious in itself) Dave 22:20, 12 February 2007 (PST)

Unfortunately this would also complicate archiving. I don't think it's past the point where it can be patrolled yet. Deco 14:01, 24 February 2007 (PST)
Did nofollow help any on Wikipedia? Dave 02:17, 17 March 2007 (PDT)
Maybe easier, given that spammers presumably don't check the sites which they attempt to spam: move "Public forum" to something like "LP public forum", then protect "Public forum"? Dave 02:39, 17 March 2007 (PDT)

[edit] PHP 5 upgrade

I recently upgraded to PHP 5 in preparation for integrating the latest version of Mediawiki. This broke the Downloadcode page for a bit due to changes in PHP 5, but these are now fixed. Sometime very soon I'll set up a Bugzilla for tracking issues and suggestions. I also intend to integrate more of the standard extensions for things like spam blacklisting, oversight, fine-grained permissions, and so on. Deco 14:01, 24 February 2007 (PST)

[edit] LiteratePrograms Bugzilla is here

LiteratePrograms Bugzilla is here. Use it to report any issues you encounter or suggestions for enhancements you have. I plan to use it for new features in the future as well. Deco 21:49, 24 February 2007 (PST)

[edit] Image Problem?

I have several image files that only recently acquired the following warning, and no longer display.

Warning: This file may contain malicious code, by executing it your system may be compromised.

I've tried uploading new copies, altered copies, JPEG in place of PNG, and uploading in different browsers. Is this possibly an issue on the server side? (especially because it has happened to older images -- but only some of them, not all)

(sorry, attempted to use the LP Bugzilla, but haven't been able to create an account) Dave 04:38, 4 March 2007 (PST)

Thanks Dave. I'm looking into this during the upcoming integration of the latest Mediawiki. I'll also fix LP Bugzilla so that you can create an account properly. Deco 18:21, 4 May 2007 (PDT)

[edit] History of Literate Programs wiki

Hi, I'm currently researching the history of literate programs and wikipedia. I have found enough information behind the history of literate programming and wikipedia as two seperate topics but cannot find any information on how this literate programs wiki started. I would like to know who created it, what influenced them to create it and when it was created. Any information would be much appreciated. You can email me at 322398@swan.ac.uk or just respond here.

A few quick answers:
  • Who: LP was created by Deco.
  • When: The first edits to the LP wiki by Deco appear to have been made around March 2005. But the wiki didn't really go live until around February 2006.
  • Influences: You'll have to ask Deco about that. I see you've already posted a question on his talk page. You could also try asking over on his Wikipedia talk page, which may get a you a faster response.
--Allan McInnes (talk) 19:14, 2 April 2007 (PDT)
Thanks Allan. I've responded to the inquiry. Deco 18:19, 4 May 2007 (PDT)

[edit] Translation of POT/PO-files using wiki

Translators of free (as in freedom) software needs quicker tools that allow for distributed translation teams, and a wiki like Literate Programs would fit that bill with the necessary tags in place. If a browser is the only tool needed, the barrier to participate in translation would be significantly lowered.

Sounds interesting. Can you give a demonstration example ? -- Derek Ross | Talk 19:04, 2 May 2007 (PDT)

I'll try.

Here is the head of sahana.po:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSIONn"
"Report-Msgid-Bugs-To: n"
"POT-Creation-Date: 2006-02-06 11:10+0600n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONEn"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>n"
"Language-Team: LANGUAGE <LL@li.org>n"
"MIME-Version: 1.0n"
"Content-Type: text/plain; charset=CHARSETn"
"Content-Transfer-Encoding: 8bitn"

#: ../inc/lib_logger/actions.inc:2
msgid "Create User"
msgstr ""

#: ../inc/lib_logger/actions.inc:3
msgid "Edit User"
msgstr ""

#: ../inc/lib_logger/actions.inc:4
msgid "Delete User"
msgstr ""

and here meta-data and each msgid has been given a translated msgstr.

# Translation of sahana.po to Norwegian
# Copyright (C) 2007 Sahana
# This file is distributed under the same license as the SAHANA package.
#
# Haakon Meland Eriksen <e-mail address>, 2007.
msgid ""
msgstr ""
"Project-Id-Version: sahana_nb_NO\n"
"Last-Translator: Haakon Meland Eriksen <e-mail address>\n"
"PO-Revision-Date: 2006-10-13 23:10+0200\n"
"Language-Team:  <nb@li.org>\n"
"Language-Team:  <nb@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"MIME-Version: 1.0\n"
"Language-Team:  <nb@li.org>\n"

#: ../inc/lib_logger/actions.inc:2
msgid "Create User"
msgstr "Opprett bruker"

#: ../inc/lib_logger/actions.inc:3
msgid "Edit User"
msgstr "Rediger bruker"

#: ../inc/lib_logger/actions.inc:4
msgid "Delete User"
msgstr "Slett bruker"

The GNU `gettext' utilities manual explains the format and options in detail, so I'll say something about how I believe LP can speed things up for translators. Please start by imagining LP as large as Sourceforge.net, and how that works now. It's not easy to start translating anything. First, I would like to add that there are similar efforts with Pootle at translate.sourceforge.net and Canonical's Launchpad, but I like Mediawiki. Secondly, semi-off-line tools like KBabel are nice because you can get autotranslation from dictionaries containing prior translations. However, all of this means none-technical translators needs to get a lot of tools and help to get started doing something very simple. Enter Mediawiki/LP.

If a Mediawiki-category is use to house the entire piece of software, then a subcategory could be called languages, and here a page could be a POT-template. Hitting a tab on top which said "Create new language", could require to fill in a language name, say Norwegian Bokmål, and you either get something like the empty example on top, or a number of editable sections, one for each msgid. Does this make sense? -- Unsigned

I think so. I take it that each set of translations would be kept on one page so that a new language translation could be produced by cutting and pasting one of the previous language translations. Even with the current setup I think we can do what you want. I'll set up a page to let you see what I mean. -- Derek Ross | Talk 22:37, 10 May 2007 (PDT)
Derek The Magnificent! What an elegant solution! :D -- Haakon 03:56, 11 May 2007 (PDT)
Mediawiki depends on Apache, PHP and MySQL, and it has table prefix built in, among other things. This makes it easy for start-ups to use a low cost, single database for several web-based free software solutions at most hosting companies. Does LP have many dependencies not readily found at your local hosting company? Would it be necessary to reproduce noweb in PHP to make LP more palatable to such service providers? Haakon 04:04, 11 May 2007 (PDT)

[edit] Bugzilla and e-mail issues

Due to some restrictions imposed by my ISP, it's temporarily impossible for my server to send mail. Consequently, password reminders and e-mail verification mails won't work until I can fix it. This is why no one could sign up on LiteratePrograms Bugzilla. I've temporarily modified Bugzilla to disable e-mail confirmation, which will enable you to create an account with no trouble. Please create a Bugzilla account and start entering bugs and features, anything you like. Thanks! Deco 22:57, 4 May 2007 (PDT)

E-mail should be fixed now, for all purposes on both this wiki and the Bugzilla site. Deco 02:51, 7 May 2007 (PDT)

[edit] Downtime

Apache has been acting weird lately, stopping serving pages after a while. I think this is because of the integration of Mediawiki 1.10 I was doing on the dev wiki. I've disabled the dev wiki for the moment to diagnose and hopefully it'll be fine. Deco 13:28, 11 May 2007 (PDT)

hijacker
hijacker
hijacker
hijacker