Do Millennials Really care? - <AUTHOR> http://www.dailymail.co.uk/sciencetech/article-3437958/Do-Millennials-REALLY-care-Researchers-claim-prefer-organic-ethically-sourced-rainforest-friendly-chocolate-14-actually-buy-it.html <comment><USER2> The article contains little more than verbatim quotes from the abstract of the linked report: [https://www.researchgate.net/publication/285639899_Millennia...](https://www.researchgate.net/publication/285639899_Millennials_and_chocolate_product_ethics_Saying_one_thing_and_doing_another)

Summary: Millennials claim to like organic, ethnically sourced foods but only 14% buy it.

</comment><comment><USER3> I love organic hipster chocolate. I ain't going to buy any either. I'm an oldish git. Not sure how this is a story though.

<comment><USER4> I have not read the article, not going to give them the clicks, but as it is a daily mail article I imagine it is a story because there is some mock outrage... and possibly something affecting house prices. Mostly the outrage though.</comment></comment>


Wiki Growth over Time as a Force-Directed Network Layout - <AUTHOR> http://infosthetics.com/archives/2009/09/wiki_growth_over_time_as_force-directed_network_layout.html

<comment><USER2> Annoying that the video ended just as something interesting seemed to happen!</comment>


Why Is It So Hard to Detect Keyup Events on Linux? - <AUTHOR> http://blog.robertelder.org/detect-keyup-event-linux-terminal/ <comment><USER2> I mean, that there's no key up event in tty context goes back to the beginning of time, and is not Linux's fault, and not even Unix's (nor VMS's) fault, or anyone's fault, because this all works the way it does because of how terminals worked, and they worked the way they did because it was _simple_.

If, in the late 70s, key up events in tty context had been important, then terminal vendors would have developed an escape sequence system for expressing those. But it wasn't, so they didn't.

So, yes, it's absolutely impossible to get key up events in tty context, and at this point it will almost certainly stay that way forever, as it's too late to retrofit terminal emulators, drivers, and applications to understand whatever protocol for communicating key up events. (The right way to do this would be to develop an escape sequence protocol that the tty/pty drivers could decode and turn events into out-of-band events to be delivered via ioctl()s, that way applications that don't care about key up events don't see them and don't need to be modified. But who is going to do all that work?)

<comment><USER3> this kind of highlights one of the differences between FOSS and paid software. "not our fault" "too late to fix it"

versus a manager forcing you to fix the damn problem nobody cares whose fault it is.

of course this difference is not innate, just a tendency.

<comment><USER2> Eh? No, no one can fix this. Oracle couldn't fix this in Solaris. Microsoft can't fix this either (in Windows, in Linux, not at all).

It's not a question of money, or managerial will-power. You're asking to boil a great lake, and if you have the money for it, you will almost certainly find better uses for it. There is no market demand for a "fix" here, so there cannot be any managerial will-power either.

Nor is this due to Unix being open source back in the 70s, because it simply wasn't open source (and save for the erstwhile OpenSolaris, it still isn't). It wasn't entirely a research vehicle either, as AT&T used Unix as the OS for its phone switches. VMS too could not have had this feature, and for the same reasons -- though I'm not familiar enough with VMS, I feel absolutely certain that VMS did not have this either. And the hardware terminals (they were _all_ hardware terminals back then, as there were no graphical terminals in which to emulate a terminal) were decidedly not open-source, and their vendors were in it for the profit.

This, and all the wonky, hacky things to do with terminals, goes back to the way things were almost half a century ago, long long before "FOSS" even came to be.

Software business models have absolutely nothing to do with why you can't have key up events in ttys.

