Better HN
topnewbestaskshowjobs
Log inSign up

developer2

2,010 karma · joined Dec 27, 2015 (10y ago) · 785 submissions

Submissions

comment 9y ago · link · parent

Well, any decent company setting up proper emails sends multipart bodies: one for html, and one for plaintext. Text-only clients should never be missing out on the essentials. Of course this relies on companies doing things properly, which is sadly not always the case.

comment 9y ago · link · parent

Ah, agreed. Hadn't considered that case. Thanks.

comment 9y ago · link · parent

I don't see how a command line flag or environment variable helps to reduce the attack surface. If an exploit is found, any attacker can add the required flag or environment variable anyway.

comment 9y ago · link · parent

>> Any static site is going to load fast though, it's when you have to make database and API calls when things get hairy

This is incorrect. Static assets are often the source of many problems, due to poor caching headers for static assets, missing gzip encoding, unoptimized images, etc. The time it takes for the backend to return a response will usually result in more overall savings in load times, but it's astounding just how inefficient frontend choices can be. It's not "micro-optimizing" to focus on improving the frontend instead of only focusing on the backend.

comment 9y ago · link · parent

>> not sure HN celebrates products for simply being successfully marketed

Except that Mongo didn't find success through "simply being successfully marketed". So many people in this thread cannot seem to understand how to look at the business as a whole. Software devs are blasting the software for not being a mind-blowing piece of technology, while not understanding that it has its niche and - apparently - a good business strategy.

You cannot (typically) succeed by only having an amazing product. You also (typically) cannot succeed by dumping millions into sales and marketing for a truly garbage product. The product itself and the business behind it are both necessary elements for success.

There are a lot of developers in this thread trying very hard to appear smart by jumping on the "Mongo is a joke" bandwagon.

comment 9y ago · link · parent

As mentioned:

> c) You cannot use page numbers. You can only do first page, next and previous pages, and last page.

To get to page 9, you start on first page. Then "next page" 8 times. This is why you see this kind of UI fairly often. First (<<), previous (<), next (>), last (>>). No numbers.

Technically you can do relative page numbers (ie: current page + 8) by increasing the LIMIT of the query and skipping over results. It's really messy to handle and you can never use "real", absolute page numbers, because inserted and deleted records can change how many next or previous pages there will be.

comment 9y ago · link · parent

The major players tend not to bounce emails. They accept all mail at the edge, and then blackhole it once it's actually looked at by the backend.

comment 9y ago · link · parent

It gets worse when you want to allow sorting the paginated results by something other than the integer primary key, such as a name. Duplicate names with different ids means having to use GROUP BY.

I typed out the example queries below from memory, hopefully I haven't made any logic errors. Note:

a) Requires additional indexes to make it efficient.

b) Accounts for inserted and deleted rows.

c) You cannot use page numbers. You can only do first page, next and previous pages, and last page.

d) Example is for 20 items per page. The query pulls 21 (+1) items, so app can determine whether there is a next or previous page.

e) In a web app or api for example, your parameters get crazy, such as: /users?page=next&sort=name&sortId=20&sortVal=George

  -- first page
  SELECT name, id
  FROM users
  GROUP BY name, id
  ORDER BY name, id
  LIMIT 21;

  -- next page (ex: last item on current
  -- page has id 20 and name 'George')
  SELECT name, id
  FROM users
  WHERE name >= 'George' AND id > 20
  GROUP BY name, id
  ORDER BY name, id
  LIMIT 21;

  -- prev page (ex: first item on current
  -- page has id 21 and name 'Harry')
  SELECT name, id
  FROM users
  WHERE name <= 'Harry' AND id < 21
  GROUP BY name, id
  -- need DESC, reverse order in app for display
  ORDER BY name DESC, id DESC
  LIMIT 21;

  -- last page
  SELECT name, id
  FROM users
  GROUP BY name, id
  -- need DESC, reverse order in app for display
  ORDER BY name DESC, id DESC
  LIMIT 21;

comment 9y ago · link · parent

>> selecting everything without paginating but fetching just one row at a time in the application

