146 karma · joined Sep 6, 2007 (19y ago) · 93 submissions
comment 14y ago · link · parent
I was curious myself, so I went digging. Most of this stuff appears in `Zend/zend_object_handlers.c`. For objects with std_object_handlers set up on them (which I assume is most of them), zend_std_read_property can do quite a bit of work: it tries a search of the property info hash zobj->ce, then the zobj->properties hash, and then calling `__get()` with protection against __get loops, then giving up and returning null. zend_hash_quick_find(), as used for these lookups, takes a HashTable* as its first argument, which is also the type of a hash table in zvalue_value.
Thus, object properties are associative arrays, though I don't think there's an equivalent severity of attack compared to causing collisions with crafted GET/POST data, as the latter is automatically parsed. You'd have to be able to upload code to make evil objects.
Going through this exercise was fun, though:
<?php $x=new stdClass();
$x->{"b\0ar"} = 12;
$x->{"b\0"} = 14;
$x->{"\0bar"} = 18; // fatal error ?>
The "property starts '\0'" case is specially checked by the standard property handler, with no explanation...comment 14y ago · link · parent
Disclaimer/explanation: I actually studied Japanese, but I'm assuming the same principle applies. If so, the symbols would be different because of the differing meanings, and the pronunciation is coincidental.
comment 14y ago · link · parent
It would help if the photos were re-done to actually show subpixels, sharply. (Edit: unless I missed the point, in which case the Settings menu shot should suffice: "It's PenTile but it looks pretty nice in actual usage!")
comment 14y ago · link · parent
I have always hated "You are male, YOU WILL LIKE THIS CHICK" flavored messages, and this still bothers me. Especially in an article like this.
comment 14y ago · link · parent
comment 14y ago · link · parent
`array_merge` will append all numeric keys from the right array to the left, under new key values, as if you used [] one-by-one; for string keys, all keys from the right are copied into the left, possibly overwriting what was there.
In real code, I either have all-numeric or all-string keys, and `array_merge` does what I want in bulk operations: it's essentially equal to Python list.extend and dict.update, respectively. `+` on arrays is basically useless for me.
comment 14y ago · link · parent
As a basically useless anecdote... for random mucking around, I use whatever language sounds interesting. This has been Perl, Python, Forth, CL, Clojure, Ruby, and many others by now. (I used to consider myself a hacker, until I realized I wasn't working on any hard problems.)
But for real business, I'd choose something I know I can deliver with, which is pretty much Perl, C, or PHP for me. I've tried to extend this set by playing in Java and C# a few times, but the interest just isn't there. (Edit: I don't seem to have any problem delivering on boring problems in php, though.)
comment 15y ago · link · parent
http://steve-yegge.blogspot.com/2009/04/have-you-ever-legali...
comment 15y ago · link · parent
aptitude is a TUI front-end for apt-get (which is to yum as dpkg is to rpm). synaptic and the Ubuntu Store are GUIs into the same system, though I think the store is further layered over aptdaemon and/or PackageKit. (I don't use the store much, since I'm used to synaptic, so I'm foggy on the details there. At any rate, the store UI isn't blocked while installs progress.)
comment 15y ago · link · parent
Like Etsy, I discovered you needed a lot of them, and worse, they weren't very easy to debug or version control. I think I decided to pull them back into the application layer in the face of those problems, and I probably would have avoided the SP path entirely if I'd known about sharding back then.
comment 15y ago · link · parent
A server facing the Internet can serve lots of clients because those clients have plenty of IP+port combinations to go around on their end, to allow the server to tell the difference among them even though it only has the one IP+port on its end. But 60K node.js connections from one machine, the frontend server with a single IP address, to a single IP+port on the backend server, do not have that luxury. All that identifies the connection now is the port number on the Node server, so it must be unique per connection.
Connection pools attempt to mitigate the problem by inserting a manager (the pool) in the middle, to accept larger numbers of requests from Node and try to schedule them on a lower, sustainable number of connections to the backend. At least on an RDBMS, transactions require the app to have exclusive use of the connection for its request, so when all the real connections are scheduled out, new requests have to wait for an old connection to be relinquished.
EDIT: Going back to the blog post, it said, "You really need your back-end services to scale out with node.js." Which I think means, your back end service should have multiple IP addresses, to alleviate the bottleneck described above.
comment 15y ago · link · parent
I'd say that's unimportant compared to other people traveling to your machine's configuration poorly, when the displayed UI does not reflect the actual result. Imagine, if you will, someone sitting down at a keyboard configured as anything not QWERTY, but still labeled in QWERTY. They're going to ask how to fix it. In contrast, an accurately labeled keyboard will at least allow them to hunt-n-peck.
Even Apple's customizations of the trackpad travel poorly to other users. A familiar scene: a user taps it several times, then has to ask the owner how to click.
Even accurate UI needs careful design. The standard bad example is Microsoft's menus that automatically "simplified" themselves by hiding infrequently used items, making life more complex for everyone.
comment 15y ago · link · parent
IIRC, if you "closed" the gnome one, it went to the systray, which is a UI problem all its own.
Also, you can pause the win8 operations, not just cancel them.
As for ugliness, this seems to be a shot of Hardy, give or take, so 2008-ish. I would say that the Ambiance theme that debuted to much controversy in 2010 is improved over the screenshot. (And neither of these are Gnome's default.)
comment 15y ago · link · parent
(If I were changing HN, I'd love an option to replace the karma score with a reply inbox, so I don't have to poll my threads page. I'm trying to break myself of my post-and-run habits, of my general fear of defending my ideas, and of my overvaluation of karma.)
comment 15y ago · link · parent
I'm pretty sure all of the retailers in my area only accept USD. Nobody even bothers with the Canadian exchange rate on this side of the border, although some (and any vending machine) will refuse Canadian coins instead of accepting them at a 1:1 value with American ones.
comment 15y ago · link · parent
Also regarding graph 2's commentary, 0.51 is not "almost" double 0.34. It turns out to be only 1.5x, so calling it "almost double" is about as meaningful as calling it "almost the same".
comment 15y ago · link · parent
I'd agree on ethical grounds, but legally, just about every TOS I have read states that they can cancel an account at any time, for any reason. I don't know if this would hold up in court, though.
comment 15y ago · link · parent
Not hiding the palettes when the last gimp window was minimized. Minimize -> d'oh! -> unminimize -> secret key shortcut[1] -> minimize again. Older versions used to hide them with any image window being minimized, so it was minimize#1 -> sigh -> minimize#2 -> unminimize#2 back then.
Placing the toolboxes at x,0 by default so they were underneath the taskbar/menubar. I keep my taskbar on top on Windows, and I'm glad I know about Alt+Space there.
Not having the image window's keyboard shortcuts work when a tool window is focused, for which I know no workaround.
Having the tool windows appear in the Alt+Tab list.
Actually, I can think of one more that was remedied with 2.0: the menu used to be hidden. You could right-click the image or hit the ">" button at the corner of the rulers, but it took me a long time to figure out how to save my first image.
[1] TAB. I think its action is finally available in the menus, and the shortcut displayed with it, in 2.7.x.
comment 15y ago · link · parent
++. When I was walking this road, I answered that question with "I'll use the user-agent instead!" Then I checked that assumption, and the Internet told me that could vary between requests as well. That was the key insight (you can't trust anything) that put me on the road to a much more standard system. (But probably still insecure, since I was younger and working for someone with NIH syndrome.)
comment 15y ago · link · parent
comment 15y ago · link · parent
Thankfully VeriSign did this to .com once with their SiteFinder service, so FOSS DNS servers generally have good support for assigning a particular IP address as "this is really NXDOMAIN". (Nowadays, I'm running Unbound locally anyway for DNSSEC.)
EDIT: the opening paragraph used to read "My ISP started doing this," but a closer look at TFA indicates this issue is about intercepting DNS queries to existing, legitimate search providers in order to substitute paid results.