Anyone (that I know at least somewhat) looking for a Google+ invitation? (I don't know whether they're scarce these days.)

I have several times heard that one should not rely on finalizers (that is, code invoked after some object becomes garbage) to reclaim external resources (file descriptors, temporary files, etc.), on the grounds that there is no guarantee they will be promptly reclaimed and therefore one might run out.

Certainly for resources whose use has semantic significance to an outside system (e.g. a network connection or a locked file) or if there is a potential shortage of resources affecting other processes (e.g. free disk space), one should free them promptly whenever possible. (Finalizers are still important for error recovery unless you’re programming completely without nonlocal exits and extremely carefully, in which case you’re probably writing C and don’t have finalizers.)

But if the concern is for limited internal resources (most prominently, the limit on number of open file descriptors), and the process is entirely managed by the GC, would it not suffice to force a garbage collection and retry in the event that opening a file fails due to lack of file descriptors, just as if running out of memory while allocating memory?

LinkedIn?

Wednesday, March 2nd, 2011 07:37

Should I get on LinkedIn? One hears far less about what they're up to than Facebook, and I recently received an invitation from a friend of mine.

Less subjectively: What does LinkedIn offer (given that it's a social network site), and do you find it worth your time?

Update: I signed up. No especially noticeable effects so far other than one newsletter sort of mailing and a lot of people I know wanting to add me as a contact^Wconnection; presumably LinkedIn notifies you when people in your address book create an account?

HTML or PDF?

Thursday, October 21st, 2010 12:00

I'm planning to write a short introduction/quick reference to LaTeX (with a particular emphasis on “what corresponds to this HTML element?”, and actually explaining the core syntax rather than just examples of particular cases), as another page on my web site. Should I write it as HTML or LaTeX (rendered to PDF)? Using LaTeX means I can embed rendered examples without each one being an image (which I don't really want to deal with), but the result being a PDF rather than HTML means that the document would have a fixed line width, and possibly require download/be unviewable depending on the particular browser/platform/installed plugins. (It could still have hyperlinks.)

(In case you're wondering, there are several LaTeX-to-HTML conversion tools, and the last time I looked they all either didn't run, accepted a far-too-small subset of LaTeX, or produced too-low-quality or obviously broken output. I used one of them for this post and had to hand-edit black bars out of every image and trim the margins, and the antialiasing is poor.)

What would you prefer?

Has anything been done in logic programming (especially in languages not too far from the classic Prolog) which is analogous to monads and the IO monad in Haskell; that is, providing a means of performing IO or other side-effects which does not have the programmer depend on the evaluation/search order of the language?

In other words, what is to Prolog as Haskell is to ML?

Nexus One notes

Monday, June 14th, 2010 22:22

