HNHacker News
TopNewBestAskShowJobs

pak

4,759 karma · joined March 29, 2010

Assistant Professor at University of California, Irvine

Opinions posted here are my strictly my own, and not representative of any employer or organization that I am a part of.

https://tedpak.com

[ my public key: https://keybase.io/powerpak; my proof: https://keybase.io/powerpak/sigs/fEW8iI_3tD3E9XjbSaPJTDOtaai7TXU6j1QAezE82Xc ]

submissionscomments
pak··on Building a pure CSS 3D City
Canvas is still 2D though, so unless they develop a 3D drawingContext for canvas, you won't be able to do what's in this article with the same kind of hardware acceleration. With canvas you'd still need to run all your own poly drawing routines, while I imagine Webkit is able to take 3D CSS properties and map <div>'s straight to polys that render with hardware T&L pipelines. (Which makes me wonder, how the heck are they dealing with Z-order?)
pak··on Google+: One too many eggs in the Google basket
FUD at its best. Not only is the Facebook TOS just as convoluted and subject to arbitrary BS as Google's but for every story about some user having his crap deleted on a Google property, there's 10 people complaining that Facebook did the same to them.

Things regarding nudity, etc. -- does he not realize Facebook has the same rules? You can't post a profile pic of your buttocks on Facebook. Dirty content or under-age user gets profile deleted, news at 11. At least I can "sign out" of Facebook, ha ha, didn't you start off the article bawwwwing over how prevalent Facebook Connect is?

Anybody that uses Facebook or Google+ has already deemed the above risks as acceptable, so none of this is really an issue for them. The benefit we all get out of two major social network players is that there's at least a chance that they will try to play nicer with their users out of fear that the competition will start to pull ahead if they don't.

The real endgame that I'm hoping for is that Google promotes some majorly open APIs for integration between social networks, kind of like Diaspora was except now done right and with major backing, and then social networking becomes a decentralized and commoditized service the way blogging is now. (Then Google wins, because their search engine is the center of the universe again, and the social web is just a commoditized paper canvas with their ads all over it.)

pak··on Why you should take the money
Facebook's investment from Jim Breyer in 2005 came with million-dollar bonuses for Zuckerberg, Moskovitz, and Parker. Just sayin'...
pak··on Where are my rounded corners?
I sympathize with all arguments here. However, if the client expects a lot of the audience to be using IE, and is willing to pay for the extra effort, some conditionally commented CSS and JS could layer on the extra images for the corners that really need to be round without sacrificing any performance or SEO juice. You may also want to check out http://code.google.com/p/ie7-js/ .
pak··on Python and the Principle of Least Astonishment
It's a bit dated, but the Python Cookbook does a great job of teaching you practical examples of Python if you already know other languages and want to quickly grok what is "pythonic." It starts with string crunching and hits just about every other general sysadmin use case, covering most of the standard library along the way.
pak··on The Strangely Compelling Game Mechanic Powering Google+
I would say there are three main elements of game mechanics: 1) rewards or penalties; 2) unpredictability, either through interaction with other players or pure chance; 3) utilizing player skills that can be improved with repeated play experience.

None of those are involved here, except maybe a little bit of 1) if you consider +1 a "visual reward". I'd really expect all three to be involved before saying something has game mechanics--you can easily find each of them in Foursquare, for instance.

pak··on Oh Yes You Can Use Regexes to Parse HTML
This is correct. As soon as I saw his lex_html function, I could see that he was using regexes to tokenize and then basically drop into different contexts while consuming the document, thereby tracking multiple levels of state throughout. That's what a full-blown parser does and it goes beyond the scope of regular languages.

By "parsing with regular expressions" most people mean applying one or two regexes to the entire document and using, for example, the group capture facility to extract information. That is and will always be a bad idea for HTML, because HTML is not a regular language.

Applying regular expressions to tokenize a string for a parsing is actually a fairly standard pattern.

pak··on Why the #AskObama tweet was garbled on screen
How do you (or the OP) know the implementation details of the consumption path for display? The author assumes it was the direct JSON feed from Twitter. That's overly simplistic and betrays his inability to understand how these sort of things are put together. This is a public, real-time event; more likely than not tweets were filtered through one or two other components to separate the interesting material from the noise. You have no idea what those intermediary components were, who set them up, and if they were all decoding/reencoding correctly. Perhaps they were going through other Twitter users' clients, which could have contributed to the bug.

Edit: yes, there were definitely people curating the questions, so it could not have been as simple as pulling one JSON feed. http://www.theatlantic.com/politics/archive/2011/07/how-obam... https://twitter.com/#!/townhall/july-6-curators