This is called an "unbuffered query". The problem usually isn't with the number of rows you're trying to read; it's about what the database must do on its end before it can know which rows to send first. ORDER BY being one example wherein, unless you have perfect indexes including the sorted column(s), the database has to generate the entire resultset before even sending the first row. That means writing potentially millions of rows' worth of information to memory or - more commonly at large sizes - to a temporary table on disk.

Unbuffered queries are fairly rare in the "real world". While in theory it means you're parsing results faster and using less memory on the application side, it introduces difficulties like the fact you can't run a subsequent query until you've finished reading all rows from the original query.

When an application is reading this many rows with a single query, it's usually an indication that the app is poorly written. Of course there are exceptions, though typically reserved for maintenance scripts, reporting, data migrations, etc.

comment 9y ago · link · parent

Some systems do. Elasticsearch is the example that comes to mind. By default, configuration prevents you from offsetting past I believe it's result 10,000. You can of course increase this limit, but there is a sensible default.

comment 9y ago · link · parent

It depends on how much expensive merchandise you own. People forget just how quickly things add up. As a single example (out of hundreds in an average home), most people won't even remember to add their toaster to the insurance claim. And even if you remember to claim "a toaster", insurance will pay you $20 for the most basic toaster possible - rather than the $120 you spent on an 8-slot, temperature-aware model.

If you're claiming < $10k and you can live with receiving less back, you may be better off doing it on your own. If you're claiming much more, a (proper, non-scammy) insurance agent is going to multiply your return by an unimaginable amount. The majority of people are getting back less than 50% of their potential insurance payout. It can be worth paying an insurance agent $2000 to get back $30k instead of $10k.

Source: not an insurance agent or anything related; just remembering a Reddit thread where multiple people shared the gap between what they assumed they were eligible for, vs. what an agent squeezed out for them. Normal people don't know how to describe their possessions in proper detail. A decent insurance agent will ensure that what is being replaced is of equivalent value, rather than a bunch of the cheapest generic products.

comment 9y ago · link · parent

Regarding your analysis as to the actual usefulness of this spec - or lack thereof - I agree. There's not much substance or detail; the result seems like the bullet points of an initial PowerPoint presentation for such a concept, rather than the final output of a panel attempting to create a proposal meant to be seriously considered and adopted.

As for the rest of your comment... are you really a "working professional in this field"? By that I'm asking whether you are self-employed and playing fast and loose according to your own rules, or if you instead have an established career within the industry for which your professional peers stand beside your methods? I have to believe that honest professionals with a shred of reputability in this field would not be advocating that playing nice, so to speak, is some altruistic gift on the part of the researcher. "Security Researchers", quoted to loosely include "rogue" grey and black hats who think they have free reign to hack in any way they see fit, have gone to jail for what you appear to be claiming is a risk-free "right". It's not black and white, and the courts seem to favour whichever side suits their fancy in each individual case.

It really bothers me to see anyone suggest that any public port on a machine is 100% free reign to abuse. If public-facing access is all it takes to be free game, then I must be morally and legally in the right to pick the door locks of private citizens and businesses, or peel off the face of any ATM in an effort to "gauge its security". The loophole excuse is that the Computer Fraud and Abuse Act, in theory, only covers computer owned by the government and financial institutions. When all moral obligations are ignored, and skirting around lacklustre laws is the only defence, the intentions of some "researchers" quickly become questionable.

Your stance on the subject is probably fairly common in terms of what people want to be labelled as fair game, while in the real world researchers have to dial back a bit and play nice in order to maintain an ounce of respect in the field.

comment 9y ago · link · parent

>> I'd be in favor of a maximum number of tweets per day, too.

A while back, I spent a few days hashing out a concept for a social network that would impose posting limits. The initial obvious approach is a single post per 24 hours, to really make each person think about whether hitting send is worth it. However, I cast this aside as being too restrictive.

Introducing the concept of categories: you can post once per 24 hours, but per user-defined category, up to some maximum category limit per account. You could post once about your cooking hobby, once about your programming hobby/career, once about the news, etc. Your followers could subscribe or unsubscribe to your individual categories; someone can opt to see your cooking and news posts, but ignore your posts about programming.

