Nov. 20th, 2012

jack: (Default)
Bookmark organising

When I organised my bookmarks, I realised that most fell into the categories of

  • Stuff I use every day and want quickly accessible. Eg. email, social networking homepages, the wikipedia page on the unicode checkmark, etc.
  • Something to read later. Eg. links that seem interesting, computer games, books and films to consider buying or renting, etc.
  • Something to read periodically, eg. news sites, social networking friends pages, feeds, blogs I follow, many webcomics divided into "daily", "bi/triweekly" etc.
  • Something I may occasionally want as a reference. Eg. step-by-step instructions for stuff I do occasionally.
  • Stuff that's useless, doesn't update, but I just keep coming back to because it's so awesome, such as The world flag rating page (do not make your country's flag in photoshop, tricolors are overused), The Evil Overlord List of movie-stereotypical mistakes I will not do if I'm ever an evil overload, and the Earth destruction advisory board FAQ on non-dilettante ways to destroy the earth

    The last category was a minor surprise to me, as I'd not realised in advance it was a category I'd need. But I really do need it, because even if I don't need those links, if I don't have it, my mind keeps saying "don't forget the earth destruction advisory board, what it if updates the earth destruction status[1]" so I need a place to put them, just to get them out of the way in all the other categories!

    I do the same with physical objects too: if I want to keep it and it doesn't have a place, make a place for things I keep for that reason however stupid. Then, if I decide it's stupid and I don't need to keep it, I can throw it out later, having already separated it from stuff I'm keeping for a more useful reason.

    The reason I mention this now is that last night several of us were talking about an answer on stack overflow that is incredibly awesome and made the rounds several times recently, but some less-programmer-y people hadn't seen, which is one of the most recent links promoted to my list of "stuff on the internet I personally find most awesome".

    Link for khalinche and ceb from last night, how do I use a regex to detect certain sorts of tag in HTML text

    http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454

    There is a question on Stack Overflow asking how to use a regex to detect certain sorts of tag in HTML text and the first answer (link) is a work of genius, as the answerer gets more and more emphatic about his opinion, it's really funny and accurate (even if you don't know what the words mean, it's still funny and you can get a gist of the answer if you scroll through slowly to the end). :)

    Footnotes

    [1] On 10 September, 2008, it did, advancing the "Earth destruction advisory count" from 0 to 1. There is a supplementary FAQ on the event at http://qntm.org/board, starting with "The Earth hasn't been destroyed! What are you talking about?"
jack: (Default)
Many people have observed that, given the volume of a sphere radius r is V(r)=(4/3).pi.r3 and its surface area is S(r)=4.pi.r2, that, very conveniently:

dV(r)/dr = 3.(4/3).pi.r2 = 4.pi.r2 = S(r)

In fact, I use it to remember the surface area, since I only usually remember the volume. It seems to make sense sort of, but many people are not quite sure why.

Today someone pointed out, that the same thing works for a cube, if you take the side length as the diameter and half the side length as the radius.

V = (2r)3
S = 6.(2r)2
dV/dr = 2.3.(2r)2 = 6.(2r)2 = S

In fact, if you do the trigonometry, it turns out the same thing works for the tetrahedron and other platonic solids, although if you take the side length as d, r is no longer half d.

In fact, if you take d = ar for some unknown constant a, so long as the volume is something times r cubed, and the surface area is something times r squared, there's always some value of a that makes the derivative dV/dr = S exact.

It may or may not be immediately obvious what that value is, but in fact, it's the distance from the centre to the middle of one of the faces aka the radius of the largest sphere which fits inside.

At this point we were puzzled why, and it wasn't until I was at home that I saw the obvious way of thinking about it.

What does dV/dr mean? It means [V(r+δr)-V(r)]/δr (as δr->0).

That is, "imagine a solid with a slightly larger r, and subtract the original r" and ask what's left. What's left is thin slab covering each face, plus some neglible rods at each edge which have an extra factor of δr in so effectively vanish to zero. What's the volume of all those thin slabs? The areas of the faces, times the width of the slab. What's the width? The distance from one side to the other perpendicular to the face, ie. parallel with a line through the centre only at the centre of the face, ie. it is δr, so the volume of the slab is S.δr, and [V(r+δr)-V(r)]/δr is approximately S.

The same diagram apparently works for a sphere, if you imagine δV to be a thin shell covering the original sphere. What's the volume of the shell? Well, it's approximately "surface area times width", but the inner or outer surface area? Well, one's too small and one's too big, so the goldilocks answer is somewhere between S(r).δr <= δV <= S(r+δr).δr. But all the extra terms in the second one all have δr^2 in so they all vanish, and δV ~ S(r).δr.

I think I've probably seen that before but forgotten.

Active Recent Entries