EDIT: And incidentally, windowing systems happened on the scene around 1984-1985. By 1987 even SVR2 had a windowing system in the AT&T Unix PC. But it was too late to retrofit key up events into ttys -- already by then there was over a decade of legacy, and hardware terminals continued to be a thing for some time yet. This is a crucial lesson in engineering: even relatively small amounts of legacy have profound effects on what is feasible, so often you have to get things right in the very beginning (precisely when it's hardest to get things right!).

<comment><USER4> > No, no one can fix this.

The nice thing about escape sequences is that they are ignored if not understood.

> Microsoft can't fix this either (in Windows

Because it's not an issue in Windows? The Windows console, as primitive as it is, supports monitoring the status of the keyboard (which can be used to infer key up events).

<comment><USER2> MSFT is adding a pty driver and support for Unix-style applications.

</comment></comment></comment></comment></comment><comment><USER5> The OS is abstracting away details about where the characters come from, which is a keyboard in this case. The characters could also come from other sources, such as a file, or a speech-to-text program getting input from a microphone. Key-up events make no sense for these sources. Essentially, the author wants to go down a layer of abstraction to use his keyboard not as a character input device but as a grid of buttons. By default, this will require special permissions on most linux distros (and rightly so, as it allows for keylogging), but this is a matter of changing one's udev configuration; root is not inherently required.

In any case, the stated goal "to remotely navigate a robot over an SSH connection using the 'w', 'a', 's', 'd' keys" is misguided to begin with; what happens when your connection drops and the robot can't be stopped?

Addendum: has the author thought about the case where the user is using a keyboard layout where the WASD keys are not together, or where the user is using a non-latin-alphabet keyboard? As someone who uses a dvorak-based layout, I am annoyed at how often developers screw the key/character distinction up and assume everyone uses qwerty.

</comment><comment><USER6> The terminal is the wrong tool for this job. I believe the author realizes this in their exploration of the topic, but I think it still bears saying explicitly. This task is difficult not because of some big design mess-up, but because this use-case is well outside the design constraints of the technology he turned to first.

EDIT: I'd also like to mention that "Linux" has nothing to do with this. One would face the same issues using a Windows SSH client connecting to a Solaris SSH server.

<comment><USER7> Right. If you want to control something in real time, use a real time protocol.

<comment><USER6> Honestly I probably shouldn't have mentioned SSH, because it also doesn't really deserve any blame here. People can / do tunnel real-time traffic through SSH without any problem. The real root problem is wanting to get so much detailed information from a tty-like interface. In this case it just happens to be via SSH. The author would have the same issue with telnet, rsh, etc.

<comment><USER8> He could also totally still use SSH for this. He just has to tunnel something else over it instead of using a TTY. SSH itself is somewhat agnostic to whether you use a TTY or not.

</comment></comment></comment></comment><comment><USER9> That raw keyboard events are not delivered through SSH connection is entirely expected. At its core, it is a text-only communication protocol. At the discretion of the client terminal, there could be an ANSI escape to enter mode where raw key events are delivered, akin to unbuffered input. But that is nevertheless beyond the scope of what SSH offers.

<comment><USER10> Yes, delivering timed key events would be a security issue.

<comment><USER11> Huh, why?

<comment><USER12> If each interactive key stroke is sent in its own packet, then you may be able to guess which keys the user is pressing based on just the timing of packets coming in, and so guess what they are typing without decrypting the stream.

[https://www.usenix.org/legacy/events/sec01/full_papers/song/...](https://www.usenix.org/legacy/events/sec01/full_papers/song/song.pdf)

<comment><USER11> But what does timestamping have to do with sending each thing in its own packet? Did you mean something else by 'timed'?

<comment><USER13> You, as a malicious 3. party, captures the encrypted packets between a client and a server. You can't decrypt those packets.

However if each keystroke is sent in its own packet, you note the timestamp of the packets and then you can infer which keys the user has pressed from the difference in time between the packets.

<comment><USER11> I get that, it's just not what I originally read the comment to mean. It sounds like you guys say "timed" to mean "sent in real-time", whereas I read it to mean "includes timestamps", that's why I was confused. (Because in my mind I think of things like "timed automata" which are automata accompanied with time variables, not automata that execute in real-time.) But otherwise yeah, that makes sense.

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> This weirdly seems like the "right" implementation to me. Somehow I feel like a TTY generally doesn't need or deserve to know when keys are pressed and released.

That said, is there a more end-to-end summary out there of how keyboard input is handled in GNU/Linux? I have the vague understanding that USB HID scancodes are translated into keycodes, which are sent along to X applications or a TTY, but where and how each step happens is still a bit mysterious to me.

<comment><USER15> > Somehow I feel like a TTY generally doesn't need or deserve to know when > keys are pressed and released.

Why? What if I'm playing a game on that TTY?

<comment><USER2> Mainly because there exists no protocol by which the terminal (really, terminal emulator) can indicate these events, and the tty/pty drivers don't know how to decode that non-existent protocol to spare existing apps having to be modified to understand it.

This all goes back to the 70s, when people first hooked up typewriters to computers as terminals: everything was far too simple to make it possible to add such a protocol, and nobody cared about key up events, and they weren't going to care for a long time because the hardware and software all had to be rather simple (exceedingly so by our standards today).

<comment><USER16> You made a nice post but that's not the question being asked. The historical record is different from the question of whether a terminal needs/deserves it _this_ decade. ("need" obviously being non-literal)

<comment><USER2> The submission's title is "Why Is It So Hard to Detect Keyup Event on Linux?". I knew the answer to that very specific question, so I offered it :)

As to whether we need to evolve this functionality today, I would hazard that the answer is "no". I did sketch out how it would be done, if we really need it and people want to implement it. But my guess is that there are too few people with the desire and funding to work on this problem. Reading TFA today is the first time I've ever heard of anyone wanting key up events in the tty -a tty that has some 45+ years of history- so I'm a bit skeptical that this will somehow become such a blindingly obviously highly desirable feature _now_ that it might get done.

<comment><USER16> > The submission's title is "Why Is It So Hard to Detect Keyup Event on > Linux?". I knew the answer to that very specific question, so I offered it > :)

You didn't reply to the top level article, you replied to a specific comment, which was asking a different question.

And "not enough desire to make the change now that we're so entrenched" is still different from "does it deserve to know, if we were doing it right". And I would say the latter is true. (Still ignoring "need" because "need" is really vague.)

<comment><USER2> Fair enough. That post said:

> Why? What if I'm playing a game on that TTY?

So my answer was still on point.

<comment><USER16> The predicate to that specific "Why" was "doesn't need or deserve to know", not "is so hard to detect on linux".

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER17> ReadConsoleInput [https://docs.microsoft.com/en- us/windows/console/readconsole...](https://docs.microsoft.com/en- us/windows/console/readconsoleinput)

INPUT_RECORD [https://docs.microsoft.com/en-us/windows/console/input- recor...](https://docs.microsoft.com/en-us/windows/console/input-record-str)

KEY_EVENT_RECORD [https://docs.microsoft.com/en-us/windows/console/key- event-r...](https://docs.microsoft.com/en-us/windows/console/key-event-record- str)

        bKeyDown
        If the key is pressed, this member is TRUE. Otherwise, this member is FALSE (the key is released).

Also, please note that INPUT_RECORD contains union of key, mouse, window buffer size, menu and focus event records. I do not want to say interface is more well thought per se, but it is definitely more rich.

<comment><USER18> The reason why Windows has this stuff is because it never was particularly supportive of remote terminals. Going back to DOS days, when writing a console app, it was either the kind that only needed print, or else you basically had full control over the screen area, changing individual characters, colors etc in a random access way. The first approach would use DOS output functions that allowed for things like stdout/stderr to work. The second approach couldn't be redirected properly.

Windows inherited that model, and mostly just kept developing it until lately.

</comment></comment><comment><USER19> This is functionality that the terminal emulator reasonably should provide to enable games or other interactive applications. I believe that would solve the author's complaints. Some work has been done along these lines in both Kitty and iTerm2. Not everyone likes the idea because it breaks the basic abstraction of a terminal. I kinda like it, though, and I'm optimistic that the situation will improve in the coming years.

</comment><comment><USER20> The title really should be "On a TTY" and not "On Linux" \- the reality is, it's not that hard. The TTY is a TTY - it's designed for typing, not general input. You could always forward your input events through another channel, even over SSH if you wanted.

</comment><comment><USER21> IIRC /dev/input/event* gives you that

</comment><comment><USER22> Meta:

I'll again have to criticize this submission's title. It shouldn't be " Why Is It So Hard to Detect Keyup Event on Linux?" (it's not a problem with the kernel), it should be something along the lines of "Why can't I detect key up events via SSH?".

And the answer to that is simple: That's not what it's designed for.

Or, even better: Instead of concentrating on the complaints part of the article provide on the part in which you're providing value to your readers: "Detecting keyboard events without a display server" or, if you want to get in on the long headlines trend: "Detecting key up events in a TTY environments is hard. Here are some ways".

<comment><USER23> No, the submission title is the title of the linked page. That is correct.

<comment><USER22> It's not uncommon to correct click-baity titles in a submission. By "submission" I'm also referring to the original article.

<comment><USER23> Your comment does not claim click bait. Your comment claims you disagree with the blog title. The rule is: Don't editorialize.

<comment><USER22> "... unless it is misleading or linkbait", which I indeed think to be the case here. I clicked because I thought frameworks like Wayland and X or something else inherent about the architecture of modern Linux systems made it difficult to detect key up events, but it just turns out the author was trying to use something that doesn't have any concept of key events, leading to the feeling I was misled.

</comment></comment></comment></comment></comment><comment><USER24> Would it work if the sender immediately started sending a fast stream of repeating characters over? Then the keyup on the receiver is when the stream stops.

</comment><comment><USER25> Very interesting, in a different context I had to tackle a pretty similar problem with Redtamarin [0]

Traditionally under the CLI you will manage key input wih a readline() command or something similar to kbhit() and depending on your needs you'll use getchar() then track if either a CR or LF is entered for the "end of command", also EOF.

This is blocking, so nothing else can happen, and depending on how you do it, you can only read single byte chars and not mutlibyte chars (like CJK input)

something like

        while( run )
        {
            i=kbhit();

            if( i != 0 )
            {
                key = String.fromCharCode( getchar() );

                if( (key == "\n") || (key == "\r") )
                {
                    run = false;
                }
                else
                {
                    buffer += key;
                }

                i = 0;
            }
        }

another way to do it

        while( run )
        {
            b = fgetc( stdin );

            if( b == EOF )
            {
                if( kbuffer.length == 0 )
                {
                    return null;
                }

                run = false;
            }
            else if( b == LF )
            {
                run = false;
            }
            else
            {
                kbuffer.writeByte( b );
            }
        }

which has 2 greats advantages, being able to read multiple bytes input (thanks to fgetc() which read the raw byte) and detect EOF (CTRL+D under POSIX, CTRL+Z under WIN32), but still blocking forever, using fgetc() the detection of EOF is done automatically for you (while getchar() getc() etc. do not detect that EOF)

now because Redtamarin is based on AVM2 and AS3, there is one part of the API which try to reimplement the Flash API with such things like KeyboardEvent that should be able to be non-blocking but still for a CLI environment

That KeyboardEvent should detect keyUp or keyDown but yeah it is hard to detect and if you try to do that for multipel platforms liek Windows / macOS / Linux it gets nigthmarish

In a little experiment [1] I found out you can do "stupid things" that actually work, like spawning a child worker (AVM2 uses pthread), blocking on the user input (like above) and then send back a message to your main worker and so receive a "key event", all that allow to listen for input asynchronously

But then, what about making the difference between keyUp and keyDown ? I decided to ignore the keyUp because in fact it does not really matters on the CLI or I least I don't see any use to it, for a GUI yes I can see the use cases, but for a CLI? not so much

Purely on the CLI (no X Server) you don't really listen for key events you read the stdin stream, the only special events are signals like SIGINT SIGHUP etc. or special kind of signals like EOF.

The other things you can alterate is the buffering of that stdin and the raw mode/cooked mode and echo off/on.

So for a use case like navigating something using the 'w', 'a', 's', 'd' keys you just need to go async to listen for chars input (which key is pressed) and probably a mix of timeout on the last key pressed and a "diff" between the "prev key" and "last key".

If last key pressed is 'w' then go up, if you keep receiving a 'w' key you keep going up, if prev key was 'w' and the last key is different you change direction.

And to detect when to stop to go up if last key pressed was 'w' you just keep the time when this key was pressed, if 1 second elapsed and no more key events are received you stop going up, ergo you don't need to detect keyUp, but maybe I'm missing something.

      [0]: https://github.com/Corsaair/redtamarin
      [1]: https://twitter.com/redtamarin/status/900794336031510530

</comment><comment><USER26> This is quite possibly one of the best critiques of YAGNI that I've ever read.

I grew up in the waterfall (as opposed to agile) era of the 80s and 90s. Back then, it was top priority to catch mistakes as early in development as possible. This is the top article I could find on the concept, which seems to stir a lot of debate:

[https://developers.slashdot.org/story/03/10/21/0141215/softw...](https://developers.slashdot.org/story/03/10/21/0141215/software- defects---do-late-bugs-really-cost-more)

The gist of it is that if a bug costs $1 to fix during development, it costs $10 to fix during testing and $100 to fix once it's in production. Maybe someone can find the original quote.

Had I been working on terminals in the 70s, I would have been the annoying person in the back of the room who raised their hand and said "what about key ups?" There would have been a lot of muttering, much debate about how to store keymap bit arrays and what might happen if they get out of sync, every edge case would be explored, and in the end my opinion would be noted somewhere and character streams would have moved forward as the "simpler" implementation.

But it's not simpler, because perfectly valid use cases were excluded. Basically, their decision meant that we couldn't have video games in the terminal. Kind of a big deal, if you ask me.

After so many decades of this, it's hard for me to drink the Kool-Aid on new frameworks, even if they're ones we use every day like C++ (operator overloading was maybe a bad idea in hindsight), git (can't store folders without .gitkeep), Angular (two way binding - oops), React (front end PHP), even HTML/CSS/Javascript (difficulty encoding our own tags as components/nondetermistic inheritance across browsers/mutability). These frameworks are great, but it takes a certain level of suspension of disbelief to buy into them.

Give me 5 minutes with any technology and I'll find the conceptual flaws and bugs that impose major hurdles on its conceptual simplicity, utility and reusability. Basically everything I touch breaks. It's like a knack that makes me a good programmer, but also a Debbie Downer.

[https://www.youtube.com/watch?v=MZF6EK7x4Dk](https://www.youtube.com/watch?v=MZF6EK7x4Dk)

P.S. The workaround for the keyup thing is probably to set the key repeat threshold and repeat delays to 0 and check for repeated keydown events each main loop, setting the keymap entry to true if the key is still down (false otherwise). It's not perfect because it can't easily detect multiple keys down or modifier keys, but that was one of the ways we did it in classic Mac OS anyway.

<comment><USER18> What makes you believe those were valid use cases for those in charge back in 1970s? Just because some hobbyist wants to run a real time game on a terminal worth thousands of dollars doesn't mean that others are going to accommodate that.

The most likely reason why they never bothered with key-up is because they were an evolution of the teletype, and inherited its protocols. That was the use case, not a generic human interface.

But even if there was some explicit consideration of this idea, I'm pretty sure it'd die almost immediately, because carrying information about keystrokes would double the bandwidth of an average session, and we're talking about the time when typical transmission speed was measured in baud, and 4- digit speeds were considered fast (the first terminal supported a maximum of 2400 baud). You need a much more profligate culture to add support for things like that "just in case".

</comment></comment><comment><USER27> What about Wayland?

<comment><USER28> This is on a tty. So outside of X as well.

Both X and Wayland have key down and up events.

<comment><USER29> Yep. All GUI systems that I'm aware of have explicit keyDown/keyUp events. They're essential for a number of things.

If the Unix console was being designed today, I expect it would also have them, along with a sane system for reporting terminal capabilities and probably a zillion other things.

It's too bad none of the console modernization projects have really gained traction. The best we seem to be able to do is fish + UTF-8 + maybe Powerline.</comment></comment></comment>


Hackers break into Subaru Outback via text message - <AUTHOR> http://www.engadget.com/2011/08/04/hackers-break-into-subaru-outback-via-text-message/

<comment><AUTHOR> All articles pointing to this event seem to indicate they actually were able to start the engine. I'm having a hard time believing any car manufacturer would build this into the car. Any ideas how this was pulled off?

What actually happened? (perhaps they unlocked the doors with a text and then hotwired the car?)

<comment><USER2> I did not see a text-enabled remote engine starter on the Subaru web site, and the article was unclear if it was a stock Subaru or it they added an aftermarket "text your car" widget.

After-market "text" widgets are available: <http://text2car.com/></comment></comment>


Missing Emirati princess 'planned escape for seven years' - <AUTHOR> https://www.theguardian.com/world/2018/dec/04/missing-emirati-princess-latifa-al-maktoum-had-planned-escape-for-seven-years <comment><USER2> These and other incidents with the UAE recently highlight the troubling willingness with which western states and businesses still jump into bed with the authoritarian dictatorship _du jour_ (usually on the proviso that it has a lot of oil) only to 'discover' years later that they're actually quite unpleasant.

<comment> at-fates-hands > highlight the troubling willingness with which western states and businesses > still jump into bed with the authoritarian dictatorship du jour (usually on > the proviso that it has a lot of oil)

This point is still a mystery to me. If it's always been about oil, then the US is currently the largest oil producer. Why are we still relying on these countries for _anything_?? Is it leveraging their wealth for other investments?

<comment><USER3> Many people in the US government are also interested in selling weapons, as well as making sure the kings of those countries are investing a good portion of their money back in the US.

<comment><USER4> Many people in Silicon Valley are interested in making sure the kings of those countries are investing a good portion of their money back into their tech ventures.

</comment></comment></comment></comment><comment><USER5> What a gut-wrenching story. Perpetual control over your child seems so suffocating and counter intuitive. So much so that the kid had to plan an operation to escape.

More background to the story:

1\. India returned the princess to protect strategic interests - [https://thewire.in/diplomacy/india-returned-runaway-dubai- pr...](https://thewire.in/diplomacy/india-returned-runaway-dubai-princess-to- protect-strategic-interests)

2\. [http://www.asianage.com/india/all-india/300318/kidnapped- dub...](http://www.asianage.com/india/all-india/300318/kidnapped-dubai- princess-returns-safely-to-uae-with-indias-help.html)

3\. Indian Prime Minister authorized the operation to seize her and return back to UAE - [https://www.washingtonpost.com/news/worldviews/wp/2018/04/28...](https://www.washingtonpost.com/news/worldviews/wp/2018/04/28/indias- modi-authorized-capture-of-runaway-dubai-princess-newspaper-claims/)

<comment><USER6> > _India returned the princess to protect strategic interests_

Why India?! Western Europe, Japan and the United States have strong judicial systems. The EU, in particular, wouldn't require any pre-declarations to be filed prior to claiming asylum. The only advantage to India is being able to disappear, _e.g._ change names and retire to a remote village. Unfortunately, she doesn't appear to have taken advantage of that.

<comment><USER7> India isn't exactly a multi-cultural melting pot. A foreigner would stand out like a sore thumb. She would be trading one prison for another.

</comment></comment></comment><comment><USER8> A (presumably) Dubaian team boarded a US flagged boat in (possibly) Indian territorial waters. No one is concerned over this? Was the yacht not really a US vessel? If it was actually a Dubaian vessel then that team probably has authority over it just like how the USCG can board any US ship anywhere, anytime. Did a Dubaian team actually grab her? Maybe it was the Indian coast guard who deported her back to Dubai.

According to emirateswoman.com, shes being married off. I hope she gets another chance to escape to a more free life.

<comment><USER5> Indian Coast Guard raided the vessel and deported her back ASAP.

</comment></comment><comment><USER9> Disappearing royals are also a ... feature ... of Saudi-Arabia's ruling family, see [1, 2]. It's interesting to speculate why Khashoggi's case garnered so much more attention.

[1] [https://www.bbc.co.uk/news/magazine-40926963](https://www.bbc.co.uk/news/magazine-40926963)

[2] [https://www.youtube.com/watch?v=r2KYQWPUbG4](https://www.youtube.com/watch?v=r2KYQWPUbG4)

<comment><USER4> Khashoggi came from a powerful and influential family in the KSA, plus he was a journalist for the Washington Post.

<comment><USER9> The other princes in the BBC article & video came from an even more powerful and influential family in the KSA.

</comment></comment></comment><comment><USER10> This is a horrible story indeed and I hope it gets public attention to lessen the hell the princess is going through.

It is always easy to be smart after the fact, but to me that the naval officer thought through the escape to getting out of the country, but not what happens next. For him, a French citizen, getting out to a neutral country is the end. For her, a UAE citizen without any right to stay elsewhere, it is at best a midpoint.

He could have arranged for news coverage _prior_ to the mission by discreetly talking to some high caliber journalists so they can prep coverage and he could have involved professionals (e.g., traffickers who move refugees and have global networks).

</comment><comment><USER11> let's hope we will switch to electric ASAP so these dictatorships won't have any leverage over other countries and they can go back to their camels

</comment><comment><USER12> What a fucked up country.

<comment><USER13> List of wrongful convictions in the USA: [https://en.m.wikipedia.org/wiki/List_of_wrongful_convictions...](https://en.m.wikipedia.org/wiki/List_of_wrongful_convictions_in_the_United_States)

It's not even a full list

<comment><USER12> What's your point? One thing is a list of wrongful convictions - _failures_ of the justice system - but what happened here isn't a failure, it's the system working _as designed_.

<comment><USER14> What do you mean by working as designed. The founders of the US said, why don't we make sure there are some major bullet holes in this design so we make sure some innocent people go to jail? If it was part of the design, then it was the design, if it was not, it is a defect. Think of software engineering in this case.

And his point is that someone reduced the UAE and all its history and people to "what a fucked up country" then it's absolutely relevant. What about the destruction of the indians and native land, the going to war for OIL for the past 20 years and killing basically indiscriminately. Do I need to remind us of slavery? I'm a US citizen, but be prepared to take salt in the face if someone reduces your country to a sentence like that.

<comment><USER15> They mean the UAE's system is working as designed, not the USAs

</comment></comment></comment></comment></comment><comment><USER16> What shocks me is how can a parent torture (or order somebody to torture) their own children? Don't they love them?

<comment><USER17> You might be surprised what people consider love, and how all sorts of other beliefs get intertwined with it.

IE you have strong sacred long held beliefs that your female children are not independent, are your property. That you want the best for them, according to your beliefs and your customs, which you believe are right. That resorting to "tough love" to get wayward children on the right track is for their own good. A lot of folks would claim or deny they're hurting their children, it's their children who are being hurtful by being "disobedient", bringing dishonor, or rejecting the values on which they were raised. The list goes on and on, the rationalizations are enumerable. And even aside all that, some people just love exercising their authority over others and actively seek opportunities to do it to the maximum degree they possibly can.

It's pretty easy to rationalize cruelty as love. And everyone is the hero of their own story, so not always a lot of incentive to be objective or introspective about it.

</comment></comment><comment><USER18> What a messed up former "navy officer." She entrusted nothing less than her life to him, yet he surrendered her without fight. If a man like him ever bothered to even turn off a transponder, let alone prepare for an armed assault.

<comment><USER19> If he fought, what would have been the result ? He would have been dead and she would still go back to UAE. He made the only logical choice.

Life is not a video game.

<comment><USER20> And he's already doing a huge favor by helping her escape. Why do people expect him to sacrifice his life for her too?</comment></comment></comment>


Ebola-proven ozone treatment for Covid-19 - <AUTHOR> https://www.youtube.com/watch?v=JYIBFnGWeEM&app=desktop <comment><USER2> Ozone therapy is quackery.

[http://americanloons.blogspot.com/2019/05/2190robert-j- rowen...](http://americanloons.blogspot.com/2019/05/2190robert-j- rowen.html?m=1)

In April 2016, the FDA prohibited all medical uses of ozone, "In any medical condition for which there is no proof of safety and effectiveness", stating "Ozone is a toxic gas with no known useful medical application in specific, adjunctive, or preventive therapy. In order for ozone to be effective as a germicide, it must be present in a concentration far greater than that which can be safely tolerated by man and animals."

[https://en.wikipedia.org/wiki/Ozone_therapy](https://en.wikipedia.org/wiki/Ozone_therapy)</comment>


Tech firms "can and must" put backdoors in encryption, AG Barr says - <AUTHOR> https://arstechnica.com/tech-policy/2019/07/tech-firms-can-and-must-put-backdoors-in-encryption-ag-barr-says/ <comment><USER2> [https://news.ycombinator.com/item?id=20507104](https://news.ycombinator.com/item?id=20507104)

</comment><comment><USER3> maybe he thinks the b in bcrypt stands for backdoor</comment>


The Crystal Programming Language - <AUTHOR> https://crystal-lang.org/ <comment><USER2> Previous discussions:

[https://news.ycombinator.com/item?id=9669166](https://news.ycombinator.com/item?id=9669166) (3 years ago)

[https://news.ycombinator.com/item?id=10014178](https://news.ycombinator.com/item?id=10014178) (3 years ago)

[https://news.ycombinator.com/item?id=10803635](https://news.ycombinator.com/item?id=10803635) (2.5 years ago)

[https://news.ycombinator.com/item?id=15574714](https://news.ycombinator.com/item?id=15574714) (5 months ago)

<comment><USER3> Some news in the past 5 months:

Crystal is now %100 funded for a full-time developer working on core - [https://twitter.com/CrystalLanguage/status/98229223882167500...](https://twitter.com/CrystalLanguage/status/982292238821675008)

Crystal Automated Release towards 1.0 - [https://crystal- lang.org/2018/03/09/crystal-automated-releas...](https://crystal- lang.org/2018/03/09/crystal-automated-release.html)

A summary of why vs. why not - [https://medium.com/@DuroSoft/why-crystal-is- the-most-promisi...](https://medium.com/@DuroSoft/why-crystal-is-the-most- promising-programming-language-of-2018-aad669d8344f)

Web Frameworks Status:

Rails inspired (with Influence from Phoenix):

Amber - [https://github.com/amberframework/amber](https://github.com/amberframework/amber)

Lucky - [https://github.com/luckyframework/lucky](https://github.com/luckyframework/lucky)

Both look healthy in terms of community and updates but Amber seems to have a slight edge.

Sinatra inspired:

Kemal - [https://github.com/kemalcr/kemal](https://github.com/kemalcr/kemal)

</comment></comment><comment><USER4> I had a quick look at the language and checked about my two pet pieves. What does the code look like when handling JSON data? (that is when I slammed the door on Golang) What does the code look like when starting an external process, supplying stdin, args and capturing return code, stdout, and stderr? (that is when I slammed the door on lua). Well, I must say that crystal-lang manages to dodge the bullet twice. It handles both situations quite elegantly. So, yes, I am interested.

<comment><USER5> What exactly frustrates you about Go's JSON handling? In my experience its among the best in typed languages. Define a struct (or just use an untyped map), optionally specify json tags for field names, pass it and the json to json.Unmarshal. Go is _literally_ designed for this use case; systems programming, sharing messages between systems. Compared to other typed languages like Rust or Java, its at least as simple, if not simpler.

<comment><USER6> Compare it with F# type providers where you don't need to generate any struct and you can access the JSON object in a _type safe_ way with autocompletion in your IDE and maybe you will understand what is frustrating...

<comment><USER7> How is that possible? You either need to specify the types up front (like Go) or give up on static type safety (like Python). It's impossible to have both.

<comment><USER8> Actually, you can have both. Many languages in the ML family (Haskell, F#, etc.) can ensure complete type safety without having to define the shape up- front.

Your data comes out of the JSON structure wrapped in a functor, and you can only access it in ways that deal with missing data.

It's hypothetically possible to recreate this approach in Python, but I don't think it would be Pythonic.

<comment><USER5> Its hypothetically possible to recreate this approach in any language. Grab the item in the map at that key -> check that it exists -> check that the type is what you expect.

Its not idiomatic in most mainstream languages. Except, that's how most JSON libraries which validate against a static structure are implemented, they just abstract the reflection away via some interface.

<comment><USER8> > Its hypothetically possible to recreate this approach in any language.

Yes, I didn't mean to imply that I was providing an exhaustive list of languages where this approach could be implemented. I merely mentioned Python because it had been brought up several times in the thread.

> Grab the item in the map at that key -> check that it exists -> check that > the type is what you expect.

I'd argue with that phrasing. _You_ don't check for the key, nor do you check the type. That would imply something like an if-statement to ensure the presence of a key, and switching over a type. In such a system, you could forget to check for null, or make some other mistake that causes the program to fail at run time.

The functor approach does not rely on the developer checking anything. It is 100% type safe, enforced by the type system, cannot crash at run time, and does not require you to provide a data type to extract the data into.

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> When I was younger, I programmed predominantly in Java and types were infuriating to me.

Then I found ruby and loved how simple it was to not worry about a type system.

Then I found out how infuriating it was to not have types.

Now I'm older and appreciate having types.

Cool story, bro.

Crystal looks cool!

<comment><USER10> There's a lot more to Types vs No Types than Java vs Ruby would imply!

<comment><USER11> Indeed. You learn e.g. Haskell and find that Java painfully lacks in the types department. You learn Perl and find that Ruby is unexpectedly rigid in the types department :)

<comment><USER12> Perl also has the ability to effectively build class instances from scratch by manually blessing arbitrary data structures (usually hashes, but not much stopping you from blessing an array or scalar). For some folks (like me), it's a blessing for making hard problems at least slightly easier to solve. For others, well, there's always Moose.

Basically, a lot of Perl's object-orientation weirdness derives from it all being exposed to you. It's an excellent learning experience if you ever want to know what it means to be a "class" or an instance thereof, since "methods" are just ordinary subroutines that expect your object (or class, for constructors) as the first argument, and class instances are just ordinary scalar/array/hash objects blessed with a package name. Nothing hidden or abstracted away. Simple and flexible enough to fit into the TMTOWTDI philosophy.

</comment></comment></comment></comment><comment><USER13> I built a client for [http://woordenlijst.org/#/](http://woordenlijst.org/#/) (Dutch word existence checker basically) and it is super fast. The syntax is only slightly different from Ruby and it starts up instantly.

The only thing that I have against crystal is that my compiled binary didn't work on all other machines I tried it on. Even the practically identical macbook of a friend of mine. Looking around on their wiki pages and in the issues on github didn't give me any real solutions. So right now, as the version numbering suggests, it isn't ready for production.

<comment><USER14> When a compiled binary doesn't run on a different machine with the same hardware, it's probably a problem with dynamic linking. That seems to have been discussed on the issue tracker [https://github.com/crystal- lang/crystal/issues/2003](https://github.com/crystal-lang/crystal/issues/2003)

<comment><USER13> Thanks, I have looked over this thread a while back, but it did not fix my issues. I might give it another go sometime.

</comment></comment></comment><comment><USER15> Crystal is pretty neat and ticks off almost all of the boxes for me atm (For example the websockets server functionality in Kemal is super neat), but the lack of proper parallelism is kind of a killer. I know it's in the works, but afaict it has been so for almost a year now without much news...

<comment><USER16> Parallelism is always possible UNIX old style, use multiple processes.

It is anyway the trend we are getting back to, after we have learned our lesson how threads and plugins can bring whole processes down, while being good vehicles for security exploits.

<comment><USER15> While forking is always possible, there are some things that it does solve well enough IMO. For example, sharing and reusing database connections via a connection pool is much nicer if all threads can actually access the same memory. Shared memory is both a curse and a blessing of course :|

<comment><USER17> One can always use a bit of shared memory between processes. At least it would be contained to the parts that one really want to share. There are a few ways to do that. The easiest one is mmap MAP_SHARED|MAP_ANONYMOUS.

</comment></comment></comment></comment><comment><USER18> I've been a fan of Ruby for about 5 years, but lately I've been leaning a lot more heavily towards statically typed languages. Which is why Crystal is at the top of my "want to learn" list. Ruby inspired syntax and statically typed? Yes please. The speed is just a bonus for me.

<comment><USER19> I consider speed to be extremely important, because it enables me to use the language in many more practical scenarios. And that's a joy. Writing in most other imperative languages after having learned Ruby feels so painful to me.

</comment></comment><comment><USER20> I've been using Crystal on a mobile checkout application to watch for and parse incoming pricing files. I've been extremely happy with it so far. It is fast, the type system is nice, and I really enjoy the Ruby-like syntax and ease of development. I've also been happy with the developers and the community. The community is supportive and the developers are making good progress on the language and are quite responsive to community feedback.

If you like the idea of a fast, compiled, statically-typed, Ruby-like programming language, you can support Crystal development here (NOTE: I'm not affiliated with the Crystal project in any way. I'm just a happy consumer): [https://crystal-lang.org/sponsors/](https://crystal-lang.org/sponsors/)

</comment><comment><USER21> I played with Ruby like 15 years ago and loved it, but surely speed wasn't exactly a selling point, so I welcome this project. One question though for the gurus out there: they say the compiler is written in Crystal; is it good practice to do it that soon? To me it could slow down development, if a subtle error occurs it could make harder to nail it to a bug in the compiler or in the language.

<comment><USER22> Bootstrapping your compiler is a vanity project for languages. It's cool to show you can do it, but pretty pointless in a practical sense unless your language is targeted at building compilers.

<comment><USER23> Additionally, writing a compiler really helps a team find their edge cases much faster. Without a major software undertaking for an immature language, most of those bugs would be found (and likely not reported) by users.

But yeah, there's a little vanity too.

<comment><USER22> Sure writing a compiler can help there, but like I said, there are probably better ways to test that taking into account the design goals of the language. If you find that writing compilers is a pain in your language, but no one in your community is using your language to write compilers, are you going to invest resources in making your language better at writing compilers, or are you going to work on things important to your community?

<comment><USER23> Yeah, that's a good point. In the sense, RubyOnRails was a great blessing to the language.

</comment></comment></comment></comment></comment><comment><USER24> I have written a few small apps in it and so far I like it. I hope it gets traction and we see broad support for it dev tools. Would be cool to have debugger support in rubymine or idea for example.

</comment><comment><USER25> Looks like a nice effort. As a fan of Python over Ruby, I would love to see something like this for Python fans, but efforts like this give me hope that one day it will happen.

<comment><USER26> Strongly typed language with Python-esque syntax: [http://strlen.com/lobster/](http://strlen.com/lobster/)

</comment></comment><comment><USER27> One of the few languages that I've seen in years that I liked right away. Checks a lot of my boxes, I like the inferred types and I like static typing. Nice job!

</comment><comment><USER28> It is also a potential compile-to-webassembly language.

</comment><comment><USER29> Crystal looks really cool but if speed is what its after, i think it misses the target for most people.

because for most apps, you will be bottlenecked by the database server. it is the slowest hanging fruit on the tech stack, be it postgres , mysql, or mongo. so unless you are working on number crunching tasks that do not involve any db queries, i fail to see the benefit of a language like Crystal.

i wait for the day until the day Crystal becomes a 100% drop in replacement ready for Ruby apps.

until then, Sinatra is more than fast enough for most things.

<comment><USER15> How small is the lightest sinatra app though, when deployed in a container? We lately had some experience with dockerizing a moderately complex ruby app and it was pretty shocking how large they get compared to simple statically linked binaries.

<comment><USER29> im not sure what you are asking for in terms of lightness but its incredibly light in both concept and execution.

i mean it doesnt get any lighter than this.

require 'sinatra'

get '/' do

      "hello"

end

you should check out [https://github.com/jaequery/jasis](https://github.com/jaequery/jasis)

its a dockerized Sinatra app with all the bells and whistles and see how light it is yourself.

<comment><USER30> Sure but no useful app can be described by this "Hello HTTP" example. I've seen the same as parent: Ruby services require a lot more memory in their steady state than say, their Go service counterpart, for a same complexity.

<comment><USER29> you must be referring to Rails. sure they can be pretty big, as they are what you call a monolithic framework.

thats why i recommend Sinatra for performance conscious devs, as its a fast and minimal framework. and you get to load only what you need. check the github.com/jaequery/jasis github project and peek at the Gemfile / boot.rb to see all that it loads for a full fledged mvc app. its pretty explicit and lean if you ask me.

if are talking about server resource then you probably referring to the web server. for which we have 'puma' and it is also incredibly light and fast. much lighter than a php stack running Apache and mod_php for sure.

but i see you compared to Go to which we have no comparison Go will run circles around Ruby. but Go is not really a well suited environment for web applications yet so ill just leave it at that.</comment></comment></comment></comment></comment>


Dilbert on Values - <AUTHOR> http://dilbert.com/strips/comic/2010-12-07/ <comment><USER2> Same issue has always bugged me with ethics. Not that I lack ethics, but that all attempts to settle on a logical and meaningful set of ethics that apply to more then 1 person has seemed futile. The engineer in me is unhappy with this lack of standardization, but understands why it is impossible short of brainwashing the population. (Wait! that is a grand idea! _runs to dust off the mind control ray_ )

<comment><USER3> You might be interested in reading about the concept of Natural Law in the Thomist tradition, which attempts to clarify the principles of morality that can be discovered most intelligent people with sufficient reflection. Don't know if you'll find it persuasive, but it lends itself to analytical reasoning.

<comment><USER2> my issue is more deeply rooted. Linear logic depends on a given true, this works fine in mathematics, computer science, and physical sciences, where assumptions are made, but resultant conclusions are void if assumptions are false, but when attempted to be wielded by philosophers said assumptions seem to be made desperately, and all attempts to challenge an assumption are met with desperate shouting and intentional deafness.

<comment><USER3> Well, Thomistic philosophy does try to start with the minimum possible set of assumptions as it works upwards toward a conclusion. As I said before, you may not find it convincing, but it is at least an interesting attempt. I'd suggest "Reality: A Thomistic Synthesis" for a general overview.

</comment></comment></comment></comment><comment><USER4> I think values actually are a useful thinking point... They provide a common framework against which to evaluate actions and plans.

Sure, not everyone agrees on their definitions, but they're like unit tests: Even one unit test is better then none, so start testing.

What I think is of NO value, is companies using values as a tool to try to encourage certain behaviours in their staff, without living them wholely. If you say you have "Superiour Customer Trust" then you don't tell them when you've got an outage, hoping they won't notice, you don't REALLY demonstrate that you deserve trust.

I guess the organisations whose values are most held too are those who don't need to tout them to all and sundry. They have no need to convince anyone of them, they're just... there.

</comment><comment><USER5> Oh, but everybody has values. Just not necessarily the same that those publicly announced.</comment>


Norway rejects bitcoin as a legitimate currency - <AUTHOR> http://bitcoinsalot.com/?p=8

<comment><USER2> The capture for the info graphics says "Norway's economy", yet the graphics talks about Denmark, Sweden and Finland only…

</comment><comment><USER3> Crazy</comment>


How Basic Common Lisp Techniques Can Improve Code Configurability, Maintainability, and Reuse - <AUTHOR> http://lispy.wordpress.com/2007/08/29/how-basic-common-lisp-techniques-can-improve-code-configurability-maintainability-and-reuse/

<comment><USER2> This is what happens when a mediocre programmer reads too many Paul Graham essays, hacks his way through a couple of sections of SICP, and shamelessly rips off Peter Norvig's code in chapter 2 of PAIP.

Kids these days.... ;)

<comment><USER3> I only hope more mediocre programmers start doing the same.

</comment></comment><comment><USER4> You've got to give the guy credit for trying. His sources are sound - PAIP is difficult, and PG consistently rings true. I'd take him over a mainstream C# drone salivating over Biztalk.

I do like his update :

"A lisp hacker has rewritten my code to take advantage of more of the language's native featuresX eliminating a great deal of code in the process."</comment>


A New System for Cooling Down Computers - <AUTHOR> https://www.smithsonianmag.com/science-nature/researchers-craft-revolutionary-invention-cool-computers-180975807/lol <comment><USER2> did u mean to add "lol" to the end of that URL?

Correct URL:

[https://www.smithsonianmag.com/science-nature/researchers- cr...](https://www.smithsonianmag.com/science-nature/researchers-craft- revolutionary-invention-cool-computers-180975807/)</comment>


Muscle Memory Discovery Ends 'Use It or Lose It' Dogma - <AUTHOR> https://sciencebulletin.org/muscle-memory-discovery-ends-use-it-or-lose-it-dogma/?no_cache=1 <comment><USER2> This does not surprise me.

Men's Health magazine, Tim Ferris, and others will tout workouts that will revolutionize your body in four weeks.

The catch is that you have to be someone who has weight trained in the past but let it lapse. In that case if you work hard for four weeks, have good nutrition, use creatine, etc. you will really lose fat, gain muscle, look very different.

If you haven't done it before, weight training is good too, but the gains you get if you restart training after a lapse are astonishing. Sometimes you get stuck in weight training and lost interest, then walk away from it for six months, and you are ready to hop in again. There are better forms of "periodization" out there, but that is one of them.</comment>


Leaky Database Reveals GPS Surveillance Of China's Uyghur Muslims - <AUTHOR> https://gizmodo.com/leaky-database-reveals-horrifying-gps-surveillance-of-c-1832658367 <comment><USER2> The technology and infrastructure to do surveillance of this scale is already in place/available in the western world (see cameras at every corner in London, Amazon Rekogition?).

So is this already happening in the west? And what can we do to stop technology like this to be put in place, considering a lot of elected officials don't seem to consider this as inherently 'bad' for society.

<comment><USER3> Many citizens, as opposed to just politicians, are happy to be surveilled, as long as it's ostensibly being used against people that they feel hatred for. That's a key difference in this case. The West may have an easier time fending this off, until the day some politician decides to frame the surveillance as a safeguard against a broad social group, e.g. a religion, race, or political affiliation, as opposed to the more nebulous category of just "criminals", in which case I'm afraid I don't have much reason to think the West would be any more immune to such societal crumbling than China is.

<comment><USER4> Why so we think such abuses will be driven by politicians? These policies come from the Executive, only two of which are elected in America. It'll be some unelected official driving these policies.

</comment></comment></comment><comment><USER5> Duplicate: [https://news.ycombinator.com/item?id=19176524](https://news.ycombinator.com/item?id=19176524)

From that news:

> ... But the company failed to protect that database with a password, Victor > Gevers, a Dutch security researcher with the GDI Foundation, discovered > Wednesday. The database contained more than 2.5 million records on people, > including their ID card number, their address, birthday, and locations where > SenseNets' facial recognition has spotted them.

> From the last 24 hours alone, there were more than 6.8 million locations > logged, Gevers said. Anyone would be able to look at these records and track > a person's movements based on SenseNets' real-time facial recognition. ....

> Logged locations include police stations, hotels, tourism spots, parks, > internet cafes and mosques, Gevers said. The researcher found that there > were 1,039 unique devices tracking people across China.

> One camera was logged monitoring the Uygur population in Xinjiang, a Muslim > minority group that the Chinese government has been accused of targeting > with human rights abuses.

</comment><comment><USER6> It truly is a peep into the future, and not just for China. High definition surveillance cameras combined with modern facial recognition techniques will be commonplace all around the world in the not too distant future. What surprises me is there doesn't seem to be much public debate about it.</comment>


Ultra Large Scale Systems: The Software Challenge of the Future (2006) [pdf] - <AUTHOR> http://resources.sei.cmu.edu/asset_files/Book/2006_014_001_30542.pdf

<comment><USER2> >>ALT posed this question to the SEI: "Given the issues with today's software engineering, how can we build the systems of the future that are likely to have billions of lines of code?"

Seems a bit misguided to use LOC as a metric here.</comment>


Uber Can Be Fixed and Middle Eastern Women Need It - <AUTHOR> https://www.juancole.com/2017/07/fixed-mideast-women.html <comment><USER2> No, middle eastern women need 1) gender equality, and 2) since that's not forthcoming, a service LIKE Uber. They don't need Uber specifically. Heaven knows there are plenty of competitors to take its place.

<comment><USER3> You mean Careem, Uber's Middle Eastern competitor? Be careful what you wish for...

[https://www.nytimes.com/2017/06/10/world/middleeast/egypt- ub...](https://www.nytimes.com/2017/06/10/world/middleeast/egypt-uber-sisi- surveillance-repression-careem.html)

[https://www.eff.org/who-has-your-back-2017](https://www.eff.org/who-has-your- back-2017)</comment></comment>


Ask HN: teaching basic coding and web design offline, solely via iOS devices? - <AUTHOR> My wife recently began working with incarcerated young adults and the coordinator of the program she's volunteering for is very enthusiastic about her potentially teaching the inmates web design and basic programming skills. The problem, however, is that the only devices available are 3rd gen iPads and there's no internet access. I'm wondering if anyone has had experience teaching in an environment like this, and if any good options exist specifically for teaching basic coding and web design skills offline and on iOS. (I'm guessing that the most attainable goal for this project would be teaching them how to create and customize a Wordpress site, but more ambitious suggestions are welcome). <comment><USER3> I recommend taking an analog approach. Use paper and pencil to teach them the concepts. Use the computer as a way to demonstrate those concepts.

Old ipads without internet access will not provide the playground to create a wordpress site. It's possible with external keyboard and some finaggling around but you'll find you're spending too much time fighting technology.

Use pen and paper to teach them the architecture and first principles. Use the ipads as a way for them to play with/write html code. For example use web inspector tools to change a webpage on the fly and see the changes.

</comment><comment><USER4> Ben - fascinating problem, and kudos to your wife for looking at this question. There are analogous programs that have led to successful outcomes here – ie, [https://thelastmile.org/](https://thelastmile.org/) These may have useful learnings.

It's quite possible to teach sophisticated computer science without computers at all, so the first question is what the most useful skillset will be. Basic frontend engineering is probably the most in-demand skill today and allows individuals to see their product on the web right away. Young inmates may also be interested in coding as a path towards entrepreneurship and this can be bundled into a curriculum.

You can code with just a text editor and view results in a web browser without internet access.

Here are two apps that may prove useful as text editors:

1) [https://itunes.apple.com/us/app/diet- coda/id500906297?mt=8](https://itunes.apple.com/us/app/diet- coda/id500906297?mt=8)

2) [https://itunes.apple.com/us/app/codetogo/id382677229?mt=8](https://itunes.apple.com/us/app/codetogo/id382677229?mt=8)

It may also be possible to take the iPads out and upload the content to the web yourself, provided staff review & clear the content. This can lead to effective outcomes.

-Anand

</comment><comment><USER5> So I'm curious as to whether these were donated or whether there was some state program which paid for them and if it was the latter, how the heck such a purchase was justified.

iPads have the lowest productivity to cost ratio of any computing device - probably up there with video game systems or burning bundles of money in large piles.

Even if they were donated, I'd try to quickly sell them on the market and get cheap traditional computers that can be used to teach real skill. You can get working used laptops from ebay for $25 a piece with shipping; ~core2 with ~1GB of ram and ~40GB of disk. Perfectly adequate machines.

That's ~40 computers for the cost of 1 iPad.

You could teach everything from how to type and use a word processor to haskell and emacs on any of those.

<comment><USER6> > iPads have the lowest productivity to cost ratio of any computing device - > probably up there with video game systems or burning bundles of money in > large piles.

I've generally been feeling the same way about tablets in general. Yet I see so many schools around me using funds to procure them for the classroom. Is there some educational use case for ipads that I've been missing?

<comment><USER7> Textbook replacement. Turns out tablets are quite economical compared to dead trees that become outdated or worn out fairly quickly. Not to mention tablets are much easier on students' backs. Ignoring any computational aspect, tablets are still a big win.

<comment><USER8> So, iPads are a physically lighter, and a better value than printed out text books. So what? Netbooks are a better value prop there hands down. They weight about the same, and obviously can display drm'd pdfs without a problem.

My guess is the non-technical people involved with ordering them think iPads are sexy and cool.

<comment><USER9> Having supported thousands of netbooks across 50+ schools I can say they are an awful teaching tool.

They require constant maintenance and updates and installing software is a nightmare. Remember these are being bought by schools where there probably isn't even a full time I.T Technician on site and there is rarely the infrastructure in place to automate any of the work.

Getting young children to simply log into a netbook can sometimes take most of a lesson. After swapping out netbooks that have keys torn off, ones that haven't been charged and ones that don't have the software installed - <USER2> kids are frustrated and the lesson is over.

Fleets of iPads are much easier to manage. It takes 5 minutes for a teacher to push out an app via an MDM platform to all iPads. The latest educational apps out there are being built for iOS first. Best of all they are relatively virus free. Also kids recognise them as being an expensive piece of equipment and treat them with more care and are more enthused to use them.

iPads let you get straight into the content and the technology just gets out of your way.

</comment></comment></comment></comment></comment><comment><USER10> For programming in Python, Pythonista is an amazing thing to behold: [https://appsto.re/us/P0xGF.i](https://appsto.re/us/P0xGF.i)

As mentioned by another, Coda would be great for general web work: [https://appsto.re/us/5KZ2D.i](https://appsto.re/us/5KZ2D.i)

A worthy endeavor, thanks for telling us about it.

</comment><comment><USER11> I hate to rain on your parade by why not just teach basic math?

Its going to be much more useful than Web dev skills in the long run. Not all the kids will get into tech, but they'll all need some basic math later in life.

<comment><USER12> "Math" is a scary word for most of non-geeks, so it's hard to persuade people to learn in. It's probably way easier to convince people by saying: "let's learn making some cool webpages everyone can see (and earn tons of money(0))" than "let's learn trigonometric algebra, you might need it sometime".

0\. or so they've heard

<comment><USER11> You aren't going to teach anyone anything of value about web development using an iPad, especially one with no web access.

<comment><USER12> iPad is definitely a bad choice here (unless external keyboard is hooked up), but you can teach basics even on paper just fine. Yes, probably you are not going to teach them enough to make a living, but the key of inmate courses is mostly to give them hope and show the other way of life, so when they are released from prison, they would want to seek a proper education themselves.

</comment></comment></comment></comment><comment><USER13> I have mentored two middle schoolers in an independent study using Codea. [https://codea.io/](https://codea.io/) It's great for that immediate feedback loop when starting out.

If you weren't using iOS, love2d is great, as well.

</comment><comment><USER14> One thing to think about with iOS devices is that you might be out of luck with some good coding apps because of their App Store policies. I looked at trying to get a python interpreter app on my iPad somewhere around a year and a half ago (maybe two?) and at least then all of the apps had to be IDEs that sent input to a remote server for execution because the App store didn't allow arbitrary user input code execution in apps on the device. I wanted offline operation so I was out of luck at the time, I wish you better luck.

<comment><USER15> Then you are in for a treat! Pythonista is AMAZING and I have no clue how Ole Zorn got it past the App Store reviewers. [https://itunes.apple.com/us/app/pythonista/id528579881?mt=8](https://itunes.apple.com/us/app/pythonista/id528579881?mt=8)

<comment><USER16> By reading and understanding the guidelines. There isn't now - and hasn't been for quite a while - a general ban on interpreters.

Relevant sections of the (current Feb 2016) guidelines : _2.7 Apps that download code in any way or form will be rejected 2.8 Apps that install or launch other executable code will be rejected_ [0]

There are a bunch of interpreters in the store for various languages. The only problem is if you download arbitrary code. In theory anyway. In reality the review process is indistinguishable from arbitrary and capricious.

[0][https://developer.apple.com/app- store/review/guidelines/#fun...](https://developer.apple.com/app- store/review/guidelines/#functionality)

</comment></comment></comment><comment><USER17> Just a question: how are you going to get anything onto the iPads without internet access?

Or, I guess, she can upload stuff to the iPads and use them online, but the inmates can't?

I can't say anything about iPads themselves, but depending on how much motivation they have, just look at how European universities taught computer science before they had cheap access to computers: use a book and pen-and- paper; if you want to run a program, you'll have to wait for a few days for the results to come back.

Of course, iPads are powerful enough, that with the right software you can program on the directly: eg [https://itunes.apple.com/us/app/scheme- programming-language/...](https://itunes.apple.com/us/app/scheme-programming- language/id500474368?mt=8)

(I have no clue whether that app is any good, I just googled for "Scheme for iPad". Edit: oh just read, this app needs internet connection. Alas.

A bit of searching should yield some that run purely locally. Perhaps [https://itunes.apple.com/us/app/iluabox/id398073834?mt=8](https://itunes.apple.com/us/app/iluabox/id398073834?mt=8))

In any case, if you can get the lads to treat programming like math, you can get pretty far with just book and pen/paper alone. If you can keep them interested.

<comment><USER18> For Scheme, Lisping is probably a far easier and more tablet friendly interface. [http://slidetocode.com/lisping](http://slidetocode.com/lisping)

</comment></comment><comment><USER19> If there's a network/intranet available that you can connect to, that just can't access the internet, you should definitely check out Khan Academy Lite: [https://learningequality.org/ka-lite/](https://learningequality.org/ka- lite/).

It has much more than just basic coding and web design too :).

</comment><comment><USER20> [http://computableapp.com/](http://computableapp.com/) a great python teaching resource for ipad. like someone already mentioned. try replacing them for proper laptops. damn, even if they were US$100 android tablets they would be more useful as a teaching tool, given android can run a web server, a database server, etc. cheers for the endeavour!

<comment><USER21> Unfortunately "As of March 2015, [the developed has] pulled Computable from the App Store because of ongoing stability issues."

<comment><USER20> bummer. :( i was using it a bit over a year ago to teach someone programming basics

</comment></comment></comment><comment><USER22> I just downloaded and tried out an app called "Time to code - learn HTML, CSS and JavaScript." I have never used it to teach (and only downloaded it in response to this Ask HN). But, what I have seen is actually quite good! It might get a bit boring for teenagers, but as a learning tool, it seems pretty decent.

(Also note that I'm 38 so I'm not a very good judge of what teenagers would enjoy.)

</comment><comment><USER23> My friends run Rikers Bot. Get in touch.

[http://xpmethod.plaintext.in/public- discourse/rikersbot.html](http://xpmethod.plaintext.in/public- discourse/rikersbot.html) [https://github.com/xpmethod/rikersbot](https://github.com/xpmethod/rikersbot)

</comment><comment><USER24> Not sure about Wordpress, but there's a Python IDE I recommend, and it also supports HTML syntax highlighting: Pythonista ([https://itunes.apple.com/us/app/pythonista/id528579881?mt=8](https://itunes.apple.com/us/app/pythonista/id528579881?mt=8))

</comment><comment><USER25> There's no Internet access, but is there a local network? If the end goal is create a Wordpress site, it would help a lot if the sites could be uploaded to a server, even if it's a local one.

<comment><USER26> Bring in a laptop and set up an ad-hoc WiFi network.

</comment></comment><comment><USER27> There is Love (but it's not webdesign): [https://love2d.org/](https://love2d.org/)

</comment><comment><USER28> Start with logic games, then fun algorithms with python. Lego mindstorm has a cool game.

</comment><comment><USER29> Hmm.

Offline code.org, anyone?

</comment><comment><USER30> Why do they want to do it?

Focus on their reasons why, rather than just teaching them to code so they can code. What's the benefits? And I don't think just having a job is a good enough incentive.

Try to instill some passion in them, and then like suggested above... All you need to do is show them some books and let them write it out on pen and paper.</comment>


Ask HN: Is there an concept to build an API that can be wrapped in any Language? - <AUTHOR> I' am looking for some guidance to build an API that could be wrapped in any/most languages. All the wrapper shall follow the same structure and rules without beeing ugly to use. I don't know much about language specific quirks implementing an API. Are there any concepts or best practices that one should use? <comment><USER2> See Swagger

[https://swagger.io/](https://swagger.io/)</comment>


Why you should use talloc for your next C project - <AUTHOR> http://blogs.fedoraproject.org/wp/sgallagh/2010/03/17/why-you-should-use-talloc-for-your-next-project/ <comment><USER2> talloc is based on my library called halloc [1], which stands for _hierarchical allocator_. The idea is that every malloc'ed block can be assigned a parent block. Freeing the parent block also frees all its children in a recursive fashion, and that's about it. I cooked up halloc several years ago when implementing IKE (the IPsec keying protocol) library and it proved to be very useful for reducing the verbosity of the code without loosing any clarity.

Tridge fluffed up halloc to make the API more fit and convenient for Samba code, and talloc came out. I still like my version better though because it is simpler and (subjectively) more elegant.

[1] <http://swapped.cc/halloc>

<comment><USER3> No offense intended, but I have to say I was a little bit disappointed by halloc. I expected it to use a custom allocation scheme, like malloc()ing large chunks of memory in one go in order to reduce malloc() time and space overhead and to increase locality of reference. Instead it looks like it just malloc()s every object separately. I'm sure some people will find halloc useful, but in my C++ project where I already use smart pointers I didn't see any advantage in using halloc.

It doesn't look like talloc is any better.

<comment><USER4> Do you have evidence that rolling your own suballocator under malloc is better than just using malloc. By "evidence" I mean you actually measured it, not arm-waving.

<comment><USER3> Yes. For example my app has a hash table which it fills upon every request. After this initial filling, not more hash table entries are set. At the end of the request the hash table is deleted, and a new one is created at the next request. I improved performance a bit by clearing the hash table instead of deleting and recreating it. What gave me an even bigger boost in performance was by using a custom allocator that allocates big chunks of memory in a single operation.

The thing is my app is already not doing a lot of work per request so almost any speedup is noticeable.

<comment><USER5> You saw benefit because you implemented a custom allocator whose behavior was optimized to the memory access pattern that you planned to use with it. Any decent implementation of malloc already allocates large chunks of contiguous memory from the operating system and tries to maintain locality among allocations. It's also possible that you saw performance improvement from the removal of a function call - it's possible that the call to your custom allocator could be inlined, whereas malloc has to be a function call.

My understanding of halloc and talloc is that they are _general purpose_ allocators. A pure library approach - that is, without source code analysis and code generation - won't be able to tailor the allocation scheme based on the data structures themselves.

<comment><USER2> FooBarWidget got a good point though.

When two blocks are explictly tied into a parent-child relationship, it gives the allocator valuable locality information. It is another matter that halloc separates allocation and block binding steps, so the relationship information is not available at the allocation time, and so it cannot utilize these locality hints.

</comment></comment></comment></comment></comment></comment><comment><USER6> This feels slightly untrustworthy. What if there are still external references to subfields of a struct? I think it's probably safer to just write explicit constructors (that allocate and initialize) and destructors (to free properly) for the things you use.

<comment><USER7> Why does everyone conflate allocation and initialization?

<comment><USER8> RAII, at a guess.

</comment></comment></comment><comment><USER9> Writing a pair of constructor/destructor is not a problem.

tmalloc() adds a layer of complexity that is unhealthy to C programs. Are the few seconds you save by using tmalloc() really worth the hours spent to debug memory leaks 6 months later when the project got big and complex with multiple collaborators ? No.

Introducing side-effets under the table is the best way to confuse other C programmers when they read your code. It's not worth it.

Memory management is part of C, and will always be. If you don't like it, switch to another language.

<comment><USER10> What side effects were introduced "under the table"? talloc introduces entirely new functions, it doesn't override standard malloc/free. All of the new behaviors are rather explicit.

As for large project with collaborators: if the project doesn't already have coding standards or doesn't have a code review process for new members then they're already headed down a bad path. And anyone blindly introducing talloc into an existing project without first getting agreement from other participants and taking steps to smooth integration is irresponsible.

The issues you give aren't reasons to dismiss talloc. Bugs, implementation flaws, design limitations are some valid reasons. By your argument, anything layered on top of the C standard library should be avoided.

<comment><USER9> 1) freeing memory automatically for you. That's under the table :)

2) Absolutely

3) No. it's just that memory management related issues are really nasty. On the other hand, adding a new printf() function won't do much harm.

</comment></comment></comment><comment><USER11> One tricky thing here is that this does break the normal memory management semantics. That is, while one nice thing about malloc/free is that you can drop pretty much _any_ implementation of a user-space memory allocator in there without changing your code, this is no longer the case. Whatever replacement allocator you use will have to change its interface, and probably its data structure, to fit the new model.

Edit: Also, how is this better than doing something like this

      struct some_complex_struct {
      ...
      };

      free_some_complex_struct(struct some_complex_struct * scs) {
      ...
      }

<comment><USER12> I don't understand why talloc preclues a different malloc/free implementation.

According to the article, talloc is a malloc wrapper. If that's the case, why shouldn't you be able to drop in whatever allocator you want? talloc should still use it under the covers.

<comment><USER11> Ah, I didn't see it's a wrapper. In that case, what's the point of using it at all? If it doesn't help to optimize the memory allocation, it seems more like a macro and less like a library.

<comment><USER13> Author of the article says quite clearly why he thinks it is useful.

<comment><USER11> But he doesn't quite make it clear if he wants it done for every memory allocation, or that specific type of allocation. The two have very different results.

</comment></comment></comment></comment></comment><comment><USER14> How does this work for a case like DOM nodes? Where each child is constantly re-assigned parents? Is there any way to reset the parent?

<comment><AUTHOR> Yes, and you can also have multiple parents with a reference-count semantics.

      void * talloc_steal(const void * new_ctx, const void * ptr);

      The talloc_steal() function changes the parent context of a talloc
      pointer. It is typically used when the context that the pointer is
      currently a child of is going to be freed and you wish to keep the
      memory for a longer time.

      NOTE: It is possible to produce loops in the parent/child relationship
      if you are not careful with talloc_steal(). No guarantees are provided
      as to your sanity or the safety of your data if you do this.

There's also talloc_reparent where you explicitly choose the parent to change.

<comment><USER14> This is nice!! Thanks!!

</comment></comment></comment><comment><USER15> was surprised to see no mention of:

<http://www.gnu.org/s/hello/manual/libc/Obstacks.html>

seems like a very similar concept / means to an end?

</comment><comment><USER16> Why you shouldn't use talloc for your next C project:

GPL v3.

<comment><USER17> Talloc uses the LGPL, not the GPL.

<comment><USER18> Even LGPL is a pretty steep price for the value being offered. The LGPL requires that is it possible to substitute a modified version of the library, which can be a logistical problem. Do you really want to have to link your malloc() as a shared library? How do you let the user substitute inline functions? What do you do when people start bugging you because they weren't able to substitute a modified version of the library due to some technical edge case?

Too much legal baggage for such a small piece of functionality.

<comment><USER17> I wouldn't call talloc a small piece of functionality. Also, the LGPL explicitly states that dynamic linking suffices, and also explicitly covers the inclusion of bits from header files. I do agree that the LGPL makes it non-trivial to statically link a proprietary application with the library; personally, I think it would help if the FSF had standard exception language libraries could use if they don't care about relinking and only care about requiring source for modified versions of the library. That said, I don't write proprietary software, so that doesn't affect me. :)

<comment><USER18> > Also, the LGPL explicitly states that dynamic linking suffices

Good point, I thought that the requirement was substitutability and dynamic linking was just given as an example of how a library can be substitutable, but it appears that dynamic linking is sufficient.

> and also explicitly covers the inclusion of bits from header files.

It's not clear to me exactly the meaning of these sections; if including bits from header files is truly allowed, then you could effectively circumvent the substitutability goal by simply inlining the whole library.

> That said, I don't write proprietary software, so that doesn't affect me. :)

I don't either, but I write a BSD-licensed library that I absolutely want to be usable with proprietary software without any difficulty.

<comment><USER17> > Good point, I thought that the requirement was substitutability and dynamic > linking was just given as an example of how a library can be substitutable, > but it appears that dynamic linking is sufficient.

You can satisfy the requirement without dynamically linking (by shipping object files or source code instead), making dynamic linking sufficient but not necessary. In practice, though, nobody seems to attempt anything other than dynamic linking against an LGPL library, or shipping enough source code for static linking (even if not all the source code).

> It's not clear to me exactly the meaning of these sections; if including > bits from header files is truly allowed, then you could effectively > circumvent the substitutability goal by simply inlining the whole library.

Substitutability represents a technical goal, and the library has to support that goal for it to prove useful. If the library provides the entirety of its functionality via inlines in header files, they clearly don't care about substitutability. And if you modify the library to move all of it into header files, you still have to supply the source for the modified version of the library, so you've broken substitutability but you haven't broken the copyleft. As far as I can tell, the LGPL's goal of substitutability seems primarily aimed at cases where you don't intend to substantially modify the library; after all, you can also change the library's API/ABI and thus make the original no longer substitutable. (Personally, I don't really see the point of the substitutability provisions anymore; I really just want a copyleft on the library itself.)

> I don't either, but I write a BSD-licensed library that I absolutely want to > be usable with proprietary software without any difficulty.

Fair enough. However, in that case the copyleft on the LGPL software seems equally onerous, since users of your library would need to ship the source of talloc, even though they don't need to ship the source of your library. (One other interesting provision: the users of your library couldn't use a license that prohibits reverse-engineering.)

In any case, yes, talloc's license effectively makes it unusable by libraries that want to provide an all-permissive license. If you really want to use talloc, you might consider writing to the authors of talloc; they might prove sympathetic to the needs of a BSD-licensed library, and grant a suitable exception. (Personally, I'd like to see some standard wording for an exception similar to the one used in UPX, namely that you can use it under an all- permissive license as long as you use an unmodified version.)

</comment></comment></comment></comment></comment></comment><comment><USER19> Or you could use C++ and RAII. It's an excellent fit for the problem that's been presented.

Though I do understand, there are some very special projects that can't use C++, and must use C. I'd say in most cases, the extra machinery you get with C++ outweighs the small performance penalty you get by going with straight C.

<comment><USER20> FWIW, with C++, the advantages of linking to tcmalloc make it the default for any code that I write that isn't intended to run as a daemon -- and even there, unless I hit tcmalloc's limit of not releasing memory back, it's still a viable choice.

<comment><USER21> Google perftools are bloody awesomesauce.

</comment></comment></comment><comment><USER22> How does it deal with cycles, or leaning ownership?

<comment><USER23> This is exactly the qestion I was asking myself. What if the child block needs to be deallocated before the parent block ? What if block dependency is changed ?

These functions are to be used with particular conditions which aren't clearly specified. When the conditions are met then it is a clear benefit to use them. But these add complexity and new pitfalls to inexperienced programmers.

</comment></comment><comment><USER14> On the whole, I think talloc() is targetting a very specific use-case and if you have that it would be great to use (just like obstack).

</comment><comment><USER24> why I'm glad to be writing objective-c and getting free reference counting built it :-)

<comment><USER25> Except apple advises you not to use reference counting when trying to debug. So when reference counting doesn't work, you still have to go back and manually count the references yourself...

<comment><USER10> Apple doesn't advise developers to avoid ref counting, it advises them to avoid using -retainCount. -retainCount is a weak debugging tool, at best. It doesn't take into account autorelease pools, to start, and any framework- specific memory management is ignored. Its use is discouraged for good reason.

For better tools, check out Instruments, MallocDebug or leaks. Or read Apple's Memory Usage Performance Guidelines, specifically the "Finding Memory Leaks" section. [1] Apple's Technical Note TN2124 "Mac OS X Debugging Magic" even has, in the Cocoa section, an example of how -retainCount can be misleading and confusing. [2]

Nowhere does Apple advise Cocoa developers to avoid ref-counting. Cocoa's ref- counting/GC'd memory management system is considered a huge advantage for the platform.

[1] [http://developer.apple.com/library/mac/#documentation/Perfor...](http://developer.apple.com/library/mac/#documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html) [2] [http://developer.apple.com/library/mac/#technotes/tn2004/tn2...](http://developer.apple.com/library/mac/#technotes/tn2004/tn2124.html)

</comment></comment></comment><comment><USER26> I look forward to seeing the rest of Common LISP implemented in C too.

<comment><USER27> Eliezer, did somebody break into your account to post that comment? Since when does Common Lisp have any kind of manual deallocation, let alone manual deallocation of hierarchical memory pools?</comment></comment>


Essential Tools for Starting a Rails App in 2013 - <AUTHOR> http://www.petekeen.net/essential-tools-for-starting-a-rails-app-in-2013

<comment><USER2> I view Devise, CanCan and SimpleForm as unnecessary gems these days. Rails has better facilities for all the things those three gems provide. If you take a little time to create your own login or auth system you'll be much better off than inheriting the bloat that gems like CanCan and Devise add to your code base.

I could flip a coin on whether SimpleForm is still useful or not. I tend to find myself fighting with its method signatures so I don't really like it.

All in all, Rails has grown since these gems were created. Use the new facilities that Rails provides as well as some OO design to solve problems. It's much better than including fat gems like the three I mention above into your code base.

<comment><USER3> So you're better off rolling your own auth gem vs utilizing a popular gem that's been baked in thousands of production environments?

I agree that Devise is heavy and hard to extend but when we're considering such a fundamental like auth, you have to have a pretty good reason to deviate from the time tested popular choices.

Maybe you can write a lighter auth class, but can you write a more secure auth class? If devise has a vulnerability, there are tons of other sites out there "watching your back" and could report the vulnerability. If you roll your own, how are you going to aggressively audit its security?

<comment><USER2> I think you're overstating the security value that Devise gives you. It's hardly more than Rails gives you out of the box. After all, Devise is for Rails and written in Ruby.

<comment><USER3> I think you're underestimating the power of utilizing a community built library.

</comment></comment></comment></comment><comment><USER4> Some additions:

* The better_errors/meta_request/binding_of_caller combo for error pages with in-browser REPL and for Rails Panel chrome dev tools tab

* foreman for launching processes

* pry as a debugging tool

* lograge/quiet_assets for cleaner log files

As the project author, I will not include simplecov here, but I would normally drop that in there too ;)

<comment><AUTHOR> That first one is pretty neat. Here's a RailsCast I found about it: [http://railscasts.com/episodes/402-better-errors- railspanel?...](http://railscasts.com/episodes/402-better-errors- railspanel?view=asciicast). Foreman is something I use every day and I didn't even think to include it, thanks.

</comment></comment><comment><USER5> Anyone interested in learning more about Devise [1], Breakman [2], Simple Form [3], or Sidekiq [4], should check out RailsCasts [5]. Ryan Bates, who runs RailsCasts, has screencast episodes on all of these. With 400+ episodes, if you have an idea, he has most likely done a tutorial that will walk you through the implementation, this is invaluable for everyone from newbie to experienced, in that it will likely save you lots of time.

ps. Using Michael Hartl's Ruby on Rails Tutorial [6], and Ryan Bates's RailsCasts, I was able to go from _zero_ knowledge about rails, to implementing CRUD apps [7] in a couple weeks. As a side note, I things these two resources show the power of internet/distance learning.

[1] [http://railscasts.com/episodes/209-devise- revised](http://railscasts.com/episodes/209-devise-revised)

[2] [http://railscasts.com/episodes/358-brakeman](http://railscasts.com/episodes/358-brakeman)

[3] [http://railscasts.com/episodes/234-simple-form- revised](http://railscasts.com/episodes/234-simple-form-revised)

[4] [http://railscasts.com/episodes/366-sidekiq](http://railscasts.com/episodes/366-sidekiq)

[5] [http://railscasts.com/](http://railscasts.com/)

[6] [http://ruby.railstutorial.org/](http://ruby.railstutorial.org/)

[7] [http://en.wikipedia.org/wiki/Create,_read,_update_and_delete](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete)

</comment><comment><USER6> I might add the pry gem to that list. It has a pretty robust community around it and it can help when debugging hairy code.

</comment><comment><USER7> I echo some of the sentiment that some of these gems provide, but they are quite helpful in getting a quick project up and running in a few minutes to start playing around.

Some of my favorites:

figaro[1] Alternative to dotenv, awesome mascot.

rack-mini-profiler[2] Often folks will say to save performance tuning until the end. I find having this around from the get go makes it much easier to do as you move along.

I love sidekiq though. Probably the best on the list. Background queues are essential to most, if not all Rails applications. The goworker post from today looks interesting too.

[1] [https://github.com/laserlemon/figaro](https://github.com/laserlemon/figaro)

[2] [https://github.com/MiniProfiler/rack-mini- profiler](https://github.com/MiniProfiler/rack-mini-profiler)

</comment><comment><USER8> I was looking for a dotenv alternative for the shell (fish preferably) but I couldn't find any so I wrote my own [1]. Does anyone know any alternatives?

[1] - [https://github.com/vially/fish- config/blob/master/modules/au...](https://github.com/vially/fish- config/blob/master/modules/autoenv/autoenv.fish)

</comment><comment><USER9> Peek and its various plugins are pretty nice in development. Let's you easily see what and where your slow points are as you click around the site.

[https://github.com/peek/peek](https://github.com/peek/peek)

</comment><comment><USER10> My personal additions:

* CanCan for authorization (it also integrates nicely with devise)

* webmock for testing (because sooner or later I always end up with some slow network call in tests)

<comment><USER11> I've grown to like Authority more than Cancan. It does 'less' magic but it's way more declarative and allows you to be really explicit on what you want to check.

</comment></comment><comment><USER12> * capistrano for deployments

* exception_notification for email notifications

* state_machine for, well, state machines

* pg_search for simple postgresql searching

* premailer-rails for html emails

* whenever for cron jobs

* backup for a backup dsl, useful with whenever

<comment><USER13> Interesting to see backup mentioned. I've used it in the past, but kind of forgot about it. It's super useful. The documentation tells you to not put it into Gemfile, but it seems like you really should. Do you?

</comment></comment><comment><USER14> Haml because writing HTML sucks.

Bcrypt-ruby and the built in auth stuff because I find Devise too inflexible.

strip_attributes to clean up user inputs

VCR to speed up tests involving 3rd party services

foreman to control processes and automatically support dotenv.

</comment><comment><USER15> I purchased the Payment Gateway book and regretted it. The only essential tool I see on the list is Sidekiq and the rest is just bloat.

<comment><USER16> I really liked Pete's book - to the point, and let me get going quickly.

I think it can be hard to accurately judge the value of something as focused as a book that is so specifically targeted.

In particular, I feel like the book gets you to a complete end to end Rails+Stripe.js system much much faster than I could have cobbling everything together myself.

</comment></comment><comment><USER17> I use 1 of those. Essential is a bit of a stretch.</comment>


Ask HN: Why do startups use fake client testimonials? - <AUTHOR> How come this trend is so widespread in the startup community. Do people not realise that it makes them look unprofessional when they clearly use a stock photo, and some fake reviews to boost their credibility.<p>The ones I'm referring to are the small oval pictures, that service/product offering startups are so fond of using. There are usually a few client testimonials that are obviously fake. <comment><USER2> Should or should we not call them out here?</comment>


Vulkan in 30 minutes - <AUTHOR> https://renderdoc.org/vulkan-in-30-minutes.html <comment><USER2> The sample code shows just how absurdly explicit this API is. 200 lines to get a triangle on the screen!

<comment><USER3> With great power, comes great responsibility. For those who don't prefer this level of abstraction, just use a higher level zero cost abstraction.

<comment><USER4> I don't know, I feel like D3 solidly demonstrated that you can have absolute configurability without sacrificing any conciseness.

<comment><USER5> D3 is not concise compared with most simple js graphing libs -- e.g. highcharts.

<comment><USER6> I agree, but it is not fair to compare D3 and highcharts because they are not in the same league.

There are many higher level libraries leveraging on D3 that could be compared to highcharts. There are also many lower level libraries that have the same scope as D3, and compared to most of them D3 is pretty concise - the parent comment has a point.

</comment></comment></comment></comment></comment><comment><USER7> It's Vulkan, with a K.</comment>