HNHacker News
TopNewBestAskShowJobs

Xurinos

1,510 karma · joined February 23, 2010

Admin for the Dark Mists MUD at http://www.darkmists.org (telnet to port 2222)
submissionscomments
Xurinos··on Humans hot, sweaty, natural-born runners
Yet our bodies have excellent self-repairing facilities (as always, supported by appropriate diet, sleep, yada yada).
Xurinos··on Kim Dotcom: The US Government is Wrong, Here’s Why
Guilty until proven innocent? Surely it is not unreasonable that if found guilty, the criminal would be required to produce that money or work to pay off debts.
Xurinos··on Haskell as fast as C: working at a high altitude for low level performance
This just isn't true. C is not portable assembler. It was never intended to be. I hear it claimed, and it is wrong every time somebody calls C a low-level language close to assembler. You can make some roughly reasonable assumptions about what comes out of the compiler, but often it is not what you think it is.

Let's challenge this specific claim, that when you do "if (foo == bar)" -- I corrected the syntax error, which is a symptom of C's high-level syntax and not of the underlying assembly code -- you compare one value to another and then jump. For this challenge,I will write some trivial code that we should be able to make easy assumptions about, and I will compile it with debugging enabled so that I can dump the results with gdb.

  $ gcc -g example.c

  1       #include <stdio.h>
  2
  3       int main() {
  4          int foo = 10;
  5          int bar = 20;
  6          if (foo == bar) {
  7             printf("Fun\n");
  8          }
  9          return 0;
  10      }

  Dump of assembler code for function main:
  0x0000000100000ef8 <main+0>:    push   rbp
  0x0000000100000ef9 <main+1>:    mov    rbp,rsp
  0x0000000100000efc <main+4>:    sub    rsp,0x10
  0x0000000100000f00 <main+8>:    mov    DWORD PTR [rbp-0x4],0xa
  0x0000000100000f07 <main+15>:   mov    DWORD PTR [rbp-0x8],0x14
  0x0000000100000f0e <main+22>:   mov    eax,DWORD PTR [rbp-0x4]
  0x0000000100000f11 <main+25>:   cmp    eax,DWORD PTR [rbp-0x8]
  0x0000000100000f14 <main+28>:   jne    0x100000f22 <main+42>
  0x0000000100000f16 <main+30>:   lea    rdi,[rip+0x19]        # 0x100000f36
  0x0000000100000f1d <main+37>:   call   0x100000f30 <dyld_stub_puts>
  0x0000000100000f22 <main+42>:   mov    eax,0x0
  0x0000000100000f27 <main+47>:   leave  
  0x0000000100000f28 <main+48>:   ret    

We see that in the very basic version of this code with absolutely no optimizations and doing the silliest things that we can, we store our two values into some memory locations, perform a comparison (cmp), and jump if not equal. We can see that the jump leads us to the puts() call.

Now, let's get smarter. The variables foo and bar do not change value, and we only work with two variables in the routine. Therefore, we could optimize by storing those values in temporary registers instead of using expensive memory transfers. Further,since our two constants are being compared and will always return a false, we actually have a section of code -- the printf -- that is dead code, that can be completely removed from final compilation. Well, that's simple, and everyone who uses C in production at least turns on some minor optimization:

  $ gcc -g -O1 example.c  # the only difference is the -O1

  Dump of assembler code for function main:
  0x0000000100000f34 <main+0>:    push   rbp
  0x0000000100000f35 <main+1>:    mov    rbp,rsp
  0x0000000100000f38 <main+4>:    mov    eax,0x0
  0x0000000100000f3d <main+9>:    leave  
  0x0000000100000f3e <main+10>:   ret    

This does not look like our C code at all! And thankfully so! What a waste of space and CPU time it would have been had we treated C like an interpreted language! C is a high-level language with numerous compiler implementations that can intelligently convert the human-readable code into the binary code that represents the real situation behind the code.

The point here is that you are not properly guessing the assembler code that will be produced. The compiler is doing a better job of that; that is the compiler's job. As a programmer, you can just focus on the algorithm. C is not an assembler macro language. For that, you would use things like "gas".

