Snow Leopard WiFi
2009-09-06 13:23:19
That thing about deleting the VPN profile turned out to be a red herring, the
problem returned after a few hours. Finally solved it today, by setting the DNS
server to my ISP, rather than my router/modem. Doing the same on my iPhone also
solved its WiFi issues, which have been annoying me since the 2.1 OS update. I
guess whatever DNS stack change was made on iPhone was backported to Snow
Leopard, and it happens to interact poorly with my modem (Billion BiPAC 7300RA,
for the record). I still don't quite understand where in the OS X software stack
the problem is; since DNS lookups against the router work fine using nslookup;
I'm guessing it's something in the Cocoa layer.
More Snow Leopard thoughts
2009-09-02 22:53:48
I seem to have fixed my earlier WiFi issues by deleting the (unused and
disabled) university VPN profile.
Many people have written that there are virtually no new front-facing features
in SL. The only ones that affect me are:
- Under 10 seconds from cold boot to ready-to-use. That's really, really
insane.
- You can show the date in the menu bar next to the clock now.
But the new APIs are really interesting. Read the
Ars Technica review for a
really long exposition. Read the
Apple developer notes for a faster, more
detailed explanation.
Some highlights:
- Block objects in C (i.e., closures).
- Grand Central Dispatch: POSIX-level threading API that cooperates across
processes to balance work units across an optimal number of threads. The API is
dead simple, using the aforementioned C block objects.
- OpenCL: numeric for GPU, without fucking about with textures, render targets
and full-screen quads.
- Explicit cache control: mark pages as volatile, and the OS will flush them
without paging them out if it needs to.
- Opt-in application termination: shutdown doesn't wait for processes to exit
if they've marked themselves as "safe for immediate termination".
- File ID-based URLs replacing POSIX paths; unifies URLs and paths, and means
applications can find files after they've been moved (if they're on the same
volume). Presumably also does away with having to worry about relative vs
absolute paths (if you don't care about changing volumes).
- QuickTime X: simpler APIs for things like playing back movies/audio that
don't require you to read documentation that dates from the 80's.
Rampant speculation:
For the last few years we've been developing in an environment in which the
three platforms (Windows, OS X and Linux) are approximately equivalent in
features and APIs. OS X and Linux to the point where you can often cross-compile
the same source code with minor changes [I recently recompiled a Linux networking
library for iPhone changing only a single #include directive]. The Win32
equivalent functions for POSIX are well-known and easy to find. Writing
cross-platform software is a matter of factoring out the common code, and either
rewriting the user interface for each platform, or using something like Qt to
smooth over virtually all of the differences. Using a cross-platform language
like Java or Python makes it even more of a no-brainer.
But it looks to me like the platforms are diverging again. OS X is gaining
features that are genuinely useful (not just eye-candy or domain-specific) that
have no equivalents in Windows or Linux. Microsoft have had big plans for
Windows, too. None of these plans (besides Vista's transactional filesystem)
seem to have made it into Vista or 7, but it's reasonable to expect that some of
them will eventually make it into a product. At the very least, it's clear that
Microsoft's focus is on supporting .NET/CLR rather than the C API now and in the
future.
Someone writing a Photoshop-like application for OS X would definitely want to
use a whole lot of OS X specific features: CoreImage, CoreAnimation, OpenCL, the
cache APIs, Grand Central, and so on. These features are not just
"nice-to-have" additions, they change the way you'd develop the
application. Similarly, the same application written for Windows nowadays would
probably want to start with .NET, at the very least to get the most up-to-date
GUI look.
The amount of code that could be shared between the two implementations gets
smaller the more you improve it for any particular platform. Cocoa/Objective-C
code and .NET/C# code don't look very much alike at all, especially when you
really start taking advantage of them. That leaves choosing an in-between
language (C++) and doing without a bunch of features, or a cross-platform
language (Java/Python) and also doing without a bunch of features (and looking
like poo, to boot).
I'd guess this is exactly where both Apple and Microsoft want us going, because
it again allows each platform to have its own speciality apps and points of
difference, where for a while they were more or less interchangeable.
While the split between OS X and Windows increases, the difference between the
desktop and mobile editions is vanishing. OS X and iPhone APIs were always
similar, and now features from iPhone are being back-ported to OS X (CoreLocation
and QuickTime X). Rumour has it that the next Zune API will be XNA. That leaves
two fairly serious platforms to choose between: Windows/WindowsMobile/Zune/Xbox
and OS X/iPhone. Game developers also target PSP (conceptually similar to
iPhone), PS3 and DS (like nothing else, from what I understand).
I don't think the cross-platform languages (Python, Java, etc) and libraries
(Qt, etc) will be relevant for much longer. When the Windows/Mac split increases
more, cross platform development will be the domain of Javascript+HTML+Canvas,
which is starting to look like a real platform since the announcement of Google
Chrome OS, and has the benefit of actually being cross platform by design.
Snow Leopard WiFi
2009-09-02 08:27:47
Something's very, very wrong. Command-line programs like ping and curl work
fine. Safari, Camino, Firefox routinely think they have no internet connection
and give up trying. Some things that help:
- Flushing the DNS cache (fixes problem for one web page fetch)
- Restarting WiFi, or creating a new "location" in system preferences
(an oft-quoted solution to this problem on the forums) -- fixes problem for
nearly a minute
- Restarting computer (which, incidentally, is an insanely fast 10 seconds) --
fixes problem for about a minute.
This is on a late 2008 model MacBook connecting to a NetGear router. Things
I've yet to try:
- Put the kernel in 64-bit mode
- Try another router (I have an old Apple one)
- Downgrade to Leopard (clean install I imagine -- shudder).
Javascript types
2009-05-27 23:21:08
Javascript has won the language wars, and look what we've got. A single Number
type (hooray), which is internally represented by a 64-bit IEEE float (erm, ok)
unless you're doing bitwise operations, in which case it's:
- violently coerced to a 32-bit signed integer in JS <= 1.1 (NaN if out of
range)
- silently coerced to a 32-bit signed integer in JS > 1.1 (truncated
fractional and high bits)
What have we done to deserve this?
(Disclaimer: I haven't been bitten by this design decision of doom, because I
don't do any Javascript programming. But I find myself strangely compelled not
to even bother, given the risks apparent).
About Reader
2009-05-05 09:18:27
I said that comments on Reader really suck in my last post, and I want to
explain why.
Google Reader has changed my life (this is no big statement; lots of things
change my life; including whichever bastard on one of the many overcrowded trains
I catch coughed on me and gave me this cold; keeping me home from work and thus
with too much time to blog inanities, like this one).
Reader started out as a feed aggregator. Technologically, this means checking
the timestamps of a predetermined list of remote files, and downloading any that
have changed. The point of which was to keep up-to-date with news (real news,
from newspapers; tech news, from procrastination web sites; or friends' news,
from blogs).
When Reader was released, there were hundreds of desktop applications that did
exactly the same thing -- Reader's advantage was that it followed you between
desktops, being online.
But it's so much more now.
Reader is how I keep in contact with friends. People of my generation don't
actually want to talk to their friends, or even SMS or email them. That kind of
contact is far too personal and touchy. All we need is some way of indicating
that we thought about each other, if only for a moment. This can be achieved on
Facebook with a nudge, on MySpace with a chain letter, on Twitter with a
140-character brain broadcast, and on Reader by sharing something. To each their
own (or, in the case of some people I know, all of them).
When you share an article on Reader, you're telling them, "Hey, I saw this
and think you should read it." Which is how most conversations go anyway.
Except for Austin, who mostly shares pictures of animals, but mostly talks about
compilers.
Originally you could only share articles from feeds; typically ones you'd
subscribed to. But some time recently Google added the ability to share any URL
with a single click. This has changed my friend's sharing habits from keeping
each other up-to-date on the few blogs that we don't subscribe to in common, to
keeping each other up-to-date with what we're doing all day. For example, based
on Sofie's shares from yesterday, I can surmise that she was passing the time by
reading about penises and Star Trek cakes. This tells me much more about Sofie
than I could ever have learned by actually talking to her.
And then there's commenting. In response to a friend's share, you can write
something back. Usually "hahaha", with the number of "ha"'s
being proportional to the amount of enjoyment you received. This comment is then
viewable by any other friend looking at that shared item.
Occasionally one of us tries to start some discourse via the comments. Say, if
you didn't agree with the shared article, you might comment, "lolz no way
ps3 is teh better than poniez". But this is where it all breaks down,
because anyone who's already read that item will not see your comment, unless
they specifically go looking for it. There isn't even a flag or a number to
indicate that articles you've read have since been commented on.
At the moment Reader is like a party where everyone is telling jokes, and
everyone is hearing the jokes, but no-one can hear all the laughter, which is
isolated. If comments were integrated into the main view -- say, given
first-class status as another article, then we'd be able to continue the
discussion past a single retort, and have a real argument. It makes me think of
Slashdot, except that the posting of articles and comments would be restricted to
just the people on your friends list. It's what I want!
(Side note: apparently whatever spell-check dictionary I have loaded on my Mac
at the moment understands "MySpace" but not "Facebook" or
"Google". Figure that one out!)
Austin writes:
Afaik, the issue is the mDNSResponder cache b0rking when it receives a certain TTL value for a DNS query