HNHacker News
TopNewBestAskShowJobs

danpat

599 karma · joined February 25, 2011

contact me at danpat@danpat.net

[ my public key: https://keybase.io/danpat; my proof: https://keybase.io/danpat/sigs/s-kP3xrOGFw_4IURoo3qLHJOo0fWeJVMnGiU6vsgzpM ]

submissionscomments
danpat··on DeepOSM: Detect roads and features in imagery with neural nets using OpenStreetMap
I'm paid to work on OSRM.

Obviously the data is imperfect, and there are lots of edge cases (https://github.com/Project-OSRM/osrm-backend/issues/2145). But overall, it works pretty well. There are regional disagreements about the highway hierarchy (primary/secondary/tertiary/etc), but as long as the structure is locally consistent, you generally get the routing results you expect (routes tend to major arteries, etc).

ETA calculation is a bit hit-and-miss, but the only way to correct this is to use real-world measurements.

The great thing is that if you find something weird, you can just fix it. This happens overwhelmingly more often that people deliberately introducing errors.

danpat··on Clang vs. GCC – code coverage checking
Run your test suite, look at the code coverage report, find out which bits of your code doesn't get exercised by the test suite, become aware that changes in those bits of your code probably won't trigger any failing tests if they introduce breakage.
danpat··on Google Fiber Phone
https://en.wikipedia.org/wiki/Wideband_audio

and more specific to cellular phones:

https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_Wideband

Search for "HD Voice" from the big cellular companies in the US. It usually requires handset support.

danpat··on More Details on the Insidious iOS Snap-To-Road “Feature”
"Map matching" is the term used in most literature for this function.

https://en.wikipedia.org/wiki/Map_matching

danpat··on Google is Forcing Routebuilder to Shut Down
There's also: Project OSRM: https://www.project-osrm.org/

and GraphHopper https://graphhopper.com/

And for the UI, you can use https://github.com/perliedman/leaflet-routing-machine

all of which you can self-host using OpenstreetMap data.

danpat··on The tale of the Snowflake Man
If anyone else likes snowflakes like I do, I highly recommend this poster of some of Bentley's images:

  http://vermontsnowflakes.com/poster2.shtml
It shows the different snowflake structures against a temperature scale. It's a great gift for anyone that likes winter.

Part art, part science :-)

danpat··on Mysterious Detour While Driving? It Could Be Due to the Curvature of the Earth
I work on vehicle routing. I've seen mysterious detours that ended up being cause by using an imprecise segment length equation.

Because the earth isn't a sphere, the common length-on-a-sphere great circle distance equation isn't perfect for the earth. However, it's a lot faster to calculate than the haversine length, which takes into account the squashed sphere that we live on.

We were calculating driving routes at high latitudes. The difference in the length calculation meant that east-west road lengths were being calculated as slightly longer than they really were.

Amortized across a long-distance route, this led to the mysterious tendency of the shortest-path algorithm to prefer north-south oriented roads a lot more often than you'd expect.

While we knew we were using the less precise great-circle distance, the deviation is not all that big, so we didn't really expect the difference to manifest in the output.

Those were some mysterious detours.

danpat··on P vs. NP: An Assumption That Runs the Internet
There are a few ways to ask the TSP question. One question is "give me the shortest route geometry", this problem is NP-hard and can't be verified easily, this is what you're thinking of. However, the decision version of the problem is usually phrased "Is there a tour of less than length L", and this is NP-Complete - takes a while to find the tour, but it's trivial to check if it's less than length L.
danpat··on Ledger, a command-line accounting system
I wrote a small, single-script clone in Python:

https://github.com/danpat/uledger

I wanted to be able to group all my assertions together. This means the assertion needs to be able to retroactively calculate the balance on a given date. ledger-cli's assert doesn't support this. hledger does, but, well, I'm not a Haskell guy and the whole Haskell ecosystem seemed...cumbersome...to install.

uledger supports a useful-to-me subset of ledger-cli, primarily nested accounts, multiple currencies and out-of-order assertions and transaction entry. It has a bunch of tests and a very simple web balance interface. My favourite feature is the accounting-equation balance feature:

    2015-01-01 Opening Balance
            Equity:Owners Contributions   $-100
            Assets:Bank                   $100
    2015-01-01 Buying widgets
            Liabilities:Credit Card       $-50
            Expenses:Parts
    2015-01-03 Some Income
            Income:Consulting             $-200
            Assets:Bank                   $200

    assert balance 2015-01-02 Expenses  $50
    assert equation 2015-01-04 Assets - Liabilities = Equity + Income - Expenses
Feedback/patches welcome.
danpat··on Map style changes on OpenStreetMap.org
Check out http://project-osrm.org/ for routing.

Disclosure: I work for Mapbox, we offer a directions service based on OSRM, I'm paid to work on it daily.

danpat··on How World's Largest Legal Ivory Market Fuels Demand for Illegal Ivory
This is an unfortunate truth.

I suddenly found myself finding big-game hunting a whole lot less morally repugnant when I realized that the big money that goes into it is very much used to keep many species alive. Operators of paid hunting areas have a very strongly vested interest in keeping their revenue stream going, and thus, in keeping viable populations around.

I am not pro-hunting by any means, but given a world where wildlife is hopelessly outmatched by man for resource competition, the only way to keep endangered species populated is to harness some aspect of humanity to fight for their preservation in ways that matter. Paid big-game hunting and animal cultivation is an effective way to do that and should be done more.

The conflict between man and wildlife is one-sided enough that blanket "protection" is not sufficient to save many animal populations. They need active cultivation and encouragement if they're not to be wiped out through attrition (via illegal poaching, loss of habitat, etc). Simply making it more illegal isn't going to prevent that.

danpat··on OSM: Mapping Power to the People?
We do too. The to-fix tool that we use tends to focus on things we can identify algorithmically, like broken links, isolated lines, mis-spellings, etc. We encourage all our staff to get out and map locally, and some have been highly involved in local GIS communities for years.
danpat··on OSM: Mapping Power to the People?
I work for Mapbox. We have some teams dedicated to improving OSM. A lot of our product stack is built on the OSM data set, so we have a vested interest in improving it wherever we can. We do a whole bunch of analysis to try to identify areas with errors and shortcomings.

We built and use this tool:

    http://osmlab.github.io/to-fix/
to queue up stuff that needs fixing, and we have people churning through it all the time.

There are some really cool things in mapping tech. For example, Strava has made available a whole dump of point data that can be used to look for un-labelled trails and roads (see the "Strava" layer in to-fix).

danpat··on What Is Code?
Taken to the extreme, could you not consider raising a child the ultimate programming exercise for humans?

Perhaps the "right-brained" are already very good at programming other people, working with faulty, non-deterministic, somewhat chaotic computing environments where "left-brained" patterns of software development fall short....

danpat··on Self-Driving Trucks Are Going to Hit Us Like a Human-Driven Truck
There are techniques for reducing the effects of active sensor interference, for example:

http://www.cs.cmu.edu/~motionplanning/papers/sbp_papers/inte...

As long as the usable sensor density is higher than how tightly we can pack these vehicles, then we're probably OK.

danpat··on To Raise Productivity, Let More Employees Work from Home (2014)
https://github.com/lukasz-madon/awesome-remote-job

Many coding jobs, but a lot of other stuff too.

There are several job boards dedicated to remote-only work listed on that page.

danpat··on Ask HN: Companies still allowing Java on the Desktop?
If the app would otherwise make sense to be web facing, one option that I've seen work quite well is to develop the "app" as a local, packaged web stack. Users point the browser at "http://localhost:10000/"

This has the advantage of removing the native UI toolkit question. This might make it easier to develop a native executable that's easy to package and distribute.

danpat··on Ask HN: Canadian junior dev wanting to move to the US. need Visa advice
You need a new TN visa if you change jobs. You can do it by mail, or by leaving/re-entering.

It's up to the border officer to decide whether you meet the critera or not. They're not experts in any particular field, so generally, they look to make sure that all the right keywords are hit in the job application and your qualifications.

Contacting USCIS will generally only get you generic advice. An immigration lawyer, while not necessary to do the paperwork (it's pretty easy) should be able to give you a reasonable opinion as to whether you'd be successful or not. They're the only people that deal with this often enough to have a feel for when an application might be successful or not.

Do some google searching on "TN visa" and "web developer", there are lots of stories out there that should give you a feel for what's involved.

danpat··on Ask HN: Canadian junior dev wanting to move to the US. need Visa advice
As a Canadian, the TN visa is by far the easiest get. If you qualify, you just get it at the border when you enter. You typically need a job offer, be qualified for the job, and the job needs to be on this list:

http://www.nafsa.org/_/file/_/amresource/8cfr2146.htm

The TN visa has the advantage that the company doesn't need to do anything really, just make sure the job description ticks all the boxes for the immigration officers at the border. Other visa classes are more complex and costly (H1-B) and usually have the same kind of qualification requirements.

"Computer Systems Analyst" is the usual job title for programming jobs, you will need either a degree, or some post-secondary school training + 3 years experience. You can probably word your degrees + training to satisfy the education requirement.

The steps to get this visa are outlined here:

http://travel.state.gov/content/visas/english/employment/naf...

danpat··on Ask HN: Who is hiring? (April 2015)
> How will this be enforced?

Probably through penalties listed in the contract, or simply suing for breach of contract.

While many US states allow at-will agreements that allow either party to depart at any time for any reason without penalty, as far as I know, you're not required to be employed at-will if both parties agree to the terms of the contract.

While it's a somewhat special case, I know the US federal government often employs people with though-shalt-not-break-without-penalty contracts. Examples are military service, and many of the higher-education loan-forgiveness programmes.

danpat··on Firefox 37 Release Notes
Related:

https://careers.mozilla.org/en-US/position/oXqA0fwH

danpat··on Ask HN: Remote/rural USA high-speed Internet options?
Can you define "lots"? I realize it'll be situation specific, but if we're at 10-ish miles on dirt road from the nearest town, are we talking 1k, 10k or 100k+?
danpat··on Ask HN: Remote/rural USA high-speed Internet options?
It'll be high-alpine Colorado somewhere, so lots of hills in the way, lots of snow in the winter (snowmobile access only), well water and solar/generator power. I figured anything wired would be out, as we're looking at at least 10 miles from the nearest major road.

I already do pretty well with low bandwidth (thank-you DVCS and virtualization), but telemedicine might be out for the missus.

danpat··on Living Without a Cellphone
The trick is to ask for a tablet SIM or mobile internet SIM for a laptop. Don't say it's for your phone.
danpat··on Living Without a Cellphone
I cut costs way down by getting a "data-only" SIM for my iPhone and using a VOIP provider.

Call quality in poor signal (e.g. 2G) areas is terrible, but in urban areas with HSPA or LTE, it works great. I talk very little.

Look for the "flex-rate" plans that Rogers/Telus/etc offer. I sometimes pay as little as $5/mo if I don't use my phone, it scales with data usage.

danpat··on Why Our Children Don't Think There Are Moral Facts
Does it go from objectively bad to objectively good if you feel differently about it on different days?
danpat··on The adventures of Norway's most radical billionaire
The telemark turn is more stable than other methods, particularly in soft snow, when your boots aren't attached at the back, which is necessary for efficient movement on flat and uphill areas. The introduction of lifts opened up exploration of specialized equipment just for descending, leading to the fixed alpine boot and popularity of the parallel turn.
danpat··on The new MacBook
All connections arc as they come apart, it's just that the arc size is a function of the dielectric medium (air?), potential difference (voltage) and current. You design for "number of disconnects" and choose materials and power design so that the connector will survive as long as specified.

Apple MagSafe connectors are on the same voltage (20V) as these new Type C connectors, although Type C seems rated for a higher current (5A).

Looking at the pinout, the GND and VBUS are a bit longer, so will disconnect last upon removal. This may be to allow for the voltage to be dropped in anticipation of a disconnect, but you'd need enough intelligence at the power supply end to notice that. Lowering the voltage prior to disconnect would reduce the arc size.

danpat··on For Tens of Millions, Obamacare Is Working
I'm a new immigrant, I expected it to be like buying car insurance, which seems relatively sane and competitive in comparison. A system like that would sort of make sense.

But it's nothing like that. What the hell are open enrolment periods for? I get a 300 page contract, how the hell am I supposed to read and properly comprehend that in the 10 days allotted before committing to paying $$$/month for at least a year?

Having lived in single-payer countries for most of my life, it's definitely a step backwards for me, both cost wise, and "how much I have to think about it" wise. The intellectual capital drain due to the complexity of the system here cannot be insignificant.

> You can always count on Americans to do the right thing - after they've tried everything else. - Winston Churchill

danpat··on Radio Shack lost its way when it ditched its hobbyist customers
Radio Shack definitely missed the niche that Sparkfun/Adafruit and others have filled.

However, I suspect that niche is nowhere near big enough to support Radio Shack's size. All those retail outlets can't be cheap to run. They needed a business/market that was easy to transition to and would support their existing size. They chose wrong, but I don't think ditching the hobby market was necessarily a wrong move in their position. Once the improved experience of ordering hobby electronics online became more widely available, "storefront supply of hobby electronics" was not a business model that could ever support a massive chain of retail stores.

← PreviousPage 3 of 7Next →