Showing posts with label computing. Show all posts
Showing posts with label computing. Show all posts

Tuesday, November 24, 2020

A more trustworthy way of asserting which claims are supported by the evidence

This post is a preliminary attempt to express the following ideas.

We need evidence to determine whether a claim is true or not.

But in our society, claims are judged mostly not on evidence, but by who is making the claim.

Is the claim being made by an expert in the field? By a scientist? Or by some random person on the internet? Is the claim being made by a journalist? How experienced is this person? Are they a junior person, or a senior person, in their area? What is their reputation? Are they a nobel prize winner? Is the claim coming from a recognised organisation within that area (e.g. a nutritional claim from "The National Nutritional Board").

In principle, judging a claim based on the characteristics of who is making the claim (like whether they are a recognised expert on the topic) is using those characteristics as a proxy for the evidence for or against that claim. We assume that, for example, an expert knows the relevant evidence, and is able to form sound judgments on the basis of it.

However, judging claims based on who made them can be fairly unreliable.

Someone's status is not necessarily a good indicator of their knowledge or capability. One reason for this is that status tends to have a political element to it. And having more experience doesn't necessarily make someone a better judge of a topic. It might mean they are stuck in old ways of thinking, and unable or unwilling to see new ideas that challenge those ways.

What people or organisations claim is often influenced by political concerns. They aren't necessarily putting truth first.

If the science on the topic isn't settled, then different experts will have differing opinions, and it won't be reasonable to justify any particular claim based on the fact that a particular expert believes it's true. In such cases, there won't be evidence showing that a claim is true, so the 'who' (the expert) isn't a proxy for the evidence, but really a proxy for their opinion.

There can be mature fields containing beliefs that are agreed by pretty much everyone in that field, but where there isn't actually good evidence for the belief. It's just that everyone in the field is taking it for granted. (I believe that, historically, this has not been uncommon).


We may recognise the limitations of judging claims by who made them, but at the same time believe that doing so is our only practical option. No one has the time or ability to learn about every field and evaluate the evidence in it. We must defer to the experts.

While there is a lot of truth to that, there is more nuance to the matter than this. 

As explained above, there are many situations where there is no good evidence, so we can't really judge claims about them based on who made them.

Instead of feeling compelled to make a judgment in such cases, we should recognise that we usually do not need to make one. The only time we actually need to make a judgment is when we need to make some decision that requires making a judgment. If we're not in such a situation, we can remain agnostic about the issue.

And, I believe there's a better option that just deferring to what an expert claims.


The problems that 'judging claims by who made them' addresses is our lack of time and knowledge for evaluating claims. I want to suggest there is another way to address those problems.

Instead of just saying "an authority claims X", we can try to make the evidence and reasoning involved transparent, and in a fashion that opens-up the hierarchical structure of the evidence and reasoning behind the claims. We can include information about the vetting of the claims alongside the claims themselves. I'll get into the reason why I think this is a better approach.


Granted, it won't always be possible to articulate the evidence and reasoning, such as for knowledge that is based on experience. But there are plenty of areas where the evidence and reasoning can be made explicit, such as in science.

Isn't what I'm talking about already to be found in academic papers? No, I'm thinking about a very different way of presenting the information.

Central to what I'm thinking of is that the information should be organised around claims, and their hierarchical structure should be made explicit. The hierarchy of a claim's sub-claims is shown. Each sub-claim is itself treated like a claim in that it has its own page and we can see its hierarchy of sub-claims, as well as the reasoning and evidence supporting it, and information about its vetting by experts (such as pointing out problems with the evidence).

I am not talking about formalising knowledge, like using some sort of formal language/notation to specify the knowledge. I'm not talking about using some sort of mathematical means to evaluate the correctness of claims. I don't think that's possible (maybe one day, but not now). I am talking about expressing them in ordinary language. But, structuring it in a way that makes explicit the hierarchy of claims and sub-claims, and which makes explicit what are the sources of evidence for each.

These claim hierarchies should be made available in a publicly-accessible location, perhaps a website akin to Wikipedia but for claims.

Academic papers don't make the claim hierarchies explicit, and usually the evidence and reasoning for a particular claim will be distributed across several papers. And when viewing a paper you can't see a particular sub-claim and, alongside that, see information about the vetting of that claim.


By making the claim structure explicit like this, it "opens up" the elements of the justification in a way that facilitates more systematic vetting of claim structure, and providing information about its vetting.

Each claim/sub-claim is a thing that can be referenced. It has a name and a URL. It's not just something implicit within some paragraphs of text. It is a thing that can be drawn out and considered just on its own. That facilitates vetting each individual claim/sub-claim, and provides a place where information about its vetting (e.g. which experts have vetted it) can be stored. This information could also include details of any disagreements with those details.

Having the structure of the claim hierarchy being opened up like this would facilitate a more distributed process of vetting its details. It could be examined in a more piecemeal fashion. Someone could examine just a particular sub-claim. Different people could look at different sub-claims. Anyone could examine any sub-claim.


The problems that 'judging claims by who made them' addresses are the lack of time and knowledge for evaluating claims. 

I think the design I've laid out would have superior properties for this. Non-experts could look at just the top-level claim (without having to look into the details about the sub-claims), and see that has been vetted, and see any mention about issues within the sub-claim hierarchy. This information would be more trustworthy than the information that an expert has made the claim -- it would be a more reliable indicator of the truth.

Why would it be more trustworthy? Here are some reasons.

The details are more out in the open, presented in a way that's more suited for vetting, and the details of that vetting are out in the open, alongside the claims.

Because information about vetting (including any disagreements) is there as part of the claim hierarchy, there is better communication of this vetting information. It will ensure it can get more eyeballs.

Information about issues with any sub-claim can be propagated up the hierarchy of claims. So that, for example, if it's a major issue, it can be seen when viewing the top-level claim.

We can trust that the judgments reached on it (that are included along with the claim hierarchy) will be based more on the evidence and reasoning about the evidence. By having to explicitly break down a claim into a hierarchy of sub-claims, it forces more of a focus on evidence and reasoning about that evidence. And when the vetting that is made explicit is similarly broken down (addressing specific sub-claims independently of the other details), it again forces more of a focus upon the evidence and reasoning about that evidence. It will be more difficult to 'get away with' making claims that aren't grounded in evidence.


The above is just the basic picture of this idea. There would be many details to work out in practice. And though, for the reasons given above, I think such a system would likely be superior overall, that's not to say it wouldn't introduce its own kinds of issues. One last caveat is that I'm not trying to suggest that such a system would magically fix all issues to do with judging claims, I'm only suggesting that it would be an improvement over what we currently have.

Monday, November 23, 2020

Online moderation should be logged for transparency

There's no transparency in online moderation. On discussion sites like Reddit and Hacker News, in online discussion forums, and things like Facebook groups, moderators can delete comments and remove users without any transparency. There's no way to see who/what was removed, or why that action was taken.

No transparency means no accountability for the moderators. Moderators are just ordinary people, with all the usual biases, pettiness, ideological zeal, and other flaws. There's no accountability that stops them from removing content and users for reasons other than them violating the group's rules. E.g. because it disagrees with their political views.

This is not good. I think moderation should be logged. The logging should record the specific comments that led to the content/user being removed, and perhaps an indication of which rule(s) were violated. It should be possible for anyone to view the record of moderation. That record should probably be read-only -- as in, users shouldn't be able to comment on the logs, as that would probably (I think) lead to endless cycles of disputes. 

I think this is more important than it seems. I suspect that more and more of our social and civil lives will end up being conducted online through things like these forums. If that happens, a lack of moderation transparency will become a larger problem, and could have serious consequences for people's lives.

