1,089 karma · joined March 1, 2007
C, Unix system and shell, Python, X Windows, ARM, ...
$ seq 100 | awk '{s += $0} END {print s}'
5050
$ seq 20 | awk -v s=1 '{s *= $0} END {print s}'
2432902008176640000
$ seq 5 | awk -v s=1 '{s *= $0} END {print s}'
120
$ seq 3 |
> awk -v s=1 '{s *= $0} END {print s}' |
> xargs seq |
> awk '{s += $0} END {print s}' |
> md5sum
fe9d26c3e620eeb69bd166c8be89fb8f -
$ seq 400 500 | awk '{s += $0} END {print s}'
45450
$More of the interesting content I read comes from RSS feeds of particular blogs built up over time and, these days, Google+. Now I've built up some circles that match my interests I get a stream that's not too noisy, mute those I never want to see again, and browse the rest. The quality of conversation seems generally high on the posts I like. (I only visit Twitter now to reply to a tweet picked up through RSS.)
My G+ profile is https://plus.google.com/115649437518703495227/about if anyone wants to see who's in my circles.
BTW, it's the readline library that handles the Ctrl-L key binding to clear the screen rather than bash per se.
$ bind -p | grep '\\C-l'
"\C-l": clear-screen
$ PS1='\['"$(tput cr)$(tput ed)"'\]$ '
is better since it clears to the end of the screen, e.g. try seq 1000 | fmt; tput cup 10 20
with and without it.But the thing is, with either that approach or the one in the article, you're wiping out what may be useful; that unfinished line causing PS1 to be pushed along may have vital data on it, data that's hard to re-create.
<foo grep bar | ...
if you really want L-to-R whilst avoiding the redundant cat and its overhead. That doesn't allow grep to do its speed-ups though, because it's still reading stdin, not a filename.Design patterns have also had an overall negative effect IMHO. Useful as a lingua franca for theoretical discussion they've again been over-adopted and the vocabulary has become so large, and sometimes imprecise, lessening their usefulness, that it sometimes seems like a geek version of the management-speak for which we criticise the pointy-haired.
"Controlling complexity is the essence of computer programming" — Brian Kernighan. I often find the above add more complexity than they're worth.
http://paulbuchheit.blogspot.co.uk/2007/06/quick-all-actions...
For a background in the CSP languages have a browse of Russ Cox's http://swtch.com/~rsc/thread/ The reference [4] to Squeak is broken, it's now at http://research.microsoft.com/pubs/67508/squeak.pdf and well worth a read.
For the general case, not Go specific, there's a scheduler that tracks what processes (in the CSP sense, e.g. goroutine) are waiting on what channels. Whenever a channel becomes ready, e.g. something is available to read from it, one of the processes waiting to read from it is non-deterministically (that's important) chosen and control (the CPU's program counter, still in user-space) jumps to where it returns from the `read'. It then has the CPU all to itself until it gives control back to the scheduler by needing another particular channel-state. I'm omitting sleeping, etc., for simplicity. The switching of control is all in user-space so quite lightweight.
Why not use an integer instead of Cell? 42 is memory address 42, -3 is register R, including for SP, PC, etc. Or addresses >= 0x10000 are registers, then you can just have
def ife(self, a, b):
m = self.mem
self.skip = m[a] != m[b]
with Python's native indexing of the mem[] list, which could be an array(). if mum.birthday.isToday(): call(mum)