Small updates to my Javascript speed reading app

Just a note concerning two small new features I added to my Javascript speed reading (RSVP) app:

  • You can now change the speed using your keyboard’s up/down arrows keys
  • Text and background colors may now be selected using a color picker (based on JsColor)

These were features some users asked for either on the blog or in the comment form in the app. Thanks for the feedback!

Organizing code snippets and programming knowledge

(This post is geared towards programmers.)

This blog is about structuring your personal knowledge. Code snippets and, more generally, programming language information, are interesting in that everyone and their cubicle neighbor seem to have their own approach to organizing them. Here I survey some interesting software and approaches I’ve read about, their features, and present my own method based on my personal wiki.

UPDATE July 29, 2011: there’s a good discussion about the wide range of options people use over at StackOverflow.

This post is an example where wiki features come in handy (by opp. to a thorough survey of Code Snippet Management as, err, an academic field of study).

Software and approaches

A code snippet manager is a piece of software which allows you to organize short pieces of code to reuse later. Yet I’m also seeking the ability to integrate general information about the language (explanations, elements of theory, etc.): in my experience, snippets are often examples of a notion I’m learning.

In researching a bit on existing systems, I’ve found a few feature families:

  • Code features
    • Syntax highlighting
    • Management of multiple files (a plus if you want to add entire libs to your snippet database)
    • More specific:
      • automatic indentation on insertion
      • dependency management
      • IDE integration
      • (other noteworthy?)
  • Organization and retrieval features
    • Hierarchical: by language, by functionality/algorithm
    • Tags
      • Tags are particularly useful here (vs pure hierarchical) because I’ll often stumble on situations like:
        • I need a snippet in whatever language for a quick sort algorithm.
        • I need a C++ snippet with an iterator loop.
    • Full-text/regular expression search
      • Regular expressions are especially useful since you often seek specific constructs and regular text indexing won’t cut it.
    • Hyperlinks (well, hallmark of wikis here)
    • Date and other general fields
  • Sharing

There are lots of different approaches and systems. Specialized software exists that allows you to organize your snippet library in a standalone and dedicated manner. Google Snippely is an example:


Screenshot of Google Snippely

A whole bunch of sharewares exist that do similar jobs. Some IDEs come with a snippet manager integrated, as is the case with Visual Studio. Most of these local programs offer a basic outline for organization with more or less search capabilities. If you’re looking for an online version with tagging, check out Snipplr, which, being online, also allows you to share and search others’ submissions.


Snipplr homepage screenshot

In the homebrew solution department, this thread is interesting. Some people talk of filesystem based solutions. A few even use a custom database. Personal wikis (as I use, see bellow) and general outliner software clearly need mention too. For example, this blogger says she uses Microsoft OneNote to organize her snippets.

Getting a bit less personal, it should be noted a quite a few bloggers describe their blog as being a “repository for them to search later”. Therefore blogs and websites somehow count as personal snippet libraries (I did a bit of this with my old me-me-me blog over yonder). These score high on integrating other information (ie. free-form formatted text) with the snippets, and of course on the sharing aspect. Community wikis (ie. not personal) are also a great way to organize and share snippets and knowledge (examples here, here).

As a side note, it’s pretty clear we won’t only rely on our own snippets when coding. “The Web + Google” describes my most often used “system” when searching for coding solutions. Yet there are specialized search engines for this job: Google Code Search (you can use regexps on the whole DB!), Koders, and quite a few more.

My approach

Given earlier posts, this doesn’t need a drum roll introduction: I use my personal wiki to organize my snippets and my programming language learning. Of course, this solution allows for inclusion of formatted text. I admit I have a strong tendency to use my snippets for learning more than for reuse, so that factor might weight more than usual in my choice.

A wiki will allow for many different types of retrieval. For example, using the right combination of plugins, with WikidPad I have hierarchical organization, tags/keywords, full text and regular expression search, and, of course, linking. Most popular wiki systems will have plugins to allow for syntax highlighting, and WikidPad is no exception.


Code snippet screenshot in WikidPad
(using the PrettyCode extension)

