Sunday, June 28, 2009

AhkWikiPad



This is my version of a plain-text desktop wiki in AHK. I used the "Scripting Pad" at the AHK Forum as a basis for this application.

AhkWikiPad is just a simple editor that allows wiki-like links to other files (typically in the same directory as the application). Each wiki-page is a separate text file.

It should be placed into its own directory. Two files must be present at all times, namely "Home" (no extension) and "garbage.txt", which is used for creating new pages.

Links should be enclosed in double brackets, like so [[Plain-text wiki]]. If the file to which a link refers does not exist, it will be created. Just select the name, including the square brackets, and press CTRL-O to create the page or to jump to the page, if it already exists. The wiki-names are case-sensitive.

CTRL-D will delete both the link and the file, but it does not remove the reference to the file in other wiki-pages. I will need to look into that. AhkWikiPad cannot automatically rename the files corresponding to the links either, but that should be easy to implement. (The bigger problem will be to figure out how to rename the link in all other wiki files.)[1]

So, AhkWikiPad is very rudimentary at this point, but perhaps not bad for the "work" of a rainy Sunday afternoon of just experimenting in order to see whether such a thing a thing is possible.

#SingleInstance off
;#NoTrayIcon

gui, font, s10, Tahoma
gui, color, FFFFCC

Menu, FileMenu, Add, &Open `tCtrl-Shift-O, FileOpen
Menu, FileMenu, Add, &Save `tCtrl-S, FileSave
Menu, FileMenu, Add, Save &As `tCtrl-Shift-S, FileSaveAs
Menu, FileMenu, Add, E&xit `tCtrl-X, SaveAndExit
Menu, FileMenu, Add, &Discard, Exit
Menu, EditMenu, Add, &Time `tCtrl-T, Time
Menu, EditMenu, add, &Date `tCtrl-D, Date
Menu, MyMenuBar, Add, &File, :FileMenu
Menu, MyMenuBar, Add, &Edit, :EditMenu
Gui, Menu, MyMenuBar

Gui, +Resize
Gui, font, s10
Gui, Add, Edit, vMainEdit WantTab r30 x5 y5,
Gui, Show, w600 x0 y0, AhkWikiPad - untitled
CurrentFileName =
Gosub Initial
return

Initial:
FileRead, MainEdit, Home
GuiControl,, MainEdit, %MainEdit%
CurrentFileName = Home
Gui, Show,, AhKWikiPad - %CurrentFileName%
return

^+o::
Gosub FileOpen
return

^s::
Gosub FileSave
return

^+s::
Gosub FileSaveAs
return

^x::
Gosub SaveAndExit
return

^d::
Gosub Date
return

^t::
Gosub Time
return

Time:
Send %a_Hour%:%A_Min%
return

Date:
Send %a_dddd%, %A_MMMM% %a_DD%, %A_YYYY%
return

^o::
clipboard =
Send ^c
ClipWait
clipboard = %clipboard%
StringReplace, clipboard, clipboard,`],, All
Stringreplace, clipboard, clipboard,`[,, All
Stringreplace, clipboard, clipboard,`.,, All
Stringreplace, clipboard, clipboard,`,,, All
Stringreplace, clipboard, clipboard,`;,, All
Gosub FileSave
Gosub WikiRead
return

^+d::
clipboard =
Send ^x
ClipWait
clipboard = %clipboard%
StringReplace, clipboard, clipboard,`],, All
Stringreplace, clipboard, clipboard,`[,, All
Stringreplace, clipboard, clipboard,`.,, All
Stringreplace, clipboard, clipboard,`,,, All
Stringreplace, clipboard, clipboard,`;,, All
Gosub FileDelete
return

WikiRead:
FileRead, MainEdit, %clipboard%
if ErrorLevel <> 0
{
FileCopy garbage.txt, %clipboard%
Gosub WikiRead
return
}
FileRead, MainEdit, %clipboard%
GuiControl,, MainEdit, %MainEdit%
CurrentFileName = %clipboard%
Gui, Show,, AhkWikiPad - %CurrentFileName%
return

