<FromGitter>
<alxgsv> @firejox very useful fix, thank you! I thought I'm losing my mind )
DTZUZO has joined #crystal-lang
<FromGitter>
<cserb> Is there something like a `abstract def self.foo` ... making it mandatory to define the class method `def self.foo() ... end`?
DTZUZO has quit [Ping timeout: 268 seconds]
HumanGeek has joined #crystal-lang
Human_G33k has quit [Ping timeout: 245 seconds]
<FromGitter>
<igor-alexandrov> Hi guys! Shrine 0.3.0 with plugin system and tons of different changes has been released today: https://github.com/jetrockets/shrine.cr/releases. I am waiting for your feedback. Thank you!
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter>
<yxhuvud> @firejox How does a Deque compare?
HumanGeek has quit [Ping timeout: 240 seconds]
<FromGitter>
<tenebrousedge> and why is this necessary?
<FromGitter>
<firejox> @yxhuvud It focus on array compare. Deque itself takes a lot advantage on rotate
<FromGitter>
<Blacksmoke16> @tenebrousedge why is abstract class methods necessary?
HumanG33k has joined #crystal-lang
<FromGitter>
<tenebrousedge> no, the rotate thing
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<tenebrousedge> what I've learned about Crystal benchmarks is that I don't understand Crystal's internals enough to write good benchmarks, and that bad benchmarks can very easily create the appearance of small performance differences
<FromGitter>
<igor-alexandrov> @j8r done, released 0.3.1. Thanks.
<FromGitter>
<firejox> It is true. Benchmark is hard
<FromGitter>
<tenebrousedge> so my question would be, is this a good benchmark, and if so, is a 20% performance gain worth the complexity of this code?
<FromGitter>
<firejox> It is not good because I have not analyzed the density of the worst case yet .
<FromGitter>
<firejox> The performance will depends on the depth of GCD.
<FromGitter>
<j8r> @igor-alexandrov 🚀
<FromGitter>
<firejox> If the rotate distance can divide the size, it will run efficiently.
<FromGitter>
<j8r> @igor-alexandrov Side note, you can use `.mime?` in place of `Tools::Mime`- that's the same
<FromGitter>
<firejox> If both size and rotate are fibonacci number, it will do more work.
<FromGitter>
<firejox> So I need to analyze them.....
<FromGitter>
<igor-alexandrov> @j8r question about https://github.com/schovi/baked_file_system was for me? I know, that I can use `.mime?`, but still `Tools::Mime` seems more readable to me...
<FromGitter>
<j8r> as you wish
<FromGitter>
<j8r> Yes for the question
<FromGitter>
<igor-alexandrov> backed_file_system is a virtual file system, Shrine is a tool to manage uploads.
<FromGitter>
<j8r> Perhaps the could add more info about this, I am a noob on this
<FromGitter>
<j8r> I can upload an image to a server?
<FromGitter>
<j8r> for instance
<FromGitter>
<DRVTiny> @Blacksmoke16 This is very optimistic approach: any of the spawned fibers can "forgot" to send result to channel, so fiber waiting workers.times will freeze forever. channel.receive(timeout: 150) will be better, but AFAIK event loop in crystal does not support setting timeout per I/O operation. I can be mistaken.
<FromGitter>
<DRVTiny> @Blacksmoke16 sorry, don't understand your question. I mean that event loop can be redesigned to support fiber-unlocking on firing any-of-several-events, any-of-several-events, (event1 OR event2) AND event3, etc. In that case is will possible for fiber to wait for (timeout event OR channel i/o event). I don't know why there are no event loops that implements desribed logic with subscription for several events,
<FromGitter>
... not only one, but i in my opinion Crystal is a modern language where such "innovative" features may be implemented.
ht_ has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @DRVTiny do you have the right person? I'm not sure what started this discussion
<FromGitter>
<CodingItWrong> I apologize if this is asked before/often. Has anyone played with interoperability between Crystal and Swift or Objective-C for building iOS apps?
<FromGitter>
<bew> Hello (; did the talk from asterite at the chicago meetup been uploaded somewhere already?
duane has quit [Ping timeout: 250 seconds]
<hightower2>
Hey folks any advice how I'd properly detect ctrl/shift/meta being pressed together with keys, while reading raw from STDIN?
duane has joined #crystal-lang
duane has quit [Remote host closed the connection]
<FromGitter>
<mavu> @hightower2 I don't think you do detect that at all.
<FromGitter>
<mavu> Its a different layer.
<FromGitter>
<mavu> the keypresses go to the terminal program which displays the operating system shell.
<FromGitter>
<mavu> which in turn runs your program.
<hightower2>
mmm... I do agree that something may be missing, but I'd say the app can detect this, I just don't know how.
<FromGitter>
<mavu> If you want to capture keypresses directly, you need to write a program that displays its own window and gets the keyevents from the window manager
<FromGitter>
<mavu> you are never going to get keypress events through STDIN.
<FromGitter>
<mavu> you get characters through STDIN.
<FromGitter>
<mavu> including for example backspace which is the "character" CTRL-H
<FromGitter>
<mavu> this key combination is received by your terminal window. and translated to a byte that corresponds (in an ancient protocol) to Backspace.
<hightower2>
Yes, the approach I was trying so far is that the modifiers do affect the characters that I receive.
<hightower2>
By looking at the codepoint of those chars (or well, at string.char_at(i).ord) I can see what the codepoint value is. And it is different for e.g. 'c' versus 'ctrl+c'
<FromGitter>
<mavu> yes, that will work, but be aware that those characters have meaning.
<hightower2>
However that has its own problems, it's not direct access to modifiers/state
<hightower2>
yeah
<FromGitter>
<mavu> not going to happen through STDIN.
<FromGitter>
<mavu> That said, things like ncurses exist, and may be able to do some magic. but I seriously doubt it will give you modifier presses
<hightower2>
yeah I wanted to avoid getting modifiers indirectly from chars received, but seems like it'll have to do