Disclaimer

The content of this blog is my personal opinion only. Although I am an employee - currently of Nvidia, in the past of other companies such as Iagination Technologies, MIPS, Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

Thursday, October 25, 2012

Multiple paths of history

I have blogged, whined, ranted and complained about systems that allow you to, nay, encourage you to, edit history.  But I also whine about systems that do not allow you to do something as trivial as fix a typo in a checkin message, let alone systems like Mercurial that do not really allow you to add properties like "passes the days-long QA test suite" to a version of the code in the repository.

Moreover, I really do understand why you want to rearrange history. My classoc example is of interleaved changes

  V0---(a1)--->Va1---(b1)--->Va1b1---(a2)--->Va2b1---(b2)--->Va2b2 = Vab

I.e. starting off at version V0, apply changeset (a1) to get version Va1, then changeset (b1) to get version Va1b1, and so on until you get final version Va2b2, which we will call simply version Vab.

I.e. there are really two independent changes going on, (a)=(a1)+(a2) and (b)=(b1)+(b2).  But they got interleaved.

Try as you might, this happens.

Using history rewriting tools like git rebase and hg graft you can rearrange the histories.


  V0---(a1)--->Va1--->(a2')--->Va --->(b1')--->Vab1'---(b2')--->Vab

or in the other order


  V0---(b1")--->Vb1"--->(b2")--->Vb --->(a1")--->Va1"b---(a2")--->Vab

Note that I have tried to indicated by priming, ' and ", that the changesets applied in different order may not be identical. Note: we are not talking about applying the SAME changesets in a different order, which might give different final results Vab, but instead calculating MODIFIED changesets (a1"), (b1'), etc. to give the same final result Vab.

Compactly, letting (a)=(a1)+(a2) and (b)=(b1)+(b2)

  V0---(a)--->Va--->(b)--->Vab

or in the other order


  V0---(b)--->Vb--->(a)--->Vab

I know how to do this with standard history editing tools.

---



But this is problematic when others have pulled and cloned and made modifications to the intermediate pre-history edited versions like Va2b1.  In Mercurial, if that version is deleted from the repository, you may not be able to merge back in - or, when you merge, it may revive the deleted version from the dead.

This is bad.

Moreover, this "you must edit history before pushing" philosophy leads to people delaying sharing code.  Which is bad.

---

I have been thinking more and more about recording multiple paths of history in the repo.

I.e. pushing first

    V0---(a1)--->Va1--->(a2')--->Va --->(b1')--->Vab1'---(b2')--->Vab

and then later, at your leisure, going and rearranging the history so that it makes sense:


    V0---+---(a1)--->Va1--->(a2')--->Va --->(b1')--->Vab1'---(b2')--->Vab
               \                                                                                   ||
                +-----------(a)---------->Va--------->(b)--------------------->Vab

I.e. the final nodes Vab are equivalent.

Or, pushing my ascii art skills

    V0---+---(a1)--->Va1--->(a2')--->Va --->(b1')--->Vab1'---(b2')---+--->Vab
               \                                                                                       /
                +-----------(a)---------->Va--------->(b)-------------------------+


(I think I like the equivalence || drawing better.)


Still later you may create a second alternate  history:

    V0---+---(a1)--->Va1--->(a2')--->Va --->(b1')--->Vab1'---(b2')--->Vab
               \                                                                                   ||
                +-----------(a)---------->Va--------->(b)--------------------->Vab
                  \                                                                                ||
                   +-----------(b')---------->Vb--------->(a')------------------>Vab
   
The basic idea is that when you establish that you are creating alternate history paths, the operations are constrained to create the same final results.

And then, for those who want a simple history, you hide the paths, the changesets and the versions, that you do not want to appear by default.  But they still are recorded in the history, so that if somebody made modifications based off an intermediate version, you can still merge meaningfully.   You get to decide if that merge appears as if based of a version that is currently hidden, or if you want to roll up the visibility of its ancestors.