FileDelete:
FileDelete, %Clipboard%
return

FileOpen:
FileSelectFile, SelectedFileName, 3,, AhkWikiPad - Open File,
if SelectedFileName =
return
Gosub FileRead
return

FileRead:
FileRead, MainEdit, %SelectedFileName%
if ErrorLevel <> 0
{
MsgBox Could not open "%SelectedFileName%".
return
}
GuiControl,, MainEdit, %MainEdit%
CurrentFileName = %SelectedFileName%
Gui, Show,, AhKWikiPad - %CurrentFileName%
return

FileSave:
if CurrentFileName =
Goto FileSaveAs
Gosub SaveCurrentFile
return

FileSaveAs:
FileSelectFile, SelectedFileName, S16, , AhkWikiPad - save file,
if SelectedFileName =
return
CurrentFileName = %SelectedFileName%
Gosub SaveCurrentFile
Gui, Show,, AhKWikiPad - %CurrentFileName%
return

SaveCurrentFile:
IfExist %CurrentFileName%
{
FileDelete %CurrentFileName%
if ErrorLevel <> 0
{
MsgBox The attempt to overwrite "%CurrentFileName%" failed.
return
}
}
GuiControlGet, MainEdit
FileAppend, %MainEdit%, %CurrentFileName%
Gui, Show,, AhkWikipad - %CurrentFileName%
return

