Better HN
topnewbestaskshowjobs
Log inSign up

developer2

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

Submissions

comment 9y ago · link · parent

If you know of a solution, please share. As far as I know, it is not possible to do multi-language unicode sorting in postgres. The idea being you have a utf8 column with some rows having English, while others have German, Chinese, Japanese, etc. Or an individual column containing mixed language, such as English and Chinese in a single string. And of course, the real deal - a consistent sort for all unicode points, including emotes and other non-language code points. In postgres you're stuck with a single-language collation such as en_US.utf8 - there's no multi-purpose "utf8" collation.

comment 9y ago · link · parent

For me this is the last major "missing piece" for postgres. MySQL's utf8mb4_unicode_ci makes it possible to order results containing a mix of any languages. With postgres you are forced to pick a single language. It's impossible to use postgres for a truly multi-language application, where you are presenting data in (for example) English, German and Chinese on the same UI.

Yes, MySQL's ordering of languages within unicode may be arbitrary, not necessarily very meaningful, and in some cases even "wrong" - but at least you can do it, and the results are consistent and usable. Postgres is outright unusable in this scenario.

comment 9y ago · link · parent

This is one of the many reasons I prefer postgres, but it's worth noting that even in postgres, there are some DDL statements that cannot be executed within a transaction. I can't remember the list, but they do exist - it's just a far smaller number compared to MySQL.

comment 9y ago · link · parent

The primary reason to print a pdf would be to do so to any random 3rd party page. Sadly, you have no control over how 3rd party sites render/load their content. And --print-to-pdf likely captures the render of the page at some predetermined point, my guess being the "onload" event. Which, again, is not going to result in a fully rendered page for many sites that load in their primary content using AJAX.

comment 9y ago · link · parent

"Could you possibly..." or "Is there any way..." is precisely the right phrasing. And again, the tone used makes or breaks the deal. Furthermore, explicitly quoting the online price is the wrong approach. Ask if there's any way to get $X (online price minus $20-30/night), without explicitly mentioning that you're comparing to the online price. Don't shove the online price in their face (ie: demanding they meet or beat, which is aggressive posturing). Only refer explicitly to the online price if you can't seem to charm them without doing so.

The long and short of it: you're trying to win over another human being to be on your side. You don't demand that a company or "lowly employee" meet your expectations. Tact for the win!

comment 9y ago · link · parent

To this day I'm absolutely flabbergasted that XHTML didn't win out. Well-formed XML documents, rather than a best-guess soup of broken HTML, was perfect. Absolutely perfect. I sat on the edge of my seat for 2-3 years waiting for the XHTML MIME type, with clients performing strict parsing, to become the new norm. It never happened. It's extremely sad if you think about it - we couldn't handle a world where developers had to conform to a very simple level of strictness. Imagine any backend language (C, Java, PHP, etc.) allowing you to get away with vomiting up garbage code with syntax errors, and having the compiler or interpreter best-guessing your program's logic. It's unfathomable! And yet, that is exactly what we have with HTML(5). Mind-boggling, to say the least.

Related aside: to this day, we still cannot write <script src="/main.js"/>. We must use <script src="/main.js"></script>. All because of a multi-decade old description of a CDATA element. Sigh.

comment 9y ago · link · parent

Bang on. Across the globe, citizens of every other nation cannot fathom why the US prioritizes military spending above all else. It just doesn't make sense.

comment 9y ago · link · parent

If you're only booking a hotel, rather than picking a travel vacation package, you're better off calling the hotel directly to make a reservation. The reservation staff almost always have sole discretion to negotiate prices within limits. If you are polite, and have checked for the best price you can find online, they will often match or beat that price. The trick is truly the politeness factor - "I SEE IT ONLINE FOR $50 LESS ONLINE, YOU HAVE TO MAKE IT CHEAPER!!!" will get you absolutely nowhere. They have discretion to negotiate, but are not required to do so. They deal with enough rude people on a daily basis that the moment you are abrasive, you can expect the wiggle room to vanish.

comment 9y ago · link · parent

The industry for developers in Montreal is large; it's nigh impossible to find oneself unemployed. However, the number of "big name" companies is quite small. MindGeek (owner of PornHub) is one, Google has an office, and the game studios are the only ones I can think of off the top of my head. So while the industry is large, most of it is small private businesses you've never heard of.

