Can (a ==1 && a== 2 && a==3) ever evaluate to true? - <AUTHOR> https://stackoverflow.com/questions/48270127 <comment><USER2> This is also possible under c, assuming a is declared volatile, or if the compile chooses not to optimize out the always false statement and tests a 3 times in sequence.

</comment><comment><USER3> > Is it ever possible that (a ==1 && a== 2 && a==3) could evaluate to true, in > JavaScript?

| Ummm...hmm... no...?

> Wrong. Nothing is impossible. Next question. You are unable to use > JSON.parse(JSON.stringify(x)), how do you clone x?

| Hmm, I'm actually not sure... its certainly possible...

> Appreciate your honesty, the correct answer is: you don't. Thank you for > your time, we'll be in touch.

</comment><comment><USER4> It sounds like the interviewer did this person a favor. It's a clever trick, and I've abused toString and toJSON for plenty, but if this is a "major tech company", do you really think it's a great workplace if they think being able to read incomprehensible code, and instead of fixing said code, they use it as a filter?

I doubt they have that code in production, but even then, devs that are enamored with hacks like this and knowing pedantic answers to trick questions, chances are, their coding style will reflect just how "clever" they think they are.

</comment><comment><USER5> As long as we're writing bad code, here's my stab at the code golf version:

      i=0,a={valueOf:_=>++i}

\- Omitting the variable statements in non-strict mode creates global (function scoped) variables

\- The comma operator evaluates its operands left to right and returns the rightmost operand, the result of which is irrelevant in this case

\- The arrow function allows us to omit parenthesis around the function parameters, so any single character variable name works (in this case _)

\- The arrow function syntax also allows us to omit the curly braces, and will automatically return the body of the function.

\- Automatic Semicolon Injection allows us to omit the trailing ;

</comment><comment><USER6>
      This is the TXR Lisp interactive listener of TXR 188.
      Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet.
      1> (defstruct incster nil
           (val 0)
           (:method equal (me) (inc me.val)))
      #<struct-type incster>
      2> (let ((a (new incster)))
           (and (equal a 1) (equal a 2) (equal a 3)))
      t

:)

