Show HN: Writing – A lightweight distraction-free editor (MathJax and Markdown) - <AUTHOR> https://github.com/josephernest/writing <comment><USER2> For me, the most satisfying markdown editor is Typora([https://typora.io/](https://typora.io/)), which doesn't need a separate preview pane to show the rendered contents. But I haven't tried the Math support of it yet.

After using Typora for a long time, I really don't think a separate preview is that necessary.

<comment><AUTHOR> Typora seems nice, but it seems it's _not in the browser_... Sometimes it's ok, but sometimes it's cool to have a solution in the browser (shared computer, university computer, etc.) where you cannot install any binaries.

</comment></comment><comment><AUTHOR> If you want to test it quickly, copy+paste the following code in the live version ([https://josephernest.github.io/writing/](https://josephernest.github.io/writing/)):

        #LINEAR ALGEBRA
        ##1. Introduction
        **Definition :** A matrix is ... a matrix.

        Examples:
        $$A = \begin{pmatrix}0&1&-2&3\\5&-3&1&-2\\5&-2&-1&1  \end{pmatrix},\
         B = \begin{pmatrix}0&8&-5\\0&0&0\\-1&-9&4\\2&19&-8\\1&1&1\end{pmatrix}$$

(paste it _without_ the 4-spaces indentation)

<comment><USER3> One cool feature would be to scroll-lock the input with the output when scrolling the output pane.

Obviously the challenge is that they don't correspond line-to-line. Embedding an image is a one-liner of input yet might be hundreds of pixels tall in the preview.

VSCode's Markdown preview does this decently when you're scrolling the preview pane.

<comment><USER4> much of the time, you want the output to sync to the input.

but oftentimes you don't.

the trick is finding a good way to walk that tightrope.

</comment></comment></comment><comment><USER5> I'm so glad it uses Computer Modern, and supports \align environments etc. I know the latter is just MathJax, but Computer Modern is a detail that every other Markdown/LaTeX mix has forgetten, and it shows.

<comment><USER6> Funnily the math it renders doesn't use Computer Modern at all.

<comment><USER7> What do you mean? At [https://josephernest.github.io/writing/](https://josephernest.github.io/writing/) it includes cmunrm.otf:

        @font-face {
            font-family: texroman;
            src: url(cmunrm.otf); /* https://tex.stackexchange.com/a/267197/27733 */
        }

And a spot check of some of symbols in the rendered math seems to prove it is Computer Modern.

Funnily for me, just today I was telling a colleague how I'm happy to see math textbooks that _aren 't_ in Computer Modern.

<comment><USER6> I see this: [https://imgur.com/a/vvYpW](https://imgur.com/a/vvYpW)

The symbols and letters are so wrong. Inspecting the element shows that the font family is STIXGeneral.

On the other hand I find it amusing that an editor that purports to be "distraction-free" uses fake italics (known as \textsl in LaTeX) who are _incredibly_ distracting to me. It also uses fake bold but at least that's slightly more tolerable. Look if you want things to be both minimalistic and "distraction-free" you have to make the typography perfect otherwise mistakes in typography stick out like a sore thumb.

<comment><USER7> I see CM myself. Perhaps STIX is in your cache or installed locally, since MathJax makes some attempt not to download fonts.

</comment></comment></comment></comment></comment><comment><USER8> I'm a fan. This is really cool and I like the Markdown parser that was chosen. The HTML output looks really damn clean (especially for code blocks). The `ctrl+s` shortcut is pretty sweet, too.

I'd love to see a couple of features though, namely an HTML export or at least a quick way to view the HTML.

I frequently write in markdown and then have to convert it to HTML for whatever blogging engine I use.

<comment><AUTHOR> Thanks!

HTML export would be cool, I agree.

The shortcut "CTRL+D" will toggle to preview only (not exactly a quick way to view HTML but at least you see preview only), code only or preview+code view.

</comment></comment><comment><USER9> One text editor I have always wanted is a word processor with first class vim keybindings support. I don't need too many fanciful features but the most important features would be proper text reflowing and vim integration. Vim doesn't do too well with reflowing text when a hard margin is set, nor when there a single digital line is stretched across several visual lines. Vim by default would treat it as a single digital line and it makes navigating really difficult as cursors would jump across the screen.

<comment><USER10> I had the same problem and I added the following lines to my vimrc to fix the movement issues.

noremap j gj

noremap k gk

[http://vim.wikia.com/wiki/Move_cursor_by_display_lines_when_...](http://vim.wikia.com/wiki/Move_cursor_by_display_lines_when_wrapping)

<comment><USER11> This is not flesh out, but it does support vim keybindings. [http://ivanceras.github.io/spongedown- editor/](http://ivanceras.github.io/spongedown-editor/)

<comment><AUTHOR> Nice, I tried Spongedown but it seems to have at least 0.5 or 1 sec delay between typing and rendering, so it wouldn't be really usable for me.

</comment></comment></comment></comment><comment><USER12> For me, the speed of rendering is fantastic.

But, the TexRoman font, the lack of lockstep scrolling, and the non- compartmental MathJax rendering causing the entire document to flick-around when making any edits makes this non-feasible for documents > 1 page. I'm also a sucker that needs inline sequence diagrams for my documents.

For now, for me, hackmd.io is king... but, maybe that will change.

<comment><USER11> Not as fleshed out as, but does support diagrams using plain text [http://ivanceras.github.io/spongedown- editor/](http://ivanceras.github.io/spongedown-editor/)

</comment></comment><comment><USER13> This is cool, I'm going to have to look at your implementation and possibly add it into Remarkbox ([https://www.remarkbox.com](https://www.remarkbox.com)).

I have a flicker issue mostly because I'm sending the markdown up to the cluster of servers for rendering.

</comment><comment><USER14> Very cool! It would be nice to see an Org mode version of this.

Org syntax for the uninitiated: [http://orgmode.org/worg/dev/org- syntax.html](http://orgmode.org/worg/dev/org-syntax.html)

It's very similar to Markdown if using Org _just_ as a markup.

\---

Can folks interested in Org mode support please upvote this issue: [https://github.com/josephernest/writing/issues/13](https://github.com/josephernest/writing/issues/13)

If nothing else, it will at least help somewhat guage the interest in Org mode :)

<comment><USER14> Here's the official form of Joseph's writing project that supports Org mode: [https://github.com/kaushalmodi/writing- org](https://github.com/kaushalmodi/writing-org)

Live site: [https://org.scripter.co](https://org.scripter.co)

I got the below Org syntax to work so far.. You can try by copying the test file I have so far ( [https://raw.githubusercontent.com/kaushalmodi/writing- org/ma...](https://raw.githubusercontent.com/kaushalmodi/writing- org/master/test.org) ) and pasting in the above live site.

Pasting the same below just for reference.

        * Heading level 1
        ** Heading level 2
        *** Heading level 3

        Paragraphs get created
        only after an empty line.

        This will be a new paragraph.

        * List syntax is the same as Markdown

        - List 1
        - List 2

        asdf (*!bug!* non-list breaker text should not be needed. Two empty lines should end a list.)

        1. Ordered
        2. Ordered

        *!bug!* No white-space following an ordered list.

        * Inline Code

        =code=

        == =code= ==

        == abc = def ==
        * Bold
        *bold*
        *bold * asdf*
        - Press =Ctrl+B= to toggle bold.
        * Italics
        /italics / adsf/
        - Press =Ctrl+I= to toggle italics.
        * Horizontal rule
        Above the horizontal rule
        -----
        Below the horizontal rule

        * Source blocks
        #+BEGIN_SRC emacs-lisp
        (message "foo")
        #+END_SRC

</comment></comment><comment><USER15> Hi, we've built Monod a while ago: [https://monod.lelab.tailordev.fr/](https://monod.lelab.tailordev.fr/). It looks very similar to your project :)

</comment><comment><USER16> This is very neat! It made me think of hackmd.io which offers similar features though maybe less minimalist/distraction free but with collaboration. Thanks for sharing!

<comment><AUTHOR> Thanks!

I just tried hackmd.io and even if it's cool, it wouldn't be usable for me on everyday use because it's not responsive enough: write some text, _wait 0.5sec to see it in the preview_ , write some text, _wait 0.5sec to see it in the preview_ , etc.

Also it's not "LPWP" enough for me (i.e. the first page that you visit on the website is the page where things actually happen, that means that there is no welcome page or login page). See [https://github.com/josephernest/writing#why- another-markdown...](https://github.com/josephernest/writing#why-another- markdown-editor-why-not-just-use-stackedit)

</comment></comment><comment> yoz-y Quite neat. I wouldn't use this myself as I prefer to have an environment which is crash proof and I would be too scared to close the window, however I think this could be quite great as an embedded editor.

It seems like the \pagebreak is not respected when printing on Safari (Chrome works fine). The preview shows a dotted line but the printed pdf is not broken.

Also, the footnotes are not on the correct page but always at the end. (This is on all browsers)

<comment><AUTHOR> Close the tab (or even close the browser), and open it again: it's still there (backuped in LocalStorage), phew! :)

<comment><USER17> Lol sweet. This is dope, keep doing what you're doing!

</comment></comment></comment><comment><USER18> Awesome! Super responsive and fast.

</comment><comment><USER19> Nice and simple job!

Guys that do not want an extra preview panel could take a look at VNote([https://github.com/tamlok/vnote/](https://github.com/tamlok/vnote/)).

</comment><comment><USER20> I might use this instead of LaTeX for short communications , but I wonder if this could work for longer work with several pages.

<comment><USER21> [https://hack.chat/](https://hack.chat/) is essentially this except ad-hoc chatrooms.

</comment></comment><comment><USER22> Nice update speed. But the font in the preview panel looks really blurry -- both regular and bold...

<comment><AUTHOR> Which browser/browser version/os? No blur on ff and chrome on windows and linux for me

</comment></comment><comment><USER23> No dark mode? What is this 1997?</comment>


Covariance and Contravariance: a fresh look at an old issue [pdf] - <AUTHOR> http://www.pps.univ-paris-diderot.fr/~gc/papers/perl6-typing.pdf

<comment><AUTHOR> Summary: The author reexamines his assertion that covariance and contravariance can coexist through recent advances in (sub-)typing theory by "explaining sophisticated type theoretic concepts, in simple terms and by examples, to undergraduate computer science students and/or willing functional programmers". Meaning that he chooses to explain using code rather than theorems.

Interesting, the author chose to demonstrate the examples using Perl 6, not because he is necessarily a fan of the language, but as he explains: "I chose it because it has the double advantage of having enough syntax to explain the covariance/contravariance problem and of having a fuzzy-yet-to-be-fixed type system... one of the challenges of this paper was to use a mainstream language that was not designed with types in mind — far from that —, whence the choice of Perl 6. I am aware that this choice will make some collegue researchers sneer and some practitioners groan: please give me the benefit of the doubt..."

I suppose that "mainstream" means "more mainstream than CDuce" or other more esoteric research languages. :) Note that the paper assumes that you don't know Perl6, and it seems to only really use multimethods and objects -- nothing too crazy.

Edit: This beginning parts of this paper probably also serve as a decent intro to strongly typed languages for those who only have used a dynamic language.</comment>


My Dev Goals for 2009: 5 Projects in 5 Weeks - <AUTHOR> http://erikdungan.bigfolioblog.com/weblog/post/88123

<comment><USER2> ClipClipSave might actually be something you'd be interested in investing longer than a week on. :-)

<comment><AUTHOR> Thanks, I think it has potential.

I was a little disappointed when I submitted it for review here. Didn't get much feedback.

<comment><USER2> Well, I wouldn't let that get you down. It's certainly not very sexy, and you're not exactly going to get YC investment out of it, but as a nice lifestyle business, it certainly has potential.

Good Luck.

<comment><AUTHOR> Thanks [deleting YC application info ... ]

<comment><USER2> Why? My opinion is just that. Who knows, maybe PG disagrees.</comment></comment></comment></comment></comment>


Lions save girl from kidnappers (2005) - <AUTHOR> https://www.theguardian.com/world/2005/jun/22/3?CMP=fb_gu <comment><USER2> This needs a (2005).

It's not canonically relevant to the story, but dating is traditional on HN, and I think it's noteworthy to point out in any case that this happened 12 years ago.

(I saw the date in the URL first, but ^F turned it up on the far left of the page too.)

<comment><AUTHOR> Thanks for that, changed it to note the date.

<comment><USER2> Oh, cool!

</comment></comment></comment><comment><USER3> I'm not sure why you'd believe this story?

What are people reading this trying to find?

Obviously the lions wouldn't think twice at ripping her jugular out and playing with her body as it bleed out.

Even if you believe the story as described, which is dubious, you don't have enough information to see what really happened. They were keeping her to eat later? Who knows, there's not enough info.

<comment><USER4> >Stuart Williams, a wildlife expert with the rural development ministry, said it was likely the girl had been saved because she was crying.

>"A young girl whimpering could be mistaken for the mewing sound from a lion cub, which in turn could explain why [the lions] didn't eat her," he said.

Also: [https://www.truthorfiction.com/lionsave/](https://www.truthorfiction.com/lionsave/)

<comment><USER3> I'm more with they were hangin at to eat her that it mentions in the link.

The crying is a bit convoluted, lions surely know a cub from a human. Plus I doubt the crying sounds the same to a lion.

These fairy tales that come out of Africa are like Grimm's Fairy tales I guess, but having the BBC report on them....

How many girls were not saved by mystical lions....

<comment><USER5> Be an interesting way to find out that human babies evolved to sound like lion babies to scare off predators. ^_^</comment></comment></comment></comment>


My editor is flirting with me - <AUTHOR> http://qdb.us/136814?=%5C

<comment><USER2> <http://www.siteadvisor.com/sites/qdb.us/summary/>

</comment><comment><USER3> this is a virus my antivirus pops up do not click on this link!!

<comment><AUTHOR> I'm not sure what virus app your using, but the site is plain text.

Here's the copy:

      <thefiddler> Holy sonofabitch.
      <thefiddler> I think my editor is flirting with me.
      * thefiddler frowns
      <Uhmerwell> ...Notepad?
      <thefiddler> Errr.
      <Uhmerwell> oh, you mean a human
      <Uhmerwell> don't you :<</comment></comment>


Fibers are the right solution to improve Ruby performance - <AUTHOR> https://www.codeotaku.com/journal/2018-11/fibers-are-the-right-solution/index <comment><USER3> > fibers can context switch billions of times per second on a modern > processor.

On a 3GHz (3 billion hertz) processor, you expect to be able to context switch _billions_ of times per second?

I would probably accept millions without question, even though that might be pushing it for a GIL-ed runtime like Ruby has. But, unless your definition of "context switch" counts every blocked fiber that's passed over for a context switch as being implicitly context switched to and away from in the act of ignoring it, I find this hard to believe.

It takes more than one clock cycle to determine the next task that we're going to resume execution for and then actually resume it.

<comment><USER4> It must be off by 3 of 4 orders of magnitude. Python with asyncio does about 120_000 switches per second with a trivial fibre/coroutine here:

      import time
      import asyncio

      REPS = 1_000_000

      async def coro():
          for i in range(REPS):
              await asyncio.sleep(0)

      t0 = time.time()
      asyncio.run(coro())
      dt = time.time() - <USER2>
      print(REPS / dt, 'reps/s')

<comment><USER5> Golang seems to do around 350k. There's a chance I'm missing some tricks, but the code is so short it's not probable I'm missing that much.

See: [https://repl.it/repls/GrimyChiefGame](https://repl.it/repls/GrimyChiefGame)

      package main

      import (
      	"fmt"
      	"time"
      )

      func coro(reps int) {
      	for i := 0; i < reps; i++ {
    		go time.Sleep(0 * time.Nanosecond)
      	}
      }

      func main() {
    	REPS := 5000000
    	start := time.Now()
    	coro(REPS)
    	dt := time.Since(start)
    	fmt.Printf("The call took %v to run.\n", dt)
    	fmt.Printf("REPS / duration %v\n", (REPS*1e9)/int(dt))
      }

<comment><USER3> I don't think you're measuring context switching.

if I remember correctly, Go's scheduler has a global queue and a local queue per worker thread, so when you spawn a goroutine it probably has to acquire a write lock on the global queue.

Allocating a brand new goroutine stack and doing some other setup tasks has a nontrivial overhead that has nothing to do with context switching, regardless of global locks.

To properly benchmark this, I think I would start with just measuring single task switching by measuring how long it takes main to call [https://golang.org/pkg/runtime/#Gosched](https://golang.org/pkg/runtime/#Gosched) in a loop a million times. This would measure how quickly Go can yield a thread to the scheduler and have it be resumed, although this includes the overhead of calling a function.

Then I would launch a goroutine per core doing this yield loop and see how many switches per second they did in total, and then launch several per core, just to ensure that the number hasn't changed much from the goroutine per core measurement.

Since Go's scheduler is not bound to a single core, it should scale pretty well with core count.

I might run this benchmark myself in awhile, if I find time.

<comment><USER3> I wrote my own quick benchmark: [https://gist.github.com/coder543/8c1b9cdffdf09c19ef61322bd26...](https://gist.github.com/coder543/8c1b9cdffdf09c19ef61322bd26d2e44)

The results:

        1 switcher:    14_289_797.08 yields/sec
        2 switchers:    5_866_478.94 yields/sec
        3 switchers:    4_832_941.33 yields/sec
        4 switchers:    4_604_051.57 yields/sec
        5 switchers:    4_268_906.99 yields/sec
        6 switchers:    3_982_688.58 yields/sec
        7 switchers:    3_799_103.41 yields/sec
        8 switchers:    3_673_094.58 yields/sec
        9 switchers:    3_513_868.07 yields/sec
        10 switchers:   3_351_813.00 yields/sec
        11 switchers:   3_325_754.64 yields/sec
        12 switchers:   3_150_383.56 yields/sec
        13 switchers:   3_037_539.31 yields/sec
        14 switchers:   2_435_807.77 yields/sec
        15 switchers:   2_326_201.72 yields/sec
        16 switchers:   2_275_610.57 yields/sec
        64 switchers:   2_366_303.83 yields/sec
        256 switchers:  2_400_782.51 yields/sec
        512 switchers:  2_408_757.26 yields/sec
        1024 switchers: 2_418_661.29 yields/sec
        4096 switchers: 2_460_257.29 yields/sec

Underscores and alignment added for legibility.

It looks like the context switching speed when you have a single Goroutine just completely outperforms any of the benchmark numbers that have been posted here for Python or Ruby, as would be expected, and it still outperforms the others even when running 256 yielding tasks for every logical core.

The cost of switching increased more with the number of goroutines than I would have expected, but it seems to become pretty constant once you pass the number of cores on the machine. Also keep in mind that this benchmark is completely unrealistic. No one is writing busy loops that just yield as quickly as possible outside of microbenchmarks.

This benchmark was run on an AMD 2700X, so, 8 physical cores and 16 logical cores.

<comment><USER6> I wrote an addendum [https://www.codeotaku.com/journal/2018-11/fibers-are-the- rig...](https://www.codeotaku.com/journal/2018-11/fibers-are-the-right- solution/context-switching)

With C++/assembly, you can context about 100 million times per CPU core in a tight loop.

<comment><USER3> The one additional comment I have is that this addendum doesn't involve a reactor/scheduler in the benchmark, so it excludes the process of selecting the coroutine to switch into, which is a _significant_ task. The Go benchmark I posted above is running within a scheduler.

But, I appreciate the addendum.

<comment><USER6> So, that's a good point, and yes the scheduler will have an impact probably several orders of magnitude in comparison.

That being said, a good scheduler is basically just a loop, like:

[https://github.com/kurocha/async/blob/bee8e8b95d23c6c0cfb319...](https://github.com/kurocha/async/blob/bee8e8b95d23c6c0cfb31992491e4e9e1527db15/source/Async/Reactor.cpp#L63-L68)

So, once it's decided what work to do, it's just a matter of resuming all the fibers in order.

Additionally, since fibers know what work to do next in some cases, the overhead can be very small. You sometimes don't need to yield back to the scheduler, but can resume directly another task.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> I'm a bit hesitant about this article's proposition, although I'm open to be convinced.

In the end there's a GIL. For pure CPU-bound workloads, your only true source of parallelism will be putting more processes into the mix, be it via forking or simply spawning more processes from scratch.

But inside a given a process, it seems to me that no matter what you do (fibers/threads), only 1 CPU can do CPU-bound work at a time.

If I was to design a high-performance Ruby solution, I'd ditch forking, threading and fibers. I'd focus instead in creating low-memory-footprint, fast-startup processes (read: no Rails!) that one can comfortably spawn in parallel, be it in a single server, or in a cluster (think k8s). Max Ruby processes count: 1 per core.

<comment><USER8> Mostly Ruby web app workloads aren't CPU-bound. And when they are, you're using a language that is 100 to 1000 times slower than C.

That is, for a CPU-bound task, you might be able to replace your thousand node k8s cluster with one machine running code written in a faster language (before even getting into communication and load balancing and HA and all that crap.)

<comment><USER9> But abandoning everything you've written in one language for the sake of a single hot path isn't really a good idea either.

It's probably a more sensible idea to use a native extension to optimize just that hot path. For instance, the Rust bindings are _really_ good: [https://github.com/tildeio/helix](https://github.com/tildeio/helix)

<comment><USER8> Sometimes. If your profile is "lumpy" enough that can be true, but often the performance problems of slow languages manifest as annoyingly flat death-by-a- thousand-cuts profiles. (Especially after the low hanging fruit has been picked.)

Grinding another 5x out of a flat profile can be hard work requiring more creativity and producing less readable code than a (fairly mechanical) translation. Luckily these tasks also tend to crop up when design has stabilised and team sizes are increasing, meaning it can often coincide with the benefits of static typing becoming greater.

It's not a panacea, and it's obviously both risky and costly. Shrugs.

(I've also seen the other case, FWIW. Wrote some C extension code called from a Rails app, and it was the right call at the time and we got great mileage out of it.)

</comment></comment></comment></comment><comment><USER10> Title is actually "Fibers are the Right Solution" and the article ends with "Fibers are the best solution for composable, scalable, non-blocking clients and servers."

The title as posted is most definitely not true. I have worked on high volume Ruby applications where the problem with using async I/O combined with poor raw execution of Ruby code resulted in excess garbage to be collected. Ruby performance should mean the performance of executing Ruby code. Perhaps the title could have been 'Ruby webapp performance'.

<comment><USER6> > I have worked on high volume Ruby applications where the problem with using > async I/O combined with poor raw execution of Ruby code resulted in excess > garbage to be collected.

What async I/O approach did you use and where did the garbage come from? I/O buffers?

<comment><USER10> It was an api endpoint making a number of db and other network requests. The garbage was the accumulation of temporary and response objects that were held for the long duration of processing, up to half of which could be in the ruby code not waiting on i/o. If the code ran faster there would be more time for gc and handling the incoming request volume.

</comment></comment></comment><comment><USER11> > We show that fibers require minimal changes to existing application code and > are thus a good approach for retrofitting existing systems.

I disagree that 'minimal changes to existing code' is a good goal for a Ruby parallelism solution. The large Ruby codebases I have dealt with have gigantic hacks to get around the GIL: complex fork management systems, subprocess management, crazy load-this-but-not-that systems for prefork memory management to optimize copy on write, and probably more. Parallel tasks in Ruby are a nightmare to work with.

Changing existing code _should_ be a goal of any Ruby parallelism solution. If we can't get rid of this kind of cruft, what are we even doing?

I still love Ruby, but I want go-style channels, not apologies for the GIL.

<comment><USER12> That's the plan with Guilds: [http://www.atdot.net/~ko1/activities/2018_rubyconf2018.pdf](http://www.atdot.net/~ko1/activities/2018_rubyconf2018.pdf)

These are the slides for Koichi Sasada's RubyConf 2018 (last week) talk updating the community on his progress in the design and implementation of Guilds.

Surprising that the author isn't aware of this planned CRuby feature announced in 2016. I wrote about it then: [https://olivierlacan.com/posts/concurrency- in-ruby-3-with-gu...](https://olivierlacan.com/posts/concurrency-in- ruby-3-with-guilds/)

Take this with a grain of salt of course because the design has clearly changed since then and I need to upgrade my post or do a follow-up.

<comment><USER6> Hi, I'm the author, I'm also a Ruby core committer, and yes I'm aware of Guilds. The are a model for parallelism and don't really affect concurrency at all. At best, they provide a 3rd option on top of processes/threads/guilds.

<comment><USER12> That makes sense. Sorry for the assumption.

Guilds felt omitted in your post since they (should) address one of the points you make about the usability/ergonomics of existing Ruby APIs for managing non-sequential execution.

But it's definitely a bit early to tell what Guilds will actually look like as a final product.

<comment><USER6> Guilds are just a fancy name for threads or processes at this point. What they ultimately end up being is yet to be seen :)

</comment></comment></comment></comment></comment><comment><USER13> Fibers are basically just async tasks with multicore support, right?

<comment><USER3> Fibers are basically just async tasks where each task looks and feels like a normal, synchronous thread to the programmer.

It doesn't really imply anything about how parallel (or not) the fibers execute.

<comment><USER13> So it is preemptively switching then?

> It doesn't really imply anything about how parallel (or not) the fibers > execute

What's all the fuss about paralllelism in the article about then?

<comment><USER3> > So it is preemptively switching then?

Any time you call a blocking function that the system provides, it should immediately yield the fiber, which makes it _look_ preemptive. If you write a loop that just spins forever, that could block the whole system, potentially, making the abstraction leaky. In a language like Ruby, they could definitely add some true preemption, but I don't know if that's what they plan to do.

From the article: "Fibers, on the other hand, are semantically similarly to threads (excepting parallelism), but with less overhead." So, the author definitely isn't implying parallelism of the fibers.

> What's all the fuss about paralllelism in the article about then?

The author was talking about different methods for handling more than one request at a given time, which include forking and threads. With Ruby's GIL, threads are a lot less attractive than they could be. A good fiber implementation can handle tons of network requests concurrently and very efficiently even on a single core, which is the case being discussed here.

At the end, the author discusses a hybrid approach of forking and fibers, where each processor core would have a fork of the Ruby program running, and each fork would have its own fiber pool, running many tasks concurrently.

In languages that don't have a GIL, forking is _rarely_ a tool that I reach for. It really hurts your database pooling and all sorts of other small problems, but it's a common trade-off when using Ruby, Python, and Node.

<comment><USER14> > Any time you call a blocking function that the system provides, it should > immediately yield the fiber, which makes it look preemptive.

In the old days we would call this _cooperative_ to contrast it from preemptive. This is the essence of cooperative, yielding at explicit points be they IO request, timers, or waiting on a message queue. Preemptive used to mean a certain thing and this is not it at all.

<comment><USER3> cooperative multitasking typically implies (to me, at least) that the programmer is required to explicitly / manually yield their task, which is annoying, error prone, and isn't required here. The system's blocking functions will handle that behind the scenes.

Fibers _are_ cooperative here, but not from the programmer's point of view, and that's an important distinction to make. If you write the same code for a cooperative system as you would for a preemptive system, is there really any difference to the programmer? It _looks_ preemptive. If anything, properly implemented cooperative systems are more efficient. Most of the time when people ask the question that is asked higher in the thread, I believe they're worried that they will be responsible for remembering to yield control.

I'm pretty sure I did a decent job in my previous comment of explaining that the system only _looks_ preemptive, and that it is possible to block it with some uncooperative code, so I'm not sure what point you're trying to make.

<comment><USER15> Not the person you are responding to.

It's a matter of point of view, but to me cooperative/preemptive is a property of the underlying scheduler, not of what the programmer is _usually_ exposed to. As you correctly pointed out, it is possible to block the scheduler with uncooperative code. It's not even hard: it takes just one heavy CPU-bound computation. I write these kind of computations every day: if you sell me a system as preemptive and it's not, I will get angry...

</comment></comment></comment></comment></comment></comment></comment><comment><USER16> I've coded multiprocess, multithread, callback and context switching on multiple OSes and languages. Golang nails it, a bed of green threads scheduled onto CPU threads with isolation. The foundation is correct.

<comment><USER6> It's the perfect approach except users must deal with mutual exclusion which is tricky for most developers.

</comment></comment><comment><USER17> Seems to me that one interesting approach would be to automatically rewrite a program in continuation-passing style, and then use callbacks (the lowest- overhead approach) where the callback is the continuation.

It _ought_ to compile pretty cleanly, since a continuation can end up being compiled into an address.

<comment><USER6> I've thought about this too, and it might be the route C++ takes. That being said, to resume you need to wind through all your function calls executing parts of the state machine, it might actually be slower.

That being said, I'm sure there are different ways to implement it and I look forward to proposed faster/efficient implementations.

</comment></comment><comment><USER18> Cooperative switching hasn't been this cool since 1985! /s

<comment><USER19> I've been trying hard not to be snarky :-) It's pretty amazing how old things become new as a combination of 1) people not knowing about it and 2) it being given a new name. The first one is a bit sad and speaks volumes about our collective lack of education as an industry. I gladly include my self in that indictment by the way. I only console myself with the fact that the things I don't know (but should) is probably greater than what could fill my (mostly useless) 4 year CS degree. Of course I graduated a _long_ time ago... I'm a bit worried that as people get into this industry in less traditional ways we are gradually losing the sight of the fact that there really _is_ something important to learn.

</comment></comment><comment><USER20> I'm not trying to be snarky but writing a performant server or web server in userland Ruby doesn't seem to be good engineering. We already have nginx & apache. If you want to write performant servers you probably want something like Go, Rust, C++, C, D, JVM, BEAM.

</comment><comment><USER21> I am glad that fibers and coroutines are going mainstream the way it is. With sincere and profuse apologies to Ruby fans (lest they think this is an attempt at hijacking the discussion) let me share this [https://felix.readthedocs.io/en/latest/fibres.html](https://felix.readthedocs.io/en/latest/fibres.html) I feel some HN'ers would be curious as there arent many languages that offer fibers as a first class citizen.

BTW I am in no way involved in the development of the Felix. Its not a new language, its more than 15 years old and has had fibers from the start.

</comment><comment><USER22> BTW, a easy explanation in how implement this for a language?

I asked in [https://www.reddit.com/r/ProgrammingLanguages/comments/9xsya...](https://www.reddit.com/r/ProgrammingLanguages/comments/9xsyad/how_provide_in_an_interpreter_iteratosgenerators/) and get a nice answer but is also of the style "just read this code and get it".

</comment><comment><USER23> How does context switching occur wrt the native stack? Does ruby avoid using the native stack, or does this save and restore it?

</comment><comment><USER24> Are these similar in implementation to the upcoming Java Fibers? Those basically yield automatically whenever they perform a blocking operation, so another fiber can be executed.

<comment><USER25> Ruby fibers yield control to the fiber that spawned them or transfer control to another specific fiber explicitly. That's close to the Continuation model which Loom's fibers are built on top of, but Loom's fibers hide that process of yielding from the user, instead concentrating on providing a more general scheduling API and yielding at certain points inside the core library.

There are quite a lot of other small differences as well since Ruby fibers are always run on the same thread which originally spawned them, whereas Loom's continuations and fibers can be resumed on a different thread.

It is quite possible to implement Ruby fibers in terms of Loom's continuations, and we've done a prototype of this in TruffleRuby (I think Charles Nutter has done one in JRuby as well), and it certainly allows us to support very large numbers of active fibers.

</comment></comment><comment><USER26> Types are the right solution to fix Ruby performance. Crystal is showing how a language can be simple and performant!

<comment><USER27> Ruby has types. Not everyone enjoys working with statically typed languages.

<comment><USER28> it doesn't really matter what you _enjoy_ if we are talking about what is needed to make a given language faster. That being said, nodejs on v8 is a lot faster than ruby and dynamically typed, so I do agree with your conclusion that static typing is not necessarily the answer.

<comment><USER29> Ruby has always put developer experience before performance. However, both are improving with each release. Give it time.

<comment><USER30> Getting a bit off topic here, but you sound knowledgeable about Ruby. Ruby is a language I've always admired from afar, but never spent much time trying out. I've read the poignant guide, which was amusing but didn't teach me too much. What's the SICP of Ruby? As in, a high quality book that will teach me the ins and outs of the language.

<comment><USER31> Ruby is a heavily idiomatic language. It's strongly advised to use rubocop or a similar style guide -- and to temper that with good judgment, at least when it recommends avoiding `!!`.

In addition to the Pickaxe book, I recommend _Metaprogramming Ruby_ by Paolo Perrotta, and potentially the sequel to that book (which I have yet to read).

Ruby lends itself to a very fluid style. One of the things that you may find less common is explicit variable assignment within a method: most of the time your assignment will be in method signatures and block declarations. The following code is illustrative of technique, but not recommended practice:

      puts(Enumerator.new do |y|
        loop { y.yield Array.new(rand(1..18)) { [*'a'..'z'].sample }.join }
      end.lazy.reject(&IO.readlines('/usr/share/dict/words').method(:include?)).first(10).join(' '))

This generates "non-words", which are guaranteed not to exist in the (Unix) system dictionary, without using explicit assignment. First it creates a (lazy) generator object which yields random "words" of varying length. In Ruby, if you are calling a method with only one argument in an inner loop, you can avoid writing the loop explicitly, which is nice here because it also avoids the performance hit of reading the dictionary file repeatedly. The `method` method lets us pass an object-method pair, to be evaluated later, and the '&' there is a sort of cast-to-block, and you'll see that used in other contexts. So, at that point, we have a lazily-evaluated collection of lazily- filtered strings, and we can take an arbitrary number of these out and print them.

The nice thing about Ruby is that you can probably express what you want in one statement. This does come at the cost of a fair amount of idiom. Some of it is functionally important, some of it is convenient (like using the `*` operator to destructure ranges), and some is pure window dressing, but enforced by convention just the same. The Pickaxe book is better than anything else that I am aware of for describing Ruby idioms. I'm not sure how well it has aged. It's probably recommended to do a lot of pair programming and code review. At times I have mentored others on the website Exercism, and I would recommend that or a similar site.

<comment><USER32> > The Pickaxe book is better than anything else that I am aware of for > describing Ruby idioms. I'm not sure how well it has aged.

The last version covered Ruby 1.9/2.0; the language has evolved since 2.0, so it's certainly not complete and current.

<comment><USER31> I had decided against a somewhat stronger statement; I didn't want to bash Pickaxe unnecessarily, particularly as I don't have a lot of better suggestions. I'm fairly inclined to write a book myself to address the situation, but not any time soon.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER33> beware before using fibers because it won't access Thread.current[:vars].

So if you plan on going with fiber on an existing app, double check first if Thread.current[:vars] is a must have for you & you dependencies (ex: the I18n gem

<comment><USER34> Are you sure about that ? If you search `Ruby Thread Locals are also Fiber- Local` there will be a blog post from 2012 about that, and the code sample works fine for me on ruby 2.5

<comment><USER33> I'm sorry, my previous comment was not clear. I should have written beware before using fibers because it won't access Thread.current[:vars] _as you might expect_.

Here is an example:

      fiber = Fiber.new do # Thread.current locals are copied to the Fiber when fiber it is built
        puts "1. #{Thread.current[:test]}"
        Thread.current[:test] = false # the fiber has it's own stack, won't leak away
        puts "2. #{Thread.current[:test]}"
      end

      Thread.current[:test] = true
      fiber.resume

      puts "3. #{Thread.current[:test]}"

Output:

      1.
      2. false
      3. true

So fibers comes with their _own stack_, including threads locals, yes, but from _when_ you instantiated them. Not from Thread.current :/ Also writing Thread.current[] won't apply outside the Fiber.

I was confused, and not alone: [https://github.com/rails/rails/pull/30361](https://github.com/rails/rails/pull/30361).

So my conclusion about Fiber is always be careful with Fiber / Thread.current.

edit: style/explanation

</comment></comment></comment><comment><USER35> tl;dr context switching gives good perf

</comment><comment><USER36> And ruby become node!

</comment><comment><USER37> I've been using Ruby and Rails for about 12 years now and I see all the solutions people come up with as bandages over a wound. A normal Rails app starts off with Node and Redis installed. If like me you hop onto the Elixir world it becomes refreshing to see the language you are using do all the stuff multiple tools did and doing it faster.</comment>


Facebook Filing For IPO As Early As Wednesday - <AUTHOR> http://techcrunch.com/2012/01/27/wsj-facebook-filing-for-ipo-as-early-as-wednesday/ <comment><USER2> Peak social ? Like AOL's "diversifying" in 2000 signaled the peak of the original internet bubble? Zuckerberg is smart and knows when to stick the average Joe's retirement fund with the downside.

I know, I know. Mod me down. Somebody's got to say it, though. But, I mean, c'mon. All fads fade away ... someday ... right?</comment>


What We See When We Read - <AUTHOR> http://www.theparisreview.org/blog/2014/08/14/what-we-see-when-we-read/ <comment><USER2> Am I the only one that doesn't even attempt to to put a face to characters? When I read a book, it is a visually stimulating experience but it's all very ethereal - I conjure up vague landscapes, actions, objects, poses, expressions etc, but never an entire portrait of a character.

To be honest I think I read entire books without even considering what colour a person's hair is, how tall they are, what shape their nose is.

<comment><USER3> Many people don't, check out Generalizing From One Example

[http://lesswrong.com/lw/dr/generalizing_from_one_example/](http://lesswrong.com/lw/dr/generalizing_from_one_example/)

key passage:

"The debate was resolved by Francis Galton, a fascinating man who among other achievements invented eugenics, the "wisdom of crowds", and standard deviation. Galton gave people some very detailed surveys, and found that some people did have mental imagery and others didn't. The ones who did had simply assumed everyone did, and the ones who didn't had simply assumed everyone didn't, to the point of coming up with absurd justifications for why they were lying or misunderstanding the question. There was a wide spectrum of imaging ability, from about five percent of people with perfect eidetic imagery to three percent of people completely unable to form mental images."

I don't have strong mental imagery, and it's actually a problem for me when reading some fiction... Some authors love putting in long, detailed, descriptions of characters.

That's incredibly boring to me, and I just skip those pages.

I've found that people with very strong visual imagery love anagrams, because they can actually visualize and rotate the letters. And to me, that's basically a super power.

</comment></comment><comment><USER4> It is difficult to describe faces because we don't have a familiar vocabulary for them. It's not necessary for us day to day to describe exactly what faces look like. Sure, we have chiseled jaws and high cheekbones, but there isn't a word for the many different styles of noses and shapes of lips. And we don't have a point of reference for the words that would be associated with the faces of our friends.

I suspect that if verbal descriptions of faces were a constant part of society, that our ability to imagine faces based on authors' descriptions (using that shared vocabulary) would be much better. I also wonder what experience police sketch artists, like the one who drew Anna Karenina, have when reading books, as they probably think about this sort of thing much more frequently.

As a sidenote, it may seem like I'm appealing to the now somewhat discredited Sapir-Whorf hypothesis, but I'm only saying that our lack of vocabulary constrains what we express, not that it constrains our cognition.

Personally, when I read I do visualize things, but I don't have strong visualizations for people's faces, much like mcjiggerlog elsewhere commented.

</comment><comment><USER5> I never focus on a detailed physical description of book characters _unless_ a body part is brought to my attention by the author. In fact, it annoys me when some authors insist on irrelevant details such as clothing (I used to joke with friends about some American writers, especially for courtroom dramas, making extremely detailed inventories of the main character's suits. We called it the "navy blue syndrome"; for some reason, the suit was always navy blue, and it was important for the author to call our attention to this).

I do have a very general idea of what main characters looks like, in particular about whether they are young, middle-aged or old, and about their hair color. When I see a movie adaptation, this always clashes with my preconceived idea. "No, no, the character was older and had black hair!"

<comment><USER6> I think visually, and so for me an initial description of how a character looks is really helpful, because otherwise my brain is forced to borrow from a different story, which leads to a disconnect when details are brought forward that aren't congruent with what I've imagined.

</comment></comment><comment><USER7> maybe what we are thinking of when we "picture" a character is the resulting feeling. so we know when someone looks like anna because when we look at that person, it feels the same- but its much harder to go the other way, like a hashing function. we know when the things match, but its hard to know how to make things that match.

</comment><comment><USER8> There's a curse that comes with watching a movie adaptation of a book before reading it, in that you can't not picture the faces of the actors that portray the characters.

I'd attempted to read The Fellowship of the Ring a few times as a kid, but never got into it. I watched the movie before I started it in earnest, and I feel I was kind of cheated by all of the visuals I wasn't able to conjure up myself. For that reason, some of my favourite parts of the book were those that were cut from the movie, such as Tom Bombadil and the Barrow-downs.

Thankfully, I went on to read The Two Towers and The Return of the King well before the movies were released, and enjoyed them much more because I got to inject a lot more of my imagination into them.

</comment><comment><USER9> There are probably neuroscientists researching the links between human visual perception and memory. I would like to know whether someone has done a comparative study of literary perception and visual perception with regards to memory. I recall reading that because vision takes more sensory input and our spatial reasoning is so well developed, our brains are able to reason and recall more effectively in this realm... but I assume blind people and others may have alternate configurations. Would the 'photographic memory' applied to literature result in words? Or visual recollections? Feelings?

</comment><comment><USER10> Whenever I try to imagine how a character looks like, I will eventually forget about it and make a new one at the next reading. So, I try to map the character to the person I know, which become a problem when the character grows older.

From a writer's point of view, maybe it is fun to put a lot of details about the world they are trying to describe in a very detailed way.</comment>


Git Punish – The Missing Git Command - <AUTHOR> http://git-punish.io/ <comment><USER2> I hate such things. It creates a terrible work environment. Instead of focusing on the _git blame_ and _git punish_ , everyone should just focus on _git commit_ fixes to make the code work. Does it really matter who put the bug? We are all humans, we all make mistakes.

<comment><USER3> While the name maybe a bit unfortunate or maybe made just for fun, git blame has actual use. While it's useful to see the commit log and figure out how the bug came to be, it can also be useful to talk with the respective developer if available and get an even better perspective.

<comment><USER4> You can just also use git annotate if you want to avoid the negativity.

<comment><USER3> Yup, wasn't defending this one :). Did the git annotate came after blame cause in the olden time I remember seeing the git blame example.

These days I mostly use IDEA's annotate feature and don't even know what's the command used in the backend.

<comment><USER5> They both came from the earlier `cvs annotate` command. annotate is the original name (from 1996). While it was common to talk about cvs annotate as 'blame', I think it first became the name of a command in subversion 0.32.0 (~2003, rcs blame was ~2004, cvs annotate grew the blame alias ~2008)

<comment><USER6> Subversion has blame, praise, and annotate depending on your mood. [1] Though I think blame was first.

[1] [http://svnbook.red- bean.com/en/1.6/svn.ref.svn.c.blame.html](http://svnbook.red- bean.com/en/1.6/svn.ref.svn.c.blame.html)

</comment></comment></comment></comment></comment></comment><comment><USER7> Go on, just sudo that unencrypted http link and blindly run what it downloads. I'm sure nothing bad could happen.

<comment><USER8> What, just because he's suggesting to use curl to download a file?

There's a difference between "curl ... | sh -" and this.

He's even separated it nicely into steps, so you can view that (very short) file in between.

What worries me more is that he doesn't properly quote $@, so this script will break when there are spaces in the filename. One of the reasons I hate bash.

<comment><USER9> Not because he is suggesting curl. But because he is suggesting curling without TLS.

<comment><USER8> TLS wouldn't help; the greatest risk is the author himself sending a malicious script (no offense, Sergii).

So everyone needs to check the script before running it anyway. Which is easy, because it's a very short script.

(Of course, it's so short that it might as well have been an alias or, even better, just a copy-pasteable git command, but I guess the author really wanted to call it 'git punish'.)

<comment><USER10> How is this any different than any app/executable/script period? When you download VLC did you read all the code to check it's not installing a root kit? When you added some python lib do you go through all the code and make sure that on the 20th run it doesn't upload your private ssh keys? Have you checked all the vim or emacs code in your latest download before running it? Maybe I'm missing the issue but they all seem about the same level of bad.

Am I missing something?

<comment><USER8> No, what you're saying is exactly my point: there's nothing wrong here.

</comment></comment></comment></comment></comment></comment><comment><USER11> This is symptomatic of something that has been bothering me lately. Programmers seem to be in some sort of twisted abusive relationship with their tools. Tools that other fellow programmers have written.

Why do programmers hate other programmers so much? Why do they have so little empathy and care?

Too much staying in one own's head? Lack of exposure to diverse opinions and emotions?

<comment><USER12> > Programmers seem to be in some sort of twisted abusive relationship with > their tools.

What do you mean?

<comment><USER11> The tools provide some value and we depend on them, however they also abuse us by being very unfriendly and disrespectful of our time.

I think this emerge of a certain way that programmers think of other programers.

There are of course exceptions, but often tools made by other programmers don't seem to respect us as users and have bad user experience: \- Few thoughts given to make common operations good, \- Lots of clunky menus, \- Poor performance,

Basically going out of their ways to make us do something else than programming by killing the feedback loop. (Think libraries that are slow to compile, tools that run slowly or require assistance or are otherwise too granular)

The absolute worst example I can give is something like Hudson or Jenkins.

<comment><USER13> > The absolute worst example I can give is something like Hudson or Jenkins.

Though I agree with you to some extent, IMO you chose a bad example. Jenkins has one of the most shallow learning curve of any the tools I use, and doesn't require a lot of fussiness. If I can it to build from a terminal window, I can get it working on Jenkins in 30 minutes.

Might I suggest Appium for your example? The one where, in the _official_ docs, it says "If install fails, keep trying to install a few times." Rest assured that you'll need those instructions. Gawd, I hate Appium.

<comment><USER11> My experience is using Jenkins with Matrix jobs (and various plugins) for building native code on multiple platforms. There, the Jenkins UI doesn't shine.

Problems navigating between pages and knowing what one is looking at abound. Organizing jobs in various tabs works but isn't extremely easy. The UI doesn't handle well dealing with large lists of nodes/labels.

The plugin based architecture might be to blame for it, however I think it's a conscious choice from the original designers and they should be hold responsible for it.

</comment></comment></comment></comment></comment><comment><USER14> As always, kudos for taking an idea and executing it. But this is juvenile and harmful to your work environment. Please think twice before using it.

</comment><comment><AUTHOR> > git clone firstname.lastname@example.com:yavorskiy/comment-parser.git

> cd comment-parser/

> git punish -L1,24 index.js

[http://git-punish.io/3EWZW](http://git-punish.io/3EWZW)

code and committers you see on the page are parsed out from `git blame`

</comment><comment><USER15> If most of the comments here are about how this is pretty hostile and unfriendly, how is it on the front page? The Silent Brojority?

<comment><USER16> Because those who comment that it's bad simply missed the joke and are taking this seriously.

</comment></comment><comment><USER17> Wow, guys. This is clearly a sarcastic tool. Banter between devs is common and healthy.

<comment><USER18> What may seem like banter to one person may be extremely hurtful to another. This is especially true for new devs, who are acutely vulnerable to Imposter Syndrome.

Of course, banter between long-time colleagues is usually harmless. But it's often difficult knowing where to draw the line.

<comment><USER17> You also have to praise and reward devs for their successes. It's not black and white - you don't have to pick between banter OR praise. You can have both. It's a dynamic. Show them that you care and that they're doing good work, genuinely. Tease them about small mistakes with tools like this, sarcastically and socially, and it helps build up rapport and make the team that much more tightly knit. Pointing out simple mistakes in a tongue in cheek manner is a good way to show someone that they've made a mistake, but it's not a big deal and no one is _actually_ upset with them about it.

<comment><USER18> It's still difficult to know when the line has been crossed. What's perceived as harmless (even productive) banter by everyone else may still be hurtful to the recipient. You never know whether someone is okay with it, or simply hiding their emotions well.

I do agree that a copious amount of praise goes a long way toward developing a healthy environment.

</comment></comment></comment></comment><comment><USER19> The "background" image should have a z-index smaller than the text (and the text should have transparent background).

Otherwise selecting text sometimes results in grabbing the image instead.

</comment><comment><USER20> What does it do?

</comment><comment><USER21> This doesn't seem very effective at what it's trying to do. Once you create the page, what then?

It should be a service that mails all other contributors in the commit log something like this: "Mr. <insert name> introduced a CATASTROPHIC security bug right here! Look at that! <insert code> <insert insults> Are all his contributions hidden landmines that might jeopardize the project at any time? Clearly they need to be checked! <insert list of all his other commits>"

Maybe "git shame" would be more appropriate too.

And yeah, you should probably not do that if it's a company project or a noncritical open source project.

</comment><comment><USER22> WTF is this?

<comment><USER23> It's git punish, the missing git command.

<comment><USER2> No. git was not created to make a hostile development environment.

<comment><USER4> Oh yeah? Why is it git blame when it was svn praise?

<comment><USER24> "svn praise" seems to be simply an alias for "svn blame". Try "svn praise --help"

</comment></comment></comment></comment></comment><comment><USER25> Isn't using Git punishment enough?</comment>


Tools/Website/Service to Note/Remove Fake/Robotic Blog Posts - <AUTHOR> While reading posts on slate.com I was struck how many were "noisy" and similar to past posts I've encountered. Certain memes pop up repeatedly (usually denigrating someone) and contain no useful information. It occurred to me there might be a websites or analysis tool or a service that would indicate which posts were likely to have been generated by a robot.<p>There's probably a vocabulary and an entire work milieu/domain/subject area about this topic but I am naive. Can anyone help me here? <comment><AUTHOR> Well, as usual, a little Googling gives more than I can handle:

\- Trolls and bots are disrupting social media — here's how AI can stop them (Part 1):

[https://towardsdatascience.com/trolls-and-bots-are- disruptin...](https://towardsdatascience.com/trolls-and-bots-are-disrupting- social-media-heres-how-ai-can-stop-them-d9b969336a06)

\- Identifying trolls and bots on Reddit with machine learning (Part 2):

[https://towardsdatascience.com/identifying-trolls-and- bots-o...](https://towardsdatascience.com/identifying-trolls-and-bots-on- reddit-with-machine-learning-709da5970af1)

\- An interesting Reddit thread titled "How do you guys recognize bot posts?":

[https://www.reddit.com/r/shills/comments/7hcywd/how_do_you_g...](https://www.reddit.com/r/shills/comments/7hcywd/how_do_you_guys_recognize_bot_posts/)</comment>


Redis sorted set stores score as a floating point number  - <AUTHOR> http://www.leaseweblabs.com/2014/07/redis-sorted-set-stores-score-floating-point-number/

<comment><USER2> I made a Hazelcast version of Redis ZSet

I will probably release it after I test it some more.

Writes are single threaded, async, and eventually consistent.

Reads are multithreaded.</comment>


Opinion: Case for removing master-slave terminology from music production tools - <AUTHOR> https://cdm.link/2020/06/lets-dump-master-slave-terms/ <comment><USER2> Oh ffs. Get some education: [https://www.google.com/search?q=dictionary+master&oq=diction...](https://www.google.com/search?q=dictionary+master&oq=dictionary+master)

These are just distractions from real issues. This isn't even incremental progress; it's a conscious choice to do nothing while looking good like you're actually "doing something".

<comment><USER3> While at first glance I don't see any value in changing these terms, I do think pushback of this angry tone serves to illustrate the shocking degree of negative emotional energy that people have for the topic, which ironically serves as evidence that the terms _do_ matter, and strengthens the argument for the change.

<comment><USER2> No, not at all. Read my other comment below.

</comment></comment></comment><comment><USER4> If your initial response to this is negative, and you aren't a member of a demographic that doesn't have recent, painful memories of slavery with horrible, tragic effects that persist to this day, then you really need to check yourself.

For some people who've been through this trauma, the words "master" and "slave" evoke one painful meaning first, before the alternative meaning is understood. If you've never personally experienced something like this, I've read it described as being punched in the stomach. And it's wholely unnecessary, so why not change it?

Words matter. Maybe they don't to you, but trust that people aren't lying when they say it does to them.

I'm super disappointed by the callous response to this: when people talk about gatekeeping in tech, or the myriad failures of tech to be accessible to marginalized people, this is what they mean. This is the culture that enables that.

<comment><USER5> >> a demographic that doesn't have recent, painful memories of slavery with horrible, tragic effects that persist to this day

"Recent" means about 2-300 years? I thought slavery was abolished in US over 150 years ago, that is several generations that never met, so other than books where are the memories? Have you ever met a slave? Have you ever heard about a slave in your lifetime? Do you know anyone who ever talked to a slave?

<comment><USER6> Hardly. It's more uncommon by the day, but there are living first generation descendants of American slaves ([https://www.npr.org/templates/story/story.php?storyId=965819...](https://www.npr.org/templates/story/story.php?storyId=96581933)).

So yeah, there's still a number of Americans who _have_ talked to a former slave.

</comment></comment></comment><comment><USER7> Ideas like this are a great way to signal how privileged you are. Black people being murdered by the cops don't care about master/slave jargon in technology, it's hilariously out of touch that someone would even think this is at all important with respect to the issues going on right now.

<comment><USER8> I think some people like myself see the current issue as an iceberg like problem. Systemic racism is composed of many tiny parts. This is not an either/or question, but a yes/and one. You can both not want to be killed and care about the casual and lazy use of language. We can as technologists, change this without stopping work on police reform for example. The defensiveness/resistance to change is much more interesting to me.

As for signalling, Sure we don't need to advertise it to ourselves and give accolades for something so simple. But we can do the bit and move on. I guess a lot of people are in love with the idea that if doing something is good then it must be being done in order to be _seen_ as doing good. That is bullshit unless you happen to know intent.

<comment><USER7> I think now is the worst possible time to delve into this issue. America doesn't pay attention to anything for long, especially issues related to systemic racism. Right now when we have the ear of America we can't afford to squander that attention on trivialities that don't affect the lives or outcomes of oppressed people. The dynamics of racial discourse over the last decade means unimportant issues like this will only be used as an excuse to shut down the conversation around the issues that really _do_ matter, yet we don't get anything material in return for dying on this hill, this is just social justice theater meant to make privileged people feel good about themselves.

<comment><USER8> I hear that. Months from now would be better than now if as you say it derails better and more urgent conversations.

</comment></comment></comment></comment><comment><USER9> Personally I feel like these changes are silly but it is not a hill I want to die on. I understand some may think this is a slippery slope but as a society we've been sliding down it for years now. Just make the change and move on. Focus on problems that matter.

<comment><USER10> So your argument is: the slippery slope is real but we've already got too much speed so we might as well hit rock bottom?

<comment><USER9> My point is we aren't going to stop 30 years of political correctness. The inertia is there. Software already has an image problem. Fighting something like this makes our industry look bad and doesn't really help anyone or set back the PC train.

We're hitting rock bottom either way. Let's not drag down the software industry in the process.

</comment></comment></comment><comment><AUTHOR> I was hesitant to submit this article because it seems extremely insignificant in the broader context of current societal changes.

But then it made me ponder the wide extent to which current events are causing people of all walks of life to question and reevaluate even the smallest details of everything around us. Do I think that the proposed changes would make a noticeable difference to society? Probably not. Ultimately do I care if this specific effort succeeds or fails? Nope, don't really care either way.

However, I do think the broader discussion about questioning how we use language, and where certain colloquialisms originated, is important. But I do see opinions at both extreme ends of this topic which are not trying to have good faith discussions, and instead are focused on the absolute worst case scenarios. Maybe the reactions to this story are even more significant than the story itself.

<comment><USER11> It's a good article. Thanks for submitting it! Perhaps reflexively, I tend to disagree with its conclusions, but it certainly makes me doubt myself. I was going to resubmit it if it didn't gain traction. I do think you should have gone with something closer to the original title, though. It doesn't quite fit exactly, but it does if you leave out a comma and one word: "Let's dump master-slave terms: they're vague and we're better off without them". Maybe you still able to edit it?

</comment></comment><comment> tekcyb-org Hiding words from people isn't going to help or save anyone. It just supports ignorance.

<comment><USER12> No one is arguing take the word slave out of the dictionary or history books.

We can call these things whatever we want. It's a name for an abstract concept.

Why not change it to something that does not refer to one of the most barbaric, nightmarish relationships between people?

For me personally it makes we wince whenever someone uses "master/slave."

We don't need to be casually throwing around "master and slave" in a professional setting

<comment><USER13> > Why not change it to something that does not refer to one of the most > barbaric, nightmarish relationships between people?

Gee, maybe because it also has connotations that have _nothing_ to do with racism or human slavery?

Where does this slippery slope end?

Should we change other terms in computer technology simply because some vastly small minority emotionally fragile busybodies break down at the mere sight of the word "abort" or "kill" or "terminate"?

Master/slave have very well defined meanings in computer terminology ~ and spoiler alert, there are no human or racial connotations in those meanings anywhere.

<comment><USER12> I think I see where you are coming from. I'm not advocating for changing "abort" or "kill" and agree they go too far.

I disagree with your point that it has nothing to do with racism or human slavery. The name master/slave indicates one is giving direction and one is following direction. It's not like someone sat there thought the letters m.a.s.t.e.r sounded good and might at well be the name of bit of the system giving order.

My concern is not with industry veterans, but with people being introduced to tech or non-techincal people who are brought into technical discussions.

Honestly, would your rather explain a bug as "the secondary was not following the instructions from the primary" or "the slave was not following the instructions of the master" to a room full of people unfamiliar with the subject?

The master/slave naming scheme is, to me, an especially bad situation. Things like whitelist/blacklist do not have the same urgency in my mind.

I appreciate your concern for the slippery slope but think we can address this without falling all the way to the bottom.

</comment></comment></comment></comment><comment><USER14> I'm all for these changes on a personal level, but when a company like Github (and by extension MS) makes a PR move virtue signaling like they actually did something then we should be skeptic, because they have time and time again supported ICE and other law-enforcement that tells a very different story.

</comment><comment><USER15> it seems the end game of this is to disappear the words slave and master from our vocabulary, so we can't express those ideas anymore and let slavery expand unhindered

<comment><USER16> If the words were to dissapear from the dictionay (which is not happening btw) then we'd invent others, don't worry.

I find this change somewhat futile as it will not make people less racist, but if it offends black people we could go with a diferent term, why not?

I always found master/slave a bit too idiomatic. I imagined a hardrive whipping the other form time to time. This picture is painful to some, lets update it and show we're willing to do good.

Im worried though that the change will amount to these types of changes, removing statues, adding disclaimets in history books, old movies etc and then no real change (as in needed change) will emerge. Hope im wrong though

<comment><USER17> > but if it offends black people we could go with a diferent term, why not?

How do we know black people are offended by the terminology of midi clocks ?

</comment></comment></comment><comment><USER18> "We are what we always were in Salem, but now the little crazy children are jangling the keys of the kingdom, and common vengeance writes the law!"

― Arthur Miller, The Crucible

</comment><comment><USER19> Some tools already do this. Reason switched in 2017: [https://www.reasonstudios.com/en/reason/updates/release- note...](https://www.reasonstudios.com/en/reason/updates/release-notes)

> Reason 10.0.1 / Reason Essentials 10.0.1 Release Notes

> ReWire master/mixer and slave/device is now always referred to as "host" and > "device"

</comment><comment><USER20> A lot of the other comments here seem absurd to me. We should all be able to imagine terminology that would be repulsive. (I.e., imagine if some tech term or project name were a racial slur. Would you really argue against changing it?). So yea, there's a line to draw somewhere; we can't say every technical term is immune from critique.

So then the argument is that in this particular case it's just not a big deal and people shouldn't be upset about it. Well, if you're saying that, I'm going to go out on a limb and guess that your recent ancestors didn't have to deal with slavery!

What percentage of people in tech are Black? Some single digit percentage? What if tech were 95% Black? Would we really say master/slave? Of course not. That wording has a lot of baggage for some people! So even if 9 out of 10 people don't have a problem with the word and see this as a PC slippery slope, that doesn't mean the minority is wrong to request changes. It's not difficult to change the terminology, and it helps some people, so why fight it.

<comment><USER7> > _What percentage of people in tech are Black? Some single digit percentage_

I think it's presumptuous to imply that black people necessarily have a problem with master/slave terminology outside of the "owning people" context. I feel compelled to out myself as a black person to say that its absurd. The issue of the day is that police need to stop killing us with impunity. Believe it or not, there is actually a _very_ limited amount of attention available for issues surrounding systemic racial injustice and distractions like this just exhaust that very limited resource and leave us with jaded citizens who roll their eyes whenever issues of social justice are broached. Even the very idea of "social justice" is considered a pejorative because of the focus on stupid issues like this by a privileged group of people who are so comfortable that they have time to worry about things like arbitrary technology labels.

<comment><USER21> Am black, I totally agree it's not a major issue, but I still think it's not a bad change to make. This is just a hypothetical scenario but I've had similar moments before. I'm working with a white person, he says something like, "you mind hooking up that slave device?" And there's this tiny bit of awkwardness, which feels unmentionably dumb to both of us, but is there none the less. We say nothing, and the moment passes. Except maybe, next time subconsciously, we're a little more reluctant to work with each other, we don't even realize why. If making this inconsequential terminological adjustment serves to help get rid of a minuscule, barely perceptible degree of racial friction, then great, why not I say.

<comment><USER7> I don't think it's a _bad_ change, I think alternative words are fine and I would encourage anyone who wants to make such a change to do a find/replace in their codebase. What I don't like is delving into this topic _now_ , when there are so many more important issues at hand and the nation is actually listening for once, especially knowing how this issue will be used to shut down important conversations around race and characterize the social justice movement as puerile and trivial. The reality is master/slave terminology _is_ trivial.

If someone wants to replace "master" with "main" in code review, I think that's fine, perhaps even slightly better than what it was before, but this should stay within the confines of the organization rather than dilute the movement proper.

<comment><USER22> A computer programmer can change programming terminology. They can't really change police department practices.

<comment><USER7> > _A computer programmer can change programming terminology_

And that's fine, perhaps even laudable in the abstract, but right now it's not what we should be wasting time on.

> _They can 't really change police department practices_

They could protest. They could donate time and money. They could use their platform to elevate issues that have a material impact on people's lives. They aren't obligated to do those things to be good people, and a few of them might be doing all of the above, but changing computer jargon doesn't even begin to register on the scales of social justice, it is so utterly meaningless in the face of what's going on all around us that it's _almost_ insulting, save for the fact that the idea is overall well intentioned.

</comment></comment></comment></comment></comment></comment><comment><USER23> White people fighting worthless causes to feel good about themselves and patting themselves on the back because they fought away racism by changing names, episode 2345.

But sure, go ahead, make the term disappear. That will surely fix the underlying issue.

</comment><comment><USER24> What is that make people react to events that happen in the US differently than those outside of the US? I mean there are people who die and people who protest about a variety of different issues outside of the US (just recently protests in Hong Kong, Iraq, and Lebanon). However, it never causes this magnitude of response, from media platforms and tech companies, to music production terminology.

</comment><comment><USER25> To move forward, you must be willing to make changes. If something is causing controversy, you cannot ignore it for long before it drags you and everyone else down. If you do not identify with the controversy, you should step away from it and let the others who can lead the change. You can focus your energy on things that matter to you.

</comment><comment><USER26> Cars have master and slave cylinders. I never liked the terms because I don't think the terms a very descriptive. Pedal cylinder and wheel cylinder describe the devices better.

</comment><comment><USER27> Next, we should stop using male/female for connectors.

<comment><USER11> This suggestion was in fact made at the bottom of the article: _Bonus footnote – male and female? Switch to "plug" and "socket." This change is tougher, though, because there's no easy abbreviation to 'm' and 'f' for text that is tougher to change. But the terms are clearer and … you know, less gross._

<comment><USER27> I was being sarcastic.. :/

<comment><USER28> There's no bottom to this rat hole.

</comment></comment></comment></comment><comment><USER29> It's remarkable how much drama is being manufactured over a non-issue. There's a zero percent chance the people putting in the effort to promote this don't realize that 'Master' is an industry term of art meaning original or reference copy.

<comment><USER30> Is "slave" an industry term of art? Certainly most people are familiar with the concept of a "master copy" - keys, documents, etc. but computer networking is the only time I've ever encountered the word "slave" thrown around so cavalierly.

<comment><USER11> Yes, both "master" and "slave" have been used as a pair for a long time in a number of different technical fields to describe relationships between devices. Instead of computer networking, the linked article is on a site that focuses on music technology ([https://cdm.link](https://cdm.link)). If you search (for example) [midi "slave"] you'll come up with a lot of hits using "slave" in a technical sense for electronic music. Here's a nice example page from that search, that goes farther to distinguish (technically and without irony) two different types of masters and slaves: [https://steinberg.help/cubase_pro_artist/v10/en/cubase_nuend...](https://steinberg.help/cubase_pro_artist/v10/en/cubase_nuendo/topics/synchronization/synchronization_master_and_slave_c.html).

</comment></comment></comment><comment><USER17> There we go again with a Rubocop-like complaint. Are we at the pinnacle of ridicule yet ? Because I don't think I can take anymore. The amount of bigotry in the news is puzzling.

</comment><comment><USER31> Changing reality with language is a Soviet propaganda tool, actually more and more used elsewhere. Look at Trump, BoJo et al. It doesn't change reality. It muddled the problem, confounds the description of the problem with the solution, and makes us forget where we come from. The shame of using the term 'slave' for an electronic device or 'master' for a Git branch is here to stay, to remind us where we come from. Erasing them is fighting history and language, and as such worse than futile.

Sure, some terms are outright offensive, but this is not the case here.

There are some factual errors in the article too, but I'll leave that. As a Slav I have no issue with the term "slave", not least because it's not the root of the word...

</comment><comment> Seb-C Next steps following this logic:

\- Stop using the word "communism" because it may offend ex-USSR citizens

\- Stop using the word "famine" because it may remind bad memories to some africans

\- Stop using negative words to talk about the chinese government because it could offend chinese people

\- Stop using the words "bible" and "jesus" because it might offend muslims

The world will sure become a better place without those negative feelings...

</comment><comment><USER32> Another opinion: Instead for going after the words, go after the facts.

The US is the world's largest slave owner state. Their prison system is the modern equivalent of a slave economy under slave jurisdiction, and the treatment of illegal foreign labor not much different. How about legal reforms?

<comment><USER33> Can't we do both?

<comment><USER34> Why would you need to (re)invent words if there is no problem anymore?

<comment><USER33> So structural racism has ended?

<comment><USER35> Well, masters and slaves have existed longer before than structural racism

They were already there in Babylon over 4 thousands years ago.

<comment><USER35> It's kinda depressing to see the downvote, again, because people don't know history

Slavery does not imply racism, it hasn't been the case for a very long time throughout history, slaves were a social class, a synonym for what we call "working class" or they were people from conquered lands, that were enslaved as a display of suoremacy, not because of their ethnicity.

They usually were of the same ethnicity.

Rome had emperors who were born in Africa (Settimio Severo for example)

Have the slaves suffered abuses?

Yes, of course, just like working class, and farmers and other poor classes before them, have been exploited.

French Revolution is all about that.

They were all French against other French.

Only in modern history slavery has been justified by racism (the theory that some "races" were superior to others) but it's not modern slavery that created racism, it's the opposite.

<comment><USER36> Slavery in the United States was an especially brutal form of slavery referred to as _chattel slavery_. In this form of slavery the slaves are not regarded as even being _human_ , they are treated with the same regard as one would treat an ox. American slaves were not the _working class_ as you describe.

<comment><USER37> Do you think Leopold the II slaves in Congo were considered human beings?

[https://en.m.wikipedia.org/wiki/Atrocities_in_the_Congo_Free...](https://en.m.wikipedia.org/wiki/Atrocities_in_the_Congo_Free_State)

Do you think slaves in Japan were treated equally?

[https://en.m.wikipedia.org/wiki/Slavery_in_Japan#:~:text=Jap...](https://en.m.wikipedia.org/wiki/Slavery_in_Japan#:~:text=Japan%20had%20an%20official%20slave,sex%20slaves%20from%201932%20%E2%80%93%201945).

There is nothing special in US slavery, except it happened in US and US has been culturally relevant for the west since the end of WW2

One thing is the historical reasoning about it, another is thinking that it happened only to one place in the world and only those people can talk about it.

Don't get me wrong, slavery is a terrible and unjustifiable crime, but it didn't start in US and it didn't end in 1861

<comment><USER36> The United States was not the only country to ever employ chattel slavery - it's not unique in that regard. It _is_ unique in that it's the only country to end slavery due to civil war - a fact I think is very important in this discussion. There are to this day a number of "rebels" as they call themselves who believe themselves to be intellectually and morally superior to black people, they want to keep black and whites separated, and they want to remind blacks of their inferiority by prominently displaying statues of Confederate Generals in the public square and promulgating the use of terms reminding blacks of their inferior social standing. Terms such as blackmail, blacklist, and master/slave. There's _way_ more behind this than just slavery and snowflakes getting their feelings hurt.

<comment><USER37> > terms such as blackmail

Isn't it weird that people that don't know words etymology want to decide what they mean for the rest of us?

> _1550s, "tribute paid to men allied with criminals as protection against > pillage, etc.," from black (adj.) + Middle English male "rent, tribute," > from Old English mal "lawsuit, terms, bargaining, agreement," from Old Norse > mal "speech, agreement;" related to Old English mæðel "meeting, council," > mæl "speech," Gothic maþl "meeting place," from Proto-Germanic _mathla-, > from PIE _mod- "to meet, assemble" (see meet (v.)). _

In 1550 USA didn't even exist, not even in the form of colonies, that formed after 1600.

The first known settlement in what we call US today is by the Spanish in 1513 that reached Florida.

So no, blackmail doesn't mean what you think it means and doesn't come from where you think it does.

<comment><USER36> Surely someone as smart as you understands the difference between denotation and connotation?

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER35> Disclaimer: I'm not and English native speaker and there's no equivalent in my language, in fact they usually are not translated and used in English. (I mean, there is an equivalent, but it's never used in this context)

My position about this issue is ambivalent.

From a purely human standpoint I understand it, truly.

When we use those terms referring to tools, I don't see much sense.

When men used bulls to pull the plough it really was a master-slave relationship

The bull could not be the master, even if it wanted too, a human is not strong enough to pull the plough effectively

It's a symbiotic relation between two elements where one is in charge of the "intellectual" part and the other of the physical one.

We can use controller and agent, but controlling is problematic too

We can use manager and worker, but it still implies that there's a disparity between the two

Frontend/backend doesn't fully capture what's going on

We use master/slave because one side is taking all the decisions, the other is just obeying

It's bad, I recognize it, and maybe it's time to change, but no amount of re- wording will change the fact that it's mainly used nowadays for tools that work that way, not for people.

Maybe leader/follower looks like a better choice, but really isn't, follower sounds more dumb to me, at least slaves rebelled throughout history, followers don't. And a leader can be as bad as a master who owns slaves.

Main/secondary is somewhat the best of them all, but it only works for systems were any secondary node can be promoted to replace the main in case of failures, which is not always the case.

Bull/man is not main/secondary for example.

<comment><USER37> What about brain/arm?

<comment><USER35> Thinking about it, brains/muscle doesn't sound so bad

Or master/blaster as in Mad Max Beyond Thunderdome

</comment></comment></comment><comment><USER38> This is really creepy and I have an intense dislike for the people behind it. Nobody alive today was a slave and choosing to become ass hurt at industry standard terms, which aren't even racial in nature (every race has been enslaved), isn't acceptable.

I never used Github as my primary host for projects, merely as a social network to show off my projects. But I'll be moving away from them now because I simply don't want to see crazy lefties redefining my language to suit their whims. And there's no discussion at all, it's all unilateral or you're a Nazi.

OK then.

</comment><comment><USER39> They're coming after tech. Don't worry, changing terminology will change the underlying issues. Just be careful not to cause thoughtcrime once neuralink is feasible in a few decades.</comment>


Total US Debt so far: $301 Trillion dollars. $1.5M per person - <AUTHOR>

all with the latest data
9.8T in bailouts http://www.bloomberg.com/apps/news?pid=washingtonstory&sid=aGq2B3XeGKok
11T in government debts http://www.brillig.com/debt_clock/
17T in corporate debts http://www.nytimes.com/2009/04/04/business/economy/04charts.html?em
1T in credit card debts http://www.opposingviews.com/articles/opinion-americans-1-trillion-in-cr...
11T in mortgages http://www.bloomberg.com/apps/news?pid=washingtonstory&sid=aGq2B3XeGKok
52T in social security/medicare obligations http://www.bio-medicine.org/medicine-news-1/Medicare--Social-Security-Ow...
Like other government trust funds (highway, unemployment insurance and so forth), the Social Security and Medicare Trust Funds exist purely for accounting purposes: to keep track of surpluses and deficits in the inflow and outflow of money. The accumulated Social Security surplus actually consists of paper certificates (non-negotiable bonds) kept in a filing cabinet in a government office in West Virginia. These bonds cannot be sold on Wall Street or to foreign investors. They can only be returned to the Treasury. In essence, they are little more than IOUs the government writes to itself. http://www.ncpa.org/pub/ba616
200T in derivatives in banks http://www.occ.treas.gov/deriv/deriv.htm
Not including derivatives; 101T. including it, 301T
Can't really pay it off anytime soon....
2.3T budget deficit this year. 10T in the next 10 years. http://www.cnsnews.com/Public/content/article.aspx?RsrcID=45528 <comment><USER2> This is really misleading. Much of that "debt" is in the form of obligations to U.S. citizens. For example, the $52T in social security/medicare is only an obligation because the government has promised to pay people like you and me. That's $52T we have to pay, but it's also $52T that we'll be receiving.

The same goes for derivatives. Every liability on someone's books is an asset on someone else's. The real problem is that with all these financial firms going belly-up, we don't know who's holding the debt and who owes it.

<comment><USER3> The use of the word "only" in front of the description "an obligation" is what is really misleading.

Another way of saying "we don't know who's holding the debt and who owes it" is to say:

      "I don't have the cash on hand to pay you what I owe you but I promise you that the cheque will be in the mail any day now."</comment></comment>


Twitter Now Using 'Spam' to Put Devs in a Corner - <AUTHOR> https://insights.dice.com/2018/07/24/twitter-spam-developers-pay-price/ <comment><USER2> Ummm... given the global manipulation of political opinion by Russia this is a minimum required step. Brexit, Trump, other massive global destabilization has been delivered by using Twitter to artificially amplify destructive voices.

Save the outrage Nate Swanner the alternative is nothing less than the end of western democracy.</comment>


A love affair with PostgreSQL - <AUTHOR> http://blog.remarkablelabs.com/2012/12/a-love-affair-with-postgresql-rails-4-countdown-to-2013

<comment><USER2> The article is showing off the -> operator and then proceeds to talk about indexes and using them for querying. Unfortunately, -> can't take advantage of indexes.

You'd have to use the @> operator and compare a partial hash.

So instead of

        SELECT * FROM comics WHERE properties -> 'story_arc' = 'Throne of Atlantis'

You'd use

        SELECT * FROM comics WHERE properties @> 'story_arc=>Throne of Atlantis'::hstore

The first query will not use an index on properties, the second one will.

See the first paragraph of F.16.3 on <http://www.postgresql.org/docs/9.2/static/hstore.html>

</comment><comment><USER3> I'm glad to see Rails supporting Postres more in a world where the future of MySQL is in flux. Postres is solid.

<comment><USER4> MySQL isn't in flux. It is getting better every single day because of the contributions from Percona, MariaDB, Facebook, Twitter and even Oracle. It's just that people have a nervousness because of the Oracle connection.

And PostgreSQL maybe solid but developers want a solution that horizontally scales. Until this is addressed it is going to find itself increasingly marginalised.

<comment><USER5> PostgreSQL horizontally scales in the same fashion as MySQL. What are you talking about?

[http://instagram- engineering.tumblr.com/post/10853187575/sha...](http://instagram- engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram)

<http://postgres-xc.sourceforge.net/>

<http://www.pgpool.net/mediawiki/index.php/Main_Page> (you can use this to transparently shard)

<comment><USER4> No it's not like MySQL which has MySQL Cluster a supported, well documented, OOTB, easy to use solution with lots of enterprise customers. Similarly Percona has a very, very impressive product with great support.

Instagram had to roll their own and Postgres XC, PGPool both have always seemed pretty sketchy. No official support, no notable customers, shocking complexity and everything just seems all over the place with documentation from say 2009 referencing PostgreSQL 8 e.g. PgPool beginner guide. They may be great solutions but do they really look like something that inspires confidence ?

These guys seem to have the right idea: <http://www.cloudpostgres.com>

It would just be nice to have something as simple and polished built into PostgreSQL.

<comment><USER6> Pretty sure Skype scales PG horizontally pretty darn well. PgPool is probably the least used, least recommended replication method out there. Streaming replication in 9, WAL shipping, and things like Londiste (Skype) are what real large production users use.

</comment></comment></comment></comment></comment><comment><USER7> I also love Postgres, but since hstore can't do nesting, but is only a flat map of strings to strings, I've been reluctant to try it out. Still, I'm glad to see it's getting support in Rails.

<comment><USER2> So because $SOLUTION can't do both $FEATURE1 _and_ $FEATURE2, you don't use $SOLUTION and thus you don't even have $FEATURE1?

Hstore is invaluable when you want to add arbitrary attributes to rows in your tables (think: different attributes for products in different categories). It's as if every row had an unlimited (and different from other rows) amount of columns.

To do this without hstore, you can dump the additional data as a serialized blob of some kind, but then you lose the ability to efficiently[1] query or sort for those additional attributes or you use a complicated mess of join tables, which means increasing cost of querying as you add more fields to query for (one join per field).

With hstore, you get indexed querying and sorting in addition to an unlimited amount of fields.

Also: because keys and values are just strings, it's in fact possible to nest hstores, you just don't get the nice indexing or any kind of type safety past the first level of hstores.

[1] if your blob is XML or JSON (via pl/v8), you can use functional indexes to still get indexed and sorted lookups in advance without having to do the indexing inside the application logic which you would have to in case of any of the NoSQL stores.

<comment><USER7> > So because $SOLUTION can't do both $FEATURE1 and $FEATURE2, you don't use > $SOLUTION and thus you don't even have $FEATURE1?

More like I choose $SOLUTION2 that _can_ do $FEATURE{1,2}. Maybe that's adding related tables, maybe it's using a JSON column, maybe it's something else. I think part of good engineering is picking solutions that keep your options open. It seems like your data's structure always gets more complex over time, so hstore is a risky choice.

I'm not saying it's a terrible choice: you could always manage the flatness the way people use Java properties files, with compound key names to simulate fancier data structures, but that's sort of a pain. I could definitely see myself trying out hstore in the future for something like user preferences; I just am hesitant due to its flatness.

> because keys and values are just strings, it's in fact possible to nest > hstores

I don't understand this; could you elaborate? Are you saying that an hstore is really a string?

<comment><USER8> > Are you saying that an hstore is really a string?

I'm not familiar with hstore but I think he means you can store some kind of _reference_ under a key.

</comment></comment></comment></comment><comment><USER9> Is there an API that doesn't require string concatenation? As-is these APIs appear relatively dangerous from a security perspective.

</comment><comment><USER10> I just realized you could do prototyping with HStore, and then if or when you need improved performance switch to regular tables.

<comment><USER11> Only for something super, super simple though. You can't have nested data structures in hstore.

</comment></comment><comment><USER12> hstore support should be nice. Thanks Rails team!</comment>


Baddges - Nexus 7 Giveaway. - <AUTHOR>

We are trying to get people interested in our site/app by offering a Nexus 7. We are targeting Teachers, Parents, and Small Companies. Please take a look and give us any feedback or ideas. http://baddges.com <comment><USER2> A little bit more info on what the actual app does would be nice. Too vague, so didn't sign up.

<comment><AUTHOR> I added the following to the page: Baddges will provide you with a fun way to acknowledge someone for their achievements. Though our target market includes parents, teachers, and employers, anyone looking for a tool to appreciate individuals for their greatness can use it.

Does this help? Thanks for your help!</comment></comment>


Being Bill Murray - <AUTHOR> http://www.rollingstone.com/movies/features/being-bill-murray-20141028

<comment><USER2> "My hope, always, is that it's going to wake me up. I'm only connected for seconds, minutes a day, sometimes. And suddenly, you go, 'Holy cow, I've been asleep for two days. I've been doing things, but I'm just out.' If I see someone who's out cold on their feet, I'm going to try to wake that person up. It's what I'd want someone to do for me. Wake me the hell up and come back to the planet."

I've been working a regular 9-5 office job for the last couple of months and this really resonated with me. I think the knee-jerk reaction some people have to unusual behavior is as much 'waking up' as it is revulsion.</comment>