[#87773] timer thread [was Re: [ruby-alerts:7905] failure alert on trunk-asserts@silicon-docker (NG (r63844))] — Eric Wong <normalperson@...>
> test_all <main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken
[#87836] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been reported by ko1 (Koichi Sasada).
[email protected] wrote:
On 2018/07/06 18:47, Eric Wong wrote:
[#87847] undefined symbol: mjit_init_p — Leam Hall <leamhall@...>
I pulled Ruby trunk on 3 Jul and am now getting errors similar to the
QXMgSSB0b2xkIHlvdSwgYG1ha2UgaW5zdGFsbGAgaXMgbmVlZGVkIHRvIG1ha2UgUnVieSB3b3Jr
T25lIG1vcmUgcmVhc29uIGZvciBodHRwczovL2J1Z3MucnVieS1sYW5nLm9yZy9pc3N1ZXMvMTM2
[#87986] [Ruby trunk Feature#14915] Deprecate String#crypt, move implementation to string/crypt — mame@...
Issue #14915 has been updated by mame (Yusuke Endoh).
[email protected] wrote:
normalperson (Eric Wong) wrote:
[#88088] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — normalperson@...
Issue #14937 has been reported by normalperson (Eric Wong).
[#88104] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been updated by ko1 (Koichi Sasada).
[#88173] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — Greg.mpls@...
Issue #14950 has been reported by MSP-Greg (Greg L).
[#88189] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — nobu@...
Issue #14950 has been updated by nobu (Nobuyoshi Nakada).
[#88199] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — takashikkbn@...
Issue #14937 has been updated by k0kubun (Takashi Kokubun).
[email protected] wrote:
> yet, sky3 had a failure at
> http://ci.rvm.jp/results/trunk@P895/1173951
> > http://ci.rvm.jp/results/trunk@P895/1173951
[ruby-core:88047] Re: [Ruby trunk Feature#14924] // floor division operator
> Out of curiosity what are you doing that needs integer division? :)
For example in my window manager I have some rules to determine how
windows should be sized and positioned (tiling).
~~~ ruby
# how many windows with 484px width would fit in a given screen?
windows_count =3D screen.width / 484
# what height to use for multiple windows in a "column"?
window_height =3D column.height / column.windows.size
~~~
(this is not my actual code, I changed it slightly for clarity)
In another case, I wanted to overlay some CSV values from telemetry
data on videos. My values are within -1024..1024, and I want to
overlay a "bar chart" that is 720px high for example, so I had code
similar to this:
~~~ ruby
(telemetry_value + 1024) * 720 / 2048
~~~
Last example, I use ruby to generate "templates" for my keyboards
(to draw and cut holes for switches/keys). I was worried about Float
approximation (maybe wrongly), and preferred to calculate
everything with integers representing 1/10 millimeter (the most
precise measurement I work with is only 0.5=A0mm).
~~~ ruby
class Key < Struct.new :x, :y, :u, :direction
def urect
Rect.new(
x * U + CASE_PADDING[3],
y * U + CASE_PADDING[0],
U * (direction =3D=3D :horizontal ? u : 1),
U * (direction =3D=3D :vertical ? u : 1),
:blue
)
end
def switch
cx, cy =3D urect.center
Rect.new(
cx - SWITCH_SIZE / 2,
cy - SWITCH_SIZE / 2,
SWITCH_SIZE,
SWITCH_SIZE,
:red
)
end
end
class Rect < Struct.new :x, :y, :width, :height, :color
def center
[x + (width / 2), y + (height / 2)]
end
end
~~~
(https://raw.githubusercontent.com/tjouan/keyboards/master/lib/keyboards/la=
yout.rb
for the rest of the code, sorry for ugliness and that github is the
only place I have it public for now)
So in most cases, it was about coordinates=A0: I can't split a pixel
for example. But I also remember using integer division at work for
financial amounts, I cannot split a "cent" either and can't rely on
approximations in such case.
> Still I think that 99% of people expect that when you divide 3 / 2 you ge=
t 1.5 (it's like that in every calculators in the world).
> =
> 3 / 2 =3D=3D 1 is against the principle of least surprise, but hey I unde=
rstand that we can't change that anymore in Ruby. :)
Yes I have exaggerated in saying the opposite, sorry=A0:-) I
understand that for math and scientific usage it's very different. My
background is mostly C and Ruby, and my "calculator" is almost always
`bc' program so I might be biased here.
-- =
Thibault Jouan
Unsubscribe: <mailto:[email protected]?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>