The concept starts to collapse at the "policing" stage. People would cheat by using all of their categories to spam a single topic, or to bypass followers' unsubscribing from a topic they just must be heard on. This necessitates a moderation system whereby followers could vote on posts, or report those which are miscategorized. With such a system in place, the possibility exists to increase the limit to 2-3 posts per day in categories for which someone receives overwhelmingly positive (or nonnegative) feedback. Dealing with users' and bots' vote manipulation is of course a never-ending battle.

The concept completely disintegrates when you consider who, as a publisher of content, would choose such a platform. A lot of people love sharing their every thought, meal, personality test, quiz, BuzzFeed article, etc. Such people would never opt in to a platform that limits their ability to do so - and why should they? Companies, celebrities, and other popular figures rightfully depend on being able to communicate whenever it suits them, so this concept is utterly useless to them.

Thus the market is tiny, to the point of being non-existent, for limiting the publishing side of the equation. This pushes the entire problem to the side of the readers/followers. We as consumers really just want to be able to intricately tailor what we see. I'm hoping we will soon have AI that can appropriately categorize posts, so I can filter out every single post having to do with personality tests and quizzes, BuzzFeed-like links, anything and everything having to do with US politics (I'm not American), animal abuse (I'm really tired of "save the animals"), and the constant stream of photos from new parents parading their children. I stopped using FaceBook entirely because their filtering options are just not adequate. Nor do I expect FaceBook to ever offer such filtering, as it would nullify all the mindless drivel that keeps their users engaged with their platform.

Lastly, I considered a monetization strategy whereby a user could pay (heavily) to post above their allocated limit. It sounds useful if you imagine people using it very rarely to push out that one extra gem that surely all followers would love to see. Of course, "pay to play" has no place in a social network designed to reduce the number of posts, and I couldn't come up with a solution to have my cake and eat it too. A "pay per post" strategy would be the foundation of a standalone concept - one for which no market exists.

tldr; A social network that limits publishers' ability to maximize engagement will never gain traction. What we need, as consumers of social networking, is the ability to perform advanced categorization and filtering of existing content. Don't get your hopes up - FaceBook and Twitter will never allow us to skip straight to the "good stuff", as viewing only a dozen posts a day would decimate their engagement stats, including ad views.

comment 9y ago · link · parent

The point I was making is that nobody uses XHTML thanks to the browser vendors' refusal to accommodate it early on when the demand was rampant. By the time the comparison was html5 vs. XHTML2 instead of HTML 4 vs XHTML1, it was too late as we had been trained to ignore the XHTML variant due to the vendors' absolute refusal to even make XHTML1 work. If you know of a single major site (not somebody's little side project) that uses the XHTML mime type, please share so I can be amazed.

The fact that the html5 spec does not permit self-closing CDATA elements is precisely the kind of legacy trash we'll be dealing with for yet another 10-30 years. (I understand that html5 didn't change the parsing rules from HTML 4 in order to be backwards-compatible, but it's still infuriating).

comment 9y ago · link · parent

XHTML was not "dead on arrival"; that is some seriously fabricated FUD. XHTML came at a time when it was entirely positioned to take over as the proper way of doing things. It had its own mime type to differentiate itself from HTML, in order to allow older content to continue to be served as soup during a deprecation phase. The demand for this strictly validatable syntax was incredible; it was absolutely in a place where it should (not could) have become the new standard.

It wasn't us web developers who rejected the call to action. We were begging the other vendors to add support for the XHTML mime type. I spent two years of my career preparing for the transition that never came. We were at the point where we served a different mime type depending on the requesting user agent, having refactored everything to return perfectly compliant XHTML responses. That is how seriously the industry anticipated the changeover.

It was the browser vendors who turned a blind eye. The childish browser wars, throughout which each company refused to cooperate with the competition out of self-interest to hoard the market, mutilated the web. Had the vendors all agreed to support XHTML within a span of 6 months, today we would have 100% well-formed XHTML. Instead, browsers still parse meaning out of LITERAL GARBAGE. HTML soup is so pathetic that there are no words to describe it.

Please show me a programming or scripting language that allows you to write code with syntax errors, whereby the compiler or interpreter never throws an error, instead taking a best guess stab at what you meant to code. It doesn't exist, because... SURPRISE - the level of absurdity required to permit such a thing is unfathomable. And yet that is exactly what we have with html5.

Aside: what the actual fuck is up with CDATA elements still being required to be CDATA. The fact you have to write <script src="/main.js"></script> instead of <script src="/main.js"/> is the only thing someone needs to know in order to understand the disgusting origins of the "modern" web.

comment 9y ago · link · parent

The idea sounds nice in theory, but the only reason any administration would implement this would be to remove anonymity from the internet. Your ability to recover accounts would just be a side effect of the system designed to allow the government to track everything you do.

comment 9y ago · link · parent

The entire point of security questions is that their answers are supposed to be things that are permanently stored in your memory, that you are physically incapable of forgetting because they are so ingrained. If you store these in a password manager, it is possible to lose them - and that is unacceptable.

These are supposed to be the very last line of defense for security, including if lose your password manager. As an exaggerated analogy, imagine that being unable to answer these questions meant your house, car, and life savings are taken from you. That is how important these answers are, except you're "only" losing one online account at a time.

Of course, it's terrible to use personal information that can be known to 3rd parties. It's also bad to reuse the same answers across multiple companies, as a compromise at one means you're at risk everywhere. The reason behind why security questions exist is a good one, but they don't offer enough security when used as intended (memorable, non-random data). The problem is there is currently no better alternative, short of requiring you to tie your legal identity to every account, and having to show up in person with photo ID to regain control of an account you've lost access to.

Anything relying on tech (like a password manager) is a bad idea for the general public. The average person does not have multiple off-site backups to guarantee that the information is physically impossible to lose.

comment 9y ago · link · parent

I hope that guy is showing that off as satire to show just how ridiculous the iPhone X's design really is, rather than providing a real-world solution.

The concept of a truly full-screen device is what everyone is waiting for. That's the future. Until the engineering manages to reach that point, Apple should have restrained themselves from releasing this kind of unpolished product. Sometimes, when you can only get to 80% of what you're aiming for, it's better to put the project on the back burner until you can reach the 100%. The iPhone X looks like an unfinished prototype, not the result of professionals who understand that sometimes you need to take a step back.

comment 9y ago · link · parent

> ICU Collation Support

This tiny little mention is a massive win! We now have access to the "und-x-icu" collation. As the postgres docs[1] put it: "ICU root collation. Use this to get a reasonable language-agnostic sort order."

I've been waiting on this forever. Columns containing strings from any/all languages can now be sorted well enough to use postgres in truly multi-language applications. If your application has users writing in English, German, Russian, Japanese, et al, using the "und-x-icu" collation should make your application much more user-friendly (as opposed to using the en_US or C locale).

The ICU root collation is far from a perfect system, but it's the best option available today. I've been tied to MySQL purely for its similarly-purposed utf8mb4_unicode_ci collation. Now I can give postgres another very serious look.

[1] https://www.postgresql.org/docs/10/static/collation.html

comment 9y ago · link · parent

I keep getting this inaccurate answer of "they're just grapheme code points - you can't do it". That is why my example specifically used the .utf8 view. It's already possible to do exactly what I'm talking about, but it takes 4 complex lines of code, needing two calls to index() with startIndex/endIndex references and offsetBy arguments.

The existing solution to this problem already uses integers (the offsetBy arguments)! I'm not talking about refactoring the String type, or breaking backwards compatibility. There would be no change in how the underlying String storage or access works. It's about adding a level of (zero overhead!) abstraction to simplify a common, basic operation.

Every other language I've ever touched has easy to use substrings. It makes absolutely no sense that Swift requires assigning throwaway constants to represent the start and end indexes for a simple substring extraction. There's this level of superiority regarding the purity and correctness of Swift's String type that clouds developers' ability to see that there is no limitation to doing this. It blows my mind that the most modern major language is this clunky.

comment 9y ago · link · parent

>> support for creating, using and managing substrings

Can I finally extract a substring from the middle of a string using integer offsets, in one line? Something like string.utf8.substr(3, 5)?

Or does it still take an absolutely insane and unacceptable 4 lines of code with throwaway temp variables to track the start and end indexes? The inability to do basic string manipulations is a major turnoff, to the point it makes the entire language look like a bad joke.

comment 9y ago · link · parent

Turning off Wifi is not something anyone - whether average or intermediate user - should be needing to do on a frequent basis. Airplane mode already takes care of the primary use case, namely disabling all radios. Someone intending to disable Wifi "temporarily" and then forgetting to re-enable it may wind up paying hundreds of dollars for cellular data. That goes against the "it just works" mentality, which is "Wifi automatically wherever possible. ALWAYS. Cellular as last resort only."

Privacy is less of a concern on iOS; the MAC address is rotated frequently specifically to prevent passive tracking. The battery savings are going to be minimal; with Apple's history with these kinds of optimizations, you'd probably save as much battery by reducing screen brightness by only 5%.

tldr; There's no real reason outside of developer testing to ever disable Wifi. Users who care should not mind the extra tap. And frankly, most who are obsessively toggling their Wifi are probably not receiving the benefits they believe.

comment 9y ago · link · parent

>> disable the feature before going through customs

I keep seeing people mention locking the phone before going through customs. This accomplishes nothing. If they ask for your device, you are required to unlock it. If you refuse to unlock, best case scenario means you turn around and go home. Worst case scenario, you are detained as a criminal. If your plan is to fight back and not allow the agents access to your phone, you won't be making it across the border. Bringing the device with you means you must be willing to unlock without causing a fuss. The only way to "win" is to not bring the device.

comment 9y ago · link · parent

Never expect Apple to ship anything recent. Anything outside of their own "core system" that depends on 3rd party packages is likely to be 2, 3, 8 years out of date. Software like brew and macports aren't only popular for "extra" software; they're popular for replacing bundled software that is severely out-of-date. Last time I started from scratch, that included updating git and php from versions so old that it was laughable. Let us be thankful that these alternatives exist.

comment 9y ago · link · parent

You always have the password as backup to unlock. If your appearance were to suddenly change remarkably, such as via plastic surgery or a horrific accident, you would set your new face after unlocking with the password.

Based on their phrasing, I'm assuming the "adaptive" aspect means that slow changes, such as gaining or losing weight, will progressively train the existing face - without it ever failing to recognize you because you passed some weight threshold. Same would go for growing a mustache or beard. As to whether you can shave off a 5-year beard and have it still recognize you without manual intervention, that would depend on how much the algorithm cares about your chin and lip regions vs. the rest of your face. Based on the demo, the hair on top of your head is 100% ignored.

comment 9y ago · link · parent

Do you know how the signing requirements work on GitHub when accepting a pull request on a repo requiring signed commits, when the pull request is from a fork where someone is not signing their commits? Must the commit to the fork be signed in order for the pull request to be merged, or is it possible for the main repo to merge an unsigned commit while signing it themselves in the process?

I can see requiring every commit on the primary repo to be signed, but it's a larger nightmare to accept pull requests from forks if they are also forced to sign their commits.

comment 9y ago · link · parent

What's so innovative about the screen? All the components at the top of the phone are still present in a blocked out section. It's not like they figured out how to conceal those components beneath the screen, which is what we're truly waiting for. Until the front of the phone is 100% screen space (perhaps minus a very thin bezel), it's certainly not worth the hype.

Edit: I went back and looked at the latest leaked photos. It's better than I remember. The phone looks decent enough when the screen is off, but very gimmicky when the screen is lit. It looks like they went as far as they could, realized they couldn't deliver any better, and so left that top section of the phone in what is essentially an unfinished state. I suspect the innovation I'm holding out for will happen by iPhone 10 or 11.

comment 9y ago · link · parent

For a company (and its customers) that rave about the design and look of the phone itself, covering it all with a case seems like the exact opposite of what one would expect to be the norm.
1
678
27