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, March 22, 2012
Personal versus Version Control Log
I keep a log. ~/LOG.
(Actually, I really need to keep a personal ~/LOG and ~/work/LOG, since the latter may belong to company. But thats another issue.)
There is redundancy between my personal LOG and the log messages checked into a version control log. Like Mercurial, CVS, RCS, SVN, git.
I often find myself writing similar messages into both mer version control log and my personal log. Cutting and pasting when I remember to.
(Unfortunately, hg's integration with emacs' VC mode makes the cut and pasting a bit harder, since it removes the buffer in which the log message was being written as soon as checked in. Old RCS mode was more convenient, since it just pushed that buffer down in the stack, and I could easily go back and get the text. Not so hard to do an hg log and then cut5 and paste, but often too much hassle.)
This is an example of the need for a multicast. Just like I sometimes want text to go to botyh my blog and my wiki, and USEnet comp.arch, and ... I also sometims want what I have written to go to version control log and personal ~/LOG (and maybe work ~/work/LOG, and ...)
Cut and paste is okay if I weren't doing it so much. But since I do it so much I want something more convenient.
How can I say it is tioo much hassle: because I often don't propagate stuff to all the logs I should.
Expressing fetch-old-and-do-new in a High Level Language
Quite often I find myself wanting to test the old value of some variable, using that to go into an IF, while then or soon thereafter setting a new value.
For example:
our $titles_already_printed;
sub print_titles {
if( ! $titles_already_printed ) {
print "TITLES...";
}
$titles_already_printed = 1;
}
This doesn't look so bad if it is a simple variable:
our $f;
sub print_titles {
if( ! $f ) {
print "TITLES...";
}
$f = 1;
}
But it can be painful if the flag variable iws accessed via a long and complicated path:
our %titles_already_printed;
sub print_titles {
my $titles = shift;
if( ! $titles_already_printed{$titles} ) {
print "TITLES...";
}
$$titles_already_printed{$titles} = 1;
}
And there can be more than one way of expessuing it:
our %titles_already_printed;
sub print_titles {
my $titles = shift;
if( $titles_already_printed{$titles} ) {
return;
}
print "TITLES...";
$$titles_already_printed{$titles} = 1;
}
The return form is convenient for functions - but only if it is correct to return. I have seen quite a few bugs caused by such returns, when there is later code (perhaps added later) that should not be skipped by the return.
The first form is convenient for straight line code, not wrapped in a function.
It is annoying that refactoring code from straight line to function may sometimes require changing its control flow structure.
Here are some other forms:
First, separating the flag manipulation from the action:
our %titles_already_printed;
sub print_titles {
my $titles = shift;
my $old_resukt = exists $titles_already_printed{$titles};
$titles_already_printed{$titles} = 1;
if( $old_result ) {
return;
}
print "TITLES...";
}
You can probably see where I am going. Would it not be nice to not have the repetition? Something like
our %titles_already_printed;
sub print_titles {
my $titles = shift;
my $old_result =
lambda_define_and_invoke_here( NAME = $titles_already_printed{$titles} ) {
return_value = exists name;
NAME = 1;
}
if( $old_result ) {
return;
}
print "TITLES...";
}
Purely syntactic sugar, but...
- lambda_define_and_invoke_here defines a lambda function, a code block, in part to get parameterization so a shiort NAME can be used. It is defined and used immediatekly, so that we don't have to repeat ourselves by defining it associated with a name, and then immediately invoking that lambda name.
- Something like Jensen's device, name substitution, is used for NAME. In this example because $titles_already_printed{$titles} doesn't exist at the time of invocation. If that weren't an issue, a non-Jensen's device lvalue could be used. Extend that to a special lvalue for $titles_already_printed{$titles}, that creates $titles_already_printed{$titles} if it doesn't already exist and is later assigned to. An "potential lvalue for an ordinary lvalue that may not exist yet".
- return_value used so that we don't have to obscure things by creating a tmp for the old value.
Wednesday, March 21, 2012
Focus on the focus window
I wonder if I should code stuff to bring the window I am working on the the center of my field of view, while moving other windows to the side.
Again, related to more screens?
Shells tightly bound to directory?
I am noticing a pattern:
I have long used emacs shell windows.
But for some reasion more and more I am creating shell windows that are intended to be tightly bound to their directory. Whose name is their directiry.
Where it gets confusing if I chdir in them. In fact, have had errors when I quickly type
keystrokes to switch to a shell window
command expecting to be in dir
PROBLEM: had changed away from dir, deliberately or by accident
I am beginning to wonder about DISABLING chdir in that sort of shell window. Or at least making it a bit more onerous.
Why this is happening more now than in the past, I dunno. Possibly because I have more screens.
---
Similar happens for xterms, but I use xterms much less often than I use emacs shell windows.
Understanding Exogenous shocks to Startups and Conditional Prophecy
-
http://cdixon.org/2011/12/07/growth-curves-of-startups/
I remember first observing this when I worked at Bessemer. For example, there was a startup that supplied services to video websites. For years, the company soldiered along, barely growing. Then, suddenly, YouTube blew up and this company took off along with it.
As a founder, these exogenous shocks are out of your control, but you can 1) understand what exogenous shocks you depend on, 2) try to guess when those shocks will hit, 3) manage your runway so you survive long enough for them to hit.
This sounds very much related to my classification of prophecy or prediction:
There are 4 types of prophets:
(1) False prophets who are always or usually wrong, or are right by random chance. These are common.
(2) Accurate prophets, who can predict exactly what is going to happen, exactly when it is going to happen. These are exceedingly rare.
(3) Eventual prophets, whose predictions, oft repeated, almost always eventually come true. Here are some from the past, and some from the near future: "Computers will fit on your desk". "Tablet computers will one day be popular." "Some day, computers will be worn, not carried, and will display on your glasses, contact lenses, directly onto the back of your eyes, or direct neural connect". Nobody with a clue will be surprised by the last set of eventual predictions coming true: the problem is knowing when, and how. How to make it happen, and how to profit by it happening.
The final class of prophet is, I think, the most interesting, because it is sometimes attainable and more useful than anything except accurate prophecy:
(4) Conditional or contingent prophets: they may not be able to predict exactly when something will happen, but they can make predictions about dependency graphs of events. For example, referring to Chris Dixon's blog post "If internet video ever takes off (like YouTube eventually did) then there will be a market for video services for websites." Or let me try: "Contact lens displays may take off (a) when nearly transparent pixels dense enough to be circa 1Mp on the size of a contact lens can be achieved, (b) when signals (whether by wire or non-wire (not necessarily electromagnetic wireless) can draw (not refresh) such pixels on a device, and (c) when a standby device <0.1W powered by energy harvesting can always run, and wake up a more power huingry device when needed).
When I helped start Intel's Microprocessor Research Lab I created several such dependency graphs. Note: not just simple chains, since there may be more than one way at arriving at a result.
Sunday, March 18, 2012
Sharing Kindles in a Family
We want to share Kindles between the members of our family - so that we can treat them as a pool of devices of different form factors, ranging from small through large.
For that matter, we often read the same books.
It looks like the only way to do this sharing is to share a Kindle account.
Since I don't want to have a credit card attached to the account my teenager logs in to, I create a second account - one associated with the Kindle, the other for purchasing books. I can then use "give a book" to, well, give a book from the CC account to the K account.
For that matter, my wife and daughter both have their own Amazon accounts. Makes gift card management easier. Now we must remember to give books to the K account.
Lossage: subscriptions need a credit card account. I may arrange a card with very low limit.
If at some time we no lionger need to swap Kindles of various sizes, we may rebind.
---
It is annoying that the Kindle does not allow multiple accounts. In this, it is like the early DOS and Windows PCs, who could not understand that multiple different users might want to use the same device.
For that matter, we often read the same books.
It looks like the only way to do this sharing is to share a Kindle account.
Since I don't want to have a credit card attached to the account my teenager logs in to, I create a second account - one associated with the Kindle, the other for purchasing books. I can then use "give a book" to, well, give a book from the CC account to the K account.
For that matter, my wife and daughter both have their own Amazon accounts. Makes gift card management easier. Now we must remember to give books to the K account.
Lossage: subscriptions need a credit card account. I may arrange a card with very low limit.
If at some time we no lionger need to swap Kindles of various sizes, we may rebind.
---
It is annoying that the Kindle does not allow multiple accounts. In this, it is like the early DOS and Windows PCs, who could not understand that multiple different users might want to use the same device.
Saturday, March 17, 2012
As a result of my move, I am losing the NAT router w. wifi that I have been using for the past few years.
At my new house Comcast is just giving me a cable modem. (I may try to swap boxes, but they probably won't let me get away with it.) (This surprised me: I did not know there were naked cable modems available any more.)
So, I am shopping. Any recommendations?
I know: I should just take one of my old machines and install the latest flavor of open source router. But (1) I'm lazy, and just want this to work, and (2) I don't have any machine younger than 2000 with slots for a second network card, and don't feel like shopping for USB NICs and ... and ... (As I have mentioned before, I went almost a decade without buying a desktop PC, laptops only, although I did give in and buy a cheap desktop last year.)
The usual shopping list:
* NAT
* wifi - nice, but I have some old wireless routers that I can use. still, it's nice to9 have just one box. (For various reasons, I don't want to use those wireless routers to connect to the net.)
Since I am shopping around, I might as well look for something that is on my wishlist: stats.
Basically, I would like the router to keep a reasonable amount of local stats. Enough so that I can document what percentage of the time I and what percentage of bandwidth up and down I spend VPNed to MIPS, so that I can at least deduct that from my income for tax purposes. (Perhaps if it's a high enough percentage, I can pay for more bandwidth, and get better Skype to you, Mike.)
Not necessarily a full connection log, although that would be nice if there was enough storage.
But at least
* total packets/bytes up/down
* total packets/bytes to a few IP addresses I identify
* total packets/bytes by IP for some selection of the top few IP addresses (not explicitly identifed)
* total 1minute time intervals in which there is any traffic, and/or any traffic to those IPs identified above
* histogram of those intervals by time of day and day of week
With reasonable ability to download automatically, so that I can keep the stats on another machine.
(Lower priority: VPN in the router: I have thought about tunnelling everything from my house router to Dreamhost for 20$ a month. Mainly so that I also get VPN that I can use while travelling. VPN in the router attractive so I don't need to configure it on Sophie and Rhonda's machines, etc.)
Subscribe to:
Posts (Atom)