Equality substitution: [http://www.nongnu.org/txr/txr- manpage.html#N-00790C76](http://www.nongnu.org/txr/txr- manpage.html#N-00790C76)

</comment><comment><USER7> In a C macro this is a classic problem - if 'a' is an argument to a macro, and 'i++' is provided to the macro, and 'i' had the value of 1, then this could evaluate to true.

<comment><USER8> Or you could just trigger undefined behaviour, in which case it _might_ evaluate to true.

</comment></comment><comment><USER9> It's a debug related question because it tests whether you realise "a" can be a getter. For the rest this line of code is so hideous, although it is accepted by the interpreter, it is in every aspect totally wrong to do such thing in your codebase.

This is a typical example of what is wrong and annoying with job interview questions. In a way it doesn't really matter if the line could possibly evaluate to true, it shouldn't be written in the first place. What in the world tells your NO answer about your skill to do the job you are applying for? That you're not smart enough? Come on, I'd be really pissed off with shit like this.

<comment><USER10> You might have bugs in the real world that are caused by language features or idiosyncrasies that are visible in this artificial, small (thus more easily understood) toy example.

I often find these toy examples or trick questions (also in the context of C++ inheritance, for example) very instructive.

</comment></comment><comment><USER11> I was thinking something like

        Number.prototype.toString = () => '';

        let a = '';

Although I always forget which side gets coerced (this would assume the right- hand side does). I like the side-effect approach, though — seems more nuanced and probably what they were looking for.

</comment><comment><USER12> This is what I came up with:

      var i = 0;
      window.__defineGetter__("a", function() { i++; return i; });
      if(a === 1 && a === 2 && a === 3) {
        "Wtf";
      }

<comment><USER13> Also works with valueOf:

        let i = 0, a = {valueOf: () => ++i};
        if (a == 1 && a == 2 && a == 3) {
            console.log("all equal");
        }

Object.defineProperty (modern version of __define[GS]etter__):

        let i = 0;
        Object.defineProperty(self, "a", {get: () => ++i});
        if (a == 1 && a == 2 && a == 3) {
            console.log("all equal");
        }

<comment><USER12> Mix it with a pseudo-random number-generator for extra fun.

      var i = 0;
      window.__defineSetter__("x", function(value) { i = value; });

      window.__defineGetter__("x", function() {
        // LCG, a = 4, c = 1, m = 9;
        i = (4 * i + 1) % 9;
        return i;
      });

      x = 3;
      if(x === 4 && x === 8 && x === 6) {
        "wtf!";
      }

</comment></comment></comment><comment><USER14> Some of the answers depend on tricks with Unicode strings and I have encountered bugs where a bad cut-and-paste via chat program led to a character substitution that was not apparent to the human eye but led to a subtle misbehaviour.

</comment><comment> d--b The fact that you can bend javascript to make it do this is not particularly remarkable.

The fact that there are 5 or 6 completely different ways to accomplish this is boggling!

</comment><comment><USER15> Question about the first answer, is there anywhere in the spec that demands this behavior? If the JS interpreter silently 'optimized' the branch into

        var a_ = a.toString();
        if (a_ === "1" && a_ === "2" && a_ === "3") {
            ...

or really just

        if(false) {
            ...

would it be in violation?

<comment><USER16> I believe so, if 'a' resolves to a getter. To optimize, it would have to prove that 'a' is a locally bound variable with no escapes or else no functions are called in the comparison.

See [https://v8project.blogspot.com/2017/09/disabling-escape- anal...](https://v8project.blogspot.com/2017/09/disabling-escape- analysis.html) for a related bug.

</comment></comment><comment><USER17> Open your browser console and find an input that works:

       function test (a) {
         try {
           return !!(typeof a === 'undefined' && a(1) && a[2])
         } catch (e) {
           return false
         }
       }

It is possible to get it to return true.

<comment><USER18> I've found a solution which I presume is the one you have in mind, though it's worth noting that it doesn't work in Firefox at the moment.

Feel free to add a link with your answer later on, just in case you came up with something different.

</comment></comment><comment><USER19> I really wanted to comment suggesting something like this, although I don't know how to do it in any language...

Everyone suggested methods of changing the value of 'a', but what if the == operator is changed to something that returns true for these comparisons?

<comment><USER20> This is possible in many languages, but not in JavaScript, because it does not support operator overloading.

</comment></comment><comment><USER21> Wooo that is dirty.

In general, I'm not sure how to feel: 75% not ok, and 25% ok with this type of question? As much as I despise these types of interview questions and this type of interviewing process, reading about them after the fact is always enlightening.

<comment><USER22> It's a pretty ridiculous interview question, but a really nice example to highlight part of the internals of the ECMAScript language specification. It's great to ask in a teaching environment, but insane to ask as a test of competency (unless the job required truly deep knowledge of the language specification).

</comment></comment><comment><USER23> Yes if a represents a function that is testing a call condition like isNumber or is less than 4

</comment><comment><USER24> i first thought about a is a volatile (in C/C++) and external clock is incrementing A just right or easily you pass some PC (program counter) as reference to fn(int &a); protoyped function

</comment><comment><USER25> This is an interview question? Any company willing to use a language with such little reasoning ability is not one I would ever want to work at. Especially a company that would use any bizarre features that would enable this.

</comment><comment><USER26> spoiler: yes in js it can

now that you know the answer try to come up with a solution.

</comment><comment><USER27> Is there any way this could work with === ?

<comment><AUTHOR> Yes, one answer on SO showed a possibility. The first getter overwrites a with a getter giving 2, then this second getter overwrites a with a getter giving 3. Crazy.

</comment></comment><comment><USER28> Anyone who does something like this in production code ... shouldn't be writing production code...

<comment><USER22> The problem is that production code never looks like the toy problem you can reduce it to. Someone could write the exact same thing but make it look reasonable, or even "a sweet hack", using an object property getter instead of a function to move something along in a finite state machine:

      if (state.step == DFA.INITIALIZED && state.step == DFA.RUNNING) {
        ...
      }

<comment><USER29> In this case they should use bitfields and bitflags.

<comment><USER22> Of course you should. No "look at this cool hack" exists that doesn't have a safer, easier to trace equivalent.

Doesn't mean you won't find those hacks in a million code bases used in production, though, and a professional knowledge of "yeah.. okay that's possible, but come on" isn't a bad thing to have.

</comment></comment></comment></comment><comment><USER30> can you just overload the operators '==' and '&&' to mean something else?

Like, set 'a' to contain a string like '0123456789' and then overload '==' to just mean "check if this number is in the string" then it works.

<comment><USER31> You cannot overload operators in javascript

</comment></comment><comment><USER32> yes in a concurrent program

<comment><USER33> Is concurrent javascript a thing?

<comment><USER34> It's environment specific, but in general w/ web workers it is a thing, but they can't update the same var (used to be able to update a shared array until just recently though :-)

</comment></comment></comment><comment><USER35> yes, at very high speeds

</comment><comment><USER36> >This is interview question asked by a major tech company. >They said nothing is impossible. >Dimpu Aravind Buddha

"Anything is possible? Then show me your perpetual motion devices perhaps? Do you compare equality to three different values often in production? Do you ask this question to all candidates, or just the Indians? Are these like the 'Jewish Problems' they used to ask at Moscow State University entrance exams?"

When I read interview experiences like these, it explains a lot about Silicon Valley's diversity problems to me.

</comment><comment><USER33> Context is important here. If you make it clear that underhanded tricks are on the table then yes. Is is reasonable as an honest programming mistake? No.

This feels like handing some prospective code monkey an example from the Underhanded C contest without warning them first. Very few people are going to pass that test.

<comment><USER37> It doesn't have to even be "underhanded". Libraries like SQLAlchemy overload `==` to return a piece of a query predicate (e.g., `foo == 0` => `WHERE foo = 0`), similarly, if I recall correctly, there's an overloaded `and` operator, which performs a similar function. Because Python is truthy and these operators return objects, I think this may evaluate to `True` without being deliberately underhanded. Granted, building a query predicate `WHERE a = 1 AND a = 2 AND a = 3` isn't a useful thing to do in the first place, but still not underhanded.

<comment><USER38> Nitpick, SQLAlchemy overrides the binary operators (~, &, |) for query construction, not the logical operators (and, or, not). It also has its own operators you can import (and_, or_, etc.)

And you are right, it can easily lead to mistakes; if you use logical operators by mistake when building a query, you will probably get 'True' instead of a query object.

<comment><USER37> I appreciate your nitpick! It's been a little while since I used SQLAlchemy, and I did run into surprises with these overloaded operators.

</comment></comment></comment></comment><comment><USER39> you could also overload the && operator for extra confusion

<comment><USER40> I know you can in C++, but in JavaScript? Are you sure about that?

<comment><USER39> oops i missed that bit

</comment></comment></comment><comment><USER41> In C++ this is easy, assuming that 'a' is a value of a custom class.

<comment><USER6> C++ being a dialect of C, you can simply make _a_ a preprocessor macro expanding to _i++_.

The expression uses the && operator, which is properly sequenced so no undefined behavior occurs in that case.

Though you might think that it's an incredibly bad idea, in fact the C standard library allows the _getc_ and _getchar_ functions to be defined as macros, and in fact they historically have been. Thus something like _getc(stream) << 8 + getc(stream)_ stuffs multiple side effects into the same expression without a sequence point (not to mention neglecting to check the return values for EOF).

Each _getc_ call wants to inspect and increment some buffer pointer, like

       #define getc(s) ((s)->in < (s)->in_filled \
                        ? (s)->buf[(s)->in++] \
                        : __real_getc(s))

We're _not_ okay on account of the ?: sequencing, because the expression (A?B:C)+(X?Y:Z) doesn't sequence A relative to Z; there no sequence point between them. The two branches of the + can evaluate in parallel/interleaved fashion.

<comment> mark-r In C or C++ you can't rely on multiple ++ in a single statement doing anything sensible.

<comment><USER42> actually it is defined, i believe you mean sequence point - in which case multiple updates are indeed undefined.

however, unless i'm mistaken,

        a && b && c

is 3 distinct sequence points, in which case, the behaviour is in fact well- defined.

</comment></comment></comment></comment><comment><USER43> Reminds me of my all time favorite programming talk-- (4:17) [https://www.destroyallsoftware.com/talks/wat](https://www.destroyallsoftware.com/talks/wat)

<comment><USER44> Which reminds me of the perl jam (29 min) [https://media.ccc.de/v/31c3_-_6243_-_en_- _saal_1_-_201412292...](https://media.ccc.de/v/31c3_-_6243_-_en_- _saal_1_-_201412292200_-_the_perl_jam_exploiting_a_20_year-old_vulnerability_- _netanel_rubin)

<comment><USER45> It's a nice talk, but does he have to swear so much?

<comment><USER44> I don't know, I think it's just how you are... Some people swear, other's don't. And I think it easier to be cynical/sarcastic than to criticize in a positive way. This is especially true, if you are

a) limited in time, because you do research in your free time.

b) getting negative, or even worse, no or ignorant feedback by the other party.

c) getting tired, because you preach the same stuff over and over again.

I think is really hard to do responsible disclosure and maintain a calm attitude during the whole process. There is this awesome talk about responsible disclosure by David Kriesel who found bugs in Xerox's compression algorithms:

[https://media.ccc.de/v/froscon2015-1524-lies_damned_lies_and...](https://media.ccc.de/v/froscon2015-1524-lies_damned_lies_and_scans)

</comment></comment></comment></comment><comment><USER46> This could be an acceptable interview question for Javascript developers, but from the SO question it looks like the interviewer screwed it up:

 _My answer was that it 's impossible. They said nothing is impossible. It happened 2 weeks back, but I'm still trying to find the answer._

The interviewer should have gone into much more depth instead of (presumably) marking that question as failed and moving on. This was a perfect opportunity to find out more about the interviewee's knowledge of Javascript instead of whether they immediately knew the answer to a trick question.

The interviewer could have asked about the difference between "==" and "===" operators, which any experienced Javascript developer should know at least a little about.

Then they could have asked if the interviewee knows how "==" converts types before comparing them, and find out if they know that it uses .toString() and .valueOf().

Then the interviewer could have asked about if those functions can be overridden, and how that can be done.

At this point, the interviewee's eyes may have lit up and they may have been able to solve the original question.

This approach would have given the interviewer information about the interviewee's knowledge of: "==" vs "===" operators, .toString() and .valueOf() functions, function overriding, and object variables. Instead the only knowledge that the interviewer learned was whether the interviewee had seen a similar problem before or was able to immediately recognize the answer.

<comment><USER47> > would have given the interviewer information about the interviewee's > knowledge of: "==" vs "===" operators, .toString() and .valueOf() functions, > function overriding, and object variables

Sure, the interviewer could have spent some more time to lead the interview in a more productive manner, but at the same time I'm left wondering: what does the interviewer get from answers to those questions? Do the answers say anything meaningful about the candidate's ability to write code (other than a weak-ish probably-can-code/not-a-coder signal)? What about ability to test? Design? Function as a team member? IMHO, the question wastes a lot of time building up to an aha moment, while only getting a glimpse of the candidate's ability to memorize various bits of trivia that are easy to google.

<comment><USER11> I actually see two red flags based on the candidate's response, so I'd argue that this answer is rather telling.

1) The candidate demonstrates a lack of intellectual curiosity (and maybe even common sense) when they say "that's impossible!" and move on.

2) The candidate attempted to pass off their (inaccurate) assessment as fact without even a shred of self-doubt. Colleagues like this are infuriating to work with.

<comment><USER48> But do you actually think you have found an effective measurement device for intellectual curiosity, persistence despite failure, or ability to examine personal errors?

If we are trying to measure some kind of mental ability as a predictor to work performance, one might question whether interviewer ability to extract such deeper insights from these questions is actually more effective than a g test.

<comment><USER49> You can criticize any interview technique by questioning whether it can _really_ effectively measure <X>. The answer is always no, and even if it were yes, you can go on to point out that <Y> is also important and is not effectively measured.

I would probably not give this question in an interview, but if I did, I'd care a lot more about how the interviewee reacted to it than about getting the right answer. The people I want to work with are people who respond to weird questions with curiosity, not with guesses and a lack of followup. For a question that presumably would only take a few minutes to ask, it's decent enough. A bad question would be one that by design gives no information (or worse, gives misleading information), and this question does better than that.

Am I guaranteed to learn about their curiosity? No. In particular, candidates who are very nervous are more likely to clam up than start teasing out the details of the question. That's unfortunate, but hopefully this isn't your _only_ interview question so there are still other opportunities for the candidate to show their stuff.

</comment></comment></comment></comment></comment><comment><USER50> The problem is somewhat underspecified without us knowing the programming language, and (perhaps) the data type of 'a'.

<comment> FLUX-YOU The question tags indicate javascript

<comment><USER50> Sorry, my mistake. I assumed that the excerpt in HN was sufficient to understand the question.

(Or if you're saying that HN is where I'd find the "javascript" tag, I'm somehow not seeing that in my browser.)

<comment> FLUX-YOU The tags are on the stackoverflow question

</comment></comment></comment></comment><comment><USER51> Please don't ask trick questions in interviews. It's never a good idea.

<comment><USER52> Disagree. If you're a web developer, knowing these subtleties could prevent major and time-consuming bugs. The best engineers I've worked with know a ridiculous amount of these kinds of "tricks"\--that's a big part of what makes them the best.

<comment><USER53> This type of information about the candidate can be gotten in a much more evenhanded way by rephrasing the question: What's the trickiest bug you've ever had to fix, and why? Follow up as appropriate with specific questions about the actual bug they solved.

<comment><USER54> I'm not very fond of questions in the form "What's the (trickiest|best|worst) (bug|problem|code|thing) you've ever (fixed|written|seen)?"

Other examples are the classic "What's your greatest strength?" and "What's your greatest weakness?"

These are all recipes for brain freeze. If you ask me a question like that I'll probably think of something, but then I'll ask myself, "But was that really _the_ best/worst/trickiest? Maybe there was another bug that was even trickier, or another strength/weakness of mine that's greater/worse than the one that just came to mind."

You can avoid that somewhat by leaving out the request to name the most extreme case: "Can you tell me about an interesting bug you fixed?" Then I could just pick one and start talking about it. Perhaps even better, ask about an _embarrassing_ bug. Those may be the easiest to remember.

Maybe it would be that election results map that started turning states red when CNN was turning them blue? And how the bug snuck in even with three people reviewing the code change? And we could talk about what went wrong and how code reviews don't guarantee correct code. All kinds of possibilities for interesting discussion there.

</comment></comment></comment></comment><comment><USER55> I was just about to laugh at JS, when I realized you can do the exact same thing in Java also. a.equals(1) && a.equals(2) && a.equals(3) can evaluate to true, if you overload the equals method with a particularly dumb interpretation. I believe the same principle will also apply to any language that supports operator overloading, such as C++.

<comment><USER56> in a pure C, without operator overloading and threads:

      int aa = 0;
      #define a (++aa)
      if(a == 1 && a == 2 && a == 3) {
        printf("pff");
      }

<comment><USER57> Well done. Whileone forgets evil macros are, we often forget how versatile they are in that cause.

That said, I feel that in practice I have to worry more about this strange hidden behaviour in C++ and Python than in C and JavaScript. And even Python is not so bad if you stick to the standard libraries.

<comment><USER58> Until you start playing with ctypes, where you can change the values of constants.

In Python 3:

      >>> import ctypes
      >>> ctypes.memmove(id(5)+24, id(23)+24, 8)
      >>> 2
      2
      >>> 3
      3
      >>> 2 + 3
      23

Or, similarly for Python 2

      >>> import ctypes
      >>> ctypes.cast(id(4),ctypes.POINTER(ctypes.c_int))[4]=5
      >>> 2
      2
      >>> 2 + 2
      5

</comment></comment></comment></comment><comment><USER59> what's the point of this kinda of interview question?

<comment><USER60> I'd normally be extremely critical of pointless tech interview questions, but this one is excellent.

It tests both debugging skill (not taking innocuous code for granted) and defensive programming (writing robust code that won't be affected by environment).

The obvious example of the latter on Javascript is being aware of how closures and scope work and avoiding global namespacing. If you're even vaguely aware that the kind of trickery in the SO question is a possibility you're much more likely to practice safe coding in that context.

<comment> FLUX-YOU >but this one is excellent.

Not really. You'll give the impression this quality of code is part of production code and send them running for the hills.

<comment> mark-r Do you seriously think anybody would confuse this snippet for production code?

<comment><USER61> You've obviously never seen the kinds of production code that I have. This example is clearly distilled down but manifestations of the cause can be found in many different languages and I've encountered quite a few of them in my day.

That said I wouldn't really consider this a good interview question.

<comment><USER62> Check me on this one. What if this is some absurd way to do a series of process steps where the a == 1 checks if you can do step 1 and then executes step 1 with a being set to 1 on success and 0 on failure thus allowing the && to go to the a == 2 comparison which handles step 2. This continues with the rest of the line. Its just psycho enough to be plausible in a truly dysfunctional way.

<comment><USER61> I have encountered code written by people just psycho enough to think that's a clever way to handle just that scenario. They were not wrong it was indeed clever. It was also terrible.

<comment><USER62> The sad part is I too can see someone who needs to do batch processes reading about short circuit evaluation and having this "amazing" idea for a framework that would look exactly like that if. Its moments like those that make me wake in a cold sweat.</comment></comment></comment></comment></comment></comment></comment></comment>


Ask HN: What have you done with Raspberry Pi so far? - <AUTHOR> I am curious how you ultilize this small piece of hardware to make your life interesting and maybe easy? <comment><USER2> I'm a pilot - the bug masher kind flying general aviation. I use a pi with a couple USB digital radios and wifi to read adsb weather and other aircraft locations when flying, adding it to the moving maps on a tablet. The stratux project ([http://stratux.me](http://stratux.me)) started off as a bit of interesting hacking on reddit, and really took off into a mature bit of software/hardware. This does almost everything the $800+ stratus does for pennies on the dollar.

<comment><AUTHOR> Wow, do you ever plan to replace fly by wire electronics with a Pi?

</comment></comment><comment><USER3> I've had a Pi running 24/7 for around 3 years - I use it to run network monitoring scripts, basic IDS for my website, uptime monitoring, etc.

When the Pi Zero came out I bought 4 of them and put them together into a 5-node grid computer, which to this day I use to run Einstein@Home.

You can see live statistics here: [https://www.jamieweb.net/projects/computing- stats/](https://www.jamieweb.net/projects/computing-stats/)

And a video of it here: [https://twitter.com/jamieweb/status/1062048785352871936](https://twitter.com/jamieweb/status/1062048785352871936)

<comment><USER4> Did you use some opensource IDS software or just your own scripts? Stuff like nmap, snort? I've been wanting to do this for a while .. just tracking comms statistics from various devices so I can see what phones home.

<comment><USER3> No it's a bit more primitive than that. :)

For basic IDS, it's a Python program I wrote a few years ago which does a recursive wget over my entire website, then generates SHA256 hashes of each page. Then it compares the hashes against the previous scan, and emails me if there are any changes. For very dynamic websites this doesn't work very well - luckily my site is almost 100% static so I can just whitelist the few allowed changes to prevent false-positive alerts.

I also monitor my DNS and WHOIS for changes, so that if my domain or DNS is hijacked, then I hopefully will know about it more quickly.

</comment></comment></comment><comment><USER5> Pi 2B user here, have been utilizing it to download stuff periodically and push it to my telegram chennels. I also use it as a pi-hole so as to block ads at the router level. Also as a ftp server which hosts my files that I share within my home.

I believe there are even better ways to utilize this mini powerhouse, as the tasks I use it for are pretty light.

</comment><comment><USER6> I'm currently building a small reminder and timer device with time tracking functionality. Touchscreen, maybe battery powered for a bit if possible (it'll probably be plugged in most of the time but it would be nice to move it around the house).

I'm sure there are phone apps that do this, but I hate my phone and I want to integrate it with one of my web applications to some extent.

It's been fun playing with and hits the sweet spot between convenience and price. A nice break from web development.

</comment><comment><USER7> When first Raspberry Pi came out 2012, I had a cheapo phone with no USB host capability. Found out however that Raspberry makes phone USB tethering connection automatically. And then if you enable FTPD and in TELNETD in Raspberry you can access it from the phone quite transparently. As an example I could now move videos and photos from the phone to USB hard disk while in the wilderness. Or use TV-dongle in Raspberry and stream it to the phone.

</comment><comment><USER8> I'm Running my own cloud at home with Nextcloud[1] and use a VPS as a "dynamic DNS" to be able to use a public domain.

I can sync files, contacts, todos and calendars across all my devices.

[1] [https://nextcloud.com](https://nextcloud.com)

</comment><comment><USER9> Used to run it with Pi-Hole, but ultimately failed and I have to resolute to use my homelab. I was facing egregious segfaults and kernel panics due to the SD card controller, in high mysterious, cannot respond to IO requests. This also happened to my Rock64.

<comment><USER7> SD-card is not suitable for hard disk replacement. They always fail after month or two. In newer rasberries you can boot from directly from the USB- disk.

In older Rasberries you need to boot from SD, because USB is not recognized as boot device but soon thereafter you chroot to USB-disk.

</comment></comment><comment><USER10> I suggest checking out this site: [https://hackaday.io/projects?tag=raspberry%20pi](https://hackaday.io/projects?tag=raspberry%20pi)

</comment><comment><USER11> I have a Pi 3B+ which I run RetroPie on. It's great for older NES, SNES and GameBoy games, but not so great for N64 games (it tends to lag a bit)

</comment><comment><USER12> Being annoyed at it for being slow and always needing more packages, installs and cryptic options that need to be changed in config files.

btw: is there a alternative that "just works"?

<comment><USER11> I guess this comes down to what you use it for - I have a 3B+ for emulating games and it works perfectly

</comment></comment><comment><USER13> Pihole, Been running a few years. Best endorsement was wife remarked one day "it's really annoying to use the internet when I'm not home"

</comment><comment><USER14> Use a zero to dive a LED board for a desk clock. I really need to make an enclosure for it but with no 3-d printer it's too much work.

</comment><comment><USER15> Lent mine to a friend who wanted to plug it to her tv to turn it into a smart, media device with a useful browsing capabilities.

</comment><comment><USER16> A pi-hole for my home network. I love it.</comment>


Ask HN: Tips for maintaining a C codebase? - <AUTHOR>

My team has a small but growing C library. We have a set of coding and naming conventions that are generally followed and things are fairly modular. Most of us are not C programmers though, so I want to continue reading and learning from other code to bring in useful ideas to our code base. Thanks in advance. <comment><USER2> Wrap your libraries up in ADT-style interfaces.

Give every such interface a _create() and a _destroy() method.

Have _destroy() either return a pointer (which will always be NULL), or (better, I think) take a pointer-to-pointer so that it can zero the pointer out after destroying the object.

Don't check malloc; instead, rig your code up to detonate if malloc ever fails. Checked allocations create rats nests of error handling.

Have a common hash table, a common binary tree, and a common list or resizable array, working on void-star. Don't allow programmers do implement their own hash table or tree.

Have a common logging library, with debug levels.

<comment><USER3> Thomas, You've mentioned that your new-programming-language-exercise du jour is to write a virtual machine (or microcontroller emulator), right? I'd like to try that in C. How would you go about writing this in a simple way. I know I could google this, but I'm worried I'll find results with too many details and pollute my discovery process.

Really, I'd just like some opinionated answers to the following from anyone who cares:

1) What is a simple instruction set that I can support?

2) What existing programs are available for that instructions set, or what set of tools are there to compile to that instructions set?

3) What are the high level tasks that I will need to accomplish to write this virtual machine?

4) What should I look up or borrow exclusively versus figure out for myself?

Thanks!

<comment><USER2> 1) AVR

2) You'd compile simple C programs, of which there are zillions, rather than writing complex programs in assembly.