Where that solution might be lacking is in the IDE integration department, and in the management of multiple files. In the last case, I have a separate personal code (file system) directory to which I may refer using file:// links.

Repetition and my WikidPad dynamic search extension

Digression on repetition

Information overload has numerous causes, and one of them is plain old repetition, e.g.: two sources delivering the same information, with superficial differences. It’s natural to repeat information for various reasons.

As an example, when students take notes on a teacher’s lecture, they all duplicate basically the same information. If they all decide to put their notes online, bam, 30 new versions of “Notes on Heisenberg uncertainty principle”. Same goes for journals and bloggers reporting on a given event.

Of course there might be additional value to each version, different points being made, but for someone doing research on recent events, he still gets to read again and again the same basic facts.

Clearly there’s no simple solution. In fact I might mention here that discussion in the blogosphere does create repetition, but makes that information evolve. Something similar happens for students exchanging notes. In this light, repetition appears as a necessary evil.

If we really want to get philosophical, let’s just say repetition is unavoidable from the very start, as production of repetitive information is just the consequence of information flowing in the social graph and of different human beings going through similar experiences and train of thoughts. And clearly it’s not because one of them has eaten apple pie that humanity can move on and experience other stuff.


Gratuitous picture of humanity’s bane (source)

(Ah, of course, the irony here is that this very article is just some remix of ideas told a zillion times over).

My WikidPad extension

Yet, being aware of the problem, you can at least work on making your own set of notes as repetition-free as possible. That’s another core reason why I love personal wikis. Instead of rewriting information on two pages, as you’d do in paper notes because you don’t have your old notebooks handy, you simply link to the other page and voilà! you just avoided adding a little more repetition to this world (why not add some grandiose here? :) ).

Yet there are cases where where linking is not enough. Say I’m taking notes on the differences between two programming languages, C# and Java. I have a page on C#, a page on Java. Where do I put the notes? I could create a page dedicated to that topic, but I don’t have enough material for the moment to justify that. So say I put them in the page about Java. Consequence: when on C# page I have to navigate to the other page to read the info.


Diagram explaining the extension

What my extension does is grab the info on the Java page (and any other page) and dynamically bring the relevant sections in the C# page. Technically, you give the extension a keyword, and it will search your whole wiki to find pages that contain it. Then, in those pages, it searches for precisely the lines that contain your keyword and some context around it (“sections”). It then prints a list of those sections.

Now it doesn’t matter as much where I put the notes. As long as I label the sections correctly, I can centralize them in the relevant pages when needed, and I don’t need manual copy anymore.

Grab the code & read details here: http://www.fsavard.com/flow/wikidpad-dynamic-search-results/

Speed reading and my RSVP web application

A few days ago I published a JavaScript-based web program, which takes a text as input and flashes groups of words successively. It’s inspired by many other similar programs available on the Web, some free, some not. The technique is called RSVP, for Rapid Serial Visual Presentation. I baptized the program “Faster!” (well, I had to pick a name :) )

<br />
A screenshot of Faster!

Go ahead and try it out. Nothing to download, just click “Play that text”.

In the rest of the post I elaborate on similar software and the effectiveness of speed reading in general.

Continue reading ‘Speed reading and my RSVP web application’ »

Small speed reading JavaScript app

This is a work in progress, but I’ve developped a small speed reading application in JavaScript. It’s definitely not the first of its kind, but I wanted web version with more options. I’m also planning to open source it, and I’ve yet to see an open source web app of this kind.

The app: http://www.fsavard.com/code/speedread/

You simply click “Play that text” and you should grasp the principle real quick.

This is thought by some to increase your reading speed if used consistently. It teaches to not go back while reading, not “subvocalize” (ie. hear the words in your head, or even whisper them as you read) and by displaying more than one word at a time, to read more in one glance.

If you like it and want to come back to it, there’s a bookmarklet in the “About & download” tab that will allow you to select text in any web page and use it as input. Or you can simply copy & paste the text in the text area.

I’ll post something more lengthy on speed reading at some point.