If you're a data geek, you'll love this presentation. It's a blatent "we invented this at Microsoft" talk, but look past the corporate nod and you'll see a really interesting technology that lets you visualize information as a web. Very pleased to see information represented in some kind of multi-dimension interface.
Gary Flake demos Pivot, a new way to browse and arrange massive amounts of images and data online. Built on breakthrough Seadragon technology, it enables spectacular zooms in and out of web databases, and the discovery of patterns and links invisible in standard web browsing.
WordPress looks nice, but is a rats nest of code under the hood. If you configure nginx* to proxy back to Apache*, you may find yourself with a nifty pile of never ending 301 redirects. I've solved this before, but had long since forgotten. Below I've got my recipe for fixing.
I'm posting this simply because I had to go to the trouble of figuring this out. Imagine a MySQL* database that has several databases, and only one admin account, but that admin account is bound to a particular database and not global to the entire server. Don't ask me how, but there was no root user in the database. Not a bad idea from a security perspective, but it's problematic to administrate the machine (read: try adding new databases, users or doing anything with the mysql database). It may seem like the simple fix would be to reboot the database with --skip-grant-tables and fire off a:
Mac ports. 10.6. Don't go outside at night, kids. What a PITA this has been if you're down in the weeds doing development. From a GUI perspective, not much has changed. Life's different down close to the operating system. I'll detail python26 building if needed, but assuming you get it working, and you get on to mercurial, you'll notice that things don't work. You'll get something like:
On an idle afternoon, I did whate very other sane computer user did: pushed update to upgrade my laptop to OS-X 10.5.7. Peachy. As per every other upgrade in the last 3 years, everything just worked as expected. Except MobileMe sync'ing. Grr...
Turns out Apple was sold a bill of goods from Verisign and in 10.5.7 Apple made the mistake of using Verisign's "Online Certificate Status Protocol" service. If I weren't using bfilter, I would've never noticed this bit of pseudo-evilness. Every time you sync with MobileMe, Verisign gets a series of connections to either evintl-ocsp.verisign.com or evsecure-ocsp.verisign.com. This is only an issue if you 1) don't want Verisign to know when you connect to MobileMe, or 2) you happen to use BFilter along with MobileMe, in which case you'll have noticed syncing suddenly stopped working.
There are two solutions: bypass bfilter and let Verisign receive these connections, or deadend requests to Verisign before bfilter has a chance to mangle the response. I'm including the /etc/hosts entry below (my preferred alternative). Add the following to /etc/hosts and you should be good to go:
Albeit scarred for life, I just survived an encounter with Visual Basic for Excel (VB 6.3). I haven't had to muck around with this kind of shit in forever (getting close to a decade), but thought it'd be neat to save the day and flex a little programming foo. Last time I did anything with VB... it was essentially contrived data munging taken from an easy to manipulate spreadsheet. This challenge? Reading a chunk of user entered data and populating a drop-down list box. Not so hard, right? Right? Oh. My. God.
The data input required me to iterate over a non-unique list of values in a column of a spreadsheet, create a unique list, sort, and insert the result in to a combo box (drop down list, whatever your widget vernacular). Figuring this must be a well documented method or function, I searched inside of Microsoft's VB help editor for term array to get a list of helper functions. It should have been a clue that this was gunna suck when the result was nearly empty and largely irrelevant.
But, being the stubborn clod that I am with regards to being able to hammer through problems, this did not deter (hindsight? I should have run for the hills, tail tucked firmly between legs). Jumping over to $GOOG, I didn't see anything that indicated there was any kind of a unique() function or method. More surprisingly, there isn't a sort() method. Unbelievable. Wanna know what's sad? I'm not the first one to deal with this.
I dare you: type in to your search engine of choice, a search query that goes something to the extent of: "[language] array sort" or change out "sort" for "unique". Ruby, C++, Java and even PHP: all well documented and easy to search for. VB? bwhahahaha! Not so much.
After a few dozen useless search results, I started panic'ing and the reality of having to dust of a qsort() routine from some of my more anctient brain tapes was starting to seem like a less than awful idea. Fortunately, I struck gold and it turns out other people carry around little stashes of code that return a unique array... Though I've misplaced the link, my favorite blurb of VB code was an implementation of qsort(). Honestly, when was the last time you had to write/include array primitives?
Oh! And did you know that VB lacks the ability to continue an iteration in a for loop? Try writing the C equiv in VB: for (int i = 0; i < 100; ++i) continue; I would have given my left hangnail to be able to write Continue For in the VB version. Supposedly newer versions of VB have this, but that just seems like a language omission that's beyond brain-dead. Thank god for Goto labels otherwise I'd be still hacking away I fear. *facepalm*
Microsoft has made VB painful to develop in and has crippled its help functionality on Windows. In fact, it is so bad on Windows that I resorted to using the help editor on my Mac laptop, should've been a clue (the irony of having better VB help in Mac Office can't be understated). VB remains as painful of an experience as I remember, but now that I've got a boatload more experience under my belt, it stands out even more as a technical perversion.
UniqueArray() function included after the break. I don't want to have to dick around searching for that ever again. *sigh*
<gloat>If only? If only. What a world. Some secrets and advantages aren't. Eyes wide open. At the end of the day, I'm open for business and quite happy, winner take all.</gloat>
Every so often I end up recreating various PDF options for LyX*. Not hard, but a bit irritating. The following snippet is some LaTeX* that should be thrown in LyX*'s "Document Preamble." I can't live without these options. Hope this helps someone else. Enjoy.
Finally, a technical post I feel worthy of commenting on.
Performance of my application changes from time(3) to gettimeofday(2). Why? -Joe Open Source Developer
Doh! Really common question and should be an FAQ at this point.... or it is, but an under-published FAQ that only the performance wonks seem to know or run into as an issue. In short, gettimeofday* == EBAD && clock_gettime* == EGOOD. I think the best discussion on this is PHK's post titled Timers and timing, was: MySQL Performance 6.0rc1. Please read. Essentially, FreeBSD*'s gettimeofday* syscall is monotonic, highly accurate and precise, and Linux's is not. Therefore, Linux's gettimeofday* syscall is faster and less accurate than FreeBSD*'s. I happen to agree that gettimeofday* should be monotonic and I take issue with Linux*'s gettimeofday* implementation. Monotonic time keeping requires CPU synchronization (which gettimeofday* does under FreeBSD* and should be done under all operating systems) and will always be slow as a result. Most applications that do not require precise time synchronization across threads and CPUs should use clock_gettime* with a clock_id of CLOCK_REALTIME_FAST. Few applications actually need highly precise, highly accurate, monotonic time measurement and instead can skid by with highly precise, accurate, but non-monotomic time keeping. And now you know.
Robert Ennals's Software Transactional Memory Should Not Be Obstruction-Free is definitely unstupid and worth reading. Same with Dave Dice, Ori Shalev, and Nir Shavit's paper on Transactional Locking II. Survey says? Holy damn. Use "per object transaction locking" models where possible and avoid the use of pthread_mutex_lock*, pthread_rwlock_rdlock*, and pthread_rwlock_wrlock* where possible. STM makes pthreads* the new fail. For some idiotic reason, I was thinking/hoping that rwlock's would suck less than they apparently do. CAS? Eh, not quite worth the hassle yet.
I just threw in a few snippets of code to handle the useful "updated" feature. If I post a blurb of content, and revise the post, I do want to bump the content to the front of the line as a new post, but don't want to move the date that the news blurb was published. Also added a privacy level so that I can write crap and shield it from the world's virgin eyes. Paragraphs that I deem required content for the front page are also now included when generating the front page index, which is important so that I can remove the two <br/> tags between the content of my Squirrel post and the video of the catapult, while still ensuring that the video makes it onto the front page. Lastly, I've also added the ability to pre-write a story and not have it publish until such time as the news is ready to break. Hardly original features, but consider that all of this has been done without aid of a turing complete programming language (sh may arguably be turing complete, but I don't want to lump it into that category) and in probably 4hrs of work. Keen. I can now collect more Squirrel Catapult related content, write up some snarky bit of dribble that I find amusing, and then suddenly reveal its existence to the world without lifting a finger. Super keenness has been achieved.
I may take this collection of scripts and crap and make it open source. I think I want to add content filtering before I release this into the world, however. Wouldn't it be nice to have foo(N) references automatically link to a man page wiki style, and for the seven dirty words to go from shit to sh#%? Hrm... fuck it, content filtering will be done by sed. You script kiddy n00bs need to get a grip on reality and do something useful with your fingers. Triple holy crap! All of this done and it's not even 9am (ie, I haven't finished my coffee yet). Win.
Updated 2007-11-20T15:50:00-08:00: Well shit, wouldn't you know it. Neither OS-X nor my hosting provider have current versions of xmllint or xsltproc. `sudo port install libxml2` and `./configure --prefix=$HOME/local/xml` to the rescue (after cleansing libtool(1)/bash(1) unholiness), but damn it what a pain in the ass. Without dyn:map(), I'm not sure XSL would be usable: it certainly makes sorting dates harder (read: only way to sort dates without using a recursive template function).
Updated 2007-11-21T13:40:00-08:00: Crap. My change to ISO datetimes broke my future proofing bits. I posted a video for later this afternoon and found that I had all kinds of busted logic because of that. Fix the build system and all previous dependencies on dates. Kinda gnarly, but now counts are correct in not including future or hidden posts. exslt standards committee, an XSLT date comparison operator would be really nice. Thanks. In the mean time, cron has been activated.
Tools used are limited to xmllint*, xsltproc*, make(1), and sh(1). make(1) calls xsltproc*, which generates a temp shell script which turns around and generates the various pages of content using xsltproc* with different sets of stylesheets. Grotesque? Yup. Clean? Very, actually. I dare say, elegant even.