Interesting:
if you do hg clone -r default
(m)any branches that were closed will now be reopened.
Because the Mercurial close record for a branch is usually a stub in the revision tree.
This is suboptimal.
It is also the sort of thing I have been obsessing about, both for source code version control, but also for logs: some state may want to transcend branches.
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.
See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.
Thursday, July 19, 2012
Code phases: Distinction between simulation and instrumentation code
I often find in simulators that I want to distinguish the simulation code, the code actually needed to run, from the instrumentation code. The latter exists only for analysis of the results, but is not necessary if all you care about is functional correctness.
Information should only flow one way, from simulation code to instrumentation. Never backwards.
I have experimented with C preprocessor macrios like INSTRUMENTATION( perf_counter++ ), and so on, but these are clumsy. I will admitt hat INSTRUMENTATION: looks better than INSTRUMENTATION( )
If you use sch macros, you can always do #define INSTRUMENTATION(x) /*nothing*/
and test that it still compiles and runs tests.
However, simulation/instrumentation are just two phases of code.
Debug may be a another phase, at least read-only debug observation. (Sometimes there is active debug, that influences the actual running.)
Asserts are yet another phase. Different from debug, because you often leave them on.
In both debg and assert phases, information flows from program main phase to the phases.
How about server/client partitioning? Although in this case data flows both ways.
Information should only flow one way, from simulation code to instrumentation. Never backwards.
I have experimented with C preprocessor macrios like INSTRUMENTATION( perf_counter++ ), and so on, but these are clumsy. I will admitt hat INSTRUMENTATION: looks better than INSTRUMENTATION( )
If you use sch macros, you can always do #define INSTRUMENTATION(x) /*nothing*/
and test that it still compiles and runs tests.
However, simulation/instrumentation are just two phases of code.
Debug may be a another phase, at least read-only debug observation. (Sometimes there is active debug, that influences the actual running.)
Asserts are yet another phase. Different from debug, because you often leave them on.
In both debg and assert phases, information flows from program main phase to the phases.
How about server/client partitioning? Although in this case data flows both ways.
== and !=
Q: should you always define operator!=() when operator==() is defined?
Uncomparables, where neither == or != are defined? Essentially, true, false, unknown.
Uncomparables, where neither == or != are defined? Essentially, true, false, unknown.
File by file merge
Screw this "treat the whole repository as a single thing".
To disentangle a thrash, I am copying files one or two at a ti,me from a thrashing branch to a new branch.
Something like
hg update -r careful-branch
hg revert -r thrashing-branch file1.cpp file1.h
...
hg ci -m 'file1.cpp/.h merged from careful-branch'
Basically doing a file by file merge.
It sucks that Mercurial does not record this as a merge. Doesn't show up in the graphical diagram drawn by glog. I'd like some sort of dotted line.
Hmm : could track workflow - what files remain to be merged. Even on a diff chunk by chunk basis:
merge this chunk ; reject this chunk; defer until next pass.
To disentangle a thrash, I am copying files one or two at a ti,me from a thrashing branch to a new branch.
Something like
hg update -r careful-branch
hg revert -r thrashing-branch file1.cpp file1.h
...
hg ci -m 'file1.cpp/.h merged from careful-branch'
Basically doing a file by file merge.
It sucks that Mercurial does not record this as a merge. Doesn't show up in the graphical diagram drawn by glog. I'd like some sort of dotted line.
Hmm : could track workflow - what files remain to be merged. Even on a diff chunk by chunk basis:
merge this chunk ; reject this chunk; defer until next pass.
Wednesday, July 18, 2012
Log entries cloned to status
I want to make logs (diaries, journals, etc.) more useful.
I have discussed the distinction between log entries - "at time T I did or observed this" - and status records - "the current state, e.g. of a code tree or my home directory, is SSSSS".
I.e. log entries are transient and historical.
Status entries are persistent, and, supposedly, current.
The big problem is that status goes stale. So status is always of the form "At time T the status was S (and I assume it still is, unless somebody has changed it, in which case they should please change the status)".
It is a pain to update both status and log.
Many log entries are status. But the log is not status - if for now other reason than a log grows huge, and periodically gets cleaned out or renamed.
Idea: automaticaly mark blurbs that are being written as status entries, in addition o adding them to the log. (I want to make everyting written get logged.)
E.g. copy them to ~/STATUS as well as ~/LOG. Linked appropriately.
I have discussed the distinction between log entries - "at time T I did or observed this" - and status records - "the current state, e.g. of a code tree or my home directory, is SSSSS".
I.e. log entries are transient and historical.
Status entries are persistent, and, supposedly, current.
The big problem is that status goes stale. So status is always of the form "At time T the status was S (and I assume it still is, unless somebody has changed it, in which case they should please change the status)".
It is a pain to update both status and log.
Many log entries are status. But the log is not status - if for now other reason than a log grows huge, and periodically gets cleaned out or renamed.
Idea: automaticaly mark blurbs that are being written as status entries, in addition o adding them to the log. (I want to make everyting written get logged.)
E.g. copy them to ~/STATUS as well as ~/LOG. Linked appropriately.
Tuesday, July 17, 2012
Cute trick to snarf Windows dialog box text
I have long been frustrated when trying to report bugs in Windows, because I could not easily snarf the text of a dialog box, etc., to stuff into the bug report.
Well, it turns out there is a way:
http://stackoverflow.com/questions/158151/how-can-i-save-a-screenshot-directly-to-a-file-in-windows
PhiLho:
O)f course, I would learn about it after I get into the habit of using tools like SnagIt and Windows 7's Snipping Tool to snip bitmaps by default, and paste those into... email, OneNote.
Heck, yesterday I got a primitive ability to paste images into GNU EMACS "text" files.
(Basically, I am making such text files be directories, and using my-org-screenshot (found all over, e.g. http://pastebin.com/QfLb9ZBr) to put the screenshot into a file that EMACS' org-mode can reference. Currently using directories, am modifying EMACS' tar mode to allow the new file to be written. Following my dictum that "UNIX already has all of the support needed for structured files: directories. Archives of directories, to make them convenient to move around.")
Heck, I think the biggest change in my usage patterns over the last three years has been to start blithely throwing bitmaps around. Basically, to treat bitmaps as a first class data type.
Especially useful when you have tools like Microsoft OneNote that can OCR a bitmap. Abd can therefore do a pretty good job of searching notes composed out of bitmap files.
Well, it turns out there is a way:
http://stackoverflow.com/questions/158151/how-can-i-save-a-screenshot-directly-to-a-file-in-windows
PhiLho:
Little known fact: in most standard Windows (XP) dialogs, you can hit Ctrl+C to have a textual copy of the content of the dialog.
Example: open a file in Notepad, hit space, close the window, hit Ctrl+C on the Confirm Exit dialog, cancel, paste in Notepad the text of the dialog.Well, I have wasted lots of time not knowing this...
O)f course, I would learn about it after I get into the habit of using tools like SnagIt and Windows 7's Snipping Tool to snip bitmaps by default, and paste those into... email, OneNote.
Heck, yesterday I got a primitive ability to paste images into GNU EMACS "text" files.
(Basically, I am making such text files be directories, and using my-org-screenshot (found all over, e.g. http://pastebin.com/QfLb9ZBr) to put the screenshot into a file that EMACS' org-mode can reference. Currently using directories, am modifying EMACS' tar mode to allow the new file to be written. Following my dictum that "UNIX already has all of the support needed for structured files: directories. Archives of directories, to make them convenient to move around.")
Heck, I think the biggest change in my usage patterns over the last three years has been to start blithely throwing bitmaps around. Basically, to treat bitmaps as a first class data type.
Especially useful when you have tools like Microsoft OneNote that can OCR a bitmap. Abd can therefore do a pretty good job of searching notes composed out of bitmap files.
Centralized Notification Ringtone/Sound Management
Android allows me to have different sounds (ringtones) for different notification events. This is good.
However, each seems to be managed in isolation. This is bad.
The most important thing about sound notifications is that they be distinct, so that you can remember which is for what. Best if there is some natural connection - like the sound of mail dropping through a slot for incoming email. (Although I get so much email... this is the only natural one I can think of.)
But distinct. Not good to have the same sound for incoming email (low priority), as for the reminder to get in the car and drive across town to an appointment you don't want to miss.
Manged in isolation, need to jump to each notifying app and change.
Want cenralised management, where I can see a list of all the different types of notifications I use, and can hear their sounds back to back.
I think Blackberry had this. But "all the differet typs of notifications I use". *I* *USE*. I recall the Blackberry list had all the notifications on the phone, includng many I had no idea about. Wasted time setting distinct notificaions, n one case thinking that incoming mssages meant incoming SMS text messages, not some other service.
--
Want different notifications for calendar items. E.g. different notifications for the "Leave now, drive 1 hour across town", and the "Pick up the phone for a meeting".
However, each seems to be managed in isolation. This is bad.
The most important thing about sound notifications is that they be distinct, so that you can remember which is for what. Best if there is some natural connection - like the sound of mail dropping through a slot for incoming email. (Although I get so much email... this is the only natural one I can think of.)
But distinct. Not good to have the same sound for incoming email (low priority), as for the reminder to get in the car and drive across town to an appointment you don't want to miss.
Manged in isolation, need to jump to each notifying app and change.
Want cenralised management, where I can see a list of all the different types of notifications I use, and can hear their sounds back to back.
I think Blackberry had this. But "all the differet typs of notifications I use". *I* *USE*. I recall the Blackberry list had all the notifications on the phone, includng many I had no idea about. Wasted time setting distinct notificaions, n one case thinking that incoming mssages meant incoming SMS text messages, not some other service.
--
Want different notifications for calendar items. E.g. different notifications for the "Leave now, drive 1 hour across town", and the "Pick up the phone for a meeting".
Subscribe to:
Posts (Atom)