The explanation as to why Montreal is a fairly busy tech hub likely has to do with salaries here vs. the expectation for equivalent talent in the US. Most companies here are actually American companies, and the only reason their offices are located here is because even senior developers tend to earn < $85k/year CAD, with $60-70k being more common. That's $48k to $70k/year USD vs. the $100-200k+ USD they'd have to pay within the US. Government incentives (looking at you, SR&ED) reimburse these companies a significant portion of developers' salaries, making it even cheaper. Canada is, for many American businesses, essentially a step above outsourcing to India.

comment 9y ago · link · parent

Any idea when exactly the PDF capture is performed? So many pages now render a minimal initial load, while the actual content is greatly delayed (usually < 100ms, but sometimes 3+ seconds) due to being loaded from one or more AJAX sources.

Capturing the PDF at even the onload event (let alone the useless DOMContentLoaded event) is going to capture an incomplete picture in a huge number of situations. Frankly, a PDF capture at onload event is going to be utterly unusable. Is there a way to set a delay before capturing, ie: 10 seconds?

In an ideal world, a true "finished loading" event would trigger only after all DOMContentLoaded and onload handlers are executed, only once any AJAX requests launched by such handlers are completed (including requests fired off in their handlers, recursively). Of course, websockets and long polling ajax would still interfere with detecting a true "finished" event, but it'd be better than setting an artificially large delay of 10+ seconds.

comment 9y ago · link · parent

You analysis is on point. The comments on Reddit in particular were so far off base. On one hand you had people raving about how this needed to be patented and produced for sale - those people are (perhaps optimistically) out of touch with reality. On the other hand were people laughing in his face for how ridiculous this was to produce as a project, because it's obviously not marketable ("I am so smart").

It goes to show how the average person thinks - everything has to be about the ability to make money, right? Why should anybody do ANYTHING if it's not aimed at directly producing income? So few people remotely understood that this has NOTHING to do with the final product and its (non-)place in the world. This is about learning a lot about every step, from concept and design to an extremely complex production process, of a single interesting idea. No, it's not about patenting. No, it's not about mass-producing in China to get-rich-quick. No, it's not about showing off "an amazing 23rd century Apple product", which it is clearly not.

Reading deep into the comments about his resulting product made me even more cynical about the average population. People just don't get it. The overall assumption is he's trying to invent the latest thing to sell people. The only reason to do anything in life must be backed by capitalist ambition! It is an idea, brought to fruition by one man's amazing ability to dedicate himself to learning - and performing - the entire process. IT HAS NOTHING TO DO WITH YOUR OWN SKEWED INTERPRETATION OF HIS SUPPOSED INTENTIONS.

tldr; People's obsession with capitalism seeps into everything they come across. You can't share the result of your labour without people only being able to see the possibilities from a capitalist point of view. Everything is viewed from a capitalist (if not, then political) standpoint; anything else is apparently unfathomable.

tldr #2; I am envious of this product's creator. I wish I had even 5% of the creator's vision, ingenuity, ambition, or skill - let alone all four of those attributes.

comment 9y ago · link · parent

To put it bluntly: fuck the living. It's impossible to please every living relative and close friend.

The solution with Facebook is simple: if you don't want to have a deceased person showing up on your feed, unfriend them and add them to your block list. Assuming Facebook is well-designed, blocking someone should prevent them from ever showing up in your feed, even if others are tagging them in photos or posting to their wall. As for your being aware that "the profile is still there and other people are interacting with it", get over it. It's not your place to dictate how others should deal with the death. You have the choice to not look; so don't look if you don't want to. Lack of self-control to not check back every month to see what other people are doing is not a valid reason to nuke the profile from orbit.

Speaking to the internet at large: the only way to mandate how companies must respond to news of a death would require tying every single page load on the internet to an official government ID. Nobody wants to provide their government ID to ThePirateBay and PornHub just so that their entire online identity can uniformly vanish upon death.

