hudebnik: (rant)
Updating the address book database in conjunction with sending out Xmas (New Year's, Twelfth Night, Candlemas...) cards. Some things had been updated on the desktop computer, some on my iPhone, and some on the laptop. I can synch the phone and the laptop easily enough, but my phone no longer talks to the desktop computer. And I haven't shelled out for a MobileMe subscription. And the ONLY approved way to synch Apple AddressBook databases or calendars is through iTunes (what a music player has to do with address books or calendars, I don't know); Apple doesn't even want you to know where your AddressBook database IS. I can figure it out, but I don't want to directly copy databases between a machine running 10.4 and one running 10.6, because the file format has probably changed in between.

So I borrowed [livejournal.com profile] shalmestere's iPhone, which hasn't yet been updated to the latest operating system, so it's still willing to talk to iTunes version 9.x, which is what runs on the desktop computer. Synched it with the laptop, taking the option to "replace" the contents of the phone's address book with those of the computer's, then synched it with the desktop machine. But the great majority of the entries in the address book are of no interest to [livejournal.com profile] shalmestere, so I went through the database making sure each entry was in the correct folder(s), then synched her phone again with only a few of the folders.

It seems to work. Knock wood.

Cool links

Oct. 7th, 2010 06:47 am
hudebnik: (Default)
No particular connection between these, but I thought I would boost the signal:

hudebnik: (Default)
An article about the use of "Twitter bombs" -- a lot of Twitter accounts all sending basically the same message at the same time -- to influence political campaigns. Apparently a thousand or so simultaneous messages are sufficient to attract the attention of Google Real Time, which then gets millions more people to read the tweet and re-tweet it without checking whether any of it is true.

So what am I doing? Re-posting the article, without checking whether any of it is true :-)

http://www.wellesley.edu/PublicAffairs/Releases/2010/050310.html
hudebnik: (teacher-mode)
So I finished with what I had to lecture about, and told my students to spend the remaining 15 minutes of class working on their homework, while I walked around looking over their shoulders and offering help. Two of them were collaborating on a programming assignment and had turned it into a Google Wave, with a gadget that knows various programming languages (including Scheme, which we're using in this course) and automatically syntax-colors whatever you type. Kewl.
hudebnik: (Default)
I believe we're about to take possession of a Mac G4 Tower without a monitor; my tentative plan is to use it as a file server. (This is really motivated by the desire for a keyboard, since my keyboard-cleaning experiment last week was less than totally successful; the computer comes as a bonus :-) I should be able to ssh into it, so I can administer the Unix side of things, but I don't know how difficult it is to administer the Mac side of things remotely. Paying $300 for Remote Desktop seems like overkill for my minimal needs. Has anybody on my tech-savvy flist done this sort of thing?
hudebnik: (Default)
To me, the word "sync" means "here are two collections of data which should theoretically agree. For each atomic item that differs between them, replace the older version with the newer version. If you're not sure you can do that safely, tell me the differences and ask me what to do."

I'm not sure what it means to Apple, but it apparently does not consistently include copying from the phone to the computer if what's on the phone is newer. That might lead to somebody somewhere using a phone to easily transport information from one computer to another, which might mean one less paying customer for MobileMe.

Apple's iTunes does sometimes "tell me the differences and ask me what to do," but only for calendar events... and even then, my decision apparently determines what goes onto the phone, but not what goes onto the computer. As a result, I have to resolve the exact same difference again next time, and the time after that, until I give up and accept the version that's on the computer, even though the version on the phone is right. (Then I usually open the .ics file in vi and fix it the hard way....)

And why is it impossible to sync a phone with more than one computer? Because, again, that might lead to somebody somewhere using a phone to easily transport information from one computer to another, which might mean one less paying customer for MobileMe.

What does "do not sync" mean? To me, it means "don't modify either of these collections of data." To Apple, it apparently means "delete the collection on the phone," because a phone is just a mirror of (part of) one particular computer, so if you don't want the data on your phone to exactly match data on that computer (which is of course the only one on which you will ever use the "sync" feature), you must not want the data at all.
hudebnik: (teacher-mode)
Take a look at this video (SFW) about how we (could) interact with computers.

(Borrowed from this post by [livejournal.com profile] jducoeur)

C++ geekery

Nov. 3rd, 2009 04:28 pm
hudebnik: (teacher-mode)
So I'm trying to write up a solution to the homework assignment I just gave my students -- a binary search tree of (key,value) pairs in C++.

From my experience in Java and Scheme, I have a strong bias in favor of immutable data structures. So I wrote a BST class that presents a stateful "front end", but which is actually implemented in terms of immutable trees.

What should one be able to do with a BST-based dictionary? Obviously, create an empty one; insert a specified (key,value) pair; check whether a given key appears; look up the value associated with a given key; etc. I decided to leave out "remove" from the assignment, since that's harder to do to a pure BST (there are ways around it, but I didn't want to get that complicated). But it should be easy to replace the value associated with a given key.

Now, if the data structure were supposed to be mutable, I would just search through the BST, change the "value" field, and be done with it. If I were working in Scheme or Java, I would search through the BST, create a new node with the modified value but the same key and subtrees, and rebuild the answer from there on up; the old nodes will eventually get garbage-collected. So I try to do that in C++... but what happens to the old node? At some point it (and everything above it in the tree) will have to be deleted, or I'll get memory leaks. The obvious C++ destructor says "just before deleting me, delete both of my subtrees." But I just copied those subtree pointers to the new node, so they'll get clobbered.

Aha: I'll zero out those pointers before deleting the old node... but that counts as mutating, even though it's just a nanosecond before the node goes away completely. Maybe I should dumb-down the destructor so it DOESN'T automatically delete both subtrees; instead, I'll do that with an explicit call to a "cleanUp" member function before deleting. No, that doesn't work either because "cleanUp" counts as mutating, even though it's just before the node goes away completely.

The only alternative seems to be that I have to rebuild not only everything from the node-to-change UP, but also everything from that node DOWN. Which feels wasteful and inefficient -- exactly what C++ is NOT supposed to be.

Is it really true that in a non-garbage-collected language you can't have immutable data structures share substructures safely?


Side note: Oddly enough, the C++ compiler doesn't complain in the slightest about "delete this;" appearing in the middle of a member function.
hudebnik: (teacher-mode)
See this news release and this NY Times article

For those not familiar with the name, Alan Turing was one of the founders of the field of computer science. Years before there were any actual computers, he developed a theoretical model of what a computer might be (the "Turing machine") and proved, among other things, that it was possible to write a single program for it (the "Universal Turing machine") that would interpret and execute other Turing-machine programs. His theoretical model turned out, surprisingly, to be equivalent to several other, completely different models of computation: Post production rules, Church's lambda-calculus, Chomsky unrestricted grammars, etc. but Turing's is the one that most closely resembles the real computers that were eventually built.

ETA: Turing also originated the "Turing test", a broadly-recognized criterion for what "artificial intelligence" should mean.

Most famously outside the field, he became a national hero for leading the effort to break the German government's Enigma code system, thus saving countless lives from U-boat attacks.

After World War II, this war hero was convicted of "gross indecency" (i.e. homosexuality), stripped of his security clearances, and offered the choice of prison or "chemical castration" -- taking female hormones for the rest of his life. Which may not be so bad if you're a menopausal woman, but if you're a 39-year-old man, it kinda sucks. The side effects are widely believed to have led him to commit suicide in 1954.

It is left as an exercise for the reader to decide what an "apology" means when made to someone who is dead, on behalf of people who are dead, who were enforcing laws that are no longer in effect.

Profile

hudebnik: (Default)
hudebnik

July 2025

S M T W T F S
   12345
6 789101112
13141516171819
20212223242526
2728293031  

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 14th, 2025 08:28 pm
Powered by Dreamwidth Studios