Did buy a Nexus One; have now had it for an hour or so. The following is not a review, but some observations:

  • It will work without a SIM card from the start. So if you want a gratuitously expensive wifi PDA...
  • The Google Account-based functionality (e.g. application Market, contacts sync) requires a Gmail account — and any Google Account with Gmail necessarily has the Gmail address as its primary email address. (Since Gmail lets you forward to another address, this doesn't matter unless you use Google services that send mail on your behalf, such as calendar invites.) I haven't tested whether they will still work if you then remove Gmail (but I would note that if it's possible at all, having a Wave account might help, since that seems to allocate a no-@-sign 'username' in the same way Gmail does).
  • Not perfect, but mighty slick. Need to stop playing around and get some sleep.

You may recall my post about looking for a new PDA. I have lately found additional pressure to find a solution.

  • Moving about on my own in new locations, I wish for a GPS/navigation device. I am currently borrowing a standalone GPS, but that's Yet Another Gadget
  • …to add to the four I already carry about (phone, PDA, watch, iPod).
  • My phone is on a prepaid plan which was chosen to be cheap for low usage rates. But it quickly becomes not-cheap under higher usage than a couple minutes a day — which I have when trying to do such things as coordinate three people on an errand.

I've compiled some of the options and what features they have into this Google Docs spreadsheet: Gadget Coverage List. Note that “-” means “No”.

At the moment, I am strongly considering getting an Android phone, specifically the Nexus One. I have recently determined that Android meets all my requirements, at least given some third-party software.

Buying a phone (and a plan) is indeed a higher cost than a stand-alone PDA, but I think universal Internet access is worth it.

Costs and carriers

The phone, unsubsidized and unlocked, is $529.

Given that it is GSM, I understand there are basically two carriers to consider: T-Mobile and AT&T. I get the impression that T-Mobile is somewhat less evil than AT&T, and I hear complaints about AT&T's network. On the other hand, T-Mobile does not have coverage (even roaming) in Potsdam, NY, where I'm going to be spending the next two years.

T-Mobile offers a monthly plan for $60/mo, 500 minutes/mo plus fees and (as far as I've looked now) a $35 activation fee. (The option to buy a plan without a phone was buried: you have to choose "T-Mobile SIM card" from the phone list.) I get the impression that the obscure monthly 'taxes and fees' can be around $3-$20 depending on the particular situation. Total cost over 2 years (not including phone): $1475+fees.

AT&T is, er, changing tomorrow. But now it would apparently be $70/mo, 450 minutes/mo, for a two-year contract with a free locked phone (which could be tossed or resold). Plus taxes and fees. After the change in data plan pricing, it would be (assuming no other changes) $65 for 2GB or $55 for 200MB data. Total cost over 2 years (2GB option): $1560+fees, and the phone works in Potsdam.

In both of these cases I assume the cheapest voice plan option.

One option would be to go with T-Mobile for the 2.5 months before I arrive in Potsdam; this would minimize my initial obligation to $709, and assuming I found I liked having a smartphone around sufficiently, I could then switch to AT&T for service during my 2-year stay in Potsdam.

Comments?

My Palm TX is noticeably wearing out (power button dead and worked around, cover hinge fraying, direction pad starting to go) and doesn't have a decent modern web browser. I might have gotten a Palm Pre by now if it weren't for the lack of full-size external (Bluetooth) keyboard support (notetaking is one of the major use cases) — though I hear there might be an SDK coming out which would let third parties build one. (Lesser issues are the cost of a phone contract (though Internet-anywhere makes that have a good bit of value) and the battery life.) I get the impression that I should be looking at the Nokia N900 or one of its relatives, but I haven't gotten around to investigating that.

My additional requirements for a New PDA are that it sync calendars/todos with iCal, sync the abovementioned notes to my Mac (I don't care what software), fit in my shirt pocket, and have mostly-not-locked-down-and-expensive software development/installation (so that customized/open-source/the-obscure-niche-I-happen-to-need software can happen).

(Apple mobile products fail on the openness criterion and either Bluetooth keyboard (iPhone/iPod touch) or fitting in the shirt pocket (iPad).)

A machine I used to use to host some web services, bots, and repositories became no longer accessible from the Internet, as a result of which I've had to move what I was serving from it; some to switchb.org, some to personal machines.

I took the opportunity to clean things up a bit, as a result of which I now have better backups, more polished services, and know a little bit more about configuring Apache — though not as much as I perhaps should.

  • My Subversion repositories are now served over HTTP, and therefore browsable; and they are now backed up daily (using svnsync triggered by a cron job) to my laptop, and thence to all its backups.

    (I wasted several minutes on remembering that cron will ignore the last line of a crontab file if it doesn't end with a newline; after listening to me grumbling about this, someone made a suggestion to end the file with a comment, so that the last line is harmless whether ignored or not, and also reminds one of the issue.)

    If you have a working copy of one of my repositories (E-on-CL, E-on-JavaScript, MudWalker, Den, etc.), here's a guide to the changed URLs.

  • My other Tahoe-LAFS volunteer grid storage node is now residing on a machine on my home LAN.

  • Finally, some simple data-querying web services I wrote for Waterpoint's word games have now been moved to switchb.org; I also took the time to prettify their URLs (no cgi-bin or .cgi) and write documentation.

I haven't yet gotten to working on the bots, darcs repositories, or miscellaneous other stuff I had there.

(Pondering moving my blog over to switchb.org as well so as to not have ads, especially now that I found I can still have LJ-friends by way of OpenID. (Hm, but reading friends-locked posts over RSS might not work since there's no username+password for LJ to accept. Anyone have experience with that situation?))

Apache configuration questions:

  1. If I have multiple variants of a document (e.g. foo.html foo.pdf foo.txt) handled by MultiViews, so the canonical URL of the document is extensionless (“foo”), how do I properly control the default variant to serve in the event that the client does not express a preference via the Accept header? (Without doing so, I found that it would serve the .txt version, whereas I would prefer the HTML.) All that I found that worked was to create a type map file named “foo” with quality values, and force it to be interpreted as a type map using <FilesMatch>. This seems kludgy to me.
  2. What is the right way to serve CGIs, not in a designated cgi-bin directory, and without any .cgi extension in the URL? I initially tried to apply mod_rewrite, but I couldn't get it to work such that /foo internally contacted foo.cgi whereas /foo.cgi redirected to /foo. I resorted to another <FilesMatch> explicitly listing the name of each CGI and doing SetHandler cgi-script.
  3. What is the right way to handle “testing” vs. “deployment” configurations, where the relevant Directory, Location, etc may be different depending on which server or subdirectory the site is set up on? I see that one may use environment variables — should I just set up variables containing the path prefixes for the particular host before including the generic configuration file?

I'm on Google Wave (by way of my participation in GSoC 2009). Tell me what's worth my time to do with it.

My ID is apparently kpreid.switchb.org@googlewave.com. (kpreid was taken, hmph.)

What do practicing Java programmers call the part of a method definition that isn't the { body }?

__________/ this bit here \___________
public static void main(String[] args) {
  // not this part
}

A quick search turned up the Java Language Specification, Second Edition calling it a MethodHeader in the grammar, but it doesn't use that term in the text and I want to know what term(s) are used in practice, not solely by language lawyers.

(“Signature” is not correct, as that includes only the method name and parameter types, not modifiers and result type.)

As I wrote before, I am currently attending MVCC, a two-year college, and need to choose a college to transfer to (for a bachelor’s in computer science).

So, tell me what college(s) I ought to consider.

(I have of course also heard the advice that it doesn’t matter that much, but I've got to choose from some short-list...)

I am willing to consider any location in the contiguous US, but have been looking mostly at New York choices as a way to make the research list manageably short.

I am not looking for vocational training; I can learn this year’s or last year’s hot technologies just fine by myself, thank you. I’m looking for general education (“well-rounding”, shall we say), useful theory, and practice in thinking. I wish to avoid a high-pressure or competitive academic environment. Also, at MVCC, I have greatly appreciated the instructors’ approachability, availability, and even willingness to acknowledge mistakes.

Outside of education, I am particularly interested in there being social opportunities for the socially awkward; chances to talk to like-minded people (i.e. total geeks), and opportunities to talk to unlike-minded people (for the practice!).

Please give me your recommendations. Just a name, your personal experience, comments on others’ recommendations, whatever info you’d like to share.


(On the other hand entirely, I’d also consider going directly from MVCC to a full-time job given the right opportunity. This will be the topic of an upcoming post.)

I've been having a lot of thoughts lately I'd like to publish, but seem a little bit too short for A Blog Post. Some options

  1. Considered signing up for Twitter. Pro: short stuff is expected there; participating in the hot new thing; people interested in short-form will be on twitter and using the follow feature. Con: Reliability problems; YA thing to manage credentials and backup for; no hyperlinks; my favorite username is taken.
  2. I could post stuff here. Particularly, LJ supports titleless posts.
  3. I could use some other site, or build my own publishing system. [er, why?]

On reflection, I'm thinking to just post the stuff here and not have yet-another-distinct-place/site.

Readers, what would you prefer?


(This post is tagged “lisp” solely so that Planet Lisp will pick it up.)

Ads

Wednesday, March 25th, 2009 23:59
I just recently found out that LJ is displaying ads on my journal-or-blog-whichever — I hadn't previously noticed as it doesn't when I'm logged in (which seems a bit deceptive). I had previously understood that with a basic account there would be no ads.

Your opinion on the matter? Have the ads bothered you? Is there actually a way to turn them off that I haven't noticed? Should I find other hosting for my blog?

(I expect most of my readers are actually via feeds and don't see them...)
Something I've wished for several times recently is a database-document program.

By "document" I mean that the database is a single file, which I can move, copy, etc., as opposed to living in a database server which has to stay up, uses accounts and ACLs, needs special backup procedures, and so on. It doesn't need to support humongous data sets — fits-in-memory and even linear searches are fine.

I am aware that people use spreadsheets for such purposes, but I would like to have named, typed, and homogeneous columns, easy sorting/filtering/querying, etc. which I assume I'm not going to find there. Relational would be nice too.

It must be GUI, and run on Mac OS X, but it doesn't have to be thoroughly native — I can stand the better sort of Java or perhaps even X11 app.

And finally, it should have a file format that either is obvious how to parse, or has a specification, or is supported by many other programs.

Does such a thing exist?

(If not, I might write it.)