News for hackers. Stuff that matters.

mfourcade

Re:First Battle of the Marne – Entente forces counter attack on Tuesday November 20, 2018 @11:57AM (#18495322)
pure gold ! I think bataille of the Marne starts in episode 2. https://www.dancarlin.com/product/hardcore-history-51-bluepr...
Re:Fibers are the right solution to improve Ruby performance on Monday November 19, 2018 @07:21AM (#18485878)
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

Re:Fibers are the right solution to improve Ruby performance on Monday November 19, 2018 @02:02AM (#18484622)
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

Re:Amazon raises minimum wage to $15 for all US employees on Tuesday October 02, 2018 @01:23PM (#18123704)
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 ?

Re:UK votes to leave EU on Friday June 24, 2016 @04:06AM (#11967728)
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.

Re:A better alternative to the Heroku add-ons listing on Friday March 30, 2012 @06:17AM (#3775227)
Love it!

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