HNHacker News
TopNewBestAskShowJobs

mfourcade

21 karma · joined January 25, 2011

submissionscomments
mfourcade··on First Battle of the Marne – Entente forces counter attack
pure gold ! I think bataille of the Marne starts in episode 2. https://www.dancarlin.com/product/hardcore-history-51-bluepr...
mfourcade··on Fibers are the right solution to improve Ruby performance
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.

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

edit: style/explanation

mfourcade··on Fibers are the right solution to improve Ruby performance
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

mfourcade··on Amazon raises minimum wage to $15 for all US employees
US ±100 years ago: "If we will not endure a king as a political power we should not endure a king over the production, transportation, and sale of any of the necessaries of life." ( https://en.wikipedia.org/wiki/History_of_United_States_antit... )

Feels like AMZN is becoming a political power, a king of production, transporation and sale... Is it too big ?

Any risk Trump answers with a New Deal à la Roosevelt ?

mfourcade··on UK votes to leave EU
Was the US an european colony? With people speaking French, English, Spanish and Portuguese? I guess it was a mix and match of many human being that decided to be free : no more, no less. Freedom was the driver, not the enemy.

Also maybe you should consider the actual state of US : What's the percentage of english/spanish people speaking? What about Catholics/Jews/Muslim? Should we expect an USbreak ?

Saying that, I do not believe that we need a common enemy to be united. There is better values and challenges for all of us : environment, peace, love. Europe will stand strong, refine its vision to the current context. After a few years, UK we be back and we will all make love peacefully in a better environment.

Long live to Europe.

mfourcade··on A better alternative to the Heroku add-ons listing
Love it!

Reviews of my peers are great inputs to validate my interest with add-ons!