Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:47
    straight-shoota closed #12051
  • 13:47
    straight-shoota closed #12050
  • 12:17
    beta-ziliani edited #7318
  • May 15 08:43
    r00ster91 closed #7318
  • May 15 08:17
    r00ster91 closed #7690
  • May 14 17:01
    Blacksmoke16 labeled #11995
  • May 14 13:03
    webhive closed #12055
  • May 14 10:19
    straight-shoota milestoned #12051
  • May 14 10:00
    I3oris edited #12051
  • May 14 08:45
    oprypin review_requested #11977
  • May 13 23:29
    Blacksmoke16 unlabeled #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 opened #12061
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota opened #12060
From IRC (bridge bot)
@FromIRC
<RX14> yes but i typically git blame on github
<RX14> i probably shouldn't complain then
<RX14> @oprypin, jan 2015
From IRC (bridge bot)
@FromIRC
<Yxhuvud> @RX14: vc-region-history in emacs. gives all history for the selected region. totally amazeballs function
<Yxhuvud> (assuming modern enough emacs)
<RX14> Yxhuvud, doesn't really work for this case
<Yxhuvud> should do, unless the refactoring was huge (or the line was in some other file or some totally other place)
<RX14> yes the latter
<RX14> the refactoring was huge AND across files
<RX14> i need to go blame -> diff
<RX14> which is easy
<RX14> and then i need to find where it was deleted and blame there
<RX14> which is hard on github
<RX14> because you can't go from a deleted line in a diff to blame
<Yxhuvud> yeah, stuff like that is easier from the command line.
From IRC (bridge bot)
@FromIRC
<RX14> its actually not
<RX14> using magit i can use git-blame-micro-state
<RX14> and blame until i find the refactoring
<RX14> then i can press enter to get to the commit
<RX14> search for accept( in that diff
<Yxhuvud> well still easier than using github for it
<RX14> then press enter on the deleted line to open the buffer to the file as-is before that commit
<RX14> then blame on THAT buffer
<RX14> which si way easier than github
kipar
@konovod

https://carc.in/#/r/2h2k

require "random/system"
u = 0_u64
u = Random::System.next_u
pp u, typeof(u)

shows UInt8. I think next_u is pretty strange method. Why not make next_u32, next_u64?

From IRC (bridge bot)
@FromIRC
<oprypin> @konovod, basically you're not supposed to use next_u
<oprypin> > It is possible to make a custom RNG by including Random and implementing #next_u to return an unsigned number of a pre-determined type (usually UInt32). The numbers generated by your RNG must be uniformly distributed in the whole range of possible values for that type (e.g. 0u32..UInt32::MAX).
<oprypin> it returns the type that is "native" to this particular RNG
kipar
@konovod
So how to get say random UInt64?
oh, yes, then it's fine.
From IRC (bridge bot)
@FromIRC
<oprypin> rand(UInt64::MIN..UInt64::MAX)
<RX14> @oprypin, perhaps the kernel will write more than sizeof(struct sockaddr) when it can, for performance reasons around unaligned memory?
<oprypin> that's too far down the rabbit hole
<RX14> lol
<oprypin> maybe the problem is size mismatch and the actual sckaddr it tries to write is bigger
<oprypin> u said there can be different ones
<RX14> perhaps
<RX14> yes but looking again
<RX14> they're all the same size?
<oprypin> @konovod, also just so you're aware, you wrote u = 0_u64 but it can have absolutely no effect on consequent assignments to it
<oprypin> assignment to a variable always makes the type of the variable the same as what was assigned to it, regardless of previous uses of that variable name
<oprypin> i seem to notice this misconception often lately, maybe some docs need to clarify this
<RX14> variables don't exist, we just have SSA but they're all named the same and every usage is a phi node
kipar
@konovod
@oprypin yeah, i was totally wrong. It would have effect in a field, but local var is just overwritten.
From IRC (bridge bot)
@FromIRC
<oprypin> it would have an effect of a compile error due to type mismatch but yeah
From IRC (bridge bot)
@FromIRC
<imnotjustarobot> hello!
<RX14> hi
<imnotjustarobot> where can I get an interactive crystal? like IRB, the interactive ruby
<RX14> crystal play
<RX14> you can write code in there and get output in your browser