HNHacker News
TopNewBestAskShowJobs

shangxiao

694 karma · joined June 17, 2013

submissionscomments
shangxiao··on Over 20 designers have copied my website and I don't mind
Sure you could, if the code is complex enough you would hide dead code acting as a signature, which would be somewhat analogous to mapmakers inserting false towns in their maps [1]

[1] https://en.wikipedia.org/wiki/Trap_street

shangxiao··on Millennium Falcon's SFX Demonstrated by Sound Designer Ben Burtt (1980) [video]
I was watching "Five Easy Pieces" the other day and instantly recognised the sound effect for the garbage compactor from episode IV. In this particular film it was the sound of the oil pump equipment in one of the scenes at the oil field!
shangxiao··on We Can't Trust Uber
lol when will people learn not to drink & make stupid jokes in public ;)
shangxiao··on We Can't Trust Uber
> Moreover, would a taxi company be held responsible for a driver raping a passenger?

Yes! If not legally responsible, at the very least they are socially & morally responsible.

shangxiao··on Some REST best practices
I've actually seen people use versioning in their URLs for deprecated APIs only, with the current version not using a version number.
shangxiao··on Some REST best practices
Chances are you're (well at least with me) going to do filtering anyway so /artist/8/albums becomes redundant ;)
shangxiao··on Some REST best practices
In this case I would either make albums a field of artist, or just leave it off altogether and just filter /albums based on the artist foreign key.
shangxiao··on Some REST best practices
Query parameters on the collection. Dealing with ranges is always a tricky one though and I've seen different REST libraries use different querying.
shangxiao··on Some REST best practices
> use nested routing for a cleaner design

I think this is actually quite debatable and I've seen a lot of people argue that nested resources are an anti-pattern. I only ever use nested resources myself when the child resource is existentially dependent on the parent.

shangxiao··on Firefox Developer Edition
Did you analyse it with Firefox Developer Edition?
shangxiao··on Firefox Developer Edition
I hope your laptop smells nice.

I'm sure you meant sniffing your network traffic?

Edit: Oh man I think I've hung out with the Python crowd for too long I think their rancor is starting to rub off on me ;)

shangxiao··on Computer Scientists Ask Supreme Court to Rule APIs Can’t Be Copyrighted
I thought developers over the age of 35 were taken out the back and shot, how did you escape??

Just curious as I turn 35 in a couple of years...

Edit: to the person who downvoted this, it's a joke in case you didn't notice

shangxiao··on Ask HN: Maybe found huge security problem, unsure what to do
What would happen if sah88 were to realise the site's name, but not the details, to warn other people to also not trust this company. Is this grounds for defamation or something like that?
shangxiao··on Ask HN: Maybe found huge security problem, unsure what to do
A couple of years ago in Australia a security consultant noticed that firststatesuper.com.au had a gaping security hole in that he could manually change an ID in the URL and gain access to other users' account information.

He kindly notified First State like any good samaritan, and so what do First State do in return? Disable his account, report the "offence" to the police, demand that their IT dept examine his computer, demanded that he sign a letter to admit liability and threaten to pursue any costs related to the matter.

Luckily the Police had more common sense, realised what had actually happened and decided not to take any action.

Reference: http://www.theage.com.au/technology/security/super-bad-first...

shangxiao··on Another Unsolicited HN Redesign
Heuristics basically means “best practices,”

heuristic: (adjective) using experience to learn and improve

shangxiao··on Modeling Data in MongoDB vs. ArangoDB
Can you explain how this is astro-turfing?
shangxiao··on Modeling Data in MongoDB vs. ArangoDB
I like this project and am keeping an eye on it, but tbh that answer doesn't really answer the question in a way that seems objective. It just says it's a "general purpose database offering all the features you typically need for modern web applications".
shangxiao··on Hobby kernel and userspace, built mostly from scratch
Writing OS's is hard and there are no shortcuts. You should take a look at microkernels and the work Andrew Tanenbaum did with Minix 3 [1] and his modular design as this is the sort of direction you're probably looking for with customisable OS's.

[1] https://www.youtube.com/watch?v=bx3KuE7UjGA

shangxiao··on Fooled by Your Own Brain
There are a few important concepts here which can help UI designers create better UX. It's always good to be able to back good design up with proven science. Eg I always tell people that animations are more than just eye candy, they attract the brains attention and elevate the element's importance in the UI. Now I can append "prevents change blindness" to that argument.

Facial recognition is also an interesting one that we tend to amuse ourselves with: https://twitter.com/faceinthings

shangxiao··on Stop Using Constructors in JS (2012)
Well there you go, interesting. The "see who wrote the comment" comment was unnecessary though as it's pretty obvious.
shangxiao··on Making a brain for my model plane
Awesome.

Is this sort of thing usually done with RC planes? I've been watching a few RC plane videos lately - there seem to be a lot of pilots out there who could benefit from electronics to help land their planes - especially those who've spent a ton of money on really nice setups like this guy: [1]

[1] http://youtu.be/nQJ3TzSZkpo

shangxiao··on Rails JS frameworks: Ember.js vs. AngularJS
I do this as well albeit with Django as my backend.

Grunt has a few plugins that help you manage this as well. If you're using CoffeeScript and/or SASS then I highly recommend grunt-connect-proxy - it's trivial to set up and works like a charm. It's also really useful to stub out HTTP calls by setting up your grunt-connect middleware to deliberately return certain responses.

shangxiao··on Stop Using Constructors in JS (2012)
I don't think Netscape demanded a "java-like" language.
shangxiao··on Stop Using Constructors in JS (2012)
Perhaps he should've taken the "Constructors considered harmful" approach?
shangxiao··on Stop Using Constructors in JS (2012)
Awesome, bookmarked like it's 1999.

Seriously though the snippet for the forgetting-new protection in a constructor seems quite handy. It's always good to hear arguments from both sides of the fence.

shangxiao··on Principles of Rich Web Applications
Furthermore, pushing most of the UI layer to the client reduces server load and results in a more horizontally scalable solution.
shangxiao··on Reverse OCR
I'm also intrigued by the cat vs human face recognition results!
shangxiao··on Reverse OCR
This is pretty cool, although it makes me wonder what the real world applications could be. It does, at the very least, tantalise my curiosity and gets me thinking.
shangxiao··on C4 – C in 4 functions
Of course this occurred to me, my comment was more of an emotional response to "complaints that it's unreadable are unfounded".

If quite a few people are saying that it's unreadable, you don't just dismiss them as making "unfounded" statements.

> The demoscene doesn't exist because of a bunch of programmers trying to make the lives of every other programmer more difficult, it exists because people like the challenge.

I'm pretty sure that this doesn't need to be stated.

shangxiao··on C4 – C in 4 functions
Breaking up code is more than just removing redundancy - it's about exactly what you have written: "Encouraging looking at each piece independently". That actually has advantages, the main being that it is easy to understand how each piece operates independently of the other pieces - simply cohesion & coupling which is applicable to any language, not just "Java". I don't believe in my experience that I miss "seeing the forest for the trees" - I encourage you to try it, perhaps by learning some functional programming.

There is one obsession that I am tired of is people posting "X awesome thing in 120 lines of JavaScript" or "Y in 4 functions". Just because the problem is reduced to small as possible metric, it doesn't make it good.

PS: Also you mention negatively connotated terms like "OOP", "Java", "thick layers of abstraction" and "deep chains of function calls" as if you've ascertained that I'm some enterprise developer that doesn't have any C experience and wouldn't know simplicity if it bit me in the ass.

← PreviousPage 4 of 9Next →