3) Make a struct that captures the state of the CPU: an array of integers for the register file, a flag word for the CPU flags, &c. Decode instructions (to a struct or something, which captures all the options of the instruction). Execute one instruction (pick it yourself): resolve its operands into temporary variables, execute the logic (almost invariably trivial), set the appropriate processor flags (overflow, zero, &c), and then store the result. Test lightly, and then repeat for all the other instructions. Most will be the same except for a single line of code. Make a big u_char array to represent memory. Write a HEX file loader, which will take a .hex file and populate memory with its contents; the GCC toolchain will compile C programs to HEX files. Now write the code to load an instruction, execute it, set the program counter appropriately, and repeat. Spend the next 2 weeks debugging.

4) I say, do it yourself. You can get yourself tied up in knots reading all the different ways to implement a VM. To start with, write a naive VM yourself with no help. Then go back and read that stuff if you want; it'll make _much_ more sense.

<comment><USER4> Incidentally, "AVR" == "Arduino", so if you want a HEX file to execute you can have the Arduino toolkit drive the GCC cross-compiler for you, while you sit back sipping mojitos. Download the Arduino toolkit, open up the "Blink" demo, and press "Verify / Compile". Watch the little message window as your code compiles: Near the end of the process it will cough up a line like this:

/var/folders/4x/cwc9yvnx071_9whsft75cjvc0000gn/T/build8742301187783484704.tmp/Blink.cpp.hex

