<FromGitter>
<codenoid> ooo, the name of algoritm is topic extraction
<FromGitter>
<r3bo0t> very basic question, what is the ruby’s `URI.encode`equivalent in crystal. URI.escape is not exactly the same.
duane has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
<FromGitter>
<t0nyandre> RX14, what was the IRC client on Android you linked to for a few days ago? I forgot to download or bookmark it 😯
That_Guy_Anon1 has quit [Quit: Leaving]
<FromGitter>
<r3bo0t> hmm URI.escape is made for escaping individual parameters unlike ruby’s URI.encode which is intended to encode URL in generic way. Got it working with `escaping` specific parameter values. ⏎ Cc: https://github.com/crystal-lang/crystal/issues/2118
<FromGitter>
<r3bo0t> Should have looked into github issues first :) #lessionlearned
rohitpaulk has joined #crystal-lang
ryan_ford has joined #crystal-lang
bonemind has joined #crystal-lang
snsei has quit [Remote host closed the connection]
straight-shoota has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
Groogy has quit [Disconnected by services]
Groogy_ is now known as Groogy
Groogy2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has quit [Client Quit]
<Groogy>
Morning!
<FromGitter>
<ryankshah> Morning guys! Is there a proper way to do an iteration through numbers (such as a for loop in a common OOP language)?
<FromGitter>
<ryankshah> I was looking at `Int.onto(Int)` but documentation is shallow and poor for this, but from what I see it is a one line thing, whereas I need to do multiple things in my iteration sequence
Papierkorb has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<aisrael> `n.times.do` or `5.times.do`?
Papierkorb has left #crystal-lang ["Konversation terminated!"]
<FromGitter>
<ryankshah> @aisrael how do I get the current index from that iteration? Can I do `(start..end).each do |i| ... end`
<FromGitter>
<aisrael> Yup. The current index is `yield`ed to the block in each case
<FromGitter>
<ryankshah> @aisrael could you provide a working example of what I suggested?
<FromGitter>
<ryankshah> Thanks! Just wanted to make sure I wasn't writing absolute bollocks haha
rohitpaulk has quit [Ping timeout: 264 seconds]
alex`` has quit [Quit: WeeChat 2.0.1]
ryan_ford has quit [Ping timeout: 240 seconds]
alex`` has joined #crystal-lang
ryan_ford has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.0.1]
alex`` has joined #crystal-lang
<FromGitter>
<bararchy> I think "Empty Enumerable" runtime errors are the new "nil is not a method of an object" :(
<FromGitter>
<bararchy> can we at least try and print which object it was we accessed ?
<FromGitter>
<yxhuvud> Um, can you give an example that exhivit it?
mooe has quit [Quit: Connection closed for inactivity]
ua__ has joined #crystal-lang
ua has joined #crystal-lang
ua_ has quit [Ping timeout: 240 seconds]
ua__ has quit [Ping timeout: 276 seconds]
duane has joined #crystal-lang
alex`` has quit [Ping timeout: 240 seconds]
<FromGitter>
<bararchy> the empty enum thingy>?
greengriminal has joined #crystal-lang
Totoro has quit [Ping timeout: 276 seconds]
Totoro has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter>
<yxhuvud> Yes, I don't understand what you mean.
dom96 has quit [Quit: Nim is King]
<FromGitter>
<bararchy> I mean that I got an exception saying "empty enumerable" , I have no clue what it means , isn't it the same as index out of bound
<FromGitter>
<yxhuvud> I've never seen that error.
<FromGitter>
<straight-shoota> @barachy EmptyError means about the same as index out of bounds, except that an Enumerable has no indices ;)
<FromGitter>
<bararchy> What's indices ? As in limits ?
<FromGitter>
<bararchy> "Bounds"
<FromGitter>
<straight-shoota> plural of index
<FromGitter>
<bararchy> Sure
<FromGitter>
<straight-shoota> Enumerable is not Indexable, so it has no concept of an index
<FromGitter>
<straight-shoota> it can be used to enumerate values, but not access values at a specific position
<FromGitter>
<bararchy> Doesn't it make more sense then to allow Enumerable.first for example to return nil instead of Raise ?
<FromGitter>
<straight-shoota> that's `first?`
<FromGitter>
<bararchy> Not even sure which of the methods can return this error
<FromGitter>
<bararchy> @straight-shoota oh, didn't know we had that :)
<FromGitter>
<straight-shoota> just look at the docs for Enumerable the methods raising this exception are documted
<FromGitter>
<straight-shoota> it's essentially every method that can only work if there are elements in the enumerable and doesn't have a default behaviour like returning nil
<FromGitter>
<bararchy> I see
<FromGitter>
<bararchy> Thanks man
rohitpaulk has joined #crystal-lang
heaven31415 has quit [Ping timeout: 245 seconds]
dom96 has joined #crystal-lang
dom96 has joined #crystal-lang
dom96 has quit [Changing host]
bonemind has quit [Quit: WeeChat 2.1]
heaven31415 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
<FromGitter>
<KINGSABRI> guys, is there anything like Watir / Selenium for Crystal ?
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<bararchy> There is selenium bindings
<FromGitter>
<ryankshah> Is the `<<` operator an arithmetic shift or logical shift?
<FromGitter>
<ryankshah> Or does it not care if the value is signed or not?
<FromGitter>
<bew> what's the difference?
<FromGitter>
<ryankshah> @bew In an arithmetic shift, the sign bit is extended to preserve the signedness of the number
<FromGitter>
<ryankshah> logical shift does not care that the value could possibly represent a signed numbe
greengriminal has quit [Quit: This computer has gone to sleep]
Creatornator has joined #crystal-lang
<FromGitter>
<aisrael> Am betting its a logical shift. But you can easily implement arithmetic shift with logical shift and bitwise masks
greengriminal has joined #crystal-lang
<FromGitter>
<ryankshah> Yeah I'm looking for a logical shift, maybe this is something that can be implemented. For example Java implements both using `>>` and `>>>` for arithmetic and logical shifts respectively
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<crystal-gh>
[crystal] kostya opened pull request #5846: add reinit for Crystal::System::Random on after_fork, fixed #5843 (master...fix_random_after_fork) https://git.io/vxcfe
greengriminal has quit [Quit: This computer has gone to sleep]