ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<nokkoisdumb> :/ trying to get discordcr working but not finding much success. please help if you can: https://gist.github.com/DimDown/c0cb97bcc411a1637eb8ebc500d93e4e
hightower2 has quit [Ping timeout: 258 seconds]
Kug3lis_ has joined #crystal-lang
<FromGitter> <faultyserver> If I have an array that I know will only have fewer than 255 entries (like, on average there will be 2), how can I get the size of that array as a `UInt8`?
<FromGitter> <faultyserver> `.size` returns a `Int32`, which can't be casted
Kug3lis_ is now known as Kug3lis_off
<FromGitter> <johnjansen> out of interest, whats the reason for casting it down … just for my curiosity
<FromGitter> <faultyserver> context: I'm writing to a binary file and the format specifies the a single byte for number of arguments to an instruction
<FromGitter> <johnjansen> try `UInt8.new(the_value)`
<FromGitter> <johnjansen> havent tried it myself
<FromGitter> <johnjansen> or `the_value.to_u8`
<FromGitter> <faultyserver> `.to_u8`, that's what I was forgetting! Thanks!
<nokkoisdumb> oh wow am i dumb
<nokkoisdumb> I thought FromGitter was a user
<nokkoisdumb> who just kept asking things
nokkoisdumb has quit [Quit: Page closed]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rubinnius has joined #crystal-lang
<rubinnius> crystal: a language with the blazing speed of haskell, the elegant syntax of c, and the type safety of ruby
greengriminal has quit [Quit: This computer has gone to sleep]
rubinnius has quit [Quit: Page closed]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
onionhammer1 has joined #crystal-lang
onionhammer has quit [Ping timeout: 240 seconds]
onionhammer has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 255 seconds]
onionhammer1 has joined #crystal-lang
onionhammer has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<FromGitter> <jwaldrip> what is the trick in crystal to force keyword args again?
<FromGitter> <jwaldrip> nvm, got it
<FromGitter> <jwaldrip> also can previous_def and super be deterministic only if the methods were defined in such manner?
fenicks has joined #crystal-lang
Kug3lis_off is now known as Kug3lis_
hightower2 has joined #crystal-lang
Swey_Hey has joined #crystal-lang
Swey_Hey has quit [Quit: Going offline, see ya! (www.adiirc.com)]
Swey_Hey has joined #crystal-lang
Swey_Hey has quit [Excess Flood]
Swey_Hey has joined #crystal-lang
Swey_Hey has quit [Excess Flood]
Swey_Hey has joined #crystal-lang
Swey_Hey has quit [Excess Flood]
Swey_Hey has joined #crystal-lang
mark_66 has joined #crystal-lang
Kug3lis_ is now known as Kug3lis_off
olek_poz has joined #crystal-lang
<FromGitter> <solisoft> Hi there, whet is the best way to transform an JSON::Any object to a Hash ?
<FromGitter> <solisoft> I try to use https://github.com/MakeNowJust/crustache ... but my data is a JSON
<FromGitter> <straight-shoota> `any.as_h`
<FromGitter> <solisoft> Error in src/mustache_cr.cr:22: undefined method 'as_h' for JSON::Any:Class ⏎ puts Crustache.render renderer, json.as_h
<FromGitter> <straight-shoota> your object `json` should be an instance of `JSON::Any`, not the class itself
<FromGitter> <solisoft> All I want it to have this script working https://codeshare.io/aVvbXQ , can you help me please ?
<FromGitter> <solisoft> basically I want to create a command line tool to run mustache generation
<FromGitter> <solisoft> Ruby version is so slow...
<hightower2> "All I want" is the beginning of your troubles! :)
<FromGitter> <straight-shoota> Your assigning `JSON::Any` to `json` in line 8
<FromGitter> <straight-shoota> If you want to restrict the type, use `json : JSON::Any`
<FromGitter> <straight-shoota> `json = ...` in the block will not refer to that variable but create a new local one
<FromGitter> <straight-shoota> You should not put everything in module scope, but rather in a method or global scope
<FromGitter> <solisoft> Ok I see for my json variable
<FromGitter> <solisoft> `parser.on("-j JSON", "--json=JSON", "JSON data to load") { |j| json = JSON.parse(j).to_h }` is raising an error :/
<FromGitter> <solisoft> Expected Array for # (index : Int), not Hash(String, JSON::Type) (Exception)
<FromGitter> <straight-shoota> `as_h`
Kug3lis has joined #crystal-lang
<FromGitter> <solisoft> argh yes ... but : cast from Array(JSON::Type) to Hash(K, V) failed, at /usr/local/Cellar/crystal-lang/0.22.0/src/json/any.cr:230 (TypeCastError)
<oprypin> well casting from Array to Hash, how is that not going to fail
<FromGitter> <saggit> hello, I am use crystal with mongodb, mongo.cr ⏎ ⏎ how to write a limit query? i try there: ⏎ collection.find({ "$query" : { "inspire" : { "$ne" => true } } }, limit=5 ) do |doc| ⏎ ... [https://gitter.im/crystal-lang/crystal?at=593e57106549436c7d3c7b1b]
<FromGitter> <codenoid> ` qdata = {} of String => String ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ` [https://gitter.im/crystal-lang/crystal?at=593e599acf9c13503c798569]
<FromGitter> <solisoft> @straight-shoota thanks a lot it's working now :)
<Swey_Hey> How long until Crystal dies?
<FromGitter> <sdogruyol> what?
<FromGitter> <bew> a looooong time
<FromGitter> <codenoid> hi sir, i have 2 row data in my database, but why this code just showing 1 row (json) data from my database, https://gist.github.com/codenoid/99bca9a3f36ff249c67852e5ae9f3dda thanks
<FromGitter> <saggit> you should put the map in a list
<FromGitter> <saggit> cause every loop you override the last assign
<FromGitter> <codenoid> right
<FromGitter> <codenoid> ok, how
<hightower2> Using yaml or json mapping, is it possible to convert input string into a symbol in crystal?
<FromGitter> <saggit> Hmm, I am new to crystal too, may be check the Array here,https://crystal-lang.org/api/0.22.0/Array.html
<FromGitter> <JJJollyjim> Hey, anyone know how I can get an Iterator of [1,2,... infinity]?
<FromGitter> <JJJollyjim> Apparently not Ruby's `(1..Float::INFINITY)`
<FromGitter> <JJJollyjim> Oh, nevermind, `Float[size]::INFINITY` :thumbsup:
<FromGitter> <sdogruyol> :+1:
<FromGitter> <sdogruyol> @JJJollyjim welcome btw
rohitpaulk has joined #crystal-lang
<FromGitter> <miks> Does crystal websockets use fibers?
<FromGitter> <sdogruyol> Yeah
<FromGitter> <miks> I'm getting strange error when client is disconnected from crystal websocket server
<FromGitter> <miks> ` *CallStack::unwind:Array(Pointer(Void)) at ??`
<FromGitter> <miks> in stack trace there is no references to my code, only crystal standart libs
<FromGitter> <miks> it's happening outside of any call from my code
<FromGitter> <miks> is it some kind of bug in crystal?
<FromGitter> <sdogruyol> any code to share?
<FromGitter> <miks> it's internal code (lot of), but I will try to extract problematic part in single class
<FromGitter> <sdogruyol> @miks btw that's not an exception but more of a warning
<FromGitter> <sdogruyol> when a client closes a connection in an unexpected way
<FromGitter> <miks> ok, but it's not a good style to ignore such a warnings
<FromGitter> <sdogruyol> agree
<FromGitter> <bew> hightower2 no you can't create a symbol at runtime
<FromGitter> <bew> @saggit to limit the result, use `collection.find({ some query }, limit: 5 ) do ...` see https://github.com/datanoise/mongo.cr/blob/2de912bceb9626c74d3740c20ce2f2eee73c5505/src/mongo/collection.cr#L120 for details
<FromGitter> <saggit> Thank You very much. it works
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<FromGitter> <JJJollyjim> Hmm, my understanding is that if a method is in Enumerable but not Iterator, I can call it on an Iterator but it won't be lazy. Is that right?
<FromGitter> <bew> yes
<FromGitter> <JJJollyjim> Is there usually a good reason for such a method to exist, or just "nobody implemented it"?
<FromGitter> <JJJollyjim> (wondering specifically about `#chunks` right now)
<FromGitter> <JJJollyjim> Oh hold on, it's called `#chunk` in `Iterator`...
<FromGitter> <JJJollyjim> And `#chunks` in `Enumerable`
<FromGitter> <JJJollyjim> Why would that be?
<FromGitter> <ultra2mh> Hi , is there any jetbrain plugin or ide for crystal lang ?
<FromGitter> <bew> no yet!
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> there are a few plugins for common editors like vim, emacs, atom (and maybe others) but currently no support for more IDE-like functionnalities (like autocompletions)
rohitpaulk has joined #crystal-lang
<FromGitter> <ultra2mh> jetbrain suggestion and auto complete and viewing errors and debugging is really sweet for me
Raimondii has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<Swey_Hey> dis my back: https://imgur.com/a/4FrVF
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
splitty_ has quit [Ping timeout: 260 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <JJJollyjim> Hmm where in the api should I be looking for `int -> bytes` methods (for IO purposes)
<FromGitter> <JJJollyjim> Ahh it's under IO, sweet
<FromGitter> <bararchy> @ultra2mh we are working on that, care to cast your voice too ? ⏎ ⏎ https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FRUBY-17225
rohitpaulk has joined #crystal-lang
<FromGitter> <miks> @sdogruyol I got error with stripped down version. websocket server code: https://gist.github.com/miks/f6e64ae6942f237640949c215737c230. Error log: https://gist.github.com/miks/f5cf37b585ee518338195429b3f5f3ac
<FromGitter> <miks> for a while things are working correctly, but after that `Broken pipe (Errno)` error new socket somehow is not reachable anymore
<FromGitter> <miks> connect/disconnect happens from Safari as there are "feature" that is closing websockets in inactive tabs
<FromGitter> <miks> itself should not be a problem, but crystal somehow can't handle it or there are some trivial error on my code
<Swey_Hey> Who wants to see an Xray of my spine? https://imgur.com/a/4FrVF
<Swey_Hey> Try not to get jelous
<FromGitter> <ultra2mh> what is this line of code mean ? ⏎ what is |value| role???? ⏎ elements.each do |value|
<FromGitter> <ultra2mh> @jwaldrip
<hightower2> -join #rubz
Kug3lis has joined #crystal-lang
<hightower2> Oh sorry, didn't realize the previous typo went into the channel
<hightower2> ultra2mh: "each" loops over each item in "elements", and in each loop it calls your block specified with {...} or do...end, and in variable 'value' (or any name inside |...|) it passes you the element currently being looped over
<hightower2> ultra2mh: https://carc.in/#/r/26e1
<FromGitter> <JJJollyjim> Hmm anyone used gprof with crystal before?
<FromGitter> <JJJollyjim> Wiki says it "should work"
<FromGitter> <JJJollyjim> ** docs do
<FromGitter> <JJJollyjim> But in C you compile with a profiling flag, and that causes the program to write a file with profiling data
<FromGitter> <JJJollyjim> I can't find such a flag for the crystal compiler
hightower3 has joined #crystal-lang
<FromGitter> <bew> it seems that you can generate object files, then link them using `gcc` and pass the `-pg` option at linking time
<FromGitter> <JJJollyjim> Ooh I'll check that out thanks
<FromGitter> <JJJollyjim> However adding `--release` gave a 10x boost so I'm no longer in a rush to profile ;)
<FromGitter> <bew> ahah ;)
hightower4 has quit [Ping timeout: 240 seconds]
duckqlz has quit [Ping timeout: 255 seconds]
duckqlz has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
Swey_Hey has quit [Quit: Going offline, see ya! (www.adiirc.com)]
olek_poz has quit [Ping timeout: 260 seconds]
splitty_ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
olek_poz has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #4553: MatchData: improve error message when refer no matched existed capture group (master...fix/regex-match-data/improve-error-message) https://git.io/vH9fn
snsei has joined #crystal-lang
<crystal-gh> [crystal] MakeNowJust opened pull request #4554: MatchData: raise KeyError instead of ArgumentError by #[](key: String) (master...fix/regex-match-data/raise-key-error) https://git.io/vH9JG
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
snsei has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> cool
<hightower2> indeed.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<crystal-gh> [crystal] akzhan opened pull request #4555: HTML.escape - Switch to Rack::Utils.escape_html behavior by default. … (master...classic-HTML.escape) https://git.io/vH93G
hightower2 has quit [Ping timeout: 240 seconds]
olek_poz has quit [Ping timeout: 260 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vH9nO
<crystal-gh> crystal/master 61f21ae TSUYUSATO Kitsune: Add Regex::MatchData#captures, named_captures, to_a, to_h (#3783)
<crystal-gh> [crystal] asterite closed pull request #3653: Enhancement to Regex::MatchData methods (master...expand-regex-functionality) https://git.io/v1gqS
<FromGitter> <eliasjpr> @sdogruyol thank you for that tweet we are very appreciative of your support :beers:
<FromGitter> <sdogruyol> @eliasjpr of course :+1:
<FromGitter> <eliasjpr> I am personally appreciative :) feel free to jump in a collaborate
<FromGitter> <sdogruyol> i think it's great to support and collaborate other crystal projects
<FromGitter> <sdogruyol> it's a good way of letting others know :)
<FromGitter> <sdogruyol> i'm really happy that @elorest and @drujensen joined amber :)
<FromGitter> <eliasjpr> We’ll do the same @elorest has the passion of a lion and eyes of an eagle he’s always pushing code to all project and repos :)
<FromGitter> <sdogruyol> yeah, he really has a great beard :100:
<FromGitter> <eliasjpr> I am excited as well their experience and understanding has helped the project flourish
<FromGitter> <sdogruyol> i met both @drujensen and @elorest in Crystal CodeCamp, both of them are really really experienced and awesome people
<FromGitter> <eliasjpr> I was going to say passion of a `crist` because of the beard but again I don’t know his religion :)
<FromGitter> <sdogruyol> haha :D
<FromGitter> <eliasjpr> Is nice that you guys have meet up. I was looking online for NYC meetups but couldn’t find any :(
<FromGitter> <eliasjpr> Any plans of having meet ups in NYC?
<FromGitter> <sdogruyol> i'm actually from Istanbul, Turkey so have no idea about NYC
<FromGitter> <sdogruyol> but it'd be great to have a user group there
<FromGitter> <eliasjpr> yes, I wouldn’t mind to help start one I just have never done it, I would need support and direction
<FromGitter> <sdogruyol> wish i could help with that :D
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vH9Rz
<crystal-gh> crystal/master 5fb0438 TSUYUSATO Kitsune: MatchData: raise KeyError instead of ArgumentError...
<crystal-gh> [crystal] asterite closed pull request #4551: Few small fixes (master...few-small-fixes) https://git.io/vHSfh
mark_66 has quit [Remote host closed the connection]
Kug3lis_off is now known as Kug3lis_
Kug3lis_ is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis_
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <paulcsmith> This is probably an easy problem to solve, but I can't figure it out. When using `run` in a macro I can it working and generating code correctly, but the code is also printed to stdout. Is there a way to generate code without also printing to stdout? Here's the most bare bones example to show what I mean https://gist.github.com/paulcsmith/23530877b2a7e31e9134b037ab93cd42
<FromGitter> <bew> do you mean "it prints on stdout during build ? or during run ?
<FromGitter> <paulcsmith> During compile time, but that is very distracting when you're rebuilding the server every time you make a change :S
<FromGitter> <bew> how are you compiling ?
<FromGitter> <bew> using `crystal build main.cr` didn't print anything for me
z64 has joined #crystal-lang
<oprypin> paulcsmith, describe your system and how you're running this
<FromGitter> <paulcsmith> @bew Hmm you're right. That example doesn't print the generated code to stdout. But the real code I have definitely does. I'll try to figure out what the difference is between the two. Hmmm...
<oprypin> ok do that then
<FromGitter> <asterite> You are probably requiring `yay.cr` with a `require .../**` too, so that it gets compiled in the main program
<RX14> @asterite btw are we waiting for anything for a release?
<FromGitter> <asterite> I'm not the one in charge of releases anymore, so you should ask someone else, maybe @waj @spalladino @mgarcia or @bew
<FromGitter> <asterite> Not @bew, @bcardiff
<FromGitter> <bew> ahahahahah
<FromGitter> <asterite> (bad autocomplete from gitter :-P)
<RX14> i don't think anyone should be "in charge" of releases...
<oprypin> pls not before https://github.com/crystal-lang/crystal/pull/4542 - that would be bad
<RX14> ah yeah i agree with that
<FromGitter> <asterite> Well, I don't want to be "in charge" of releases :-)
<oprypin> while we're at it, RX14, maybe you know a good replacement example
<FromGitter> <bew> np, the day I'll launch a release by myself will be a great day (in my imagination..)
<RX14> but i get people using discordcr asking for the websockets fix every day
<RX14> i'm tired of getting them to edit their stdlib to add a flush call
<oprypin> by example i mean some method call that can accept Random::System as Random
<oprypin> that deck shuffling is not good indeed
<FromGitter> <paulcsmith> @asterite That was it! Thank you :D
<FromGitter> <asterite> :tada:
<FromGitter> <paulcsmith> I figured it was something simple :P I didn't think of that at all though
<FromGitter> <asterite> It happened to me a couple of times too. You can try to use another extension, maybe .cr.run, and then explicitly using that name. I think the `require /**` won't take it then
Raimondii has joined #crystal-lang
<FromGitter> <paulcsmith> Oh that's an interesting idea. I'll give that a shot :thumbsup:
<FromGitter> <jeromegn> I've also been wondering when the next release will be cut
<travis-ci> crystal-lang/crystal#61f21ae (master - Add Regex::MatchData#captures, named_captures, to_a, to_h (#3783)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/242074658
<DeBot> https://github.com/crystal-lang/crystal/pull/3783 (Add Regex::MatchData#captures, named_captures, to_a, to_h)
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <jeromegn> it fixes a bunch of issues like macro precedence
rohitpaulk has joined #crystal-lang
<FromGitter> <miks> anybody is using crystal websocket server on production?
<jhass> ?anybody
<DeBot> jhass: Nothing known about anybody.
<jhass> too bad
<jhass> ?justask
<DeBot> jhass: Nothing known about justask.
<jhass> ?anyone
<DeBot> jhass: Nothing known about anyone.
<jhass> ?anyone=Just ask your question, if anyone has, is or can, they will respond.
<DeBot> jhass: Set anyone.
<jhass> ?anybody=?anyone
<DeBot> jhass: Set anybody.
<jhass> ?justask=?anyone
<DeBot> jhass: Set justask.
<FromGitter> <bew> trying anyone ?
<FromGitter> <bew> not working through the gitter bot maybe :/
<jhass> ah, no it won't
<jhass> oprypin: does the gitter bot relay DeBot at all?
rohitpaulk has quit [Ping timeout: 260 seconds]
<oprypin> jhass, yeah sure, as any message
<oprypin> meaning that gitter users see its messages but cannot interact with it
<travis-ci> crystal-lang/crystal#5fb0438 (master - MatchData: raise KeyError instead of ArgumentError): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/242088436
rohitpaulk has joined #crystal-lang
<travis-ci> crystal-lang/crystal#61f21ae (master - Add Regex::MatchData#captures, named_captures, to_a, to_h (#3783)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/242074658
<DeBot> https://github.com/crystal-lang/crystal/pull/3783 (Add Regex::MatchData#captures, named_captures, to_a, to_h)
fenicks has left #crystal-lang [#crystal-lang]
sustained__ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5fb0438 (master - MatchData: raise KeyError instead of ArgumentError): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/242088436
sustained_ has joined #crystal-lang
sustained__ has quit [Ping timeout: 260 seconds]
sustained__ has joined #crystal-lang
sustained_ has quit [Ping timeout: 260 seconds]
sustained_ has joined #crystal-lang
sustained__ has quit [Ping timeout: 268 seconds]
sustained__ has joined #crystal-lang
sustained_ has quit [Ping timeout: 268 seconds]
sustained_ has joined #crystal-lang
sustained__ has quit [Ping timeout: 240 seconds]
sustained__ has joined #crystal-lang
sustained_ has quit [Ping timeout: 240 seconds]
sustained__ has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Ping timeout: 246 seconds]
rohitpaulk has quit [Remote host closed the connection]
pduncan has joined #crystal-lang
pduncan has quit [Ping timeout: 246 seconds]
<travis-ci> crystal-lang/crystal#61f21ae (master - Add Regex::MatchData#captures, named_captures, to_a, to_h (#3783)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/242074658
<DeBot> https://github.com/crystal-lang/crystal/pull/3783 (Add Regex::MatchData#captures, named_captures, to_a, to_h)
sustained has joined #crystal-lang
Kug3lis has joined #crystal-lang
sustained_ has joined #crystal-lang
Kug3lis has quit [Ping timeout: 255 seconds]
sustained has quit [Ping timeout: 240 seconds]
sustained__ has joined #crystal-lang
sustained_ has quit [Ping timeout: 246 seconds]
Kug3lis has joined #crystal-lang
sustained__ has quit [Ping timeout: 268 seconds]
Kug3lis has quit [Ping timeout: 246 seconds]
<travis-ci> crystal-lang/crystal#a8e5567 (master - Fix typo.): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/242090095
Disrecollection has joined #crystal-lang
<Disrecollection> I think the most annoying thing with Crystal, even considering the lack of newbie support, is the fact that when I look up "crystal something-something" on google, I get videos about witchcraft and stuff instead of the lang, and I have to go and revise my search.
Kug3lis_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <bew> always type "crystal lang" for now, until it popular for google :)
<FromGitter> <bew> it gets*
<Papierkorb> Disrecollection: Are you using google to find api docs pages?
<Disrecollection> Nah, I open up one API doc, and then I just clone it to new tabs and search.
<FromGitter> <straight-shoota> There are several Crystal Lang on facebook... :smile:
<Disrecollection> Finished my webscraper with crystagiri. Sorta hacky, but certainly led to better understanding of Crystal(and ruby) syntax. Working on messing with concurrency stuff now.
<RX14> ?xy
<DeBot> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<RX14> well
<RX14> that still works at least jhass
<jhass> heh
<jhass> I just forget what keys I set in which channel :P
<RX14> i like ?ask
<RX14> thats what it's always been to me
<RX14> ?ask and ?xy
<DeBot> and: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<RX14> huh it strips spaces
<RX14> bad bot
<jhass> :D
<jhass> didn't even remember that
<jhass> anyway, have to say nighty night
<Papierkorb> gn8
<RX14> night
<Disrecollection> Gnight.
<Disrecollection> So, as I understand it, fibers mut voluntarily give up control; so long as any given fiber doesn't have something like a sleep or yield, the fiber manager will never wrest control from them. ??
<RX14> yup
<RX14> they're cooperatively scheduled
<RX14> in practice it doesn't really crop up often
<Papierkorb> Disrecollection: Waiting for I/O, channel, ... will also yield a fiber, giving another one a chance of doing something useful
<RX14> but it can be an issue if you're doing lots of computation and no IO
<RX14> annoying thing is that File IO never blocks
<Disrecollection> Alrighty, good to know. Thanks!Esp. with the IO etc, always forget.
<Disrecollection> Yeah, I've got that baboy open rn.
<Disrecollection> Sometimes it's better for me to ask people though, cause often I'll read something and forget some of the minor things or exceptions.
<FromGitter> <redcodefinal> Working with the RPI version of Crystal and shards is throwing this at me. ⏎ ⏎ ```shards: symbol lookup error: shards: undefined symbol: GC_get_push_other_roots``` [https://gitter.im/crystal-lang/crystal?at=593f06d702c480e67239df6e]
<FromGitter> <redcodefinal> any ideas?
<Papierkorb> libgc missing?
<RX14> @redcodefinal need a newer version of libgc
<RX14> did you build it from source?
<RX14> if not you need to
<FromGitter> <redcodefinal> @RX14 Not on the official repos yet?
<RX14> no debian is always years behind
<FromGitter> <redcodefinal> Sounds exciting, I'll make from source ty.
<FromGitter> <mhsjlw> What's the best way to do an interface-style class like in Java
<RX14> module with only abstract members
<FromGitter> <mhsjlw> My API needs an event listener-style API
<FromGitter> <mhsjlw> Is there a better way to do that ^ or is an interface the best way to go
<FromGitter> <mhsjlw> Ah, ok I'll check that out RX14 (or is there a better way for what I need to do)
<RX14> no a module is pretty much the most flexible container of stuff ever
<FromGitter> <mhsjlw> Ok, nice, thanks
<Disrecollection> @varname is an instance var for a class, confirm?
<RX14> yes
<Disrecollection> Thanks. For some reason I felt shakey on that one.
hightower3 has quit [Ping timeout: 255 seconds]
<FromGitter> <mhsjlw> How can I write a Double value to a IO::Memory
<FromGitter> <mhsjlw> currently i do `io.write_bytes(2_f32, IO::ByteFormat::BigEndian)` for example
<FromGitter> <mhsjlw> but there is no double primitive so how can I write a double ?
<FromGitter> <mhsjlw> Any is there a way to, for example, read/write a 3 byte integer to a stream?
<FromGitter> <mhsjlw> ```slice = Bytes.new(3) ⏎ io.read_fully(slice)``` [https://gitter.im/crystal-lang/crystal?at=593f1a61d83c50560c00e86b]
<FromGitter> <mhsjlw> except that isn't an integer
<Papierkorb> double? you mean `Float64`?
<Papierkorb> And no, there's no 24bit integer
<FromGitter> <mhsjlw> firstly, facepalm
<FromGitter> <mhsjlw> secondly, yeah, how can I read 3 bytes into an Int32
<Papierkorb> `a = uninitialized UInt8[3]; io.read_fully(a.to_slice); my24 = a[0].to_u32 | (a[1].to_u32 << 8) | (a[2].to_u32 << 16)`
<Papierkorb> that'd be LE, for BE, swap the bytes
<FromGitter> <mhsjlw> thanks!
<FromGitter> <mhsjlw> how should I handle writing?
<Papierkorb> the other way around.
<FromGitter> <mhsjlw> hmm, i need to figure out another way though
<FromGitter> <mhsjlw> i'd really rather not add complexity like bitwise operators
<Papierkorb> Or, if you control the wire protocol, just write a i32
hightower2 has joined #crystal-lang
<RX14> I think creating an int32 and then shifting the 3 int8's in is better
<RX14> ot even just a 16 and an 8
Kug3lis has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
hightower3 has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <elorest> @eliasjpr Lets just cut it down the middle and say I have the passion of Aslan :sparkles:
Disrecollection1 has joined #crystal-lang
<Disrecollection1> dangit
<FromGitter> <elorest> and @sdogruyol thanks again for the retweet.
Disrecollection has quit [Ping timeout: 255 seconds]
<FromGitter> <sdogruyol> @elorest you're welcome mate :)
<FromGitter> <sdogruyol> `Aslan`:)
gewo has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vHHlQ
<crystal-gh> crystal/master 5370faf Ary Borenszweig: Optimize Range#size for integers
<crystal-gh> crystal/master c8ec408 Ary Borenszweig: Optimize Range#map for integers
<FromGitter> <elorest> In response to crystal meetups discussion earlier. Until we have more people in the community we can combine meetings online. For instance my talk last wednesday in Salt Lake City was also streamed to denver.cr.