How many people burn their photo albums when a loved one dies, in order to remove all traces of that person? Nobody. Why should the digital equivalent be any different? More simply, why should an online presence be terminated? Just... "why?". I suspect every attempted answer to that question is born of self-centred excuses that have no merit; ie: based on "I" or "me" - "I don't want to be reminded", "It pains me to see", etc.

tldr; The whole think stinks of "Won't somebody think of the children?!", but instead it's "Won't somebody think of me me me me me?!". The level of absurdity seems equivalent to me.

comment 9y ago · link · parent

Saying that Walmart has "notoriously bad margins" makes it sound like they're working at a disadvantage. Walmart's margins aren't low out of necessity. Their entire business is purposely built around low margins, and refusing to hire full time employees with benefits, etc. It's intentional on their part - there is no sob story about margins there.

Same goes for Amazon et al. The business strategy is to crush every small retailer by operating at slim to no margins, purely to make it impossible for anyone else to compete.

comment 9y ago · link · parent

Regarding iOS and macOS kits, all of the documentation is in Objective-C. The libraries' Obj-C is imported and usable with Swift-only code, but the Swift documentation lazily links you to examples in the Obj-C docs. You have to perform trial-and-error by manually converting the Obj-C examples into the equivalent Swift (which often entails renamed classes, methods, types, etc.).

If your projects typically do a lot of string parsing, get ready for a world of hell. Swift 4 didn't improve upon the very basic ability to extract a substring from the middle of a string. It takes 3-4 lines of code, with throwaway explicitly defined variables, to do the equivalent of a str.substr(start, end|length). It boggles the mind that you can't do a str.utf8.substr(3, 5) in Swift.

comment 9y ago · link · parent

Their _entire_ comment is sarcastic. Even "Try to limit all discussions at the desk area to 5 people or less" - all it takes is 2 people talking to ruin the environment for everyone else. Scratch that, it takes 1 person - someone on the phone.

comment 9y ago · link · parent

Is a bloom filter worth it in this case? With the optimal "k" hash functions of 10 and a "p" error rate of 0.001% (false positives of approximately 1 in 1000), a bloom filter for the 306,259,512 items will take 538 MB. Increasing the error rate to 0.01% (1 in 100) is still 358 MB. That's a sizeable filter to maintain in memory (then again... RAM is cheap).

I'd probably just shove the passwords into a database, limiting the index prefix to the first X characters to reduce index size.

comment 9y ago · link · parent

>> Who was his lawyer? When did his lawyer arrive?

Personally, this is the part that really scares me. The majority of us Canadians do not have personal lawyers. If this happened to me, I'd be stuck trying to find a lawyer for the first time. I'm sure the thugs entering my home would seize my computers and phone immediately, and refuse to allow me to use them to look up and contact a lawyer. Due to the seizure, I'd be unable to find representation. What do you do at that point?

comment 9y ago · link · parent