Xurinos··on No way I am calling you for a price
I skip by any site that does not mention a price, but the one thing they could do to get my interest is to at least mention a price range and what goes into the calculation of the lower and upper prices. Ballpark figures are nice, and some small description of the rationale helps me to make a decision, even if it is to make a call to drill down further.
Xurinos··on The myth of the eight-hour sleep
There is only one study in this article, and it involves how a group of people adapted to a 14-hour sleep pattern. Other than that, there are no studies of importance here, nothing that confirms concretely that this kind of segmented sleep is effective for humans. It is based on historical hearsay but cannot make a prescriptive judgment. The evidence purely anecdotal. Please be careful in reading things like this that you do not immediately form a blind belief or justification.
Xurinos··on Preprocessor magic: Default Arguments in C
I think it is inconsistent with the idea of allowing the instantiation of classes with default constructors, classes whose member variables may be given default values by the constructors.
Xurinos··on Megaupload: A Lot Less Guilty Than You Think
I realize that you can lose your business if your equipment is confiscated and so forth, but isn't this akin to a temporary injunction? These stop a suspected-within-reason on-going crime and do not require a full trial to be placed. I don't know how long a temporary injunction lasts or what is considered reasonable, but every time I see the argument about shutting down the business, I am reminded of the temporary remedy. Perhaps it is abused in this case. IANAL and have little idea of what I am talking about, so please correct me on the legality here if you know better.
Xurinos··on Sal Khan explains SOPA / PIPA
It looks like the wording of this clause has people in conflict about its meaning. Isn't that enough to suggest that it is poorly written and can result in some judge's interpretation in the wrong direction expanding the law's power?
Xurinos··on Maddox - I hope SOPA passes
Wait... why can't we make Internet communication a talking point? The tech community has been wrestling with censorship, net neutrality, and the like for a long time now. Can't we frame this into a simple, non-extremist message and start asking candidates about their stance on it? It is a talking point, and if we are persistent in asking these candidates their stance on the issue, it will end up on the evening news. But first we have to form a consistent and clear stance.
Xurinos··on Why I Won't Hire You
This is what I fear. I fear that some hiring manager is going to make a career choice for me. I chose to interview with his company for a specific position, my choice of career path.
Xurinos··on I Think You're Fat (2007)
> Keeping silent is a form of a white lie.

I grant that people may believe this, but I disagree that it is true. If you ask me now my social security number, and I silently refuse to answer, or I ignore you, am I a liar? Of course not. I am not submitting a "white lie"; I am saying nothing.

If my silence is crafted to deceive you, that is another story entirely. There is a difference between "silence intended to deceive" and "silence intended to not answer". Usually there are other cues to aid in the deception, too, such that the response is not entirely silent (wagging eyebrows or whatever).

Xurinos··on Salman Khan of Khan Academy AMA on reddit
Strange. I see your post is from 10 mins ago, but many of his responses are much older than that. His name is highlighted in blue and has a green leaf next to it.
Xurinos··on I Think You're Fat (2007)
I have not told a lie in roughly ten years -- although something bugs me about that statement, rankles me deeply, so I suspect I may have said something wrong at some point. I do, however, keep a lot of things to myself. I can speak truthfully without injecting lies, and I keep silent when it is obvious the truth (as I see it) is unhelpful or causes trouble. I will occasionally dodge a question, too, in order to keep conversation flow moving; it is another form of keeping silent, although some will consider that that is a kind of lie (probably because they feel entitled to an answer). I am also apt to answer the question that somebody really meant to ask rather than the easy surface question ("Do you have spare change?" == "Do you have spare change that you are willing to give me?" ==> "No.").

How does that affect my relationship with my wife? We both have been able to be very honest with each other, and we have a relationship built strongly on trust and honesty. I hope I never break that because it would be a betrayal. It is really about the tone used to express the thought if the thought is important enough to express in the first place.

I despise the whole concept of "white lies". I despise people who dare to manipulate me, to condescendingly see after my own good or feelings by bald-face lying to me about something. Be honest or say nothing, but do not dare tell me excuses that are obvious lies, "socially acceptable". According to whom? Where do you draw the line between "white" and "black" lies? I do find it insulting, and I often do not mind calling people out on it; sure, things get uncomfortable, but they are the ones spouting deceit.

Perhaps it boils down to the notion that what somebody expresses is a measure of their integrity and honor. Somewhere I read a quote along the lines of... You can judge a man by two things: what he wants and what he is willing to do to get it.

Xurinos··on Lisp is Too Powerful
I see it as a reminder that one still needs to worry about deployment because of OS version limitations, lack of upgrades, etc.
Xurinos··on Lisp is Too Powerful
Yet I have had trouble with having the "right version of Java runtime" installed in order to run programs, especially on Mac OS X where you sometimes cannot upgrade Java without upgrading the OS. I think there is still an installation/compatibility issue to consider. No free lunch.
Xurinos··on Go Daddy No Longer Supports SOPA
You meant jointly.
Xurinos··on Concurrency in Go (or, Erlang done right)
That's weird. I am not logged into anything related to Google, but I can read the document at this link.
Xurinos··on Poll: Do you use an adblocker?
I agree. And so when I go to a website that I trust, I enable its JavaScript. NoScript makes it easy to enable JavaScript from specific places and permanently ban scripts from other places. I prefer having the whitelist approach so that I can avoid accidents, such as clicking the wrong result from a search. I do have to occasionally play guessing games when I am on certain sites and want to enable media served by multiple other places.

