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
Ven has joined #crystal-lang
Ven is now known as Guest30373
snsei has quit [Remote host closed the connection]
Guest30373 has quit [Ping timeout: 272 seconds]
havenwood has quit [Excess Flood]
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
balduin has joined #crystal-lang
hako has joined #crystal-lang
<FromGitter> <bigtunacan> `Syntax error in test.cr:1: $global_variables are not supported, use @@class_variables instead`
<FromGitter> <bigtunacan> LOL
<FromGitter> <bigtunacan> I had to check :)
greengriminal has joined #crystal-lang
<FromGitter> <bigtunacan> What's up with Crystal Weekly?
<FromGitter> <bigtunacan> http://www.crystalweekly.com/
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <fridgerator> is this related to the crystal weekly email?
<FromGitter> <bigtunacan> Yeah
<FromGitter> <bigtunacan> It is linked off https://crystal-lang.org/community/
<FromGitter> <bigtunacan> "Crystal Weekly summarizes every news of the Crystal community in a short, focused newsletter. You can subscribe to it and even see the past issues on the web."
<FromGitter> <fridgerator> cool
<FromGitter> <fridgerator> I don't know whatsup w/ the website, maybe @sdogruyol would know
greengriminal has quit [Quit: Leaving]
pduncan has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <bigtunacan> Where does the Crystal stdlib/api live on github?
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
statikowsky has joined #crystal-lang
statikowsky has quit [Ping timeout: 245 seconds]
snsei has quit [Remote host closed the connection]
muhlisbc has joined #crystal-lang
muhlisbc has quit [Quit: AtomicIRC: The nuclear option.]
<crystal-gh> [crystal] mirek closed pull request #2716: Add `UUID`. (master...uuid) https://git.io/vrxeh
<FromGitter> <piyushranjan> I have a valid json (validated using online validators and got VALID JSON (RFC 4627)) which results in a crash (I have try, catch around json parsing)
<FromGitter> <piyushranjan> Crash message is: expected Hash for # (key : String), not Nil (Exception) ⏎ [4356740338] *CallStack::unwind:Array(Pointer(Void)) +82 ⏎ [4356740241] *CallStack#initialize<CallStack>:Array(Pointer(Void)) +17 ⏎ [4356740200] *CallStack::new:CallStack +40 ⏎ [4356744793] *Exception#initialize<Exception, String>:CallStack +41 ... [https://gitter.im/crystal-lang/crystal?at=59266236fa63ba2f767a3584]
<FromGitter> <piyushranjan> What I am doing wrong ?
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
duckqlz has quit [Ping timeout: 260 seconds]
monadicDuck has quit [Ping timeout: 260 seconds]
duckqlz has joined #crystal-lang
monadicDuck has joined #crystal-lang
statikowsky has joined #crystal-lang
<FromGitter> <sdogruyol> what's the json
<FromGitter> <sdogruyol> and what's the code?
<FromGitter> <bew> @bigtunacan in the Crystal repository, in ``
<FromGitter> <aolko> {"its":"amazing"}
<FromGitter> <sdogruyol> @aolko what?
<FromGitter> <aolko> {"Im": "speaking","what": "json"}
<FromGitter> <sdogruyol> Meanwhile crystalweekly.com is up again
mark_66 has joined #crystal-lang
<FromGitter> <bararchy> @sdogruyol Nice ! I really love your updates !
statikowsky has quit []
<FromGitter> <drosehn> iirc, the error you're seeing is because your JSON.mapping defines a field which does not exist in the JSON that you're reading, and it also has 'strict:true' defined.
statikowsky has joined #crystal-lang
statikowsky has quit [Client Quit]
<FromGitter> <drosehn> Apologies if that doesn't make a lot of sense, but I woke up just a minute ago, and much of my brain is still asleep.
statikowsky has joined #crystal-lang
<FromGitter> <drosehn> so, for instance, you have a field `v` defined as `v: String | Int32`, but in your data there is an entry which does not define `v`. So instead you need to define it as `v: String | Int32 | Nil`.
<FromGitter> <drosehn> Although based on the error message, I'd guess that your field is named `#` instead of `v`, and that doesn't seem likely to my (tired) brain.
<FromGitter> <drosehn> I'll say that in my experience with JSON.mapping (*which amounts to one single program*), it does work very well. However there are a few cases where a programming error in your program will generate an error message which does not make sense when you first see it. I even wrote up one PR thinking that JSON.mapping had an error in it, when in fact the error was in the JSON data that my program was reading,
<FromGitter> ... when compared to the JSON.mapping I had defined.
unshadow has joined #crystal-lang
unshadow has quit [Client Quit]
<FromGitter> <piyushranjan> @sdogruyol I am doing JSON.parse over this json.
<FromGitter> <drosehn> @piyushranjan -> I hope my comments make some sense, but I have to go back to sleep now.
Philpax has joined #crystal-lang
<FromGitter> <piyushranjan> @drosehn Thanks for the message. JSON.mapping is not something that I have done. This is an existing JSON. I am parsing it using JSON.parse
<FromGitter> <bararchy> @bew ==> https://github.com/benoist/intellij-crystal Amazing !!
<FromGitter> <bararchy> And thank to everyone who pushed the idea => https://youtrack.jetbrains.com/issue/RUBY-17225
<FromGitter> <piyushranjan> @sdogruyol Won't be able to share the JSON due to some reason. I am trying to distill it to the reason of the crash
<FromGitter> <bew> @bararchy I think you meant to mention `@benoist` ?
<FromGitter> <bew> But it's awesome :)
<FromGitter> <bararchy> Oh yeha XD sorry,
<FromGitter> <bararchy> @benoist ==> https://github.com/benoist/intellij-crystal Thanks for this repo
TheLemonMan has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest58223
hako has quit [Ping timeout: 240 seconds]
hako has joined #crystal-lang
Guest58223 has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
splitty__ has joined #crystal-lang
bjz has joined #crystal-lang
splitty___ has quit [Ping timeout: 240 seconds]
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
<FromGitter> <bew> If someone has a little time, I'd like to know why the Inference can't figure out this https://carc.in/#/r/22ym
<FromGitter> <l3kn> I think using Failure as Result(T) binds T to String but your Success type returns a Tuple(Char, String)
<FromGitter> <l3kn> But it seems like there is something else going wrong
<FromGitter> <bew> I tried to simplify: https://carc.in/#/r/22yq
<FromGitter> <bew> I reviewed the Result hierarchy
<FromGitter> <bew> but it doesn't want to put `Failure` into a `Result(T)` even though `Failure` inherits from `Result(String)`
<FromGitter> <bew> Ah I think I see the possible error going on, but have no idea how to fix that..
<FromGitter> <bew> I really need generic aliases... `Result` should be defined as `alias Result(T) = Failure | Success(T)` or sth like that..
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> that's it!
<FromGitter> <bew> this works: https://carc.in/#/r/22yt
<FromGitter> <bew> coool
<FromGitter> <bew> thanks @l3kn for the quick look!
Ven has joined #crystal-lang
Ven is now known as Guest96562
<FromGitter> <sdogruyol> @bew that looks pretty good fp
<FromGitter> <bew> yeah it so coll I made it work and look reeally nice
<FromGitter> <bew> cool*
<FromGitter> <l3kn> https://github.com/maiha/try.cr/blob/master/src/try.cr found an interesting way around this problem, too
<FromGitter> <bew> when generic aliases will be handled by the compiler, we'll have real generic FP's Variants
Guest96562 has quit [Ping timeout: 255 seconds]
Ven_ has joined #crystal-lang
<FromGitter> <sdogruyol> Yeah that'd be awesome
<FromGitter> <bew> TIL FP's concept, Railway Oriented Programming, through great slides at https://fsharpforfunandprofit.com/rop/
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> @l3kn u right, interesting implementation, with many handy methods, maybe in the end I'll use sth like this
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 245 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest32458
<FromGitter> <l3kn> @bew https://github.com/jon-hanson/parsecj might be a good inspiration, too. Do you plan on implementing all stuff from the original parser combinator paper?
<FromGitter> <l3kn> Not sure if the performance would be great, but I'd love to have something like that available in crystal
Ven_ has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> thanks! I'm working on a cool parsing lib for crystal, it has been in my head for some month now, I've read a lot of papers on parsing in general, currently I'm just experimenting combinator parsing, to see how it's going with crystal
<FromGitter> <bew> but my lib will not hopfully be tied to a parsing technic
<FromGitter> <bew> I've seen the benefits of combinator parsing, and I'm experimenting, that's it for now
<FromGitter> <sdogruyol> have you seen this https://github.com/umurgdk/haydari
<FromGitter> <sdogruyol> may give you an idea
<FromGitter> <bew> Oh nice, I missed that one!
<FromGitter> <bew> thanks
<FromGitter> <sdogruyol> yw
Guest32458 has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <bew> So I'm trying to get `haydari` parsing lib to compile with recent compiler version, I have a type error that shouldn't be one IMO, I tried to make a minimal version of it: https://carc.in/#/r/2304
<FromGitter> <bew> (I'll be back in a few hours, I pushed my progression if someone wants to give it a try (the compilation fix): https://github.com/bew/haydari/tree/fix-compilation)
<FromGitter> <bew> (I'm trying the compilation by trying to run `samples/json.cr`)
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven_ has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest58622
Guest58622 has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
bjz has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
wontruefree has joined #crystal-lang
Ven is now known as Guest96298
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vH3i2
<crystal-gh> crystal/master d65ea1a Tim Su: Use separator and quote char in CSV#each_row method. Add a spec.
sz0 has quit [Quit: Connection closed for inactivity]
Guest96298 has quit [Ping timeout: 258 seconds]
Ven_ has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
<wontruefree> is there a way to turn on profiling when running the specs?
<wontruefree> I think I found "-p"
<wontruefree> but I am curious if there is a way like verbose to get all time data
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 255 seconds]
onionhammer has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
<travis-ci> crystal-lang/crystal#d65ea1a (master - Use separator and quote char in CSV#each_row method. Add a spec.): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/236047049
Ven_ has quit [Ping timeout: 246 seconds]
Ven_ has joined #crystal-lang
jaitaiwan has quit [Ping timeout: 258 seconds]
jaitaiwan has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest4882
Guest4882 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
onionhammer has joined #crystal-lang
Ven_ has joined #crystal-lang
onionhammer has quit [Ping timeout: 240 seconds]
<wontruefree> can you deconstruct an array like `* [1, 2, 3]`
<FromGitter> <werthen> Hey guys, what's the best way to contribute to crystal with little compiler knowledge? Any documentation or something that needs writing or...?
<FromGitter> <straight-shoota> @wontruefree `a,b,c=[1,2,3]`
<wontruefree> I want to put it into a constuctor
<wontruefree> which I think I just figured out in a different way
<wontruefree> so like
<wontruefree> `Tuple.new(Array.new(100, 0))`
<Papierkorb> werthen, Docs (See what you're missing, and then improve it), helping out here (or anywhere else), and/or creating and maintaining shards. You can also work on the standard library!
<Papierkorb> werthen, for inspiration, you could look around the stdlib, and identify parts you care about and/or know about. Then check existing code, improve tests (try to break it!), and/or contribute additional functionality
<Papierkorb> werthen, you can do of course the same with shards: Usually, authors don't bite :) Just build stuff in Crystal, and be on the look-out for what is missing.
<FromGitter> <straight-shoota> I just noticed the keywords `deconstruct` and `splash` don't yield any results in the Gitbook :P
<RX14> @werthen the stdlib is quite easy to get started in as it's all in crystal
<Papierkorb> werthen, If you're looking for project ideas, there's also a tracker for that: https://github.com/johnjansen/crystal-libraries-needed/issues
<FromGitter> <werthen> Oh that last link is pretty neat
<FromGitter> <werthen> I'll look into that! I've just started to fall in love a bit with the language and I want to see it grow :)
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wontruefree has quit [Quit: Is gone... Just plain old gone]
<Papierkorb> werthen, I think there's already a good chunk of stuff available, but also tons of things missing. With that, Welcome on board!
<FromGitter> <sdogruyol> @werthen welcome
<FromGitter> <werthen> Thanks
onionhammer has joined #crystal-lang
Renich has joined #crystal-lang
<FromGitter> <fridgerator> 2 more stars til 100, hook a brotha up - https://github.com/crecto/crecto
<FromGitter> <werthen> @fridgerator consider yourself hooked up
<FromGitter> <fridgerator> yeah! thanks!
<FromGitter> <straight-shoota> I'm 100 :star: ^^
<FromGitter> <fridgerator> yes! thank you
<FromGitter> <sdogruyol> :tada:
wontruefree has joined #crystal-lang
<wontruefree> is there something like ObjectSpace in crystal
<FromGitter> <bew> wontruefree I don't think so, what do you need to do?
<wontruefree> trying to profile something
<wontruefree> I am using benchmark report
<wontruefree> but I am looking for memory allocation
<wontruefree> I did an Array.new with Ints and got way more objects then I expected
<FromGitter> <akzhan> @wontruefree GC is not part of Crystal project. It is separate https://github.com/ivmai/bdwgc one. Anyway I should ask author for required APIs. Binding is easy, already has GC.stats
xaxisx has joined #crystal-lang
<FromGitter> <akzhan> *You
<wontruefree> yeah I was just doing `puts GC.stats.total_bytes `
<wontruefree> I would like to know if there are any tools in the language for profiling this
<wontruefree> it is a little hard to figure out
_whitelogger has joined #crystal-lang
wontruefree has quit [Quit: Is gone... Just plain old gone]
miketheman has quit [Ping timeout: 240 seconds]
miketheman has joined #crystal-lang
jadams has joined #crystal-lang
wontruefree has joined #crystal-lang
Kug3lis has joined #crystal-lang
<Kug3lis> Hi, I am feeling bit stupid I have a incoming JSON structure which I map to object and have property which is coming string binary and I want to convert it to hex representation. I just did like string.bytes.map(&.to_s(16)) which converts to completely different stuff than original JS library
<Kug3lis> maybe I am doing something incorect?
splitty__ has quit [Ping timeout: 255 seconds]
<FromGitter> <bew> maybe `String#hexstring` ?
<FromGitter> <bew> huh sorry doesn't work
<Kug3lis> yeah if it was so easy :(
<FromGitter> <bew> there is `Slice#hexstring`
<FromGitter> <bew> and `String#to_slice`
<FromGitter> <bew> not sure that's what you're looking for
<Kug3lis> I think something is wrong with parsing json, because I just dumped json to file and tried to parse with php same shit incorrect value :/
<FromGitter> <bew> can you show us an example?
<TheGillies> Whats with sec/PROJECT/version.cr
<TheGillies> is that some sort of convention?
<TheGillies> src/*
<TheGillies> isn't version in shard.yml?
<Kug3lis> TheGillies its better than parsing yml file to get version in code
<Kug3lis> bew I think its related that string is in binary encoding
<FromGitter> <bew> TheGillies it's for accessing the version at runtime, to respond to cli like `program --version`
<FromGitter> <akzhan> Better to provide Shards API to get my own shard info.
<FromGitter> <bew> Kug3lis yes indeed, maybe you'll need a custom JSON parser for that binary string
<Kug3lis> Yeah I am already writing converter for it just trying to deal now with encoding have zero ideas :D
<FromGitter> <bew> especially for `\u####` chars
<Kug3lis> \u its standard json char encoding which are not in utf something
<FromGitter> <bew> encoding is utf-8 by default, I don't think you should worry about it
<Kug3lis> yeah I understand that, but from that JS code I see that strings is added to buffer as binary and then converted to hex but how that parsing in binary is done I have zero idea
zipR4ND has joined #crystal-lang
<FromGitter> <bew> maybe your final type (the one you convert the string to) should be simply `Bytes` (which is a `Slice(UInt8)`, and `UInt8` is the equivalent of a C `char`)
<FromGitter> <bew> so you end with binary data
<FromGitter> <bew> a crystal `String` should contain only valid utf-8 chars
<Kug3lis> I think I know whats problem faceplam :(
<Kug3lis> JSON::PullParser read_string....
<zipR4ND> hey all, I'm getting this kind of output deep down the rabbit whole: https://pastebin.com/raw/9XwDQafd can't easy reproduce atm, but can anyone give me a hint of what's happening to find a solution=
<zipR4ND> ?
<FromGitter> <bew> yes, instead of writing a converter, write a custom json pullparser for your banary type
<Kug3lis> Hmm, I compared string result after parsing json and from nodejs they both same so something is bad with my code trying to convert into hex
<FromGitter> <bew> what kind of input & output do you have/need ?
<FromGitter> <akzhan> anyway json should be utf-8 encoded by RFC
<Kug3lis> i have binary string need to generate hex representation
<FromGitter> <akzhan> write it to json as base64, for example.
<FromGitter> <akzhan> and binary is not compatible with json at all. write your own modified json parser
<Kug3lis> I cant do anything to what I receive its protocol
<oprypin> zipR4ND, an LLVM error message almost always means that there's a bug in Crystal, so yeah, just gotta try to reproduce and report it
<Kug3lis> I think something is bad with the way I try to convert I think, I need to change something with encoding because I tried to do the same with php and get the same result as in crystal. in JS it adds that string to Buffer with encoding binary I dont even imagine whats happening inside there...
<FromGitter> <bew> <troll>that's JS, you probably don't want to know </troll>
<oprypin> Kug3lis, what are you actually trying to do?
<oprypin> i tried to follow the conversation but i can't get to the core of it
<Kug3lis> I am writing webtorrent client in crystal so I could create Tracker because u know crystal Websockets Rocks
<Kug3lis> communication is done under Websockets with JSON
<Kug3lis> this is what I am trying to replicate in Crystal from JS https://gist.github.com/aurimasniekis/6991ec2365ae91de6dd7d40b6029036c
<oprypin> so.. working with malformed JSON?
<Kug3lis> I dont think it's malformed, just encoding problem I guess or something similar
<oprypin> no, it is malformed
<Kug3lis> oprypin if it was malformed then parsers would complain
<FromGitter> <akzhan> @Kug3lis try to transcode your not-json to utf-8 encoding before parse
<oprypin> ...
<Kug3lis> oprypin json lint says its valid json :D
<oprypin> give me the original json file
<zipR4ND> @oprypin I know, its just my code is pretty complex and it's really hard to reproduce this issue because I have no Idea why or where it is happening. I narrowed I so far that I now know that the problem seems to be two classes including one module. I on class includes the module and the other two inherit from that one the bug is gone. the module itself makes extensive use of macros (a nested combination of inherited, extended, included,
<FromGitter> <akzhan> hm, Perl reads it. perl -MJSON -MFile::Slurper -MData::Dump -e 'print Data::Dump::dump decode_json(File::Slurper::read_binary("a.json"))'
<FromGitter> <akzhan> but said that it is not valid: offer_id => pack("H*","96e8df9bea4feec88bc1b6a83658442a70b23316")
<Kug3lis> mm?
<FromGitter> <akzhan> your offer_id field have invalid bytes for utf encodings.
<Kug3lis> yeah I see
<FromGitter> <akzhan> So only way is to create your own not-json parser that supports invalid strings
<FromGitter> <bew> or use a custom type with a custom json::pullparser
<oprypin> no
<FromGitter> <bew> why not?
<oprypin> Kug3lis, do you really have to try to transfer this gibberish through json?
<oprypin> i tried to reproduce this result in Python and it also just makes no sense
<Kug3lis> yeah it's hash but I am going to create issue on webtorrent side because its not valid UTF-8 value going to json, and JS has no problem with it
<FromGitter> <akzhan> @bew pull parser saved raw value sas srtings as i see
<oprypin> which is the only conformant behavior
<oprypin> okaaay so i got it
<oprypin> binascii.hexlify(j['info_hash'].encode('latin-1'))
<oprypin> they treat first 256 unicode codepoints as byte numbers
<oprypin> which is idiotic btw
<FromGitter> <akzhan> Yest another approach - to read all file as bytes and represent all invalid sequences as any escape. Parse JSON. and convert these escapes to Bytes.
<oprypin> >> "úÕކ=ð‚\u0003\n\u0011þ\u0015~ÉY%øŽé".encode("latin1").hexstring
<DeBot> oprypin: # => "fad5de863df08d82030a11fe157ec95925f88ee9" - https://carc.in/#/r/232q
<Kug3lis> cool thanks, but still I created ticket on this...
<oprypin> >> "úÕކ=ð‚\u0003\n\u0011þ\u0015~ÉY%øŽé".chars.map(&.ord.to_s(16)).join
<DeBot> oprypin: # => "fad5de863df08d823a11fe157ec95925f88ee9" - https://carc.in/#/r/232r
<oprypin> ok this one is not quite correct because it skips leading zeros
<Kug3lis> I was looking how other clients deal with this stuff...
<Kug3lis> Vuze (Java client): String hash_str = (String)map_in.get( "info_hash" ); byte[] info_hash = hash_str.getBytes( "ISO-8859-1" );
<Kug3lis> so the same stuff
<FromGitter> <piyushranjan> @sdogruyol I found a pattern to replicate the "expected Hash for # (key : String), not Nil (Exception)" with JSON.parse. Justa little context: What I am trying to do is to parse a bunch of json files. All the files are large but they are valid json files. When I try to parse them one by one in a loop I encounter this error with a specific file. However, if I try to parse just this file, I do not find this
<FromGitter> ... issue
<oprypin> Kug3lis, what should be happening is that hexstring should be in json in the first place (or base64)
<oprypin> if they used base64 it would literally take less bytes
<Kug3lis> Yeah, thats what I wrote in ticket, but as its already accepted so in question if they invest time trying to fix this...
<FromGitter> <piyushranjan> @sdogruyol This is the program I am using to parse one by one https://gist.github.com/piyushranjan/3cf105544ed5ee6618e3f9ef4cac3710
snsei has quit [Remote host closed the connection]
<FromGitter> <piyushranjan> I am guessing that JSON.parse is creating a mapping and when I try to parse another json which is not consistent with previous json, it craps out. Questions is, is there any way I can destroy json variable here at that end of every iteration ?
Renich has quit [Quit: Renich]
pduncan has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
<oprypin> piyushranjan, I think your assumption is incorrect
<FromGitter> <piyushranjan> yes I am effing stupid
<FromGitter> <piyushranjan> it is something else
<FromGitter> <piyushranjan> really sorry for the botheration
<crystal-gh> [crystal] wontruefree opened pull request #4463: Spec suite speed increase (master...spec_speed) https://git.io/vHsSL
bjz has joined #crystal-lang
<crystal-gh> [crystal] wontruefree closed pull request #4463: Spec suite speed increase (master...spec_speed) https://git.io/vHsSL
<TheGillies> instance variable '@contents' of Room must be Array(Item | Lifeform), not Array(Monster)
<TheGillies> Monster inherits from Lifeform
<Papierkorb> TheGillies: Right now, it's not smart enough to notice that. When creating the array, make it of type Array(Item | Lifeform) explicitly
<Papierkorb> TheGillies: Either by new'ing it like that, or if you're using a [ array literal ] write `[ creature ] of (Item | Lifeform)`
<oprypin> `Array.new(5) { Monster.new.as(Item | Lifeform) }`
<oprypin> in case of another alternative usage
<TheGillies> thanks
wontruefree has quit [Quit: Is gone... Just plain old gone]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Papierkorb has quit [Ping timeout: 240 seconds]
Papierkorb has joined #crystal-lang
hako has quit [Ping timeout: 240 seconds]