pak··on Why the #AskObama tweet was garbled on screen
"This is SUCH a classic sloppy programmer mistake that I'm disappointed"

Oh come off of it. This happens everywhere on the web on probably something like 25% of websites. And it's NOT always the consuming program's fault: very often somebody upstream, e.g. the hosting company, the person that wrote the HTML, the source of an RSS feed being inserted into the page etc. etc. forgot to encode something the way somebody else expected, and you as the poor guy at the end of the chain gets a document with multiple encodings improperly embedded into it. Inevitably you have to make some bad decisions and not all corner cases are handled.

Somebody once reverse-engineered the state chart for how Internet Explorer handles documents with conflicting encoding declarations and I kid you not, it must have had >20 branches spanning a good few pages. Officially, the correct order of precedence is (http://www.w3.org/International/questions/qa-html-encoding-d...):

1. HTTP Content-Type header

2. byte-order mark (BOM)

3. XML declaration

4. meta element

5. link charset attribute

but that's not how every browser does it, because the W3C sort of declared that after things on the Real Internet (TM) had already gotten out of hand. I hate to resuscitate Joel posts but Unicode is not easy to implement right.

pak··on [dead]
Linkbait. One person's opinion, and the article doesn't even attempt to validate it against other experts or people with real knowledge of what Facebook's architecture and current concerns are.
pak··on Newspaper to close its doors over hacking scandal.
That's still a bad analogy, and you've used it way too many times in this thread.

Whether or not accessing anything on a webserver is illegal depends partly on your intentions while doing so. That's a basic function of most court trials--to discern your intentions. For example, see the differences between the various degrees of murder, and the way such trials often hinge on "preconceived intent."

If my intention in accessing "/admin" was to access your server without your authorization to access some protected piece of information, damage computers, or defraud you, that may indeed be a crime. See http://www.law.cornell.edu/uscode/18/1030.html . It doesn't matter whether it was password protected or not. If I went there by accident, however, it probably was not a crime, although depending on what I accessed I may wind up having to go to court to prove that my intentions were benign.

pak··on A Walk in the Woods with Mark Zuckerberg
Kind of a cute idea, although if I'm seeing this trail correctly, you wouldn't be starting at the edge of the Facebook parking lot--you cross a hill, then cut through an elementary school, walk a few blocks to Junipero Serra and start up the trail there. Also, the trail itself is not very wooded--more like grassy.

http://maps.google.com/maps?q=Facebook+Offices,+South+Califo...

pak··on Man Flies with Someone Else's Ticket and No Legal ID
What state are you talking about? AFAIK when you say

>I can order a copy of my drivers license and change the address to "1600 Pennsylvania Avenue, Washington, DC" and they'll ship it to me quick as can be.

some states (e.g. New Jersey) mark the new license as a duplicate copy, which causes increased scrutiny by police officers and other ID checkers. And most states do send something to the old address, if only a simple notice stating the change of address.

Likewise, USPS sends a notice to both addresses if you activate their mail forwarding service, so you can't forward somebody's mail to your address and reorder their license. (Unless they are on vacation...) All of that is mail fraud which is a federal offense and probably a felony.

That all gets you a license with somebody else's picture, so you need to be a very close match with them to be able to use it--LulzSec isn't dumping pictures of their targets yet, so that means for a lot of facebooking.

As for a brand new ID, I wouldn't say it's impossible to jump through all the hoops you have described in para 3, but you'd have to pick somebody that does not already have an ID in the state you are getting a license from, and somebody that you are sure will not be contactable as a result of all your shenanigans (i.e. missing without a death certificate), or your fake license is bound to be useful for only a short period until the IRS and credit agencies catch up with the real person and that victim files a report of identity theft, freezing/suspending it. The next time you get pulled over with that license, it's lights out. Additionally, you can't just walk out the door of a DMV with a new license, you have to wait for it to be shipped a real address and if your forgeries are detected before then, police may be waiting to see who picks it up. That risk probably serves as a sufficient deterrent, no?

pak··on Show HN: Two-faced URLs
> Advocating for "proper link formatting or better content presentation" reflects the fact that you've never had to dig deep into the complex SEO, user, customization, and other general business requirements that arise when running a CMS.

Erm. I don't think you understand what I meant. I meant if a URL is too long to fit within a block of text in your medium, enable hyperlinking it with short, descriptive link text the way just about any media other than twitter or plain text (or HN markdown, but I digress) allows. Have we already regressed from the concept of the well-made hyperlink?

I appreciate that designing URL structure for a site can be difficult. I don't think it's as hard as you make it out to be, because just about any free CMS package will take care of SEO'd URLs for you and set up redirects even if you change your content. Hell, you can customize all of this in Wordpress without touching code. But that's an orthogonal problem, and shortened URLs neither contribute to SEO nor constitute a viable long-term URL structure for any site.

> Short urls are valuable because they allow people an ability to simplify the increasingly long urls for use in many different mediums without the worry of breaking or losing portions of the url.

This is what I don't understand. OK, sure, URLs get long, but they could be long before we started putting keywords in them, that's not new. Besides email or twitter, what media are you possibly talking about where I'm dropping bits of a URL on the floor? And if bad email clients can't linkify long URLs properly and twitter won't allow proper link formatting, why are we just rolling over and enabling their problems?

>Twitters 140 characters is part of what defines them. There will always be short message mediums, ...

They could and should make an exception for URLs. Imagine tweeting:

    URL shortener controversy all over again!
    [Read it on HN|http://news.ycombinator.com/item?id=2734728]
and the URL portion and formatting doesn't count toward the limit, only the link text part. Visually, that's only 55 characters worth of information, and that's how the limit should be formulated. You can't tell me that http://bit.ly/blsa23848 is more informative or contributes meaningfully to Twitter's character limit by virtue of it being shorter than my formatted link with link text. In fact, it's less informative, and obscures the link's true destination without deshortening (and as the OP shows, deshortening is fallible).
pak··on Google+ is Awesome. Facebook Maimed, Twitter Mortally Wounded?
Asynchronous or one-way sharing is fundamentally incompatible with the current Facebook friends model. They'd have to rework a lot of the privacy code. Probably all of it, actually.

It would also be a major UX shift to bring Lists back to the foreground and make it a part of every interaction a la circles. And if they did, it would be hard to do it without offending existing users.

Facebook also may have big datacenters but perhaps not currently architected to handle videochatting at the volume that Hangouts require. Google has a one-up on them there since they've offered free video chatting for years, and they also have gotten many people to already install the Voice and Video plugin by offering free phone calls in GMail for the past two years. That plugin is key to a good videochatting UX in a browser (Flash by itself has some technical and UX problems with webcam access).

pak··on Show HN: Two-faced URLs
Yet another reason for URL shorteners to be banished from the web (not that this will ever happen). Besides the arcane input requirements of Twitter and the semi-retarded behavior of certain email clients, I haven't found a good use case for them that couldn't have been solved better with proper link formatting or better content presentation.

When the web is just a sea of opaque pointers to pointers to pointers, with various hilarity like these URLs mixed in, we'll all wonder why the hell we stood by and let it happen.

pak··on How to Read Mathematics
>Obviously mathematicians don't leave "exercises for the reader" in research papers

ORLY? I'll leave this right here for you:

http://scholar.google.com/scholar?hl=en&q=left+as+an+exe...

That's >100k hits from what Google Scholar can index alone--a few are from books, but the vast majority are journal articles.

pak··on How to Read Mathematics
You must have only seen this phrase in places where it was used in the bright, sparkling, professorial manner assumed by your comment. I take no offense when it appears in a textbook, where the intent is to have me practice a skill. I do object to its appearance in a journal article, however; that is a context where you are supposed to communicate findings as clearly and concisely as possible. In particular, I've come across its use more and more often where one of the following likely applies:

1. it is doubtful that the author has actually done the work to prove his own assertion, and uses the phrase to cast his own burden on the reader,

2. the author has possibly done the work, but can't be bothered to condense it to the quality required for publication,

3. showing the work would clearly be useful for the target audience, but the author is more concerned with making the material appear difficult, or

4. the author is being ironic, because the assertion is either superfluous, outright incorrect, or known to be unprovable.

In fact, all these bad use-cases are common sources of humor among math nerds (http://www.jargon.net/jargonfile/e/exerciseleftasan.html), (http://abstrusegoose.com/12), (http://fasterdonuts.tumblr.com/post/4516834904/the-proof-is-...) ... so I think I'm being fair in calling this phrase a trope. As in, its overuse is well-known, tolerated, and occasionally ridiculed.

tldr: I am indeed complaining about bad writing, not the subject--specifically that "left as an exercise" has become a common idiom behind which bad writers in math and CS hide, and its inappropriate use is now all too common.

pak··on How to Read Mathematics
The most irritating trope of math and CS literature has to be whenever something interesting or useful is "left as an exercise to the reader." I always felt that phrase has no place in the internet age, where the concept of a "page limit" is laughable and a simple hyperlink can point me to chapters upon chapters of appendices. Calling something "trivial" is swallowable, and perhaps this article's example of "it easily follows that..." is the mathematician's secret handshake that the steps in between are boring, but pointing out an interesting conclusion and then saying the reader deserves an exercise to actually make sense of it, I mean... isn't the point of academic writing to communicate research and results already performed? Wouldn't it be better to show the work for your assertion so that others could critique it or offer even better solutions?

I know somebody is about to point out to me that I'm being "lazy" and should enjoy doing more work to learn so and so, but being asked regularly in the literature to reinvent somebody else's wheel seems to run counter to everything we do in CS (and academia in general, I would think). This article aside, I do sometimes feel that academic writing in the math/CS realm occasionally reeks a little bit of snobbery, where communication is held secondary to keeping up appearances.

pak··on “Let's settle this in a Ruby programming contest”
The huge super-dotty background actually makes my monitor sound different when I have his page open. I can literally hear the scanlines firing. And this is a laptop LCD. I've never heard this sound before.
pak··on [dead]
Yes, but I believe their intent was to rewrite the other script as it functioned, not for it to be any more effective.
pak··on [dead]
I think you meant

           if (strpos(@file_get_contents('http://'.long2ip($c), false, stream_context_create(array('http’ => array('timeout’ => $argv[3])))), $argv[4]) !== false)
pak··on [dead]
Meh. Neither are particularly inspiring. Yeah, thejester's is pedantically long and uses way too many variables, while lulzsec seems to have an aversion to variables, running ip2long($argv[1]) up to three times per loop.

Also, the "lulzier" version does not separately handle the case where a webserver is found but does not return a response containing the needle. It's true that thejester's script is not particularly efficient in wasting a socket connect to do this separate check, but for a one-off task, who cares.

pak··on What PHP Needs
Not unique to PHP in the slightest. In C

    sizeof(int, 2)
will return a parse error, because sizeof is an unary operator despite looking like a function (the parentheses are mandatory when using it with a type name). In PHP, isset is implemented as a "language construct", essentially like another operator.
pak··on Google discontinues support for IE7 in Google Apps
> Did you read what I wrote? I mentioned Google Maps as one of the two places I found AJAX useful.

Yes, and I was dissecting why you may have found it useful, because the same principle applies to hundreds of other situations that you may not have recognized.

> The applications on my mom's PC do have much better UI standardization than the web does. Microsoft releases UI guidelines. alt-f4 does the same thing in every application I've used

Questionable. About the only key shortcuts you can rely on are the ones that will work in your browser too. Alt-F4 will close your browser--that's what you wanted, right? Cut/copy/paste, print, etc. all work there as well...

> the menu structure is roughly the same too

Ha, you mean the invisible menus on Explorer and IE>8, the mega "office button" menu in Office 2007, the delightfully inconsistent menu bars in WMP>9...

pak··on WebKit and Chrome prerendering
Isn't this Google Web Accelerator, all over again, with the same problems?

http://en.wikipedia.org/wiki/Google_Web_Accelerator

pak··on Google discontinues support for IE7 in Google Apps
A big part of usability is not sitting around waiting for entire pages to reload every time you interact with them. AJAX has done great things for users by minimizing this delay. You wouldn't like Google Maps as much if you had to click an arrow and wait for a page refresh for the map to move, like MapQuest circa 2003.

Yes, the proliferation of web apps has created a diversity of user interface paradigms. Some would say this is a good thing, however, since the web has spurred all kinds of new UI philosophies, and the fact that JavaScript and HTML isn't compiled allows people to examine and re-work others' code, so good ideas spread very quickly. I for one don't intend on waiting for the HTML5 group to invent every new <input type=""> that I could conceivably need, and then wait some more for browser vendors to implement them all consistently. With JavaScript, you can currently build and deploy just about any kind of 2D client-side interaction imaginable.

In short, the vast majority of users on the internet probably have a different idea of usability than yours, and the numbers tell the rest of that story. You only need to look at the gross casserole of UI paradigms within the applications installed on your mom's PC to see how much users really care about UI standardization.

pak··on Google discontinues support for IE7 in Google Apps
With all the headless Webkit tools coming out nowadays (and all the free and fast JS engines like V8), writing a spider that runs a JS engine and clicks on all kinds of non-<a> elements is not beyond the reach of somebody innovative and motivated enough to create new kinds of spidering robots.

You won't need to write a complete JavaScript library. Look at all the testing suites that automate browser instances, Selenium being the most well-known.

pak··on You should learn to type (properly)
Pot calling the kettle black. What's with the increasing level of trollbait around here?
pak··on How do magnets work?
I may be confusing propagation speed and drift velocity--it's been a while since I learned this, and I think there is some way to rationalize that the net current is really moving close to the speed of light when you add/subtract the motions of all the individual particles, even if none of them in isolation are moving anywhere close to that speed.

In any case, this article explains the whole matter a lot better than I could.

http://en.wikipedia.org/wiki/Relativistic_electromagnetism

← PreviousPage 13 of 26Next →