That file seems like it would be a fun thing to explore.

<comment><USER3> Scheew! I think I'll close the nongnu.org tab I have open and go get that mojito right now. Thanks!!!

</comment></comment></comment></comment></comment><comment><USER5> Two projects you may want to review for ideas are Redis and toybox.

Redis comes to mind because it started out as largely a single file of code that has since been split and organized into multiple files. The code is quite approachable; you'll likely understand how most of it works after a day of causal browsing. <http://redis.io>

Toybox comes to mind because it's insanely modular, and aggressive about code re-use. The logic can feel a bit dense at times, but he's going for size and speed. I'm a big fan of Rob's efforts. <http://landley.net/code/toybox/>

<comment><AUTHOR> On the subject of code reading: are there specific areas of the linux kernel (or minux or ...) that someone would recommend to read?

<comment><USER6> Reading through this book[1] was a really mind-expanding experience for me. It is an overview of the kernel and doesn't dive into any one part in depth, but it was extremely valuable for me in learning how to structure a large c project as the same techniques and ideas are useful for many large projects.

[1] [http://www.amazon.com/Kernel-Development-Developers- Library-...](http://www.amazon.com/Kernel-Development-Developers-Library- ebook/dp/B003V4ATI0/)

</comment></comment></comment><comment><USER7> If you've a bunch of bare integers or floats you're passing around with meaning beyond "number" and you're tempted to wrap them in a typedef to add some readability, consider wrapping in a struct with no additional elements. The compiler will boil it away entirely when it comes time to generate code, but it'll catch it when you mix up the order of arguments to a function and the like.</comment>


Need help Computer screen goes black after a while - <AUTHOR> So, I have an hp and after using it for a while the screen goes black. The computer is still running, yet the screen fades to black. What should I do? <comment><USER2> [https://www.ifixit.com/Answers/View/379051/Computer+screen+b...](https://www.ifixit.com/Answers/View/379051/Computer+screen+blank+out)

this link might help you. I had the same problem and it was a faulty backlight power inverter

</comment><comment><USER3> Have you looked at the power-save settings in Control Panel?

</comment><comment><USER4> Try turning it off and on again.</comment>


How to setup a VPN with a VPS - <AUTHOR> https://anonymster.com/setup-openvpn-server-digitalocean <comment><USER2> Good - I wanted to add a reminder that Microsoft Azure and Amazon's AWS have free-tiers where you can get, with a valid credit card, a tiny box for a year. Then once you're provisioned you can follow the steps in the article, which are pretty much the same to install openvpn!

<comment><AUTHOR> Thx for your comment. It is indeed the same as long as you use the same OS as the one mentioned in the article.</comment></comment>


Ask HN: Should I work in the US on a tourist visa and get paid via PayPal? - <AUTHOR> I'm working with a company for a few months remotely, and now they ask me to come aboard to states and work from there for a few months. But they can't sponsor a J-1 work (internship) visa and I only have a tourist visa (B1/B2) valid for a couple of years from now.
Should I move to the states for a few (2-3) months as a friend/visitor and get paid via PayPal or some other means?
What are your thoughts ? Thanks ! <comment><USER2> IAAL, and as you would expect, I'm going to recommend not doing this, for a few specific reasons.

1\. Working without authorization is unlawful, and could subject you to deportation, as well as severe difficulties entering the US in the future.

2\. Entering the US on a B visa, knowing that you plan to work, basically involves lying to the immigration officer when you arrive and are asked for the purpose of your visit. This constitutes immigration fraud, and its consequences are 100x worse than working under the table. You can be barred from entering the US forever - not just for a few years - or even jailed for a criminal offense.

3\. Even if none of the above happens, at some point you'll want to renew your B visa, or apply for some other immigration benefit. The application form will ask you whether you've ever committed a US immigration violation. You will have to answer "no" to have any hope of getting the benefit, which will be untrue, and thus will also constitute immigration fraud, with the same consequences as above.

4\. A US employer who knowingly seeks to hire unauthorized workers is also breaking the law, plus this is just a super-scummy way to do business.

5\. If you do this, you can't "undo" it, and it will interfere with your sleep for the rest of your life. Seriously, you don't want to be looking over your shoulder, worrying about the consequences, every time you have some dealings with the US in any way.

HTH

</comment><comment><USER3> Standard disclaimer: not a lawyer, consult someone familiar with immigration law but…

…please dear g–d don't do this. If you are caught you can be deported and banned from re–entry to the US for anywhere from 5-10 years (on any visa).

<comment><USER4> Also, any company that would be willing to hire you under these circumstances would be breaking numerous laws, and thus would probably not be very trustworthy. If they decided they wanted to not pay you for work you did, it would be very hard for you to get your money from them.

</comment></comment><comment><USER5> Dont. Its illegal and if you are caught by any reason you will be permanently black listed.</comment>


Linux on the (consumer) Desktop - <AUTHOR> http://people.gnome.org/~michael/blog/2012-09-10-desktop-linux.html <comment><USER2> It's fascinating to watch people totally underestimate the lock Microsoft has on the corporate computing environment. This article suggests that it would be easier to break into the business/enterprise desktop than it would be to sell to consumers.

It's probably just about the opposite. Linux is many years away from the level of plug-it-in-and-forget-it integration that Windows has. Linux is light years away from having anything resembling Active Directory in quality. And like it or not, the corporate world lives and dies by Office.

I'd say if you want to make progress, the consumer space is the only possible bet, and it won't be on desktop computers but on tablets and embedded devices which, for the most part, will replace people's keyboard and monitor machines at home.

But not in the office.

<comment><USER3> +1 I don't think there is a proposition as powerful as the entire Microsoft ecosystem on the business desktop.

There is also support, training, excellent literature and documentation, large quantities of staff, functional software at a reasonable price and as you mention: Active directory (which is awesome if you actually understand it).

If you've seen some of the shit I've seen wired up to Office in the last few years, you'll get it. It's just awesome. Entire businesses hang of it. It might not be clean and squeaky but it's functional and does the job. Google Docs + iWork + LibreOffice are precisely zero competition.

(I have to add this to each of these posts to avoid the shill downvotes: I am primarily a Linux user which suits me but I don't think it'd suit most people).

</comment></comment><comment><USER4> I think all of this is close to be pointless, when there is an abundant and sickening Windows bundling problem which persists until present day. End users don't care about any ISVs, ABIs and other such matters, and some even don't have a clue about OS names. They buy a computer with an OS preinstalled. And guess what that OS is? That's the problem which needs to be solved first. The rest as the author admits, will be solved under the market pressure.

<comment><USER3> Have you considered that windows is good enough for the end users and represents good value?

People don't want to make a choice or have to care about what they buy. The ISVs are quite happy to ship windows as they have reusable experience and it's just plugging things together.

The reason no market share destroying competition has appeared is that people are quite happy apart from a minority of users who are quite vocal.

consider that are more windows power users than there are mac users and Linux users combined.

I'm a Linux user (heavy with 15 years' experience) but i don't have a problem with the current situation.

<comment><USER4> _Have you considered that windows is good enough for the end users and represents good value?_

Same as Linux in this day and age (if user has such option).

 _The reason no market share destroying competition has appeared is that people are quite happy apart from a minority of users who are quite vocal._

With this logic any kind of monopoly can be justified, but it doesn't make monopoly good per se. Artificial lack of competition is bad.

 _consider that are more windows power users than there are mac users and Linux users combined._

Network effect is part of the problem, but the bundling issue is just a method to feed it. So one way to break it - is to remove the bundling blocker to allow fair competition.

<comment><USER3> Firstly, reinforcing my position before I say something good about Microsoft: I am a Linux user and have been for 15 years. Before that, it was Solaris and HP/UX. I do a fair bit of work with Windows, particularly .Net at the moment. I'm pretty much neutral. It's a box that does a job.

I don't get these arguments: the user has the option. In the UK, there are magazines on every shelf in every newsagent pushing Linux and in every PC related stored they are pretty much giving Ubuntu away (yes they even had a box at the checkout in PC World with free CDs - completely untouched). You can buy PC's with it preinstalled and buy PCs with no operating system so you can install it.

I know MANY "normal" non enthusiast and non power users from social housing unemployed to professionals who have used Linux distributions and just end up back with Windows. Everyone knows what Linux is or has heard of it.

I don't think Microsoft is a monopoly - they just work pretty well on the desktop for most users (well they did until Windows 8 but I'm not going there in this discussion ;-). The competition is there but it's not really competition in mindshare as people are comfortable.

