$return = getCachedObject($hash); if($return) return $return;
It’s technically good code, but something about if($return) return $return; makes my head spin…
$return = getCachedObject($hash); if($return) return $return;
It’s technically good code, but something about if($return) return $return; makes my head spin…
I’m pretty OCD and thus run an NTP server on this server. (It should respond to any hostname on this box.) Despite the server being in Texas, I keep the timezone set to EST.
So here’s a page displaying the time. Granted, having a clock that’s accurate down to a fraction of a second (synced to the atomic clock) is no longer that impressive. But tell me you’ve never wished for an easy way to find the correct time… Now you know.
I was just trying to play some Team Fortress 2 on my laptop… Without a mouse. It wasn’t going so well. Plus, I couldn’t find anyone on the map. (It was a big map with only a few people on it.) So I’m just moving around trying to find where everyone is.
And all of a sudden a Scout comes through the door and fires his shotgun. I don’t think he even hit me on the first shot.
But I totally panicked. I jumped back in my seat and began flailing my arms. He proceeded to shoot me again and I died.
Me: 0. Pathetic: +1.
Check out this radio‘s description. It’s got excess value and pettiness! And a phrase-lock-loop. And “LCD aphellotropic lights of showing screen,facile operation in dark” has got to mean “backlit screen.” (Facile is Spanish for “easy,” no your mom jokes.) Oh, and you can’t forget the Auto-charger rabbet. And it comes with a chargeable battery.
Anyone else confused? (Bonus points: I tried to copy-and-paste a quote, and it carried over the HTML tags, which included at one point….?!)
On my continuing series of me poking around at ways to improve performance…
I accidentally stumbled across something on memcached. The classic example is LiveJournal (which, incidentally, created memcached for their needs). It’s extraordinarily database-intensive, and spread across dozens of servers. For what they were doing, generating HTML pages didn’t make sense that often. So it does something creative: it creates a cache (in the form of a hash table) that works across a network. You might have 2GB of RAM to spare on your database server (actually, you shouldn’t?) and 1GB RAM you could use on each of 6 nodes. Viola, 8 GB of cache. You modify your code to ask the cache for results, and, if you don’t get a result, then you go get it from the database (or whatever) as usual.
But what about situations like mine? I have one server. And I use MySQL query caching. But it turns out it’s useful. (One argument for using it is that you can just run multiple clients on a single server to render moot any problems with using more than 4GB on a 32-bit system… But I’m not lucky enough to have problems with not being able to address my memory.)
MySQL’s query cache has one really irritating “gotcha”–it doesn’t catch TEXT and BLOB records, since they’re of variable length. Remembering that this is a blog, consisting of lots and lots of text, you’ll quickly see my problem: nearly every request is a cache miss. (This is actually an oversimplification: there are lots of less obvious queries benefiting, but I digress.) (WordPress complicates things by insisting on using the exact timestamp in each query, which also renders a query cache useless.) I just use SuperCache on most pages, to generate HTML caches, which brings a tremendous speedup.
But on the main page, I’m just hitting the database directly on each load. It holds up fine given the low traffic we have, but “no one uses it” isn’t a reason to have terrible performance. I’ve wanted to do some major revising anyway, so I think a rewrite in my spare time is going to experiment with using memcached to improve performance.
I had someone on a forum I frequent ask me a question. It’s in broken English and he explained that he’s not a native speaker. In my reply, I tried to be sensitive to that by speaking somewhat simply. Not in a demeaning way, but in my attempts to learn Spanish, I learned very quickly that short sentences expressing one simple idea are much simpler than elaborate sentences conveying a complex range of thoughts, such as this one.
And that reminded me of the Simple English Wikipedia project, which I think should get more attention. They treat it like another language: there’s English, Spanish, Simple English, etc. A really awesome idea in my opinion. (Although the sexual intercourse page–warning, has an illustration of the process–is still pretty sketchy… Maybe because it’s not a topic that lends itself to being explained in simple, direct terms?)
I think “Simple English” is something everyone should practice, though. As some of the pages on the simple.wikipedia.org site show, writing in a simple manner does not necessarily require coming across like a dimwit.
I don’t think there’s a mnemonic aid for “mnemonic,” but I’m studying for a law exam, and it’s insanely conducive to various visual associations:
Of course, we’ll see in an hour if this helps, or if I just sit there thinking that I could really go for some Welsh grape jelly having no idea why I’m thinking about it.
No, not that one.
I consider myself a talented writer. And I’m obsessive-compulsive about things being well-written. So giving me access to edit things is a recipe for awesome.
So I was doing some research for class. My research into Lynch v. Donnelly made me realize that the page was pitiful. So I cleaned it up to get it to its current state. (Which still needs a lot of work.) The Nautilus, Inc. page also got some updates after another class project on the subject.
You should get extra credit in class when you become the top contributor to the Wikipedia page on the subject.
In a hypothetical business proposal, when you can’t find anything but a blunt way to put a strategy, say it even more bluntly and put a trademark symbol after it.
We sell “None of the CrapTM” that other stores do.
There’s a pile of snow outside.
In other news, Georgia is still having a drought.
Business idea of the day? Charge New Englanders for snow disposal. For about the cost of plowing, I’ll take the snow for you. You don’t have to worry about snowbanks.
I’ll then fill trains with it and ship it to Georgia and others in need of water, who will buy it from me.