Programming

Coding is not so hard, once you get into it. Start with the most simple tasks, and try to write code to solve them.

In the 1980s, The Work Research institute, where I worked,  was an early adopter of information technology. The institute’s goals included task optimization as well as work democratization. Moreover, these were seen as dialectically intertwined.

The more you could do away with the negative aspects of a task, the better the chance for conflict resolution. Shift the work from routine to development. Whenever you do a routine task, try to program it better instead, try to change the focus.

In my case, programming started as a hobby, starting from DOS batch file writing in the 1980s and moving to Windows in the 1990s. My programming has a core purpose for me as a work researcher – to make PC work easier and the routine work faster.

This section describes my non-commercial project Bro (bridge, in Norwegian), and ideas for information work tools. It is a project under development. It is indebted to the many programmers who have put their work in the public domain, and helped people trying to develop information work.

On my PC, the core Bro program runs as a small window, lower left, just above the taskbar. This is shown in the figure below (Bro display language is Norwegian).

bro 261205

The lower part of this small window has log lines, in this case, start Iexplore, Corel capture. These are recent Windows actions that the program has recorded. The user can click the line to redo the action. The log shows that two items have been started through Bridge menus. The window also has two graphical controls, the upper bar with Bro and other items, and a right-hand control (with “dir” and others in a list).

In the upper bar (two lines), the different items are clickable, e g the “T” in the middle of the top line gives the text or documents directory, and the next “7s” ( Seven senses or PIM personal information management) symbol starts the main calendar program.

In the next line, the “A C D E” list shows the connected drives; a click opens the latest directory on the drive. The way these items display and work can be partially user-modified (per 2010).

This is a compressed panel version of the Bro interface. It can be setup in other ways also.  Per 2010, there is a semi-flexible menu system for the user. For example, the menu is ordered under (English translation) Sys, Prog, Utility, Window, PIM (7sans) and Help, but the user can edit the menu subcommands. The right hand control gives quick access to the last used objects in specific categories (Dir, Projects, Texts, Help).

This interface is useful, and takes up little screen space, but also often just hangs around, so recently I have introduced a variant of the interface. The log part of the window, now, shows upcoming events.

We see three upcoming events, week number, book project, other. This helps especially if the PIM is not displayed already. The user can switch easily between calendar and log view.

Bro had a very common starting point – how to cut down on unneccesary PC time. Someone put up the idea that “babysitting computers can be better used for babies” already in the late 1980s or early 90s, I think it was in PC Magazine. It was a great idea. It had an impact on me.   I babysat and also worked at the other end, how to make computers easier and less time consuming.

As a hobby project, Bro was not developed for the average user, but for 1 advanced user with quite specific research and reference needs – me. This was not due to egocentrism, but the nature of the project. I felt it needed a long starting up period, tuned to one person’s development.

Bro / bridge started as isolated remedies correcting poor program behaviours, in the 1980s. Gradually, core cooperation tasks were taken over by my own code, retaining the idea that lower-level tasks should be done separately by independent programs (downwards delegation).

From the mid 90s I developed Bro using Visual Basic. It has evolved into a work logging and statistics program combined with code to control program startup and cooperation. The goal is to create easier access and improve work flows.

I start the presentation of the system by showing an on-going experiment, Ball / Kule, before going into some more permanent and experimental parts.

A crystal ball experiment

Usually Bro runs in a quiet manner as a small window at the bottom of my screen. For a quite different idea of a user interface, I thought of a “crystal ball”. Wouldn’t it be nice if past actions could slide down towards the sides of the ball, with present choices, or even future predictions, in the middle? Or if predictions can’t be made, at least a list of main past actions? The Ball / Kule program does this, as shown below. In the middle is a list of main past actions, and out towards the sides, past actions in different categories.

The user can click on an item to repeat the action (for example, open a text document, or repeat a web search).  The most recent items in each action category (that is, the lists outwards from the middle) are the items closest to the centre. Three special lists are included, the master list in the middle, a listing of the most usual action after a selected program (here: Bro) to the left, and Ball options at right. The idea of having a choice box or button bar in the middle did not work well, and was excluded in this version. So it is not much of a crystal ball, but has evolved to be useful as a map for locating items or commands. An earlier 2007 version with Bro in the middle is shown below.

bro i kule 07