If you forcibly removed the bundling, you are going to get nowhere i.e. people saying "Can I just have it with Windows on it". Also, at the sales desk, the salesperson is going to make a few extra readies for selling Windows with a PC so you're going to lose anyway.

Take a look at where IBM is now compared to the late 1980's. They monopolised and beat their competition to death and they didn't survive in that market. Microsoft's time will come if they fuck up or piss off a lot of people, but at the moment they do what people want for a price that people want to pay.

The idealisms of "Microsoft sucks" and is a "monopoly" remind me of Slashdot circa 2001 onwards where OSX and Linux were going to take over the world and destroy Microsoft.

Sorry it ain't going to happen and I'm not really that bothered myself.

<comment><USER5> > In the UK, there are magazines on every shelf in every newsagent pushing > Linux and in every PC related stored they are pretty much giving Ubuntu away > (yes they even had a box at the checkout in PC World with free CDs - > completely untouched). You can buy PC's with it preinstalled and buy PCs > with no operating system so you can install it.

Is this the same UK I live in? The newsagents I see might have one Linux magazine lurking behind the iPad magazines. And you really have to go looking for computers that come with Linux preinstalled or no OS. Dell stopped offering them online, and I haven't seen a Linux PC in a retail store since the brief wave of Linux netbooks. I found a small business that sold me a computer with my choice of distro on, but they didn't really promote the option at all.

> If you forcibly removed the bundling, you are going to get nowhere i.e. > people saying "Can I just have it with Windows on it"

"Sure, that will be £20 extra" (a complete guess at the OEM Windows price)

Obviously preinstalled Linux systems aren't going to topple Windows overnight - there's a lot of network effects and familiarity there. But at the same time, it would definitely benefit Linux adoption if consumers regularly saw an option to use Ubuntu, say, with known-good hardware and without having to install it themselves. Not many would take it at first, but a few people would go home and look it up.

> Everyone knows what Linux is or has heard of it.

Many people have heard of it, certainly, but they often have some vague idea that it's a command-line interface for ultra nerdy experts. That's why Android and Ubuntu both avoid using the word 'Linux' in their public branding.

<comment><USER4> _> Many people have heard of it, certainly, but they often have some vague idea that it's a command-line interface for ultra nerdy experts. That's why Android and Ubuntu both avoid using the word 'Linux' in their public branding._

That actually is a lack of gratitude and failure to improve Linux image on their part. But I agree with the rest of the above. Removing the bundling won't magically solve all issues, but it's a huge blocker which prevents any kind of solutions from reaching the broader audience.

<comment><USER5> > [Avoiding the word Linux] actually is a lack of gratitude and failure to > improve Linux image on their part

I don't see it quite like that. Firstly, I'm not sure that the people working on Linux (the kernel) particularly want to be a popular brand - it would mean a deluge of naive questions, apart from anything else.

Secondly, Ubuntu benefits from Linux, GNU tools, X, Gnome, Debian, and many other projects. In techie circles, they readily acknowledge that it wouldn't be possible without the work done in those upstream projects. But trying to fit them into the public branding would confuse users.

<comment><USER4> For general population, Linux became the name of the whole stack of related technologies rather than the kernel name, so not using it (by Ubuntu at least) is a disservice to everyone involved. I'm OK with Android not using it, since they are too far apart from the rest of the Linux world anyway and aren't benefiting global Linux community much. Just my 2 cents.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> I'm betting long on ElementaryOS[1]. It's a distro that wants to be top-notch in UX, design, developer APIs and system frameworks. They even have a Human Interfaces Guideline. Still a work in progress, but I used their previous release for a while and it was just a breeze of fresh air after Gnome/Unity, and surprisingly stable.

Two things are real blockers for Linux desktop adoption: the Adobe suite (or alt) for professionals, and gaming for casual users. One of these is about to be solved :)

[1] <http://elementaryos.org/>

<comment><USER7> This looks very interesting indeed. Initially it looks like a darkly themed Gnome-desktop with a new launcher, but looking around it seems like this is something different.

Unfortunately I cannot seem to find any details on the what's backing this distro. Maybe that's the point and that you shouldn't have to care, but I'm still curious.

Do you have any more details on what's actually running here?

<comment><USER8> From the screenshot it looks like an OSX clone to the point. It seems like the UI designer switched to 2d-dock, inverted the colors, replaced the apple with an 'e' and called it a day.

Not that this is bad per se though.

Edit: They even pretty much copied the icons for browser, address book and dictionary.

<comment><USER9> The browser icon has changed since: <http://elementaryos.org/journal/new- midori-icon-elementary>

<comment><USER8> Oh so instead copying Safari's logo they now copy Firefox? [http://elementaryos.org/sites/default/files/user/5/midori.pn...](http://elementaryos.org/sites/default/files/user/5/midori.png)

Elementary might have something going on for them but originality is not it apparently.

<comment><USER9> The new icon solves the problem of being yet another thing people will point at and say they were just copying Apple. It might not be totally original, but that's okay, everyone borrows from everyone, and I don't think they will get any flak just because it somewhat resembles Firefox.

The problem arises when you can trace so many ideas back to a single source that it makes it look like you're just making a cheap copy, which sadly is what is happening with elementary.

</comment></comment></comment></comment></comment></comment><comment><USER10> Part of me is happy that there is a member of the Gnome community that is speaking the language of business. The truth is for the longest time Linux geeks have been speaking the parlance of technology. In this article I see things like this.

""" a better ISV story """

""" Channel issues """