Collaborative 'summary of useful points' for Reddit/Hacker News kinds of posts

Sites like Reddit and Hacker news are made up of posts, and each post is about some topic and contains a discussion thread about that topic.

The idea I want to talk about would probably be most suited to certain types of posts, not all posts. It'd be suited to posts like those about news stories, where the discussion threads usually contain a lot of interesting information that fleshes out the picture of the story.

That interesting information tends to be lost amongst a lot of "noise". It'd be quite useful to have a condensed summary of all the useful information dispersed throughout the thread. I could imagine the post having two tabs. A 'thread' tab (shown by default) and a 'summary of useful points' tab.

Is there a way we can incentivise the collaborative work of constructing this "summary of useful points"? And have a sufficiently simple design?


The following are two ideas for how it could be done. These may not be suitable, but they're at least starting points for thinking about the problem.

The first idea is to allow users to add bullet points, where each one contains a 'useful point' summary, and for these to be voted on, where their number of votes controls whether they're shown as part of the summary of useful points.

Notes

  • limit on the size of the bullet points. Perhaps 280 characters, like tweets.
  • if a bullet point has had more than, say, 20 votes, and is in the negative, then it will be hidden (though there's a link to view the hidden items).
  • let the users link a bullet point to the bits of text in the discussion thread that originally made the point. The UI details of this are beyond the scope of this post.


The other idea is that the summary of useful points is updated via a 30 minute cycle that involves a number of phases:

  1. 10 minute phase where anyone can suggest changes to the current summary. Each is limited to 280 characters. People can vote on these suggestions.
  2. 10 minute phase where anyone can write a new summary. They can use the pool of suggestions to help them decide what changes they want to make to the current summary.
  3. 10 minute phase where the new summaries are anonymously shown for voting. When viewing a new summary, users can see a diff of it compared to the current summary.
  4. The top voted summary (if it passes a critical threshold of votes) becomes the new summary, and the cycle repeats.

Notes

  • users can have the thread highlight new comments added since last time the summary was updated. There could be buttons to navigate to next/prev new comment. 
  • users can view history of changes to the summary.
  • the summary tab would show a representation of the update cycle and indicate where it currently is in the cycle. 


Could there be other possibilities? Could there be something that doesn't involve any threaded discussion at all?

Perhaps you could have a system that cycles between two phases. One is where there's a discussion thread. The next is where that content is condensed into a summary. Then this is summary is a seed for further discussion, and then the current summary plus the new discussion is condensed to form the new summary, and so on. At the end of each cycle only the summary is kept (the comments are effectively discarded -- though perhaps a read-only view of them can be accessed).

.

Related

  • I believe Stack Overflow originally wanted to have a feature a bit like this, but that doesn't seem to have panned out. Would be worth investigating.
  • Are there any other systems or designs doing something similar to these ideas?
  • Back in 2005 I wrote Slashdot Article Summaries?, which was a more basic take on the ideas outlined in the present post.

Wednesday, November 18, 2020

Example of a lightweight workflow that the OS would ideally support

Work at the computer often requires the user to undertake repetitive patterns of actions. So there's an implicit workflow to the user's activities. Ideally, the Operating System (OS) would support such workflows, to lessen the amount of repetitive busywork the user needs to do.

Here's an example of the kind of lightweight workflow I'd like an OS to be able to support. I'll leave questions of how such workflows could be supported to future posts.

This workflow is from a university tutoring job, where I was marking some assessments. (For my own reference, these were weekly labs in a database subject at JCU).

There was a spreadsheet with assessment-related information (like listings of each tutor's students), an online system (Blackboard) that students submitted their assessments to and to which their marks were added, and I kept a notes file where I kept a copy of my feedback on assessments before uploading them along with the marks.

For each of my students in the spreadsheet, I would

  1. copy their name from the spreadsheet
  2. paste their name as heading in my notes file
  3. search for their name in Blackboard
  4. click on the link for their submitted assessment
  5. scroll down to the bottom of the page
  6. click on the relevant items to download their assessment
  7. open that assessment (e.g. in Microsoft Word)
  8. check their assessment against the solution I'd printed out
  9. write my feedback in the notes file
  10. go back to the Blackboard page for the student's assessment, enter their mark, and copy and paste my feedback from my notes file.
  11. click on the 'x's on that page multiple times to get back to the list of the student assessments
  12. that listing will have scrolled back to the top of the list, so I'd have to find the student name's again
  13. click on the link next to the student's name to post their mark, and click the confirmation
  14. go back to the spreadsheet and note down that I've completed marking off this student.

These tasks involved so much switching between applications. Many of the steps involved moving the mouse pointer to a particular place on the screen. So much of the activity was: switch to this app, for step X, move the mouse pointer to the place for step X, do one or more actions, switch to this other app, move the mouse pointer to the place for the next step (or the net part of the current step), and so on. There was much repetitive tedium. There has to be a better way.

Of course, it would be possible to write a single application that encapsulates this entire process and which streamlines it all. But there is a general need to support workflows that involve multiple different applications, like in this case, and the question I have is, how can such workflows be best supported on the Operating System level?

Sunday, July 08, 2018

How I think file-system tagging should work

The idea of file-system tags makes intuitive sense.  You might have files of different types -- documents, text files and images -- stored in dispersed places in the directory hierarchy, that may all share a common characteristic, such as all being recipes. The directories containing those files might also contain a whole lot of non-recipe-related files (e.g. one of those directories might be for your website and contain a lot of files that aren't recipes).  If you can tag all the recipe files with a 'recipe' tag then you can get a listing of all those files, and only those files. Or, as another example, you can restrict a search to be only within that collection of files.

Directory structure provides the primary basis for organising, and thus finding and viewing, collections of files. Tagging provides another layer on top of this, where files that may be unrelated in terms of directory structure can be related by the tags they share.

Nowadays, mainstream operating systems like Windows and macOS include some sort of file-system tagging.  (I should note that I only have direct experience with tagging on macOS, and have only read about how it works on Windows, so hopefully there won't be any inaccuracies in my depiction of that).  While I think tagging is a good idea in principle, I think that current importations of the idea leave room for improvement.

There are two common properties of tagging systems that I think can be improved:

1. the tag namespace is flat
2. tags are global

I think it would work better if:

1. tag namespaces were hierarchical
2. tags were private to particular directory subtrees

Why?

In short, hierarchy is an important tool for organising information, and that's what these two suggestions are about.

When the tag namespace is flat, there's a single tag namespace and all the tags are at the same level within that.  This gets too unwieldy. You might have a set of tags associated with recipes, like for the dish type (entree, main, dessert), and for cuisine type (italian, chinese, mexican, etc). But then if you have other sets of tags for other topics unrelated to recipes, the overall collection of tags can soon get too unwieldy. When trying to find a recipe-related tag from the list of tags, you have to find them from amongst all the other tags.

Being able to partition the tag namespace in a hierarchical fashion would help this.

At this point we can note a trade-off at work here.  In some sense, the whole point of tagging is to escape from hierarchy, to be able to specify categories that cut across the hierarchical structure of the file-system.  A tag like italian could be applied to recipes, but also songs and images of paintings. Applying a hierarchical organisation to tags goes against this. But, it doesn't go totally against it. Even with hierarchical organisation of tags, any tag could still be applied to a file anywhere in the file-system. I believe that a flat global namespace for tags is too unwieldy, so I think the tradeoff is a reasonable one.

One way to do this would be for there to be a global tag namespace, which is then hierarchically structured.  On the top level there might be tags like recipe and work. Under recipe we could have the tags like those listed above: entree, main, desert, italian, chinese, mexican, etc. Under work there'd be various work-related tags, and so on.

Like how I've argued that a flat namespace is too unwieldy, so I think a global namespace is too unwieldy.  My solution for the flat namespace was to make it hierarchical, and similarly my solution for the global namespace is to have a kind of hierarchical partitioning of it.

I think it would be better to associate tag hierarchies with particular directories (or more specifically, the directory subtree rooted at that directory), where the namespace for the tag is only within that directory subtree.  Where, outside of that subtree, those tags do not exist.

Despite tags allowing us to cut across hierarchical structure, we may want to only apply tags to files within a particular directory subtree.  Perhaps some tags are only for music files, which are only under the ~/music directory, or photos, which are only under the ~/photos directory. Or if we need the tags to be a bit more general we could put them in ~, or if we do want some to be even more general we could put them in / or C:\.

In terms of GUI file managers like Finder, their side bar could show only those tags that are applicable within the current directory.

Such a scheme would limit the ability of tags to cut across hierarchy, but I think it is a reasonable tradeoff.

Tags are ultimately a kind of metadata about the information in the directory structure, so it makes some sense to organise the tags within the directory structure, associating them to some extent with the information they're about.  A global namespace does not allow specifying any details of how the tags relate relate to the organisation of the information they're about.

Associating tag hierarchies with directory subtrees would make it more explicit as to what the intended use of the tags is - that is, what sort of information they were intended to classify. That, for example, dog is meant to be for pictures of dogs, not for any file in some way related to dogs. If we start using tags in a more haphazard fashion the entropy in the tag use increases over time.

One way to think of this is that, what we're looking to organise is not just, one the one hand, the directories and files, and on the other, the tags, as if these were separate concerns.  We're looking to organise the overall structure including both the directories-and-files and the tags, and how they relate.

Thursday, May 02, 2013

Allowing wiki-style edits on every single web-page

As everyone knows, anybody can edit any page on Wikipedia.  What if anybody could also make edits on every single page on the internet?

I mean every - a corporate site's 'about' page, their CEO's bio page, the Amazon.com description of a book, a post on someone's personal blog, a news story.  Anything.

Sound crazy?  No doubt about it.  But here's a slightly less crazy way it could be handled:

  • Edits don't change the public version of the page.
      
    • All edits are publicly accessible via a standard [edits] link on each page, and the page owner gets to choose whether to accept, reject or ignore any of them.
        
  • You must log-in with a public identity (Facebook, Google+, etc) to make an edit.
      
    • To help deal with trolls.
Why let anyone edit any page?  For the same reasons Wikipedia does: to allow people to suggest corrections and enhancements.

People like feeling that they've made a contribution, and if their contributions are useful and get taken up that can add to their reputation.   Such a system would help better harness the talent out there.  Or such is the hope.

Some slightly more technical points:
  • The site owner could possibly even mark someone's edits as trolling, where both the edits and who marked them as trolling are public information, and if people's edits across the internet were aggregated it might further discourage trolling.
  • What if the changes a person suggests concern information that comes from a database rather than a static page?  If the page owner thinks it's a good contribution then they'd have to change the relevant data in the database.
Obviously there'd be various technical issues in implementing this.  Presumably these days storage space for the edits wouldn't be much of an issue.  Perhaps the ability for storing each person's edits for a page could be handled by a standard feature of the web-server.  Naturally there'd be issues with how the editing interface is provided, how the edits are described, etc.  This post is more just about the general idea rather than all of the hurdles it'd have to overcome to make it practical.

.

EDIT 5 May 2013: I originally used Wikipedia as a model for this idea.  Github is another model you could think of it in terms of.  On Github you can fork anyone's project to make improvements to it.  Doing so doesn't effect the original project.  You can send the owner of the project a pull-request suggesting for them to incorporate your changes.  They can ignore that if they wish, but if they decide they like your suggested changes they can make use of them.  What I'm suggesting is a standard, structured way for anyone to suggest changes to a web-pages.

Thursday, December 22, 2011

Future scenario: personal AI drone cameraman

Here's a possible future scenario.

There's really cheap, light, compact drones (mini helicopter things) with good AI, an on-board camera, and really good battery life. They're quiet, too.

You and a friend go on a hike together, and take one of these with you.

At the start of the hike you take it out and tell it to follow you. (it's got voice control, so you just tell it what to do).

You tell it to take shots every once in a while. Its AI is good enough to compose reasonable shots, ensuring it gets one or both of you in the frame.

Perhaps it can even spot things of interest on the side of the track (e.g a big mushroom nestled in a rotting log on the side of the track) you might have missed.

You come to nice waterfall beside the track so you ask the drone to fly out so it can get a shot of both of you with the waterfall in the background.

It flies out to where it thinks it might get a good shot. It's transmitting the image to your phone so you can see what it looks like. You want it to move more to the left and get a little lower so you tell it that.

At the end of the walk you sit down on a picnic blanket and have lunch together. You figure it'd be nice to get a shot of both of you having the picnic so you instruct the drone to take one.

(and of course that's just one of many possible scenarios, many no doubt with a sinister edge, that such technology might make possible).

Saturday, September 10, 2011

Idea: hold-and-swipe touch-screen gesture

An idea for a type of touch-screen gesture for phones: the user places their left-thumb anywhere on the screen and keeps it in the same place, and at the same time they swipe across with their right-thumb.

You can think of the left-thumb as acting like a modifier, like the shift-key.  A left-handed person could keep their right thumb stationary and swipe their left thumb - it'd have the same effect.

Each different swipe direction (up, down, left or right) could be recognised as a distinct gesture with its own distinct meaning.

I don't know if anyone has used this type of gesture before, but the benefit of it is that it's quite easy to perform.  Which is one of the challenges with gestures: finding ones that are really quick and easy to do.


Monday, April 11, 2011

Making Vim copy all yanked text to the system clipboard

In addition to the usual cut and paste operations found in most other editors, Vim has a 'yank' command that can be followed by a motion operator.

So you can type yw to copy a word to the clipboard, or y3w to copy three words, or yip to copy the current paragraph to the clipboard, and so on.

Which is useful. But by default the text copied by the yank command is only accessible from within that same instance of Vim.

So if you've opened another instance of Vim in a new window[1] and you want to paste the text into that, or you want to paste it into another program, you can't.

An IMO problematic solution is to set 'unnamed' in the 'clipboard' option in your .vimrc / _vimrc, like so

set clipboard+=unnamed

this works but it has a downside - it also means all deleted text gets sent to the system clipboard.

Most of the time I delete text because I just want to get rid of it. When I tried setting this option I kept overwriting the clipboard contents (that I did want) with the deleted text that I didn't want.

And if you do actually want to delete text _and_ copy it to the clipboard you can use a cut command - i.e. C-x. So set clipboard+=unnamed doesn't seem like a good idea.

Here's a better solution, that just ensures yanked text is copied to the system clipboard. Just add the following line to your .vimrc / _vimrc:

nnoremap y "+y

The "+ tells Vim to yank into the + register, which is the system register.




[1] I know many people like to work within one Vim instance and use splits/buffers and tabs to arrange their files, and may want to suggest this as an alternative, but I find it very useful to work with multiple Vim instances. It's a long story, but I like to be able to spatially arrange the (OS)windows in a certain way that reflects the relationship between the files in them, and you can't achieve what I want with a single Vim instance.

Tuesday, February 15, 2011

idea: personal subject-lines for emails.

#gmail. Some emails you just read the once and never come back to them. Other emails contain information you'll want to reference in the future, which means you'll need to be able to find them again down the line.

There's lots of things that help in your search for an email - like knowing roughly when it was sent, so you can scroll down to that point in your inbox, or knowing terms mentioned in its body, so you can search on them. Sometimes you scan the subject-lines of the emails in your inbox or search results.

But sometimes those subject-lines are aren't very informative.

Some are just too generic (like "hi"). Or they may just not be specific enough for what you're looking for.

At the times when you know you'll want to find an email again later on, and it's obvious to you that the current subject-line isn't going to be that helpful, it'd be handy if you could stick a 'custom subject-line' over the top of the existing one.

After you'd added this custom subject-line in your inbox, that's the subject-line you'd see for that email, but it'd be clearly distinguished to show that it wasn't the original subject-line, and there'd be a way to find out what that original subject-line was.

As with any possible feature addition, the question is whether its benefits exceed its costs. This feature would be handy in some situations, but is the additional overhead in the UI and effort to come up with and type the new subject-lines worth it, for example? I doubt you could really tell if it's worth it for a feature like this unless you tried it out. You might get some idea from thinking through, in a lot of detail, scenarios of what the UI and usage-experience would be like if it existed.

Sunday, February 06, 2011

Idea: drag'n'drop merge of gmail conversations

#Gmail allows you to drag and drop the conversations in your inbox (for example, you can drag a conversation to a label, to apply that label to it). It'd be great if you could drop one conversation onto another in order to combine them.

Recently I've been planning a holiday with some friends and this planning, and the associated details, like confirmations of flight bookings, spans several separate email conversations.

If I could put them all together in one place it would make it so much easier to deal with the information. (I've submitted this idea as a feature suggestion to the gmail team).

(for interest's sake, the planning is for a trip to South Australia).

Sunday, April 11, 2010

Promoting conversations to more heavyweight communication mediums

There's all these different communication mediums -- IM, twitter, email, wave etc -- each of which have their own place because they have different affordances making them suited to different sorts of purposes.

But I wonder whether we can have better integration between them.

One dimension on which these mediums differ is their 'weight' - Twitter is quite lightweight, wheras email is more heavyweight, and wave appears to be weightier still.

Sometimes it would be useful to 'promote' a conversation from a lighterweight medium to a heavierweight one. What might start out as a twitter conversation might end up being better served by a wave.

Perhaps communication tools could support this conversation 'promotion'. For example, by supporting a full history of the conversation, spanning any changes in medium. The tools could also have knowledge of peoples' different identities across the different mediums, so that if you went from an email to certain recipients to a wave, all those people could be automatically added to the wave.

(and along with the notion of 'promoting' conversations, you could also have the inverse - demoting conversations).

Tuesday, March 02, 2010

A goal for education: giving people confidence in their learning ability

Too many adults fear learning. They think they can't do it. I think a lot of this comes from their school experience.

I think education should have the explicit goal of preventing this fear. Of course, this shouldn't be the only goal of education, but I think it should be there to instill people with confidence that they actually can learn about things, so that they will feel able to learn new things on their own later in life.

This doesn't mean having some lame attempt to simply tell students they can learn things, nor does it mean just getting them to believe they can. (I'm thinking of the lame way that self-esteem seems to be taught - or at least how it was taught in my school). Just telling people how they should feel doesn't do anything.

People actually need to successfully learn things. Only then will be able to build confidence. Then they'll genuinely know that they can do it.

I'm not saying it's practical to do a perfect job at this, I'm just saying it is an area we should target and try and do better at. From my experience of schooling, I don't think this was a terribly high priority. It seemed to be more about grading people.

People also need to appreciate that learning things can be difficult, that there can be extended periods of pain with no apparent progress before finally getting over the hump. That's probably a separate matter, and perhaps one that is harder to get people to appreciate. It's one that is especially applicable to when people head out into the "real world".

Monday, February 22, 2010

My Vim setup

[updated: 02.03.14; 11.4.10; 23.2.10; 17.1.10; 29.8.09; 31.8.09]
vimrc
(UNIX/Mac: ~/.vimrc; Windows: $VIM/_vimrc)

" vim:fo-=a


set nocompatible


"== pathogen
call pathogen#runtime_append_all_bundles() 


filetype plugin indent on 



set autowriteall   " auto save the file on things like :next

set switchbuf=usetab,newtab


" Make shift-insert work like in Xterm
map  
map!  

if version >= 500

  " highlight strings inside C comments
  let c_comment_strings=1

  " Switch on syntax highlighting if it wasn't on yet.
  if !exists("syntax_on")
    syntax on
  endif

  " Switch on search pattern highlighting.
  set hlsearch

endif



set shiftwidth=4
set softtabstop=4
set expandtab

set linebreak      " dont linebreak inside words
set mousehide    " hide the mouse when typing text
set splitbelow


"== search related
set ignorecase smartcase
set incsearch
function! NoHLSearch(pat)
   call search(a:pat)
   set nohls
   set hls
endfunction
" command -nargs=1 S :call NoHLSearch()
" F5 - toggle highlight search
map  :set hls!set hls?


" unicode - for hars pasted from web-pages, PDFs etc (see usr_45.txt)
set encoding=utf-8


" ** actualyl these sould be defined in vimrc and called in there to set
" the default that is set when vim is run.
function! NormalWritingModeLinesAndLinespace()
    set lines=36
    set linespace=4
endfunction

function! DraftingWritingModeLinesAndLinespace()
    set lines=21
    set linespace=13
endfunction


"== syntax/display
set columns=75
" set lines=38
" now setting it to less as i've increased linespace
" set lines=32
" set linespace=5
call NormalWritingModeLinesAndLinespace()
set ch=2  " Make command line two lines high
set laststatus=2   " so last remaining window always has a statusline
" make closed folds less visually prominent
highlight Folded guifg=LightBlue
function! MyFoldText()
    let leadingSpaces = "                                                                   "
    return leadingSpaces . "\\" . (v:foldend - v:foldstart)
endfunction
set foldtext=MyFoldText()
" note that the following has a backslash followed by one space
set fillchars=fold:\ 
highlight statusline guibg=LightGray guifg=DarkGray gui=none
set statusline=
set statusline+=%{getline(search(\"^[:#]\",\ \"bnW\"))}   " show curr heading
set statusline+=%=                                     " show rest right justified.
set statusline+=\ \ %c\,\ %l\ (%L)                     " col, line (tot lines)
highlight CursorLine guibg=#D9D9D9
"colorscheme morning
"set background=light " dark   " for solarized
if has("gui_macvim")
    colorscheme solarized
else
    colorscheme morning
endif



set backup          " turn on backup
set backupdir=/Temp/vimFileBackups    " dir for tilde files
set dir=/Temp/vimSwapFiles     " dir for swap files 
" mustn't have trailing slash. otherwise subsequent additions wont work 
set path+=~/Notes
set path+=~/PhD


set autoindent


set browsedir=current       " open file browser in current dir 

set selectmode=key



"== snipmate options
let g:snips_author = "James Cole" 


"== taglist options
let g:Tlist_Auto_Open=1
set updatetime=100
let Tlist_WinWidth = 40
let tlist_text_settings  = 'text;h:headings'
nnoremap   :TlistToggle
" To not display the Vim fold column in the taglist window
let g:Tlist_Enable_Fold_Column = 0
" only show contents of the current file in current tab
let g:Tlist_Show_One_File = 1

" weird, my computer crashed and after restarting it would no longer 
" generate the tags. it'd say 
" Taglist: Failed to generate tags for /my/path/to/file
"   ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
" Taglist FAQ says this is coz its not using the exuberant ctags file.
" if i type ctags in shell it gets exuberant one...
" but anyway i recently installed oh-my-zsh, which might be somehow the 
" problem.  setting the following var fixes the prob
" This seems to be about this problem (though I didn't it all):
" http://vim.1045645.n5.nabble.com/MacVim-and-PATH-td3388705.html
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'



" assume it gets a valid filename and path 
function! GetMarkdownHtmlFilename()
    let b:htmlFileNameForMarkdownDoc = expand('%:t:r') . ".html"
    let dialogPrompt = "Name and location for HTML file"
    let b:htmlFileNameForMarkdownDoc = 
        \ inputdialog( dialogPrompt, expand('%:p:h') .  "/" .  b:htmlFileNameForMarkdownDoc) 
    let menuTypeAndLoc = "amenu 900.107 "
    let menuItemName = "&Personal.A&uto\\-generate\\ HTML\\ on\\ save"
    let menuCall = ":silent call GetMarkdownHtmlFilename()"
    let menuDef = menuTypeAndLoc . menuItemName . menuCall
    execute(menuDef)
endfunction

" let markdownUtilName = "multimarkdown"
let markdownUtilName = "peg-markdown"
function! SaveFile()
    w
    TlistUpdate
    if exists("b:htmlFileNameForMarkdownDoc")
        execute("!" . g:markdownUtilName . " % > " . b:htmlFileNameForMarkdownDoc)
    endif
endfunction

nnoremap   :silent call SaveFile()
inoremap   :silent call SaveFile()
vnoremap   :silent call SaveFile()gv


"== tabbar options
let g:tagbar_expand = 1
let g:tagbar_updateonsave_maxlines = 7000



"== scrolling 
imap  
set sidescroll=1   " smooth horizontal scrolling - 1 char at a time
set scrolloff=1


"== cut and paste
" set clipboard+=unnamed    " copy yanks and deletions to system clipboard 
" send all yanked text to the system clipboard
nnoremap y "+y
" a 'cut' operator that can be used with text-objects, where cut text
" is placed on the system clipboard.
nmap \u "+d


" F4 - show list of headings in document
map  :g/^:/

" F6 - change all the non-displayed chars to plain-text equivs
"    (note how have to escape pipes between commands, and
"     double escape pipes within replace commands)
map  :%s/—/--/ge \| %s/…/.../ge  \| %s/“\\|”/"/ge  \|  %s/‘\\|’/'/ge


" F7 - to condense selected lines
" very quick a dirty way to do it, should put all the words in a datastructure
" and handle words and their variants ending with s better
map   :s/\/\&/ge  \| '<,'>s/\/tt/ge \| '<,'>s/\/b\/ween/ge \| '<,'>s/\/w\//ge \| '<,'>s/\/info/ge \| '<,'>s/\/compu/ge \| '<,'>s/\/r/ge \| '<,'>s/\/pic/ge \| '<,'>s/\/2/ge \| '<,'>s/\/in2/ge \| '<,'>s/\/b/ge \| '<,'>s/\/defn'd/ge \| '<,'>s/\/4/ge \| '<,'>s/\/Howevr/ge \| '<,'>s/\/defn /ge \| '<,'>s/\/partic/ge \| '<,'>s/\/thng/ge \| '<,'>s/\/thngs/ge \| '<,'>s/\/whch/ge \| '<,'>s/\/prt/ge \| '<,'>s/\/arg/ge \| '<,'>s/\/u/ge\| '<,'>s/\/wnt/ge \| '<,'>s/\/othr/ge \| '<,'>s/\/corresp/ge \| '<,'>s/\/4/ge\| '<,'>s/\/reps/ge \| '<,'>s/\/abve/ge \| '<,'>s/\/char/ge \| '<,'>s/\/chars/ge \| '<,'>s/\/req'd/ge \| '<,'>s/\/undef'd/ge \| '<,'>s/\/replacemnt/ge \| '<,'>s/\/dest/ge \| '<,'>s/\/src/ge \| '<,'>s/\/ure/ge \| '<,'>s/\/langs/ge \| '<,'>s/\/frm/ge \| '<,'>s/\/orig/ge \| '<,'>s/\/abt/ge \| '<,'>s/\/prop/ge \| '<,'>s/\/attrib/ge \| '<,'>s/\/qu/ge \| '<,'>s/\/diff/ge \| '<,'>s/\/philos/ge \| '<,'>s/\/impl/ge \| '<,'>s/\/req'd/ge \| '<,'>s/\/elems/ge \| '<,'>s/\/elem/ge


" insert '.x' at the start of the line - i've got syntax highlighting so
" that this line is 'crossed off' (as a plain text equiv so strikethrough)
" i use it for my planning docs and the 'to do' sorts of items in it
map  I.x 


" pump out lines below the cursor 
" orig ver: nnoremap  ok
" newer ver that supports counts - see http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_2)
" nnoremap  @='ok'


" execute the selected lines on the ex-line 
" e.g. if those lines contain a function you're coding, or a map
" so you don't have to copy those lines then type ':@"' 
vnoremap x "xy:@x





" note that we may have already deleted some of the files created today..... 
"   e.g. the files from today left might be 
"          100423.txt
"          100423--3.txt
"          100423--4.txt
" and we don't really want to just find the first available sequence num....
" but actually the first one after the current greatest sequence num
function! SaveNewPhdFile()    
    let today = strftime("%y%m%d") 
    let newFileName = today
    let theFileNames = glob(newFileName . "*.txt")
    let suffixes = []
    for fileName in split(theFileNames, "\n")
        let res = matchlist(fileName, "--\\(\\d\\+\\)")
        if res != []
            call add(suffixes, res[1]) 
        " assume it is the unsuffixed file for this date
        else 
            call add(suffixes, 1)        
        endif
    endfor
    " note: max rets 0 on an empty list, which will be case when none of the files had suffixes
    let suffix = max(suffixes) + 1  
    if (suffix > 1)
        let newFileName = newFileName . "--" . suffix . ".txt"
        " ^ for some reason += isnt working  ??
    else
        let newFileName = newFileName . ".txt"
    endif
    exec "w " . newFileName
endfunction

command CreatePhdDocument :call SaveNewPhdFile()

" improvement: hmm, i think i could exec both of these in the one command... and
" whatever is used to separate two commands.. like an ampersand i
" think...thatd guarntee that one only happens after the other and that
" only a single window is used.
function! AddFileToGit()
    exec "silent !git add " . expand("%:p")
    exec "silent !git commit " . expand("%:p") . " -m 'added'"
endfunction
command AddFileToGit :call AddFileToGit()



" @nextAvailable - if '1' attempt to delete the next block of whitespace lines
"   in the given direction, not just any immediately above current line
function! DeleteBlankLinesAboveOrBelow(direction, nextAvailable)
    let currLineNum = getpos(".")[1]
    if (a:nextAvailable == 1)
        let currLineNum = GetNextWhiteSpaceLine(currLineNum, a:direction)
    else
        let currLineNum = Next(currLineNum, a:direction)
    endif
    while (WithinDocument(currLineNum))
        if getline(currLineNum) =~ "^\\s*$"
            exec currLineNum . "delete"
            " note that if we're deleting lines below (direction == 0)
            " then the line numbers below will be one less each time we
            " delete a line
            if (a:direction == 1)
                let currLineNum = Next(currLineNum, a:direction)
            endif
        else
            break
        endif
    endwhile
endfunction

    "  ^ the problem i was having was coz i wasnt reading the documentation of
    "   delete closely enough. i thought you put the line number (or rather,
    "   range) /after/ the delete text. 
    

" the maps stand for 'delete blanks above/below' 
nmap  dba :call DeleteBlankLinesAboveOrBelow(1, 0)
nmap  dbA :call DeleteBlankLinesAboveOrBelow(1, 1)
nmap  dbb :call DeleteBlankLinesAboveOrBelow(0, 0)
nmap  dbB :call DeleteBlankLinesAboveOrBelow(0, 1)

" ^ hmm, if you have these maps as 
"       dsa     (delete space above, etc etc)
"       dsA
"       dsb
"       dsB
"   then for some unknonw reason when you 
"   type 'dd' it pauses before doing it, as if you could be typing 
"   some other thing after it - but none of these start with 'dd' ??
"   but then why can surround.vim not have this effect??


    " @direction:  1 - up, 0 - down
    function! Next(item, direction)
        if (a:direction == 1)
            return a:item - 1
        else
            return a:item + 1
        endif
    endfunction


    function! WithinDocument(lineNum)
        return a:lineNum >= 1 && a:lineNum <= getpos("$")[1]
    endfunction


    function! GetNextWhiteSpaceLine(currLineNum, direction)
        " cases (just in the upwards direction)
        "     - 1. next line above *is* whitespace
        "     - 2. next line above isnt whitespace
        "         - 2.1 whitespace line is N lines above
        "         - 2.2 there are *no* lines of whitespace above
        " 
        "     - 1 & 2 r both handled coz it is passed the line the cursor was
        "       on when deletion command was called, and it just starts looking
        "       from that line 
        "     - the code in general handles 2.1
        "     - the uses of WithinDocument handle 2.2
        let newLineNum = Next(a:currLineNum, a:direction) 
        while ( getline(newLineNum) !~ "^\\s*$" && WithinDocument(newLineNum) )
            let newLineNum = Next(newLineNum, a:direction)
        endwhile
        if !WithinDocument(newLineNum)
            return a:currLineNum
        else
            return newLineNum
        endif
    endfunction
     " *** should really put the regex for whitespace lines into a var!
    " testing map  :echo(GetNextWhiteSpaceLine(getpos(".")[1], 1))


function! FormatXml()
   % !xmllint.exe % --format
endfunction
command FormatXml :call FormatXml()



function! SOnPlural(num)
    if a:num == 1 || a:num == -1
        return ""
    else
        return "s"
endfunction


cd ~/PhD/working/2013/

" show the 'cued-up' keys as you type them, eg as you type 3d
set showcmd

" Highlight from start of fileEdit
" most accurate but slowest 
" see http://vim.wikia.com/wiki/Fix_syntax_highlighting 
" autocmd BufEnter * :syntax sync fromstart

set textwidth=9000
set formatoptions-=a

autocmd FileType text set textwidth=75
" auto-format as you insert text
autocmd FileType text set formatoptions+=a
" With this, a linebreak means a new para, unless trailing whitespace at 
" end of line.  It means that the 'a' option doesn't auto join lines 
" separated by a linebreak.
autocmd FileType text set formatoptions+=w

set hidden
set switchbuf=useopen,usetab

set tabpagemax=35

let g:gitgutter_enabled = 0

set foldmethod=manual


gvimrc
(UNIX/Mac: ~/.gvimrc; Windows: $VIM/_gvimrc)
" vim:fo-=a if has("win16") || has("win32") || has("win64")|| has("win95") " get normal ALT-SPACE behavior map :simalt ~ set gfn=Lucida_Sans_Typewriter:h18:cANSI elseif has("gui_macvim") set gfn=Menlo:h15 endif set cursorline " highlight line cursor is on set guioptions-=T " no toolbar " must be set in vimrc rather than vimrc - they're values are reset when " gvim starts set vb t_vb= function! SubsituteTildeForHomeDir(path) " " want the trailing slash to avoid case of a file in " parent of homedir starting with homedir's name " e.g. if homedir is /users/James " if there was a file called /users/JamesNotex.txt " let homeDir = expand("~") . "/" let newPath = substitute(a:path, "^" . homeDir, "~/", "") return newPath endfunction " sets window title that shows, in this order, these details: " - for unnamed files " - '[No Name]' " - a '+' if buffer has been modified " - current working directory " - vim server instance name " - for named files " - filename " - a '+' if buffer has been modified " - path " - if we're currently auto-generating HTML for this markup, " indicate name+path of that file " - vim server instance name " in any paths, a tilde is substituted for the home directory " function! JamesTitleString() " get list of nums of the buffers assoc'd w/ each window in curr tab page. let l:bufnrlist = tabpagebuflist() let fileNameAndPath = bufname(l:bufnrlist[tabpagewinnr(tabpagenr()) - 1]) " show only the filename (get rid of all the path details) let fileName = substitute(fileNameAndPath, ".*/", "", "") " 'escape' ampersands, so they 1) aren't hidden " & 2) make character following them underlined let fileName = substitute(fileName, "&", "&&", "g") if fileNameAndPath == "" let title = "[No Name]" else let title = fileName endif " Add '+' if the current buffer in the tab page is modified if getbufvar(l:bufnrlist[tabpagewinnr(tabpagenr()) - 1], "&modified") let title = title . ' +' endif if fileNameAndPath == "" let title = title . " (CWD: " . SubsituteTildeForHomeDir(getcwd()) . ")" endif if fileNameAndPath != "" let title = title . " (" let title = title . SubsituteTildeForHomeDir(expand("%:h")) let title = title . ")" endif " if we're currently auto-generating HTML for this markup, indicate name+path of that file if exists("b:htmlFileNameForMarkdownDoc") let title = title . " [->" . b:htmlFileNameForMarkdownDoc . "]" endif let title = title . " - " . v:servername return title endfunction set title set titlestring=%{JamesTitleString()} " max size of titlestring set titlelen=100 function! JamesTabLabel() let label = '' let bufnrlist = tabpagebuflist(v:lnum) " Add '+' if one of the buffers in the tab page is modified for bufnr in bufnrlist if getbufvar(bufnr, "&modified") let label = '+' break endif endfor " Append the number of windows in the tab page if more than one " let wincount = tabpagewinnr(v:lnum, '$') " if wincount > 1 " let label .= wincount " endif " if label != '' " let label .= ' ' " endif " ^ commented out because it includes taglist window in count " an enhancement would be to filter it out let fileName = bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) " show only the filename (get rid of all the path details) let fileName = substitute(fileName, ".*/", "", "") " 'escape' ampersands, so they 1) aren't hidden " & 2) make character following them underlined let fileName = substitute(fileName, "&", "&&", "g") " don't show '.txt' extensions let fileName = substitute(fileName, "\\.txt$", "", "") let label = label . fileName return label endfunction set guitablabel=%{JamesTabLabel()} function! OpenMyFiles() " note that for filepaths, must use forwards-slashes let notesDir = "~/Notes" let phdWorkingDir = "~/PhD/working" let dropBoxDir = "~/Dropbox" let fileList = [ \ notesDir . "/2014-plan.txt", \ notesDir . "/2014-days.txt", \ dropBoxDir . "/Apps/PlainText\\ 2/plan.txt", \ notesDir . "/vim.txt", \ notesDir . "/biograph.txt", \ notesDir . "/food&drinks.txt", \ notesDir . "/artsRelated.txt", \ phdWorkingDir . "/phdNotesInclSources.txt", \ notesDir . "/projectsToWorkOn.txt", \ notesDir . "/doAndGet-ideas.txt", \ notesDir . "/media-ideas.txt", \ notesDir . "/presents-ideas.txt" \ ] " \ notesDir . "/compu.txt", " \ notesDir . "/aiya,univData.txt", " \ notesDir . "/thinking&Knowl.txt", " \ notesDir . "/writing.txt", " \ notesDir . "/postQueue.txt", " \ notesDir . "/otherIdeas.txt", " \ notesDir . "/I-F&Games.txt", for fileName in fileList exec "e " . fileName exec "tabe" endfor exec "tabc" exec "tabdo :TlistToggle" " now, put the focus on the days file exec "normal! 2gt" set columns=135 endfunction " dev notes: " originally I didnt have the command there to join the lines, and it " didnt work properly. the reason was that you can't call exec like that " when there are a range of lines specified on the command line, as there " will be because there is a selection - and that sucks. the only " reasonable option would be if i could just put the 's' command there " without putting it as an arg to the exec...which i tried but it didnt " seem to work. if you use the substitute function, it only works on a " per-line basis, which'd be a pain. " could ask vim-use if there's a better way to do this. function! ConvertStringToFileName() normal! gv normal! J exec "s#\\<\\l#\\u&#ge" normal! gv exec "s/ //ge" exec "s/:/-/ge" endfunction " kinda silly way to impl this - I dont know how to define it as a string " and just insert that string. dont know how to encode the linebreaks. but " it works. function! InsertNotesFileFields() let oldFo = &fo set fo-=a normal! O normal! otitle= normal! oauthor= normal! otype= normal! oyear= normal! otopics= normal! oread= normal! o normal! o normal! o---------- normal! o let &fo = oldFo endfunction " requires the input text to be visual selection function! CleanTranslinkResult() let stringsToRemove = "Take Bus\\|\\t\\|(.\\{-})\\|daily timetable\\|trip timetable\\|Departing\\|Arriving\\|Zones travelled in:.*$\\|Fares for this journey.*$\\|Fare included in the next trip.*$" normal! gv exec "'<,'>s/" . stringsToRemove . "//ge" endfunction function! WrapAllLines() let oldTw = &tw let &tw = 9000 normal! gg normal! gqG let &tw = oldTw endfunction function! CloseTlistAndSetColumns() TlistClose set columns=76 endfunction function! GetLevel(theLine) if a:theLine =~ "^:" return 0 else return 1 endif endfunction function! FoldOnColonHeadings() setlocal foldmethod=expr " Make all the text within each section a fold " note that you dont call that func you just spec the func name setlocal setlocal foldexpr=GetLevel(getline(v:lnum)) " set columns=77 " setlocal foldcolumn=2 normal! zR endfunction "== menus function! OpenMyFiles_MenuItem() call OpenMyFiles() amenu disable &Personal.&Open\ Standard\ Files endfunction amenu 900.100 &Personal.&Open\ Standard\ Files :silent call OpenMyFiles_MenuItem() amenu 900.105 &Personal.C&lose\ Tlist\ and\ Set\ Columns :silent call CloseTlistAndSetColumns() amenu 900.107 &Personal.A&uto\-generate\ HTML\ on\ save :silent call GetMarkdownHtmlFilename() amenu 900.109 &Personal.Toggle\ GitGutter :GitGutterToggle amenu 900.110 &Personal.&Format\ XML :silent call FormatXml() amenu 900.120 &Personal.&Convert\ String\ To\ File\ Name :silent call ConvertStringToFileName() amenu 900.140 &Personal.Clean\ &Translink\ Result :silent call CleanTranslinkResult() amenu 900.150 &Personal.&Insert\ Notes\ File\ Fields :silent call InsertNotesFileFields() amenu 900.160 &Personal.&Wrap\ All\ Lines :silent call WrapAllLines() " eventually i want to put ticks next to the selected ones ✓ amenu 900.170 &Personal.W&riting\ Mode.&Normal :silent call NormalWritingModeLinesAndLinespace() amenu 900.180 &Personal.W&riting\ Mode.&Drafting :silent call DraftingWritingModeLinesAndLinespace() colorscheme solarized set background=light " for solarized " its set to dark in vimrc, as light is unreadable in terminal " make the highlighting of search terms less prominent " this is a lighter shade of brown " highlight Search guifg=#cbac4c highlight Search guifg=#dac47f


Autocommand for setting filetype of .txt files
(UNIX/MAC: ~/.vim/bundle/myadditions/ftdetect/txt.vim; Windows: $VIM/vimfiles/bundle/myadditions/ftdetect/txt.vim)
au BufNewFile,BufRead *.txt setf txt


$HOME/ctags.cnf (unix/mac: $HOME/.ctags. ctags website).
--langdef=txt
--langmap=txt:.txt
--txt-kinds=+h
--regex-txt=/^(:.*)$/\1/h,headings/

($HOME is an environment variable ctags uses; that's where it looks for the configuration file - I've set mine to same dir as $VIM)


$VIM/vimfiles/syntax/txt.vim
syntax match lvl1Heading /^:[^:].*$/
syntax match lvl2Heading /^::[^:].*$/
syntax match lvl3Heading /^:::[^:].*$/
syntax match lvl4Heading /^::::[^:].*$/
syntax match lvl5Heading /^:::::.*$/

highlight lvl1Heading guifg=#0000FF
highlight lvl2Heading guifg=#0075FF
highlight lvl3Heading guifg=#0095FF
highlight lvl4Heading guifg=#60B9FF
highlight lvl5Heading guifg=#90DCFF


syntax match crossedOutLine /^\s*\.x.*$/
highlight crossedOutLine guifg=#AAAAAA



Add-on scripts
  • matchit
  • three related ones by Tim Pope
  • snipMate - TextMate-style snippets for Vim
    • though i haven't used this one much yet
  • taglist
    • for this i've installed ctags, and put it in my PATH environment variable (in my case in c:\programs\ctags58)
    • to get it to work properly with tabs (the 'tabs' for selecting different files, not the 'tabs' for indenting) apply the following patch
      --- plugin/taglist.vim 2008-08-13 19:04:48 +0000
      +++ plugin/taglist.vim 2008-08-27 19:24:49 +0000
      @@ -4097,6 +4097,12 @@
      " window. Used after entering a tab. If this is not done, then the folds
      " are not properly created for taglist windows displayed in multiple
      tabs.
      function! s:Tlist_Refresh_Folds()
      +
      + " Not needed when one file is displayed.
      + if g:Tlist_Show_One_File
      + return
      + endif
      +
      let winnum = bufwinnr(g:TagList_title)
      if winnum == -1
      return
  • renamer - rename multiple files by editing a text document
    • Allows you to use the familiar editing techniques like regexs and using visual-block mode to rename multiple files, and also not have to deal with the escaping you have to do with a shell
    • I came across this in a discussion thread about the editor-agnostic massren util, which allows you to do a similar thing. I ended up using renamer as I couldn't get massren running properly on my system.



How I've dealt with Vim's temp files

Details here.

Thursday, January 28, 2010

Thought: virtual iPhone for cut and paste between phone and computer

I'd like a 'virtual iphone' program on my computer that would open when I connected my iPhone. The program would emulate my iphone, including all of the data and applications on it.

The virtual and actual phones would be synched in real time. If I did anything on either my virtual iPhone or my actual iPhone, the other one would act in exactly the same way. (to get the most out of some apps you'd need some way to emulate multi-touch).

Why? So when u copied text or images in the virtual iPhone it'd appear on the windows clipboard. And items in the windows clipboard would be pastable into the virtual iPhone and thus directly into my actual iPhone.

Say I had some text in my iPhone notes app that I wanted to put into a text file I'm editing on my computer - i think this cut and paste between the virtual iPhone and the text editor would be the most convenient way of doing it.

(and it'd be even better if the phone could _wirelessly_ connect up with the computer...)

Tuesday, January 19, 2010

On language documentation for experienced programmers

For someone familiar with programming it's pretty easy to get going with a new language.  The new language will likely contain many familiar concepts, just perhaps done a bit differently.  There are stylistic differences between languages, but I'm talking about the basics here.

What is the most efficient way to present these programmers with what they need to know to get going with a new language?

I tend to find most documentation isn't that good for this task. What I find useful is concrete examples of the features, directly showing the syntax and the results you get for particular inputs.

Like if I already know how to do regular expressions and want to see how they're done in Python, I just want to see what a call looks like in Python and see things like what sort of value is returned if there is no match.  

So perhaps you could have documentation that was essentially a representative bunch of simple examples showing the exact inputs and exact outputs.

You'd have clusters of examples showing the different variations on a particular construct or function. Eg those showing the syntax for doing different things with regular expressions. They'd come with brief descriptions of what is being illustrated. Eg 'non-greedy matches'.

It'd be even better of you could edit the examples then and there to modify the input values and see how it effected the results.

The idea would be to have the information in a format that is concise and easy to scan, to make it as quick as possible to lookup what you want to do.  

Monday, January 18, 2010

idea: using 'photo sequences' in photo viewing apps

Say you've got a bunch of pics in a directory or in your iPhone photo roll and amongst those there's a set of consecutive pics that form a grouping. You might have looked at a unit to rent and taken several pictures of the place - these photos would be in a consecutive sequence, bounded at both ends by photos taken at other times and places.

A photo viewing app might be able to automatically determine such groupings. It could use the photo metadata about when and where the photos were taken, and form groups of photos where each successive photo was not taken too far away from, and not too long after the one prior to it. Perhaps some AI techniques could help out as well (though I'm a bit doubtful of any of the existing techniques being good enough to do a sufficiently useful job).

It's hard to know how well these groupings could be automated without actually trying it. Lets consider the possibility that the software could do a reasonable job.

The iPhone photo roll is just a flat sequence of photos. Each photo you take gets appended to the end of it. As people have pointed out, the iPhone tends to eschew hierarchial storage of information within folders and sub-folders, instead using flat storage like this. Storing information in a flat structure in chronological order seems a reasonable solution that meshes reasonably well with human memory. One problem with it, though is that you can end up with a huge number of items -- in this case photos -- all lumped in together.

An app that could detect the photo groupings could have ways to browse the photos in terms of them.

Perhaps each grouping would be displayed as a line of thumbnails, with the groupings shown one after the other as you go down the screen. You'd scroll down to view more of the groupings. If there were more photos in a grouping than you could fit in a line of the screen (a likely possibility) it could continue the line off to the right - requiring a horizontal scroll to see them. Or maybe it would just only show as many as would fit on the screen, and use an icon to show there were more. You could click on that to view the first unshown photo.

I think it mightn't matter so much if you only see some of the photos in each group - hopefully the ones you would see would be enough to remind you of the subjectmatter of those photos and know if any one you were after was in that group or not. And since only a single line is shown for each group, it means that you could (i'd think) be able to scroll more quickly through all of your photos.

Of course it might not be as efficient if a lot of groupings only contained a one, two or a handful of photos.

There are other possibilities for displaying based on groupings. The screen could show one grouping at a time, where you swipe to the right to see the next group. And if too many photos in the group to display at once, scroll down to see the others (like how he iPhone photo roll works).

The general idea is that using photo groupings would be a way to give a lightweight, automatic structure to the sequence of photos -- without having hierarchies, thus preserving the benefits of 'flat' layouts iPhone uses.




notes

When viewing the photos one by one and you got to the first image in a photo group, it could do the following. Instead of viewing that first photo, it could show thumbnails for all the photos in the group. You click on one of them to jump straight to it. Of if you just scrolled across to the next photo it would _then_ show you the first photo in the group.

Alternatively, when you hit the first photo in the group it could show it, but then underneath it show a line of thumbnails for the other photos in the group (and perhaps it would do the same when you were viewing any of the other photos in the group).

Regarding the automatic determining of the groups, perhaps the software could let you manually adjust its auto-groupings. It could also let you create your own groupings and give the groupings names. I suspect though that for a device like the iPhone, this'd be getting too complicated.

Sunday, January 03, 2010

A practical way to compensate musicians?

These days purchasing music is pretty much a voluntary act of charity.  The listener decides if they'll pay. 

I think a number of ppl would like to pay some amount to the artists but not the amount the music's sold for.  Which means they end up just pirating it for free.  

They might pay something if it was an  amount they were comfortable with and doing so was super low friction. 

Since they'd only pay what they're comfortable with they'd have to set the price. 

I'm not talking about how things should be in an ideal world. But trying to see what is the best that can be done in the world as it is. 

You could incorporate a new feature into music playing programs like WinAmp and iTunes. When they installed they'd ask the user if they want to make a monthly contribution amount that'd be distributed amongst the artists whose songs the person plays. The user could enter in an amount they were comfortable with - eg $5. Obviously this'd have to be connected with something like pay pal or a credit card.  

The user would of course be able to later change this amount or stop the payments all together. 

The programs can track which songs by which artists the person plays (like plugins for things like last.fm currently do - in fact the scheme I'm describing could alternatively be done via a site like that). 

It'd then divide the monthly amount appropriately between those artists. Obviously there'd need to be infrastructure to get all these paymets to them. That'd probably be the hard bit to do.

This seems pretty low friction  Once it's set up the user doesnt need to think about it or think about how the amount of music they're playing is going to cost them.  The amount they pay is known in advance and is a flat amount that's the same no matter how few or many songs they listen to in the month.
 
It could be set up so a verified display of their contribution amount could, if they wanted, be shown on their facebook profile or whatnot, which might apply a little social pressure to others to contribute.  

Making these contributions the default on music players could harness the power of defaults.

And of course there's the potential to apply such a model to other media such as movies or newspapers.

Saturday, January 02, 2010

The iPhone analogue of Vim-like editing?

What'd b the iPhone/touchscreen analogue of Vim-like editing?  

The most obvious thing would b to have modes.

This might not seem that useful. After all a lot of the benefit of having modes is being able to explicitly specify positions in the text or blocks of text, such as 'the end of this sentence' or 'this paragraph', whih is less of a benefit with a touchscreen coz u can directly point at and select things.  

Still I wouldn't be surprised if it turned out to b easier to specify certain text positions/ranges in a vim-like way.

Another benefit of modal editing is dealing with structure such as markup or code.  

Coz the iPhone has a virtual keyboard it could have different virtual keyboards for each mode. At least it'd be interesting to see if this made things better.
   
You could poss also use gestures (or maybe even phone movements) to specify certain commands. 

And I wonder if such an editor could help w/ coding on phone ala Y-Combinator's RFS 5: Development on Handhelds.  

Friday, December 04, 2009

"Re-thinking WYSIWYG editors for Web CMS"

Some thoughts from the Amaxus people on keyboard-only ways to add formatting and html links in rich-text editors or text-areas using just the keyboard.

They consider these options: Automatic Markdown Conversion, and Inline Formatting (introduce a keyboard shortcut that initiates ‘inline formatting’ - basically shows what the shortcut keys are for different types of formatting and which gives you an easy way to set which text the formatting will apply to).

Also, some Hacker News comments on that post.




My interest in this is how we can have editors that can handle structure (the formatting and link information requires structured information. but also stuff like the structure of code and XML) in a fluid fashion. I think there's a lot of room for improvement there.