If you want snazzy tree views for your project of your local drive files and the remote master repository that you can traverse with a browser, just modify this script and set up a cronjob to keep your trees updated.
How does it look?
Download the file itself, load it into your browser and have fun traversing the tree of the Corinthia GitHub repository. (blogger.com and google.drive won't let me paste the file without crippling the links, fair enough, it's 168 directories (and thus links) and usually people who do this kind of thing would probably be up to no good[1]). If you just want to see it without working links, it's here.
I think it's nice to have a tree overview --- a picture is worth a 1000 words (as they say).
[1] sadly, saving the document also ninja-edits the original. So, don't waste your time with pasting lots of links into Google Docs :(
is a quick way of profiling your code. Does of course not beat the real thing(tm), but for most purposes, this should give you a rough idea where your code spends it's time.
Today I was idly reading some random unixy stuff, and, came across the 'tree' command.
I had to install it for Ubuntu, but, it definitely was well worth it.
It's s useful if you are connecting with a shell and need to navigate a forest, and also makes a neat html file from any tree you like, which looks good in lynx, or in any web browser for that matter.
The tree gives you the big picture, with tree -d -H . > tree.html
(OMG, I'll be whistling this all day long now. And so will you ;-D )
I signed up for the Coursera Automata Class, and it reminds me of the Schraraffenland Fairytale: to get to the fabled country where delicious fried birds fly into your mouth and pralines grow from bushes, you have to eat your way through a mountain of pumpernickel.
Om nom nom.
(I will probably need to take this class twice, once for the measure, once to sink in)
File under:
'And you do Addition?' the White Queen asked. 'What's one and one and one and one and one and one and one and one and one and one?'
'I don't know,' said Alice. 'I lost count.'
'She can't do Addition,' the Red Queen interrupted. Through the Looking-glass
(Maybe I should make this into a t-shirt ;-)
I'm also reading through 'The Linux Programming Interface' book and I'm now starting to cycle down into re-reading the chapters and doing the exercises [(I'm half-way through the book in the first sitting, time for some action), and whilst I'm having fun learning the basics, maybe you would enjoy refining your systems programming jutsu at the same time and heckle a beginner in style ;-)]
If you want to pile in, mail me.
Music I'm listening to:
(this is probably more 'ye olde jazz head stuff' -- but if you spool forward a bit to 10:35, you find some easier listening. That said, Michel Petrucciani is just wonderful. Yeah, some stuff is wild, but it always has soul(and much jump). Lots of it.)
Programming from the Ground up is an easy going, fun read, and goes a long way towards explaining all those inconvenient miracles that occur when you first try to use pointers in C.
... and, for some reason, Holger Czukays' short video of 'Ode To Perfume' nicely matches the topic (and it's pretty good hacking music). The longer version of that song is here
(and if this reminds you of Stockhausen's work, well, there's a reason for that)
Update: This here is also a useful read about C's peculiarities.
As much as I like Exaile, it sadly lacks the option of turning a recording off after n minutes.
But, who needs a feature for the Exaile GUI when a script will suffice?
So, set your story up to play in the GUI, then use this:
bedtime-story.sh:
# turn the screen off xset dpms force off sleep $@ > /dev/null 2>&1 if [ $? = 1 ] then # turn the screen on xset dpms force on echo "Fade out Exaile playback after a defined time, using the computer's volume control." echo "" echo "Usage: bedtime-story NUMBER[smh]..." echo "" echo "Each argument is a number followed by a unit." echo "The units are: s (seconds), m (minutes), h (hours)" echo "Example: bedtime-story 20m 10s" echo "The screen will be turned off, move the mouse or press a key to turn it back on." fi # grab current spot and volume, then gently fade and pause c=$(exaile --current-position) v=$(pactl list | grep Volume | cut -d ":" -f 3 | cut -d "%" -f 1 |\ sed -n '1p' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') for((i=$v;i>=0;i--)) do sleep 1s pactl set-sink-volume 0 ${i}% done exaile --play-pause # return volume to former setting pactl set-sink-volume 0 ${v}% echo "The current track was faded out beginning at $c."
Seasoned UNIX users and developers of software often forget how mindbogglingly complex their creations are, because they use and work them every day, and --- it's just ever so obvious, right?
Why do newbies and even experienced users have such difficulty in grasping the timeless elegance and simplicity of a well-formed UNIX command line?
Well. Allow me to put you, the expert, into the newbie's position for a moment :)
In the UK and Australia, there exists a particular fiendish form of crossword puzzle: the cryptic crossword.
Here is a classic example of the type of mystifying clue such a puzzle offers:
15D Very sad unfinished story about rising smoke (8)
is a clue for TRAGICAL. This breaks down as follows:
15D indicates the location and direction (down) of the solution in the grid
"Very sad" is the definition
"unfinished story" gives "tal" ("tale" with one letter missing; i.e., unfinished)
"rising smoke" gives "ragic" (a "cigar" is a smoke and this is a
down clue so "rising" indicates that "cigar" should be written up the
page; i.e., backwards)
"about" means that the letters of "tal" should be put either side of "ragic", giving "tragical"
"(8)" says that the answer is a single word of eight letters.
If the above maketh your mind go carroussel and gives your brain slight vertigo, you now know how most newbies and other mere mortals feel about the UNIX command line and the many cool options your software can be used with :-)
Example taken from The Guardian crossword of Aug 6 2002, set by "Shed", found in the Wikipedia explanation of Cryptic Crosswords.
Ps.: Brit and Aussie geeksters who are crossword fiends will of course not be fazed at this attempt to demonstrate the users' head space, and I'll wager that at least one of them will now probably feel inspired to set a cryptic crossword with UNIX clues :-)
Because sqlite produces ~50000 extra letters of bumpf per compile that often obscures actually important compiler messages, I've not been as diligent as I should have been about reading compiler messages. A lot the time I get lucky and it doesn't matter, but I also got caught out by that.
Here is how to get rid of all the noise and make your compiler output useful once again:
First we take a snapshot of the 'native' compiler messages that come with the trunk:
This removes the sqlite warnings and shows you only the current warning messages that are actually ~/trunk related.
Any subsequent compiles that are started with the line below will use the generated stderr.unique file to filter output and remove every compiler message that is 'native' to the trunk, leaving just the compiler messages that pertain to your code:
make 2>&1 >stdout.report | tee stderr.report | grep -v -F -f stderr.unique >&2 2>/dev/null
You can also type this line when you invoke the emacs compile buffer and your C-x ` will continue to work.
Update:
Daniel Shahaf kindly mailed me his solution:
When I ran into this problem, I solved it differently: by building
sqlite3 as a shared library and pointing configure to that. Details
here:
# NOTE: this doesn't create a .la file for libtool, so
libtool won't add this library to rpath of binaries compiled against it,
so we have to set LD_LIBRARY_PATH below.
'--with-sqlite=/home/buildslave18/slave18/tools/sqlite',
They all do different things despite looking like the same thing, and usually it would make sense for something as basic as basename to be consistent. However, no such luck, and I ended up suitably confused, and asked a friend to clue me up. This is what he wrote: "There are two different things called 'basename' here. There is 'locate --basename', and there is the GNU make function $(basename ...). They are both inspired by the command basename(1), which does yet a third conceptually similar thing (strip off the directory part and optionally a given suffix, if present), but other than that they have no connection to each other at all.
"Note that $(basename ...) is running the *GNU make function* 'basename': it is *not* doing the same thing that $(basename ...) would do in the shell and running the shell command 'basename'. If you wanted to do that in make, you'd use $(shell basename ...). locate considers the basename of a file to be the last component of a filename. GNU make considers it to be *everything* in the filename before the first dot. When you consider their likely use cases, this makes sense: in make, you generally don't want to throw paths away when transforming names, because you're going to want to look those paths up again. If you wanted to strip pathnames too, you could say $(notdir $(basename ...))."
...so basically, basename is the same basic idea based on different bases.
In other, unrelated news, those who have managed to miss this video about 'Bohemian Gravity' below should watch it right now:
You supply the tea, and when the music is over and the cup is empty, you'll know how to quote just about anything and everything. You can quote me on that.