This is the first step towards actually making inroads. That right there is BS and its the language of the corporate sales cycle. Linux will need advocates who are fluent in the language of the corporation to make the partnerships and sales deals that will be required to get Linux onto the corporate desktop. We are not there yet where we can walk into a sales room and compete on a corporate sales cycle with the professional sales guys who pitch solutions based on Microsoft, but at that point that's the battle that needs to be fought.

</comment><comment><USER11> The biggest surprise for me from this years google io was how much I like and use the chromebox. Chrome os is the best linux desktop distro I've used by far. A fast, stripped down kernel and intuitive, minimal ui and seamless auto updating.

It isn't cable of running a local dev server or compiling code, which are things I still need from my computer (I'm hoping for a chrome os pro supporting guest vms) but everything else is so easy I see the os gaining serious ground and think it is silly to leave it out of a discussion of desktop linux.

</comment><comment><USER12> Call me silly, but the series of blogposts that this is a continuation of seem to have widely different definitions of "Desktop". One minute it seems to be gnome and other "Desktop Systems", another minute linux in general. Be good to have a little more clarity on just what they all seem so keen on achieving.

Persoinally, I'm not so sure Linux needs to aim to be used by everyone under the sun... People have different needs and pluralism in operating systems (yes, including MS) can be a good thing....

</comment><comment><USER13> I still think it's going to be Android PC that's the next big (Linux) desktop OS. It has openness and it has the big support of Google.

Android is not suddenly going to be a desktop thing. It'll happen over time as Android devices become more and more important than desktops. An Android PC will serve to extend that Eco-system on the same level as iOS & OSX (but better since it's still fun).

<comment><USER14> I'm not sure I'm comfortable with Google (a large corporation driven by advertising profits) owning the desktop too.

> It has openness and it has the big support of Google.

Google did not open up Android 3.0 when it did not suit them to do so (commercially). I've never heard of Redhat or Canonical doing something similar with one of their Linux releases.

<comment><USER13> If you saw 3.0 you know why - it was a giant fake hack which was not ready for phones. Opening it up would have destroyed confidence in the platform.

I'm not entirely comfortable with Google either, but I'm far less comfortable with Apple & M$.

</comment></comment></comment><comment><USER15> After using a desktop linux box for about 15 years, I have moved on. Not because the desktop experience was bad, in fact I think it was one of the best out there. Sure, there are rough edges but the user experience of regular desktop activities (launching apps, browsing files) worked for me better than redmond or cupertino -flavored desktops.

No, I moved on because I realized that I don't like the desktop paradigm. The best thing I ever did to my computer was changing to tiling windowing and a keyboard oriented user experience. It's definitely not for everyone, but I don't miss the desktop.

<comment><USER16> If you've still got a desk computer which runs linux, regardless the WM you've still got a desktop linux box. "Linux on the desktop" doesn't use "desktop" in the sense by which we refer to the place that contains "My Computer" and "Recycle Bin". No, "desktop" refers to "on the top of your desk".

<comment><USER15> > If you've still got a desk computer which runs linux, regardless the WM > you've still got a desktop linux box.

Semantics. I prefer to call it a personal unix workstation :) I have a similar software setup on my laptop, which you can't call a "desktop". We can call it a portable unix workstation then.

<comment><USER17> >I have a similar software setup on my laptop, which you can't call a "desktop".

According to the standard terminology used by most writers in the computer industry last 5 years, yes you can (when applied to software).

In contrast, if you say, "After using a desktop linux box for about 15 years, I have moved on," most readers are going to be misled into concluding that you've switched to OS X or Windows. (We only got what you actually meant because we were paying sufficient attention and because you went on to talk of tiling windowing and a keyboard oriented user experience, which are not really an option on OS X and Windows.)

P.S. In all the discussion about tablet computer, _you really never noticed_ any of the thousands of authors using "desktop OS" to refer to the more- traditional kind of OS that runs on both desktop computers and laptop computers?

And you never noticed authors using "desktop" to distinguish a user-facing computer from a server?

</comment></comment></comment></comment><comment><USER18> Don't call the PEOPLE using your software "consumers", they're people.

<comment><USER19> While I agree that people are people, they are also consumers. And he's talking about the consumer market, not enthusiasts adding it to their own systems so in this context it makes sense.

<comment><USER4> It's degrading, because not only tech enthusiasts can use computers for creative activity, becoming producers, rather than consumers.

</comment></comment></comment><comment><USER20> We already have linux on the desktop. It's called OSX.

Seriously, I've been reading about dreams of linux on the desktop for 20 years. Give up. Move on.

<comment><USER21> I use OS X a lot. But my home desktop has been Linux for the last 17 years, and it will stay Linux for the foreseeable future. Maybe it will never see mass adoption. Maybe it will. For my part it doesn't matter.

What matters to me is that there's nothing I have on my OS X laptop at work that I miss when I use my Linux laptop at home, but I can't say the same in reverse.

<comment><USER22> In my (just as anecdotal) case, you can literally swap OSX and Linux:

I use Linux a lot. But my home laptop has been OSX for the last 6 years, and it will stay OSX for the foreseeable future. Maybe it will never see mass adoption. Maybe it will. For my part it doesn't matter. What matters to me is that there's nothing I have on my Linux workstation that I miss when I use my OSX laptop at home, but I can't say the same in reverse.

</comment></comment></comment><comment><USER23> Post points out very well how inferior products that charge can beat superior products that are free. It's quite sad that Linux already has the best experience if you care about getting things done.

In order to save the desktop we must kill the desktop.

Stop the madness and get on with life: apt-get install ratpoison

The desktop metaphor is the worst kind of skeuomorphic design. Why should I waste precious screen real estate to show a background image?

The only thing tiling window managers need for better adoption is to ship with better defaults and a reference card for keyboard shortcuts.

<comment><USER15> > The only thing tiling window managers need for better adoption is to ship > with better defaults and a reference card for keyboard shortcuts.

That works for hackers but for non-techies that aren't willing to put any time and effort into re-learning the basics.

What I hope to see is more tiling windowing features on mainstream user interfaces for the intermediate users.

<comment><USER23> This is the direction Android will go in. I am pretty sure that in five years most people will have one smart phone that they dock at home to have access to large screens and keyboard/mouse. The laptop as we know it will be replaced by laptop shells with a smart phone dock.

And those phones will run Linux with the Android UI and drivers.

I believe tiling window managers would be fantastic productivity boosters for enterprise use. Less distractions for the worker bees.

<comment><USER24> > And those phones will run Linux with the Android UI and drivers.

You seem to assume Android is just another Linux distro with a different windows manager? If so, you are mistaken. An Android system is very different from a Linux distro - they basically only share the kernels and it is quite wrong to classify Android as "Linux" because it creates confusion.

<comment><USER23> The Linux kernel and Android kernel have already become one again, and I suspect that the community will narrow the gap further.

Right now they mainly just share the kernel. If the GNU tool chain is included and you can compile and run linux programs, what is the difference besides some architectural changes?

<comment><USER24> > " If the GNU tool chain is included"

That's a very big "if". It is not the case currently so I would not put them under the same umbrella.</comment></comment></comment></comment></comment></comment>


Programming M.C. Kids (1992) - <AUTHOR> http://games.greggman.com/game/programming_m_c__kids/

<comment><USER2> There's a long article [here]([https://drive.google.com/file/d/0B9bAMoEXM_uOSF8tRnFTMTc0Uzg...](https://drive.google.com/file/d/0B9bAMoEXM_uOSF8tRnFTMTc0Uzg/edit)) (from page 24) about this game from a game design perspective. MC Kids was quite unusual for a McDonald's tie-in videogame.

<comment><USER3> Having endured my share of terrible tie-in games (Yo Noid anyone?), I never gave M.C. Kids a chance. It's a shame to read 20 years later that it was apparently a good game.

The other parts of that Russell's Quarterly issue was fun to read, too. Lots of memories.

<comment><USER2> Glad you enjoyed it! If you'd like to read a few more, here are some links:

#2 The Problem with RPGs: [https://drive.google.com/file/d/0B9bAMoEXM_uObEJUUlFfcXdvWk0...](https://drive.google.com/file/d/0B9bAMoEXM_uObEJUUlFfcXdvWk0/edit)

#3 God Games [https://drive.google.com/file/d/0B9bAMoEXM_uOUHJSVGpac1luUzg...](https://drive.google.com/file/d/0B9bAMoEXM_uOUHJSVGpac1luUzg/edit)

#4 Boss Battles [https://drive.google.com/file/d/0B9bAMoEXM_uON3NXT21lM1oweHM...](https://drive.google.com/file/d/0B9bAMoEXM_uON3NXT21lM1oweHM/edit)

#5 SMB [https://drive.google.com/file/d/0B9bAMoEXM_uObnZ4MG5QZndNdWs...](https://drive.google.com/file/d/0B9bAMoEXM_uObnZ4MG5QZndNdWs/edit)

