Horace on MVP
sapias, vina liques et spatio brevi
spem longam reseces. dum loquimur, fugerit invida
aetas: carpe diem, quam minimum credula postero.
sapias, vina liques et spatio brevi
spem longam reseces. dum loquimur, fugerit invida
aetas: carpe diem, quam minimum credula postero.
Introducing refac_lines.
Refactoring common output (using something like LCS as the base; i.e., difflib in Python) and then creating an index...is pretty helpful for analyzing large builds. An example is included using a snippet of the make output from the Chromium Embedded Framework.
If you think about it, most of 'intelligence' (a la Jeff Hawkins) is about deducing patterns and formulating parse trees in your mind.
The idea is pretty key. This script is not particularly pretty. JS and CSS should be added and it should be rewritten. But don't currently have the time / need. Others might though.... You can actually deduce the 'structure' of pretty much anything with that or a similar approach.
Put this in your path as 'efm_filter.py':
And this two-line file as 'rev_python':
#!/bin/bash
python $* 2>&1 | efm_filter.py
And this in, e.g., ~/.vim/ftplugin/python/python.vim (or use autocommand hooks):
set errorformat+=
\%A\ \ File\ \"%f\"\\\,\ line\ %l\\\,%m,
\%C\ \ \ \ %.%#,
\%Z,
\%-G%.%#
set makeprg=rev_python\ %
Via reading :errorformat closely and thinking about the differences between what most compilers output and what python errors on. The errorformat scanf language is a fun little hobby of a DSL.
quite wise
http://blog.miliauskas.lt/2008/04/meaning-of-code.html
via the fact that this guy is apparently the only person in the known universe to have a correct python vim errorformat:
http://gintas.pov.lt/files/vimrc
Some pretty sweet bit of vimscript from tonight:
Usage:
:T pydoc urllib2
:R ifconfig -a
:R netstat -nr
It's funny how people affect lives.
I suspect little bits of what Steve Jobs meant will reappear over time, now and then. I'm waiting to get my oil change / 20,000 mile maintenance done. Listening to Young the Giant, and observing this peculiar mother and daugther -- no doubt also waiting for a maintenance appointment.
They're playing on the mother's iPhone. Probably some sort of kid's game.
alias spaceout="sed 's/ /\\\\ /g'"
Probably the most useful alias that I've come across that isn't regularly used. If you pipe a lot of commands together regularly, it's useful. I use it a lot.
Run your build (e.g., using gbuild, gyp, etc.) from the command line and pipe all the output to a file (somewhat like http://tmsh.posterous.com/hackers-guide-to-porting-an-autotools-build-t ). Then analyze it by dividing the build output into sections, and analyzing how the parameters for compiling each src code file (.cc and .cpp, in this case) vary from line to line. This is a sort of crude quick version. But the main thing to note is that we're taking advantage of the dependencies already built into the build system (gyp). So we know the dependencies come first, etc. And we also have a list now of only the files that we need for the Mac build. Not terribly hard to port this to a custom makefile-based build (with ccache, etc., or something a little simpler, and less edge-case handling for all platforms (and not necessarily dependent on xcodebuild), for hacking purposes).
And sample output:
Allocate 128MB RAM to microcorelinux in virtualbox. Give it 8GB disk space to grow into.
Use the 'ab' command line tool:
http://distro.ibiblio.org/tinycorelinux/install.html
And be sure to s/tinycore/microcore in the grub menu and elsewhere if you prefer. Also install sshd (openssh http://forum.tinycorelinux.net/index.php?topic=4471.0 and setup port forwarding http://sk.c-wd.net/wp/2008/01/05/virtualbox-port-forwarding-with-linux-host/) and vpnc. And add passwords for the default user tc and root.
Now think about it -- you can have multiple vpn connections open at the same time, etc. Just clone the vm multiple times. (And ssh/sftp/rsync/or-otherwise-script to the local hosts.)
But it's also lightweight enough that you can just keep one or more VMs running up in the background. Or just start it in 5 seconds or whatever. No more internet connectivity interruptions; but no more swapping or CPU usage via a larger distro.
Caveat: installing vim depends on the Xlibs package:
http://forum.tinycorelinux.net/index.php?topic=9117.0;wap2
ETA. Still working on this setup. microcore/tinycore linux are RAM-only for the most part. So have to hack it to persist sshd and other configuration information. Still worthwhile, I think. But will update when I've completed the setup..
ETA2. Finally got around to getting this to work. Here are some more notes:
you need multicore.iso for the installer
but from there you can install microcore.iso into the hard disk
change the hard disk from scsi -> ide
install (via the instructions)
on boot,
tce-load -wi vpnc
tce-load -wi openssh
tce-load -wi rsync
tce-load -wi popt
tce-load -wi vpnc
add 'opt=sda1 and home=sda1' to /mnt/sda1/boot/extlinux/extlinux.conf
set your passwords (http://wiki.tinycorelinux.net/wiki:passwd )
add the scripts to copy back the sshd_config files also. e.g., my current bootlocal.sh:
#!/bin/sh
sudo mv /etc/shadow /etc/shadow_prev
sudo cp /opt/shadow /etc/shadow
sudo cp /opt/sshd_config /usr/local/etc/ssh/sshd_config
sudo cp /opt/ssh_host_* /usr/local/etc/ssh/
sudo /usr/local/etc/init.d/openssh start
sudo cp /opt/default.conf /usr/local/etc/vpnc/default.conf
sudo cp /opt/authorized_keys /home/tc/.ssh/authorized_keys
export PATH=$PATH:/opt/bin
Installed packages (via http://wiki.tinycorelinux.net/wiki:package_management_cheat_sheet ):
Xorg-7.5-lib
Xorg-7.6-lib
advcomp
b43-fwcutter
bash
dosfstools
ezremaster
firmware
firmware-ipw2100
firmware-ipw2200
firmware-iwlwifi
firmware-libertas
firmware-openfwwf
firmware-wimax
firmware-zd1211
gcc_libs
gmp
gnutls
grub4dos
iw
libgcrypt
libgpg-error
libiw
libnl1
libpci
libssl-0.9.8
libtasn1
libx86
mkisofs-tools
ncurses
ncurses-common
ndiswrapper
nettle
openssh
p11-kit
pci-utils
perl5
popt
rsync
syslinux
tar
tc-grub4dos
tc-install
vim
vpnc
wifi
wireless-3.0.3-tinycore
wireless_tools
wl
wpa_supplicant
Here's a nice Saturday challenge -- I'm pretty much done with it for my purposes (must move on, but in case anyone else is interested). XSL files are kind of picky (order of elements matters, there are lots of '/' inside attributes and values). Can you programmatically clean up / reindent such a file? Can you do it better than this?
N.B. xmllint fails. Googling 'xml cleanup very conservative' turns up a link to Ron Paul. And reformatting in IDEs doesn't work (I waited for Eclipse to startup and tried it -- not so much).