In the Bro system, Bro itself is generally the expert, and submodules usually run as standard separate exe programs. These ask Bro for things like the correct file adress to a program that needs to be started. However, Bro can also ask submodules for information.

Bro is not the expert in case of Ball / Kule, which is managed by Filechoice / Filvalg, the main disk logging and file statistics part of the system. So in order to know “what are the ten most usual actions after starting program x” you would have to ask Filechoice, but Bro will politely pass this request along. By issuing a one-line command from your program, you  can get a listbox with the ten items, to be opened with one click.

filvalgvanligsteprosjekter1

The picture above shows Filechoice listing the most frequent choices in my programming projects category (frequency numbers, left (this dialog is a more conventional display of the “arms” of the ball interface, above). The categories include Projects, Searches, Contacts, Texts and other files, Directories visited, Graphics, and Help items (in the Bro help  system). Urls and Active program monitoring can be included also.

Working together

Inter-program communication is the key to the Bro / Bridge system. Since this a changing and difficult terrain, Bro has many approaches. Today, running in Windows 7,  it mostly uses registry entries for getting updated  information, and Dynamic Data Exchange (DDE) where possible, but it can use cruder methods like programs passing command files to each others (and executing these by timers), windows socket port communication (LAN ipc), or even direct keystrokes when nothing else works.

Third party programs, besides Bro interacting with the Windows core, like word processors, are preferably run as independent applications and contacted through DDE or macro commands, sometimes through add-ins that give them DDE capability.

Sometimes I use the more conventional method of directly invoking other programs as objects, though this is not allowed in Bro itself. Although such direct object manipulation is most common e g in Microsoft Office programming, I often prefer a more detached method where the other programs work more independently on their own (in this way, if they crash, it does not affect the system.)

Bro includes analysis programs that can help the user monitor how the system works, like the submodule (separate exe) Check installation (Sjekk installasjon) that checks things that must be in place –  now 30+ things (dynamic link libraries, shortcuts, etc) needed for the system to run smoothly, and tries to install missing links and correct errors found.

Another analysis module is Graphics plotter, shown below. Graphics plotter can show the frequency of items on two axes (and simulate a third).

grafikkplotteraktivtprogramanalyse1

The plotter is here giving ‘active programs/files’  statistics (one axis only), with the most frequent at top right. The control panel for the tool is shown top left. Frequency is here concretized to time use (as the active Windows program). Be careful – your employer may use this against you….

Ruby link (trial)

(This link may not work – an attempt to put Bro into another programming language, Ruby – results to be updated).

Bro submodules (semi-independent programs), examples

Frame9.JPG

Emailer Bro module.

The  purpose of  Bro Emailer is to show the contact, not the mail. It is contact-history-focused. It has one contact box, instead of  two disparate inbox and sent mail boxes.  Emailer uses a special ‘virtual’  list box to make this more intuitive, with one color (here, light blue) for input, another (here beige) for output. It also has two special graphic controls at the top (below toolbar) showing contact events last year (dots) plus a summary (top right circle). These follow the same color code – the summary changes color according to input/output balance, and size according to total frequency.  The events last year are clickable to open each letter.

Emailer uses the Outlook object model, partly through the Redemption library, to analyze and archive emails. independently. Emailer can be run in “follow Outlook” mode. Here, Emailer will open the selected contact in Outlook.

emailermedoutlook

Emailer  is shown left, Outlook right.  When a different mail is selected in Outlook, Emailer changes to show the contact,  if  the name is  recognized.

Together with Mirror (Speil), shown below,  Emailer can synchronize sent mail accross pc’s.

Frame10.JPG

Bro Mirror / Speil

Purpose: mirrors (synchronizes) user-selected hard disk areas between computers, primarily on a local area network, and synchronizes the user’s chosen calendar / PIM program (for now, Commence). In the file sync, the most recent file in the networked computers overwrite earlier versions on other computers. Also includes safety backup.

Mirror (Speil) has the claim of being the most consistently useful of my Bro applications, the one I use most.

I use it every time I go away with a laptop or reconnect a laptop to my main home system pc. Using a tablet (first, a Palm Tungsten, later, a smartphone, my PIM program (Commence) is also able to update my tablet / smartphone / handheld pc.

Frame11.JPG

Another Bro program I use a lot is the Reference Bro module.

Purpose: show literary, music etc references from data base (now, Commence), especially, to  use in text documents and presentations as research literature references.

Can be called from a word processor to insert reference at the insertion point and full listing at the end of the document. Not as sophisticated as Endnote and similar, but does the work.

Tasks Bro module showing running processes’ exe file names and their window titles.

brooppgaver

Using advanced DDE code, Bro can respond to a command line call from a non-DDE-capable application, as if it was sent through DDE. The Bro system application then either processes the call itself (sometimes), or (mostly) forwards it to other modules running as separate exe programs (like Emailer, Speil/Mirror,  Referanse, or the log editor), again using DDE, so that the command can run, if needed, w ithout starting a new instance of the program.

The picture below shows how Bro records incoming DDE messages. If these are recognized, they are executed.

broddelogg

The Bro DDE  message log.

Bro Outlook addin

Redemption and a special version of DDE (DDEML) make it possible for Bro to establish two-way communication with email programs like MS Outlook. This allows the program to run more smoothly on its own premises, yet we can also get information from it, and forward commands. The next figure shows Outlook with Bro-added command buttons.

Frame23.JPG

Through the Bro toolbar, the user can access an external database, paste recipient mail addresses easily into the body text of an email, or  get a calendar from a date mentioned in an email.

The Get a calendar tool works by searching the email text for a date and then opening a calendar view with the date, shown below.

Frame24.JPG

In this case, the third-party database (Commence) does not have the capability to go to a specific date from a command, only manually, so I had to write a “wrapper”.

Other modules

The Bro system includes modules for household keeping purposes like checking system installation, running automatic tasks, and giving / writing help. For example, the Bro Help system is editable, based on a Bro database that can run concurrent with an external database program, using a text editor program for the main file viewing and editing of help items.

Research applications

Intervjutolker / Interview interpreter was developed as a help for analyzing qualitative interviews.

Frame29.JPG

The program presents interviews in a list at left, with a text box showing the interview to the right. Here, interviews from the Nordic Man i rørelse 2007 study (see 2007e in Publications). This window runs together with two other components in the program – a control for setting variables and recording values, and a background database. The control is shown below.

Frame31.JPG

The ideas behind the Interview interpreter application were based on a 1992 version made in Foxpro (using Men’s life connections interviews). The user should be able to setup a number of often-used variables, and code them quickly reading the interviews. The 1992 version was mainly based on text search for specific words, giving the search terms plus some lines of context. This idea is retained in the new version (cf the 3 search terms, shown at the bottom of the control, Søk variable / Search variables). The new version has 10 variables that can be set up by the user (at the top), with values to be filled in, based on the interview to be coded.

NetWord (NettOrd) is a program for web text (e g discourse) analysis. It lists the most frequent words that are used close to some selected term or search words – what kinds of words are most frequently associated (in the somewhat narrow sense: is close to) some search term.

For example, I want to know how “rape” is discussed in Norway today, so I do a Bro – Referanse – NettOrd search on”voldtekt”, getting the following list (April, 2007). Note how women-associated items appear at the top of the list, men (in the term “man”) at the bottom, with criminology rather than sociology terms.

Frame25.JPG

In this list, “women” / kvinner is most frequent (72) followed by “guilt / skyld” (47), “meaning” (46), “violaton” (35), “2007” (30),  “men” (25), “sexual” (24), “violence” (22), “flirting” (19). At the bottom, we find “men”, “sentenced”, “abuse”.

Finally…

I test each module using strict test criteria, declaring variables explicitly and starting with a bTest variable set to true. This gives debug or messagebox information, and is set to false only when the procedure works without trouble. I also use strict syntax and format rules for tricky things like nested for loops with many ifs inside.

Why enjoy programming?

A task is on the one hand just a task. Take the hammer, put in the nail. Looking more closely, it consists of the task itself, and various surrounding tasks. Task: hammer in the nail. Surrounding tasks: focus the hammer correctly, take the right grip, get the right angle, a solid foundation etc. These surrounding tasks are meta tasks. Programs on the PC are still mainly designed around “the task itself”, while the Bro system mainly adresses the meta tasks.

Programming is therefore interesting for a work researcher. And whatever one’s background, it can create a good learning experience.

Coding is not so hard, once you get into it. Start with the most simple tasks, and try to write code to solve them. Write code that you will actually use. Search the net, perhaps someone has discovered the wheel before you. Give it a new shape. Have fun.

Kule og kalender jan08