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.
Saturday, January 14, 2012
I'd like to have a text parser, like Perl CPAN Text::ParseWords,
that *only* breaks the text into words
- but which does not transform the words, handle escape characters, etc.
For example,
Text::ParseWords::
shellwords("a b 'c d' e")
returns
a
b
c d
e
i.e. it breaks the text up into words,
but it also transforms the words.
I would like to separate the breakup from the transformation:
a
b
'c d'
e
Note that if you ever encounter such a list whose words can themselves be further broken up,
then you know that it has been parsed by some tool after your original parser.
[[Category:Programming]] [[Categy::Text]]
Sunday, January 08, 2012
Thumb drive as a webserver / NAS
I wish that I could find a flash drive that acted as a NAS.
Most USB flash drives are passive storage. Encryption is done by the OS you plug into. Since I run Windows and various *IXes, and want to access my data from each, depending on a particular OS is a pain.
Booting an OS from the USB flash drive is better - but still not great, since it makes assumptions about the platform you are plugging in to. Typically, that it is a PC.
Flash drives have non-trivial processors in them. Probably running Linux. Why not make them a peer?
Issue: network interface.
I don't really want to add a typical Cat 5 ethernet connector - what is that, RJ45, 8P8C plug? - to the flash drive, neither in addition to nor replacing USB.
Q: I am sure there is a standard for networking over USB - but how ubiquitous is it? I do not recall ever getting the option, when I plug in a USB flash drive, of connecting a webnrowser to a server running on tghe drive.
Most USB flash drives are passive storage. Encryption is done by the OS you plug into. Since I run Windows and various *IXes, and want to access my data from each, depending on a particular OS is a pain.
Booting an OS from the USB flash drive is better - but still not great, since it makes assumptions about the platform you are plugging in to. Typically, that it is a PC.
Flash drives have non-trivial processors in them. Probably running Linux. Why not make them a peer?
Issue: network interface.
I don't really want to add a typical Cat 5 ethernet connector - what is that, RJ45, 8P8C plug? - to the flash drive, neither in addition to nor replacing USB.
Q: I am sure there is a standard for networking over USB - but how ubiquitous is it? I do not recall ever getting the option, when I plug in a USB flash drive, of connecting a webnrowser to a server running on tghe drive.
Friday, January 06, 2012
Gratuitous key position changes.
Was wondering why "search" or "find" in Google chrome was broken.
Wasn't. For the past week I was using a keyboard that was not my usual, with the keys in the lower left hand corner looking like Ctrl,Fn,...
Just switched back to what has been my usual keyboard for several months, with those keys swapped: Fn,Ctrl,...
It's funny how these trivial differences in devices are some of the most annoying.
Last time I shopped for keyboards, I bought 3 identical. Not my favorite keyboard, but cheap enough that i could afford 3 of them. Home, work, and Oceanside.
Yeah, yeah: remapping. Loses.
(The only good form of keyboard remapping is one that is downloaded into a PROM on the keyboard, so that it works in all modes, even before the OS boots.)
Wasn't. For the past week I was using a keyboard that was not my usual, with the keys in the lower left hand corner looking like Ctrl,Fn,...
Just switched back to what has been my usual keyboard for several months, with those keys swapped: Fn,Ctrl,...
It's funny how these trivial differences in devices are some of the most annoying.
Last time I shopped for keyboards, I bought 3 identical. Not my favorite keyboard, but cheap enough that i could afford 3 of them. Home, work, and Oceanside.
Yeah, yeah: remapping. Loses.
(The only good form of keyboard remapping is one that is downloaded into a PROM on the keyboard, so that it works in all modes, even before the OS boots.)
Thursday, January 05, 2012
hg schemes extension
http://mercurial.selenic.com/wiki/SchemesExtension
I like the idea of this extension, that allows you to create shortcuts for URLs you use often, e.g. cloning.
E.g.
However, it is something of a no-sale when I saw that the URL was notexpanded in the clone:
Or in WorkDir/.hg/hgrc
PRO: when the remote repository changges location, this *might* allow you to change the scheme URL shorthand in hgrc, and have things work in the possibly multiple clones you have outstanding.
CON: it loses some documentation. If I got run over by a beer truck, my replacement might have trouble finding where it was from. Worse, if a repo was restored from backup (particularly if people keep branches as repos), and my home directory with the ~/.hgrc enabling SchemesExtension was not present.
I'm not sure what I would like. Possibly always expand the shorthand. Possibly record the shorthand with the long path as a comment:
TBD: move this to my wiki Category:VCS.
I like the idea of this extension, that allows you to create shortcuts for URLs you use often, e.g. cloning.
E.g.
[extensions] hgext.schemes= [schemes] ups = ssh://my-uarch-performance-simulator/...
However, it is something of a no-sale when I saw that the URL was notexpanded in the clone:
> hg clone ups: u ... > cd u > hg paths default = ups:// >
Or in WorkDir/.hg/hgrc
[paths]
default = ups:
PRO: when the remote repository changges location, this *might* allow you to change the scheme URL shorthand in hgrc, and have things work in the possibly multiple clones you have outstanding.
CON: it loses some documentation. If I got run over by a beer truck, my replacement might have trouble finding where it was from. Worse, if a repo was restored from backup (particularly if people keep branches as repos), and my home directory with the ~/.hgrc enabling SchemesExtension was not present.
I'm not sure what I would like. Possibly always expand the shorthand. Possibly record the shorthand with the long path as a comment:
[paths] default = ups: # ssh://my-uarch-performance-simulator/...
> hg paths default = ups:// # ssh://my-uarch-performance-simulator/...
TBD: move this to my wiki Category:VCS.
Tuesday, January 03, 2012
VirtualBoxen
Gave in, worn down... Installed VirtualBox, and Ubuntu in a virtual box, on my tablet PC running Windows 7.
Stream of consciousness...
Stream of consciousness...
Monday, January 02, 2012
Recovering diverged home directory version control
I have long version controlled my home directory. CVS. Git. Hg.
Unfortunately, they diverged. Divergence happens naturally with CVS. You have to work hard to get git and hg to diverge, but I did.
Now I want to merge the diverged home directories back together. Preserving the history if possible, from the different VCS. Sometimes just merging fikes.
==
Today: I want to start merging a diverged linux tree, from a flash drive, with my working tree (which started off on cygwin).
I created a new hg repo, created a branch on it, and then imported the tree to be merged.
I pulled/pushed this with my main home hg repo. Had to use -f, to force unrelated repos to be together.
Now I have a single repo, with my current working (cygwin derived, homedir, and a not working linux homedir, on different branches. The former n the default branch.
That's okay. Not so bad. A single history object(although I have kept separate working space trees.)
===
Now I want to merge, a file or a few files at a time.
E.g. copy the README from the linux branch to the default working derived from cygwin branch.
AAARGH!!!! Hg doesn't handle partials... neither merges, not copies, nor... Hg just plain really wants to lose track, not make doing this activity easy.
Unfortunately, they diverged. Divergence happens naturally with CVS. You have to work hard to get git and hg to diverge, but I did.
Now I want to merge the diverged home directories back together. Preserving the history if possible, from the different VCS. Sometimes just merging fikes.
==
Today: I want to start merging a diverged linux tree, from a flash drive, with my working tree (which started off on cygwin).
I created a new hg repo, created a branch on it, and then imported the tree to be merged.
I pulled/pushed this with my main home hg repo. Had to use -f, to force unrelated repos to be together.
Now I have a single repo, with my current working (cygwin derived, homedir, and a not working linux homedir, on different branches. The former n the default branch.
That's okay. Not so bad. A single history object(although I have kept separate working space trees.)
===
Now I want to merge, a file or a few files at a time.
E.g. copy the README from the linux branch to the default working derived from cygwin branch.
AAARGH!!!! Hg doesn't handle partials... neither merges, not copies, nor... Hg just plain really wants to lose track, not make doing this activity easy.
Missing X fonts
Like http://ubuntuforums.org/showthread.php?p=11544410, I was getting errors such as
(Except that I was getting the errors, not on a fresh Ubintu install, but when trying to use a fairly new machine at work, with what is probably a newer version of redHat.)
The post I quote fixed things by setting ~/.Xdefaultsto
And then doing xrdb -merge ~/.Xdefaults
Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct
(Except that I was getting the errors, not on a fresh Ubintu install, but when trying to use a fairly new machine at work, with what is probably a newer version of redHat.)
The post I quote fixed things by setting ~/.Xdefaultsto
emacs*font: 7x14
And then doing xrdb -merge ~/.Xdefaults
On my end, I found that neither 7x14 nor courier worked. But font "fixed" did.
Subscribe to:
Posts (Atom)