HNHacker News
TopNewBestAskShowJobs

shangxiao

694 karma · joined June 17, 2013

submissionscomments
shangxiao··on C4 – C in 4 functions
It is unreadable. Lumping code together into big functions just so you can say "Look I've created a compiler in 4 functions" is pointless, unless your goal is to post it to HN to show everyone how clever you are.

This is not how you code when you work in a team or when you know some other poor soul has to come along and maintain it.

I suggest you take a look at [1] then go and read this excellent book by Martin Fowler: "Refactoring: Improving the Design of Existing Code" [2]

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

[2] http://www.goodreads.com/book/show/44936.Refactoring

shangxiao··on The hammer-feather drop in the world’s biggest vacuum chamber [video]
I would've also had a silly grin on my face due to the epiphany I would've experienced.
shangxiao··on The hammer-feather drop in the world’s biggest vacuum chamber [video]
I actually like the slow-mo as it reaffirms the fact that there is no air in that chamber.

When the feathers first drop you see a slight sway in the feathers, but only due to the acceleration. It's actually quite a sight to see feathers accelerate so quickly and stay so still.

shangxiao··on The hammer-feather drop in the world’s biggest vacuum chamber [video]
"Violently impatient" - I must remember to use that one myself
shangxiao··on 2D gaming using Processing.js
Well actually it does. Every time you do an someArray.push(val), that's "object oriented as a style of writing code".

If you're referring to the style in the article (ie the Java code), well that's classical object oriented.

shangxiao··on Immutable JavaScript data structures, backwards-compatible with arrays, objects
Good timing. I was thinking about taking a look at immutable.js after the HN post a couple of days ago [1] and now I have an alternative to compare it with.

[1] https://news.ycombinator.com/item?id=8541496

shangxiao··on 2D gaming using Processing.js
Better not define any functions or arrays then, they're objects and that would be "gross"
shangxiao··on The First Browser Dedicated to Developers Is Coming
It's pretty much text out of the article shoved into a video with some random background images & graphics accompanied by some epic LoTR music.
shangxiao··on FreeBSD turns 21
It pays to check validity of such claims before you announce them to the world... You (tachion) wouldn't want to be accused of being Americentric now would you? ;)
shangxiao··on Cantonese Proverbs in One Picture
Those sound clips are killing the page load...

Aside from that this is quite good. I feel like some of these proverbs could be quoted here on HN comment threads.

shangxiao··on Countries are still paying off debt from World War 1
Technicalities about "helping" start either war aside (I'll let someone else more knowledgable in this area argue that), yes I do feel sorry for them, it's just basic human empathy.
shangxiao··on Friends Don't Let Friends Clap on One and Three: A Backbeat Clapping Study
Touché!
shangxiao··on Please remove mitsuhiko/*
They are all valid points, if you don't like it, argue against it, don't get snarky.

Edit: Yes thanks for that downvote, encouraging people to have an intelligent conversation through constructive arguments rather than making pointless remarks seems to be frowned upon by some people

shangxiao··on Please remove mitsuhiko/*
I wanted to tell these guys that they remind me of the infuriating Comcast guy who refused to disconnect the customer's account, until I saw that somebody else felt the same way and had already told them.
shangxiao··on Friends Don't Let Friends Clap on One and Three: A Backbeat Clapping Study
Nitpick: The slide author correctly spells "zwei" but deliberately misspells "schwartz" and "vier".
shangxiao··on Hungary Internet tax cancelled after mass protests
It's actually both - surveillance and we will have to pay for it
shangxiao··on Hungary Internet tax cancelled after mass protests
An internet tax? That sounds like something that the Australian government would conjure up [1].

[1] http://www.smh.com.au/federal-politics/political-news/secret...

shangxiao··on Why I can't have conversations using Twitter
It's really unfortunate though there there are people who can't resist the urge to shame others and enlighten the world with their sharp & intelligent wit, such as the person who wrote:

"You have clearly not understood how the math works or why tail latencies matter in dist sys. I think we're done here."

Was the bluntness really necessary?

shangxiao··on Why I can't have conversations using Twitter
And hilarious - try imagining @antirez explaining average vs 99th percentile to someone on the street as he drives by while keeping a straight face ;)
shangxiao··on Mistakes AngularJS Developers Make
I actually close my file browser "side bar" in Sublime and just open files with the "Goto" command (⌘ P). With strict naming conventions I find this to be quicker than navigating a file browser.
shangxiao··on OnionTip – Donate to volunteers who are running Tor relays
From my understanding the rewards aren't that big, even with large tips like the 10 BTC one. It's probably more of an acknowledgement thing.
shangxiao··on OnionTip – Donate to volunteers who are running Tor relays
A couple of days ago a colleague received $4 AUD tip share due to a large tip which he thought might've been the 10 BTC tip: https://twitter.com/BitcoinNews3/status/516097500755668992
shangxiao··on Declassified photos from Tinian Island as the B-29 “Enola Gay” was being loaded
> "Immediately, all eight scientists in the room felt a wave of heat accompanied by a blue glow as the plutonium sphere vomited an invisible burst of gamma and neutron radiation into the room. As the lab's Geiger counter clicked hysterically, Louis used his bare hand to push the upper plutonium hemisphere off and onto the floor, which terminated the supercritical reaction moments after it began."

Nit pick: What you have described is the incorrect version in the movie "Fat Man and Little Boy". It was a knee-jerk reaction that stopped the supercritical reaction, and it was the beryllium outer sphere which was dropped, not the plutonium core.

Slotin was holding the top half of the beryllium sphere with his thumb which he immediately lifted up due to the intense heat.

shangxiao··on Declassified photos from Tinian Island as the B-29 “Enola Gay” was being loaded
People are probably already scanning it ;)
shangxiao··on The shockingly obsolete code of bash
If only it was on GitHub or Bitbucket ;)
shangxiao··on The shockingly obsolete code of bash
What do you suggest the alternative should be to make bugs inherently easier to find?
shangxiao··on Everything you need to know about the Shellshock Bash bug
This is actually quite common and acceptable if you want to interact with a piece of software for which there is no library or api. One real world example is producing thumbnails from Word documents using Libre Office.
shangxiao··on Everything you need to know about the Shellshock Bash bug
A CGI script may not be PHP - it could actually just be a bash script, perl, whatever.
shangxiao··on Everything you need to know about the Shellshock Bash bug
And functions with malicious shell script appended at that! ;)
shangxiao··on Everything you need to know about the Shellshock Bash bug
How can a bug be evil? Don't attach morals to things which should be amoral.
← PreviousPage 5 of 9Next →