GuiDropFiles:
Loop, parse, A_GuiControlEvent, `n
{
SelectedFileName = %A_LoopField%
break
}
Gosub FileRead
return

GuiSize:
if ErrorLevel = 1
return
NewWidth := A_GuiWidth - 10
NewHeight := A_GuiHeight - 10
GuiControl, Move, MainEdit, W%NewWidth% H%NewHeight%
return

SaveAndExit:
IfExist %CurrentFileName%
Gosub SaveCurrentFile
IfNotExist %CurrentFileName%
{
gosub FileSaveAs
return
}
ExitApp
return

GuiClose:
IfNotExist %CurrentFileName%
{
msgbox, 3, AhkWikiPad - exit, Save this new file or not?,
IfMsgBox, Yes
{
Gosub FileSaveAs
if SelectedFileName =
return
else
ExitApp
}
IfMsgBox, No
ExitApp
IfMsgBox, Cancel
return
}
IfExist %CurrentFileName%
{
msgbox, 3, AhkWikiPad - exit, Save %CurrentFileName% before exit?,
IfMsgBox, Yes
{
FileDelete %CurrentFileName%
if ErrorLevel <> 0
{
MsgBox The attempt to overwrite "%CurrentFileName%" failed.
return
}
GuiControlGet, MainEdit
FileAppend, %MainEdit%, %CurrentFileName%
ExitApp
}
IfMsgBox, No
ExitApp
IfMsgBox, Cancel
return
}
return

Exit:
ExitApp


Perhaps I should use one large text file with labels for wiki pages, rather than separate text files.

On the other hand, I should perhaps not waste any more time on it, as it will never become a serious contender.

1. Notetab cannot do these things either. See Notetab as a Plain-Text Wiki.

Monday, June 22, 2009

How the Brain Treats Tools as Body Parts

This article on the Brain and tools as temporary body parts reports on some interesting research about body schemata.

"Data presented in this review support the idea that tools, by enabling us to extend our reaching space, can become incorporated into a plastic neural representation of our body." Indeed, "humans might have such neural machinery present in the brain from birth or early in life, whereas lower primates seem to need a period of raining to induce behavioural learning ..."

This certainly has implications on the way we use typewriters and software.

On the Gradual Creation of Thoughts While Speaking

The German poet Heinrich von Kleist published in 1805 an essay, entitled "On the Gradual Creation of Thoughts While Speaking."[1] In it, he argued that speaking engenders thinking, and that this is the way it should be, not the other way around.

We often have no clear idea what we want to say when we begin to explain something to someone else. Kleist argues that not only should I not try first to get clear on what I want to say by just thinking about it, but that the effort to put it into speech will actually be more helpful, "because usually I already have some sort of obscure notion, which is remotely related to what I am looking for. If I just begin boldly enough, my mind will complete what it has begun. The muddled idea is going to pressed and shaped into a new form of clarity, while I progress in speaking. To my astonishment, the thought will be fully completed as soon as I have finished the sentence. I may mix in inarticulate sounds, draw out the connective words, use an apposition where none is needed, and use other tricks to extend my speech in order to find time for the fabrication of my ideas in the workshop of reason," but I should not be worried, as the result is a new thought.

"This kind of speaking truly is thinking out loud ... [and] language is in such circumstances no hindrance (Fessel) ... but is like a second wheel, running parallel to [thinking] ..." Speaking and thinking go hand in hand. Some people would argue that this supposed contrast between language and thought is a misguided theory anyway, and that language is one of the necessary conditions of the possibility of thinking in the first place.

What I find more interesting is the claim he makes on the basis of these observations, namely that it is "not we who know; it is first and foremost a certain condition, in which we happen to be, that 'knows.'"[1] As Lichtenberg put it, we should say: "there is thought," and not "I think," just as we are wont to say "there is lightning" or "it is raining."[2]

It appears to me that writing exhibits the same feature in an even more pronounced way. We find out what we think by writing it down, and we know little that has not been put into that condition. The condition, in which we happen to be when we know, is not independent of its "external" expression whether it be in speech or writing.

A good software application should facilitate this process of thinking.

1. "Über die allmähliche Verfertigung der Gedanken beim Reden."

2. "Denn nicht wir wissen, es ist allererst ein gewisser Zustand unsrer, welcher weiß."

3. Georg Christoph Lichtenberg: "Hierher gehört was ich an einem andern Ort gesagt habe, daß man nicht sagen sollte: ich denke, sondern es denkt so wie man sagt es blitzt" (L II, 806).

Sunday, June 21, 2009

Brainstorm

Brainstorm has been around for a long time. It is a "deceptively simple idea-organizing tool for Windows, with a long history on DOS." Though it is often referred to as an outliner, strictly speaking it does not belong into that category. "BrainStorm was invented before the first commercial outliners came on the scene." However, "if you are already an outliner user, you will find both familiarity and difference in BrainStorm."

This short review of the program in the New York Times from many years ago still correctly characterizes the strengths of Brainstorm as a program and its problems in the market place.



Perhaps its elegance and its "geekiness" are essentially related. But, however that may be, I still like it.

What I like about it:
  • it allows you to capture things easily without paying attention to how things might be ordered later; hence the name

  • it's the best list manager I know; and in the end all organisation starts with lists

  • it also allows you effectively to order the listed materials later

  • when the time comes to start elaborating your ideas, it allows you to concentrate on one thing at a time, keeping everything else out of focus

  • it plays nice with other programs: you can easily import and export to other programs; if you want to work on the structure in Mindmanager or another Mind mapping program just paste a text file written from Brainstorm to the clipboard into that program; it also allows you to launch other programs and files easily

  • it works well with Connectedtext; you can easily copy its URLs into Brainstorm and launch the appropriate topics from it

Here is a picture of the Mindmanager file on Luhmann's card index as a Brainstorm model:

Information on Mind Mapping

This is the most comprehensive site on on mind maps I know. It is accompanied by an interesting blog.

What makes both sites interesting is that they are not restricted to one operating system.

Mind Maps

I find so-called "mind-maps" and "concept-maps" useful in thinking about certain issues. Visualizing relationships between people, concepts, theories, or problems allows me to "see" things I otherwise might not have thought of. I have been using software to make mind maps for many years. Come to think of it, I never really used mind maps on paper. After trying out some other contenders, I began using MindManager when it was still shareware and called Mindman (in 1996, I think, but it may have been 1997 or 1995).

I am very skeptical about the pseudo-psychological concepts—like "right-brained thinking"—which seem to inform the thinking of many developers and advocates of mind mapping. There are also many who believe that mind maps are good tools for large-scale note-taking. I am not one of them. In fact, I think that the kind of visualization they allow of is best for small-scale projects.

Nor am I sure about the claims concerning the kind of "delinearized" thinking they are supposed to allow. In my opinion, linear thinking has always been difficult to achieve, and what people popularly refer to as "linear thinking" is not thinking at all

But, in spite of all my skepticism about some of the hype that goes with mind maps, I find these visualized outlines serve a definite purpose.

For large-scale visualizations other methods seem to be better. (More about that in a future post.)

I have not upgraded MindManager since version 2002, and I am not likely to do so in the future, since the price for the upgrade far outstrips its usefulness for me. Here is a mind map on Luhmann's card index I made some time ago:



Click on image to enlarge!

When I am done with a mind map, I usually save it as a jpg file and import it into ConnectedText.

Friday, June 12, 2009

Tools for Visual "Knowledge Management"

I am not sure there is such a thing as "knowledge management." The concept seems incoherent to me. However, there are interesting applications that allow one to manage one's notes and ideas.

In a very interesting post, Eric Blue presents what he calls: 15 Effective Tools for Visual Knowledge Management. It's worth a look.

The link comes to you thanks to Franz Grieser and the Outliner Forum.

I should perhaps also point out that my favorite note manager is regrettably not included. Too bad.

Wednesday, June 10, 2009

Portable Index Card Holder

It's always amazing to me to see what all can be patented. Here is the Portable Index Card Holder for Notebooks. One of the reasons why this invention never really took off is probably that the term "notebook" no longer means what it used to mean.

I saw diskette holders (somewhat) like this, however, and may even have owned one myself.

Tuesday, June 9, 2009

Freemind Scholar

Freemind Scholar is an attempt to combine mind mapping with reference and Pdf management, which is a great idea. More specifically, it is an attempt to combine the freeware Freemind mind mapping software with the JabRef and Foxit Reader. JabRef uses the BibTeX format (but other formats are planned).

It's written in Java; it's at the alpha stage now, and it's something whose development is to be watched.

Saturday, June 6, 2009

Talking to Index Cards?

Here is an interesting reference to this blog.

Though there is communication apart from talking, I hope that there will soon be software that recognizes my German accent without long training, so that I can tell my programs what to do and to record.

Mempad

Mempad is a small and very efficient "plain text outliner and note taking program with a structured index. All pages are stored in a single file."



"The program offers standard editing functions including cut, copy, paste, undo, date/time insert, drag&drop, and supports Web links as well as network and local file or folder links (full path not required) and internal page links. Environmental variables can be used in file links to run programs, for example."

It's free and it does everything as promised.

I do not use it much anymore, but from among the other applications developed by Horst Schaeffer, I do use Popsel, which "offers simple pop-up menus to launch programs, documents, web links, Explorer windows, batch scripts etc." I run various AutoHotkey scripts and other programs from it.

In fact, I have it embedded in the header of my ConnectedText projects to start small utilities and programs.




TimeSync is another one of these utilities I regularly use.

Wednesday, June 3, 2009

yUml (and ConnectedText)

There is a cool new site called yUml. It allows you to "create and share simple UML diagrams in your blogs, wikis, forums, bug-trackers and emails," something like this:



You just have to type in the proper code, like so:

[Research]+1-items>*[Sort]
[Sort]<->[Retrieve]
[Store]<->[Retrieve]
[Collect]<->[Sort]
[[Collect]<->[Store]
[Research]++1-items >*[Store]

and then click "Generate the Diagram!"

You can also select, copy, and paste the diagram into an application like ConnectedText. Just make sure that you follow the last line with .jpg, like so:

[Research]++1-items >*[Store].jpg

It does not work without this because the transparent parts of the picture get somehow rendered almost black, if you don't tell the program to render the image in jpg form. It seems to be a Windows problem. (Don't know how it works on the Mac.)

I like it.