Privacy is a huge concern. It's difficult to phrase this properly without sounding like an asshole, but Discord's development team has a lot of very young people (no proof, but I'd swear some of them are 13-16 years old). If you've ever listened in on their Discord voice channels, the level of immaturity is astounding. Power to them - it's great to see talented youth create a great product. I just wouldn't trust them with a business's confidential information.

Discord's specifics aside, it blows my mind that people use any off-site SAAS for internal communications, including Slack. The database set contains so much critical information, including infrastructure passwords, private SSL and SSH certs, etc. Employees will send anything and everything over the company's chat client. Even if you trust the company's employees and general security, the fact remains that your uploaded attachments typically have a public URL not requiring authentication to download.

comment 9y ago · link · parent

Most do not, and even Google doesn't. I just verified on my account. You only need to provide your password to access account settings. Completely stripping all two-factor authentication requires no additional 2FA code.

comment 9y ago · link · parent

>> The only real defense is to glance at the url bar every time you're about to enter your password

With Google specifically, the worst part is you really do have to look at the URL every single time you go to enter your password. And by that I mean that if you land on the login page, verify the URL, enter your password, submit, and get the error page saying you got the password wrong... you must check the URL again before re-entering your password.

Why? Because Google's login, by design - and repeatedly defended by them as being "acceptable" - allows redirecting off Google's properties after login. So hackers send you to the real Google login page, with a post-login redirect to a fake but perfect copy of the "wrong password, try again" page, where they then capture the passwords of people who mindlessly re-enter their password without double checking the URL a second time.

Most importantly, 2FA does not help you here. You'll enter a currently valid 2FA code on the hacker's site, and they will immediately use that code to actually log in to your account. Before you realize what is happening, you are already locked out of your account - new password, 2FA stripped or replaced, security questions changed, and all pre-existing sessions/devices wiped.

comment 9y ago · link · parent

It's perhaps unfortunate, but such a library does indeed become very popular for the very reason that it is open source and free. I haven't used this, but if I ever needed in-browser CSV parsing, I'd use it. Were it not free, I'd find an alternative or roll my own library with the bare minimum functionality needed for my project. Paying for anything related to CSV just doesn't "compute", for lack of a better phrasing.

This applies to things like date pickers and html5 charts as well. While these could be separated into a separate category based on the fact that their markets are oversaturated, the result is the same: why pay when there are perfectly usable options that are free, or can be done in-house on the cheap if necessary?

comment 9y ago · link · parent

I'm not certain of their use of the word "webview", nor exactly how multiple rendering windows work in Electron. In theory it should work the same as multiple tabs in a single Chromium instance. In any case, the Slack app is very heavy. You should be able to manage all your teams in one tab with a single instance of the app rather than a separate tab with the entire single-page app having to be loaded over and over again.

comment 9y ago · link · parent

Slack currently uses a separate webview for each team you're signed in to[1]. They're apparently working to optimize the app for those running multiple teams. People like to hate on Electron, but in this case Slack's implementation of multiple teams deserves more blame than the underlying stack.

[1] https://slack.engineering/reducing-slacks-memory-footprint-4...

Quotes:

>> This memory footprint increases as the user signs into more teams, as each team runs in its own webview.

>> Each of these teams is running the full JavaScript web application and maintaining and updating the DOM tree as the state of the team changes.

>> Work is underway to fix the underlying factors affecting client memory consumption

>> Exploring running all teams in a shared context to eliminate the overhead of one webview per team.

comment 9y ago · link · parent

Small private company, nobody's ever heard of it. There are a lot of shady ones out there.

comment 9y ago · link · parent

One reason: you'd be surprised how many companies allow entering the hash as an alternative password to login to customers' accounts in production. Lazy method for customer support teams who don't have support tools to access customer information. Also frequently done to allow developers to debug problems on a customer's account when a bug cannot be reproduced elsewhere.

If such a company's database of hashed passwords is leaked, then an attacker doesn't even have to crack the hashes - the hash itself is a valid version of the password. Yet I've seen this behavior at multiple companies; only one of them pushed back against my request to remove that "feature", and I didn't stay with them much longer after that.

comment 9y ago · link · parent

>> This removes one of the major reasons to use a Mac for Linux development

If I wanted Ubuntu, I would have it on my MacBook (dual boot or replacement). I don't want Ubuntu. I want OS X. Apple hardware is great for development, but the real reason I am here is for the operating system and software. So no, Windows+Ubuntu does nothing to replace a MacBook or iMac with OS X.

comment 9y ago · link · parent

As the visualization doesn't let you zoom in to check the precise path, I found a tool[1] where you pick the eclipse from a dropdown, give it your latitude/longitude, and it calculates partial and totality information. Helped me to confirm that I'll be having 100% totality in 2024.

[1] http://xjubier.free.fr/en/site_pages/SolarEclipseCalc_Diagra...

comment 9y ago · link · parent

Amazon goes to the extent to fully explain in the very first two sentences: "Serverless computing allows you to build and run applications and services without thinking about servers. With serverless computing, your application still runs on servers, but all the server management is done by AWS."

"Serverless" had no previous meaning - it's not like Amazon bastardized an existing term. The word will ultimately be defined once people expect it to mean something specific. Personally I like Amazon's use of the term here.

A recent similar example: the word "performant". The number of stubborn people who screamed "performant isn't a word!" was ridiculous. Everyone understands the intention behind the word "performant" without needing to have it explained to them. The introduction and wide adoption of a word is exactly how new words are folded into language. Language is fluid! Language has never been static and inflexible, and pouting because we have extended the dictionary over and over again for thousands of years is frivolous.

1
789
27