With this policy, I have an awesome track record on my systems with regards to the number of "problems" that have installed themselves on my computer (number = zero, and I do not have AV installed, though I like to temporarily install several AVs and sanity check once every couple years or so; their overhead, constant updates, etc, just are not worth my time).

Xurinos··on Poll: Do you use an adblocker?
AdBlock + NoScript. The web has been much more tolerable for a long time, thanks to these, and it is always amazing how much noise is on the page when I navigate with an alternate browser.
Xurinos··on Ask HN: What functional programming language should I start with?
Erlang. It is a reasonable stepping stone towards Haskell and will introduce you to some new concepts and syntax. It is also a simple language. Then tackle Haskell, which will build upon what you learned in Erlang.
Xurinos··on Carrier IQ references discovered in Apple's iOS
Update: I checked my systems today and could not get it to reproduce. I do not know if that gives Google Chrome a clean bill of health, but I have no more evidence of a phone home.
Xurinos··on Carrier IQ references discovered in Apple's iOS
This is partially true.

At one point I was trying to figure out how much I would enjoy Chrome, and one test I do with my applications is to have tcpdump in the background running while I run them. Whenever I went to any site, internal, external, or whatever, Chrome phones home to specific google sites. I think the published reason has to do with faster DNS lookups, but when I looked the sites up, they seemed attached to ad-related services. I searched around and could not find any setting to disable this feature. No, "Preferences > Under the Hood > Privacy" has nothing for disabling this feature. I think this phoning home was still there for Incognito mode, but time has left my memory fuzzy on that detail; Incognito mode is useless if you want to actually use cookies to maintain some session anyway, and why should I tell google about what accounts I hold across the net?

For the wiseguy who picks up on that last comment, my preference is Firefox with NoScript, AdBlock, and a disinclination for downloading sex.exe, so no, the common tracking systems do not know much about me. However, my ISP is quite familiar with my habits.

Someone recommended to me Chromium, claiming that it was stripped of this nonsense. So I tried that. Chromium did not phone home in my tests. It also lacked a few nice features that Chrome had, as if it were at least a version behind; I cannot remember what they were, only that at that point, I was sick of the hassle and ditched both pieces of software.

If you are concerned about apps phoning home, just run tcpdump/wireshark/whatever and watch. The extra paranoid will route their connections through a box with these tools.

My tests were within two months ago, so I feel the claim is pretty relevant.

Xurinos··on Confident Code
Thank you for the note. There is a large difference between slides used in a presentation and slides intended to be read like a book. With the former, it is pretty useless to have the slides out of context. With the latter, there is no need for the author to speak. Fortunately, someone posted a video to the presentation, a better link than the initial submission's (http://confreaks.net/videos/614-cascadiaruby2011-confident-c...).
Xurinos··on Announcing The jQuery Standards Team
My first thought about a jQuery standards team was that they would rate plugins on "adheres to jQuery interface standard". Too many times I grab some contributor's plugin for adding behavior to primitives, only to find out that they taint the namespace unnecessarily or depart from jQuery's query-and-return model and require invasive workarounds to conform. jQuery is really flexible; many "plugins" are not.
Xurinos··on SICP in Python
Every time I hear from someone that scheme has no real world applications, I like to pass them this link: http://philosecurity.org/2009/01/12/interview-with-an-adware...
Xurinos··on On cryptography and dogmas
If those become common enough, then you have reduced your symbols from 50 (your first example) to 11 (your second) where five ("in the and in the") are typical joining words. We can imagine password crackers can just combine the words in the dictionary just like they currently combine letters and give a higher priority to looking for combinations of conjunctions. The random letters make these approaches a lot more difficult.
Xurinos··on List.js
In some agreement... According to an article on "color for developers" that was posted at some point on HN, one gets a better "pop" contrast if there is a smidgeon of color. As I read it, using white or black, regardless of the other color involved in the combo, is less effective. One should strive instead to add at least a little bit of color and contrast that color with the other. For example, if you toss a tiny bit of blue into your black, then you should toss a tiny bit of yellow/orange into your white. The contrast is not in symmetric values either; R, G, and B have different contributions to the brightness.

If I have the time to dig up the article I am thinking about, I will add it to this post.

(Here is the HN thread on the contrastrebellion site: http://news.ycombinator.com/item?id=2807047)

Xurinos··on Signs that you are a bad programmer
In fairness, "so much" fits the "weasel words" category (https://en.wikipedia.org/wiki/Weasel_word). You and jrockway placed different values on the phrase because it is a "numerically vague expression". I admit to making similar expressions. :)
Xurinos··on Macros in Perl6
The argument on the delayed execution issue is that you could just wrap crazily-expensive-computation() in a lambda/sub that is executed conditionally.
Xurinos··on Macros in Perl6
I like your proposal, especially if it could be expanded a bit:

  macro do_in_reverse($value, @code) ...
← PreviousPage 3 of 16Next →