Wednesday, October 24, 2012

How to capture a screen image with transient flyovers in VNC

I usually work in VNC, on a UNIX box, typically from a Windows PC latop.

I occasionally want to capture screen clippings of GUI applications running in VNC.   Problem: often they are transient - any key press, etc., causes what I want to capture to disappear.

Usually on Windows my scren capture tools (Windows 7's snipping tool, or SnagIt) have a keyboard or mouse shortcut that takes priority.  However, apparently VNC managed to install itself underneath, so all keyboard and input events get sent to VNC and Linux and the app.

So here's how to capture such a transient GUI popup or the like in VNC:

VNC has its own shortcut. On my machine, F8.

Press F8. Go to the VNC options menu. Unselect "send keyboard events to server" and "send mouse events to server".  Now enter the screen capture shortcut.  Undo so that VNC works again.

Not nice, but I can use it.  Will have to see whether AutoHotKey is underneath all of these so can shortcut.

GMake order dependent inconsistency

I dislike how GMake is inconsistent about ordering:

You can define rules out-of-order

top-rule: sub-rule1 sub-rule2
      @echo top-rule
sub-rule1:
      @echo sub-rule1

sub-rule2:
      @echo sub-rule2

but if you want to do something like collecting the sunb rules in a variable this breaks

top-rule: $(SUBRULES)
      @echo top-rule
SUBRULES+= sub-rule1
sub-rule1:
      @echo sub-rule1

SUBRULES+= sub-rule1
sub-rule2:
      @echo sub-rule2

because the variable is expanded when encountered

It must be fixed by rearranging

SUBRULES+= sub-rule1
sub-rule1:
      @echo sub-rule1

SUBRULES+= sub-rule1
sub-rule2:
      @echo sub-rule2
top-rule: $(SUBRULES)
      @echo top-rule

Darn! But I like being able write things out of order, top-down.

In general, I like languages that have relaxed order dependencies.  Like some RTL languages (notably Intel iHDL).  Even C++ has relaxed ordering in some places.

But the inconsistencies such as above are painful and confusing.

--

Single assignment is the easiest way to do non-order dependent.

But accumulation - += - is very much required.

Q: is the accumulation done order dependent, or not?

What is needed is accumulating += - probably order dependent.
And then expanding.

With an error if expanding results in changes to variables already being expanded.  ??

Or relaxation.

Tuesday, October 16, 2012

i should revive my old integer & fp recursive descent expression recognizer, & extend to lists & structs. it was nicely extensible.

New queue... - GQueues

New queue... - GQueues:

'via Blog this'

Anpther organizer, spoken well of.

But yet another tool that does not understand hierarchy.

You can have categories: Home and Work are default.  I added Personal.

You have queues within categories.

But you don't have categories within categories, queues within queues.

Nowhere to record comments as t what a category or queue is used for.

Tags are a flat space.

Sigh

Monday, October 15, 2012

Notify at end

I've already talked about this, but again:

My wife is dropping our daughter off at MNusic class, and I am picking her up a while later.

Compound Event:

Start Driving W: 3pm, alarms -5 minutes, for my wife and daughter
Interval: driving, blocked out for my wife and daughter
Event Start: 3:30pm
Interval: blocked out for my daughter, but not for my wife nor me
Event End: 5:30pm
Start Driving H: 5pm, me. Alarm -5 minutes, for me.
Interval: Start Driving H to Event End: blocked out for me

...etc...

Meet Person at 7:30

A pattern in my usage of calendaring programs: I will often create meetings, events, appointments of the form "Pick up D at 7:30 after Music class"

I.e. I will put the actual target time in the title.

Reason: I will set the actual start time earlier, e.g. at 7pm, to give me time to drive to the music class to pick her up.

And I will have alarms, notifications, set at the usual countdown - 10 minutes, 5 minutes - before.

Q: Why not just set the event for the pickup time, and set an alarm?

A: I need the time to be blocked out, so that no meetings will be set up conflicting.