Unfortunately, only five issues were ever made, and it's been a long time since I've been in contact with Tom Russell. As far as I'm aware, these copies on my Google Drive are the only copies available online.

<comment><USER4> Thanks for sharing these!

</comment></comment></comment></comment><comment><USER5> I remember renting this game from blockbuster back in the day. The game was so good I barely noticed that it had the McD's tie-in. The anti-gravity stuff added another level of complexity to each of the stages, and there were tons of secrets. This may be the nostalgia talking, but I feel like it was ahead of its time for platformers in '92.</comment>


Product Management: why simple UX wins - <AUTHOR> http://www.futureofsocialnetwork.com/2012/06/product-management-why-simple-ux-wins.html <comment><USER2> I am sorry but I will not click on your two links in the article. With the f-work in one and the name of the other implying some sort of porn... I'm not sure if this post is serious.</comment>


An alternative to ads that lets you find products/services based on your needs - mr-b https://www.google.com/ <comment><AUTHOR> Wow, and it even works for general information that you do not even need to pay for! Incredible! Now how could we monetize this thing...

</comment><comment><USER2> Search engines queries, the most personalized advertisements on earth, without having to know the exact make up of your DNA</comment>


Computer Programming is a Trade - <AUTHOR> http://on.wsj.com/1zLQhOL

<comment><USER2> This is so bad. I fail to believe that the world will get out of the paradigm of social stratification in the next dozen years or so. Making computer programming a "trade" is basically putting computer programmers on the same social and intellectual level with locksmiths, plumbers you know the folk the this definition of trade:

<< An occupation, especially one requiring skilled labor; craft: the building trades, including carpentry, masonry, plumbing, and electrical installation. >>.

Perhaps i push the snob alarm in some but i do not mean it like this. The problem i am talking about is that we _should_ have higher education for being a programmer. The reason to skip it now is because their academic rhythm and notions are late and incomplete not because programming is not school worthy.

I really think that, at least for serious programmers and developers, this trade business is a bad thing.</comment>


Show HN: Heap – turning everyone into a mobile blogger - <AUTHOR> https://itunes.apple.com/app/id1022477945?mt=8

<comment><USER2> Nice</comment>


The GitHub Developer Program - <AUTHOR> http://developer.github.com/program/ <comment><USER2> I'd certainly be interested in knowing what the heck "select features" might be, and what exactly I can do with a development license for GH products... but it's really hard to see whats in it for me with such an uninformative marketing page.

I'm not yet making money off of my github integration, so I can't justify jumping to a paid plan just to see what this is all about...

<comment><USER3> My guess is that they're trying to build a showcase of all the interesting 'value-adds' around GitHub. They will then use that showcase as part of the sales-pitch for GitHub Enterprise (and allow a chosen few 'developers' to access their Enterprise customers - perhaps via an AppStore model).

<comment><USER4> "They will then use that showcase as part of the sales-pitch for GitHub Enterprise"

This is pretty much how everybody does it when it comes to enterprise sales. Even massive companies like IBM have partners to fill in gaps in their product line. When it comes to enterprise sales, you don't go in with an minimum viable product, you go in with a Swiss army knife. There is a reason why Jira is the way that it is.

By making it easier for others to develop enterprise grade solutions that is tightly integrated with their own, they can say to potential customers "GitHub Enterprise doesn't do that but we work with a company that does". All it takes is one missing feature for a customer to say no, because they usually have the resources to build it in house. Or superglue together a solution that is ugly, but meets the needs of one or more individuals in the purchasing chain.

</comment></comment></comment><comment><USER5> It isn't clear to me what this is. Does anyone mind explaining?

<comment><USER6> It looks like a good source of information for developers working on products built on top of GitHub's API. (Like Gitpoints, [http://gitpoints.com](http://gitpoints.com), in my case.)

<comment><USER7> Gitpoints looks like fun! Beta request sent.

<comment><USER8> same!

</comment></comment></comment></comment><comment><USER9> > In order to register for the developer program, you must be on a paid plan.

<comment><USER10> I really don't understand this. I would like to subscribe, but I can't because only the organizations I'm part of but not admin of are paying...

<comment><USER11> Can you not be added to a team of the said organization ? Or is it that github is not allowing team members of organizations to participate ?

<comment><USER12> It looks that way, I'm on the owners team of a paid organisation and can't sign up.

<comment><USER13> You cannot sign up as an individual, your organisation (since it's on a paid plan) will be able to sign up though.

</comment></comment></comment></comment></comment><comment><USER14> Nice! Finally. We've been itching for this since building ZenHub.io, our project management extension built on top of GitHub ([http://zenhub.io](http://zenhub.io))

<comment><USER15> Nice idea and product, but a bit confusing for new users. I felt like I could easily understand the overall idea of your software, but not really what it's supposed to accomplish and how.

<comment><USER14> Thank you! Great feedback! TBH we've been in "private beta", we have a v2 of the site in development which provides a lot more context / detail and is much more optimized for conversion.

</comment></comment></comment><comment><USER16> At first I thought this might be a developer program to help you run developer programs. Which might be interesting.

Instead it seems more like an airline affinity program. Like, congratulations you get baggage tags.

</comment><comment><USER4> This is great to hear. My product was designed to be a complementary asset for GitHub and I was wondering what would be the best way to get in contact. And low and behold, they have the "Take on the enterprise" link that lets you know how.

The real money has always been in enterprise and the fact that companies are still shelling out $3,000 for ClearCase licenses demonstrates this. Git is becoming more and more important in enterprise, so it's nice to see GitHub is really going after this market.

</comment><comment><USER17> Very cool! I'd pinged GitHub's bizdev team to ask about a developer program a few months back and was told that something was in the works. I'm impressed with what they have so up and running so far.

Question for anyone from GH who's reading this - will there be documentation released for how to integrate with GH Enterprise? I imagine there are some implementation details (e.g. OAuth access) that differ between regular GH and a GH enterprise install.

<comment><USER18> There are some minor differences for integrating with GitHub Enterprise, but just about all the documentation at [http://developer.github.com/](http://developer.github.com/) applies to both products. While the GitHub.com API is accessed at api.github.com, the API for a GitHub Enterprise install is accessed at yourdomain.com/api/v3/. Definitely shoot us an email if you've got more questions or run into problems: firstname.lastname@example.com.

</comment></comment><comment><USER19> Is anybody aware why they're limiting this to paid plans?

I'd be on one if there was a benefit besides private repos, which have no use to me.

<comment><USER20> In a company, many conversations start this way: "Hey, we need more paid accounts. How can we further incentivize people to sign up?"

Maybe having a paid account has more utility to you with this added feature? Maybe you should sign up and try it out hint hint nudge nudge?

<comment><USER21> Another question is: "Hey, we want to provide a good program, but how do we make sure only to people with serious interest sign up?"

Restricting to paying customers is a good way of weeding out people that just sign up because there is a free sign-up form.

</comment></comment></comment><comment><USER22> Can someone provide some more information? The page is basically just redirects to existing resources, and has you signup for a program. What's new here? What are they offering?

<comment><USER23> Cynically I wonder if they are going to start making it more difficult to use the GitHub API if you aren't part of the program.

<comment><USER18> We currently have no plans to make it harder to use the API if you aren't part of the program. If you are a business that relies on our API, we want to have a better relationship with you because there is a good chance we share a customer base.

<comment><USER24> I'm still not clear what a developer license to build and test against GHE is. "Take on the enterprise" links to a support form.

<comment><USER18> GitHub Enterprise is the on-premise version of GitHub.com that you can buy to run on your own servers. If you are in the developer program and building a product that integrates with GitHub Enterprise, we will give you free licenses for dev/test purposes.

<comment><USER24> OK I see, thanks. That does sound useful.

</comment></comment></comment></comment></comment></comment><comment><USER25> Neat. This is better motivation for me to hop on the paid account tier than the private repos, which I have no use for because I don't hide my personal source code.

(I mean, if I were to do it, it would be mainly to support a company that makes a great product I use and love. Voting with my wallet for things I want to see more of in this world, and all that. Since they don't wanna take money from me via Gittip. :( )

</comment><comment><USER26> Hate to be picky, but shouldn't it be "kudos are all yours"?

I like to think I write decent copy, and am genuinely curious. I'm assuming whoever wrote that actually thought about it, and can probably tell me why I'm wrong

<comment><USER27> From oxforddictionaries.com[1]

Kudos comes from Greek and means 'praise'. Despite appearances, it is not a plural form.

[1] [http://www.oxforddictionaries.com/definition/english/kudos](http://www.oxforddictionaries.com/definition/english/kudos)

<comment><USER26> Thanks so much!

</comment></comment></comment><comment><USER28> That is a great news! We were thinking about it for our GitHub issue queue product heavily relying on the GitHub API: Octokan ([http://octokan.com/](http://octokan.com/)).

</comment><comment><USER29> Actual blog post about it: [https://github.com/blog/1790-announcing-the- github-developer...](https://github.com/blog/1790-announcing-the-github- developer-program)

</comment><comment><USER30> > The URL for the product, company, or service that integrates with GitHub.

Do they accept personal website for now? I have ideas but not a product or a domain to spare

<comment><USER18> A personal website is just fine. We're mostly interested in a link to something that you are building or plan to build that integrates with GitHub.</comment></comment>


Bioaerosols generated from toilet flushing in rooms of patients with C-Diff - <AUTHOR> https://www.cambridge.org/core/journals/infection-control-and-hospital-epidemiology/article/bioaerosols-generated-from-toilet-flushing-in-rooms-of-patients-with-clostridioides-difficile-infection/2EDE288E5A2C3180790037537669B4B7# <comment> _-___________-_ This is something I often think about when using those new hand dryers in public toilets that blast high-velocity air into a confined space where some of the water removed from people's hands collects.

It seems like a great way to aerosolise whatever was on the hands of all the people who previously used the hand dryer.

<comment><USER2> the Dyson AirBlade and similar? Yeah, and the hand holes are none too big either, and I'm sure people bump into the sides and those get gross too. Not a fan, they kinda squick me out a bit.

I guess in theory people have washed their hands by that point, but not everybody has washed them _well enough_. It's at least 20 seconds of solid rubbing, people, not just in and out of the water. The temperature doesn't matter, what matters is being under there for long enough the germs come off.

<comment><USER3> > It's at least 20 seconds of solid rubbing, people, not just in and out of > the water. The temperature doesn't matter, what matters is being under there > for long enough the germs come off.

Anecdotally, I don't wash for anything close to 20 seconds and I'm sick much less often than my coworkers who do. I'm also not afraid to touch food with my hands

>... Of those that exist, nearly all have measured reductions in overall numbers of microbes, only a small proportion of which can cause illness, and have not measured impacts on health. Solely reducing numbers of microbes on hands is not necessarily linked to better health.

[https://www.cdc.gov/handwashing/show-me-the-science- handwash...](https://www.cdc.gov/handwashing/show-me-the-science- handwashing.html)

<comment> _-___________-_ Yeah, removal of all germs is not something I would ever be interested in. I'm keen to keep a strong immune system, thanks.

Having said that, I'm also not keen to aerosolise and breathe in whatever's on the hands of the ten people who used the hand dryer before me. I like the hand dryers that blast a decent flow of warm air past your hands towards the floor, rather than an extreme flow of cold air past your hands at a pool of other people's used hand-washing water.

<comment><USER4> You can keep your germs, but please wash your hands long enough so you don't pass them onto others. That's why we have restaurant staff wash their hands

</comment></comment></comment></comment></comment><comment><USER5> I believe this has been known a very long time. That's why most tooth brushes are full of fecal coliform.

But given how nasty c-diff is, perhaps this will lead to some change in behavior or environment.

</comment><comment><USER6> Didn't they test this with toothbrushes on mythbusters? I have long believed toilets spray germs around. If you flush with your arm directly above you will feel fine droplets hit it. Those same droplets would also hit the ground outside the toilet. The next person who walks through the bathroom will spread those germs across the floor and on to other surfaces. I keep my toothbrush in a drawer.

<comment><USER7> I also always assumed that was the case and flushed with the lid on.

Also I avoid air hand driers as much as possible.

</comment></comment><comment><USER8> not to mention hand dryers..

[https://arstechnica.com/science/2016/04/dyson-dryers- hurl-60...](https://arstechnica.com/science/2016/04/dyson-dryers- hurl-60x-more-viruses-most-at-kid-face-height-than-other-dryers/)

</comment><comment><USER9> Apparently designers of large air craft have been aware of things like this for quite some time. It's not a good look if everyone on a 747 comes down with measles, or worse.

<comment> _-___________-_ Airplane toilets don't flush with large amounts of water like toilets on the ground, they just use a strong vacuum to evacuate the bowl.

</comment></comment><comment><USER10> sounds like an issue that can be mitigated by a simple $400 toilet seat built using tools from NBC protection arsenal like pressure differential - i.e. flush activates only when the seat is down and there is lower pressure by air suction from under the seat during and a bit after the flush. Probably can make for a small (what are the number of toilets in US hospitals? in the world? and also can be sold to some people who have some money to spare :) cottage business.

<comment><USER11> I prefer the engineering solution that improves the smell in restrooms.

A laminar (sp) flow "air-curtain" from fresh air directed down at the doorway to isolate the restroom. Combined with an overall positive (to local environment) pressure airflow design such that the restroom is one of the lowest-draw places in the building and has a direct egress for ejecting air.

The toilet could probably be improved by use of a UV clear lid shaped to let any backspray drip back inside of the toilet, a UV sanitation lamp (on either low voltage AC or DC with ground-fault protection systems), and maybe some minor automation to lift the lid and/or seat again depending on settings.

Upgrade to modern bidet (asian/Japanese style) toilet optional.

</comment></comment><comment><USER12> This another reason why we should have dry toilets. Flushing toilets waste water and excrement that could be put to good use.

<comment><USER13> There's some high tech air and minimal water toilets in the service station on the M4 in the UK, there is a locking closing lid that triggers the flush, in the light of this seems very sensible.</comment></comment>


TIOBE language popularity absurdity - <AUTHOR> http://accidentalidad.wordpress.com/2011/04/07/8/ <comment><USER2> Anecdotal: There are several shops in town that use Progress 4GL. I used to work at one of them. It is a definite niche language language, I had never heard of it until I worked there.

However, if you are a customer of a (smaller) bank or credit union there's a good chance that you are indirectly using this technology.

That said, I'm not sure what this rant is about? Is he mad that scala/groovy are more niche?

You wouldn't find (any?) Progress 4GL on github because it's a commercial language. You have to pay for it. But it generates millions of dollars of sales and is in use in hundreds of companies (at some level).

</comment><comment><USER3> I find it really hard to understand why TIOBE keeps being brought up as an authorative source when time and time again people demonstrate its inaccuracy. Could it be just because there's no serious alternative?

Has anyone considered a more serious method of comparing programming language popularity?

<comment><USER4> As the guy behind <http://langpop.com> I wonder too. I don't think my results are perfect, but I think they're a bit better.

In any case though, no survey of this type is going to be entirely 'accurate'. To be 'accurate', you'd have to follow around millions of programmers for a few years and see what they're reading, writing and talking about, at home, at work, and with friends. So I do the best with the data I can get.

Another thing to consider is what 'popular' means. You could consider both 'velocity' (current use) and 'acceleration' (increase in usage). Cobol for instance, is widely used in some environments, but has no acceleration. Java has a lot of the former, and still has quite a bit of use in new projects. Something like Ruby is not widely deployed, but more popular for new web projects.

</comment></comment><comment><USER5> TIOBE is not particularly accurate, but that doesn't mean that counting Github projects is better.

<comment><USER4> Github is still hugely biased towards Ruby, which is one reason I still haven't included it in <http://www.langpop.com>

<comment><USER6> How is it any different from Google Code (which you've included) which is heavily biased towards C?

<comment><USER4> Google's Code search is heavily biased because there's a crapload of C code out there, which makes sense, given that it's been around for nearly 40 years and is used as the basis for... well, pretty much everything, including many other programming languages.

Github's bias is based on the early adopter Ruby guys climbing on board quickly.

</comment></comment></comment></comment><comment><USER7> I've commented on here and other forums about the absurdity of Tiobe being taken seriously. He changed the rules dropping one language nearly forty places. I emailed him pointing out that following his new rules several other languages would also drop. He replied to the effect it was his site and he would do as he pleased.

Surely a site can be created that uses somewhat objective measures based on jobs available, blog posts and tweet mentions etc to arrive at a more accurate composite score.

</comment><comment><USER8> If a language in Tiobe drops from, say, 25 to 65 in a single month when the number of search engines used increases to 7, then Tiobe's being gamed. You'd think language implementers would have better things to do than create webpages with circuits of links.

</comment><comment><USER9> How about this: Any language popularity index that doesn't include COBOL is a joke.

This is an interesting requirement because COBOL is used everywhere the kinds of people who make these indexes aren't looking. Finding ways to include it in a reasonable fashion will likely uncover uses of other languages that really are obscure, and _that_ would be interesting.

<comment><USER2> Exactly. There are COBOL jobs that go unfilled every year. The local college started teaching it again (I think using COBOL.net of all things) because the COBOL programmers are all retiring.

Seems to me TIOBE is a good tool to show your boss to convince him/her that it's ok to use Ruby b/c it's gaining in popularity. (I wouldn't do that of course, I would instead state that obviously Python is more popular and we need to use that :-) )</comment></comment>