jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.3 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<fowlduck> since the user can randomize the order of the array before passing it in to `select`, it's not really an issue that needs fixing yet
<fowlduck> but if we end up with some sort of new syntax for `select` it might be necessary
<fowlduck> ok, enough reading about crystal and stuff. back to work
krainboltgreene has joined #crystal-lang
<krainboltgreene> What's the crystal library system?
krainboltgreene has left #crystal-lang [#crystal-lang]
<fowlduck> I saw something about "shards" in the google group
bcardiff1 has quit [Quit: Leaving.]
<crystal-gh> [crystal] waj pushed 1 new commit to master: http://git.io/vI1Vz
<crystal-gh> crystal/master 6a80594 Juan Wajnerman: Added `.union?` and `union_types` methods for macro types
<travis-ci> manastech/crystal#2461 (master - 6a80594 : Juan Wajnerman): The build passed.
havenwood has joined #crystal-lang
waj has quit [Quit: waj]
Cidan is now known as zz_Cidan
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
NeverDie has joined #crystal-lang
waj has joined #crystal-lang
havenwood has quit [Ping timeout: 276 seconds]
ponga has joined #crystal-lang
havenwood has joined #crystal-lang
Dreamer3_ has joined #crystal-lang
Dreamer3 has quit [Ping timeout: 264 seconds]
willl has quit [Quit: Connection closed for inactivity]
mdz_ has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
zz_Cidan is now known as Cidan
fowlduck has quit [Remote host closed the connection]
willl has joined #crystal-lang
fowlduck has joined #crystal-lang
waj has quit [Quit: waj]
ponga has quit [Quit: Leaving...]
bcardiff has joined #crystal-lang
ponga has joined #crystal-lang
<crystal-gh> [crystal] will opened pull request #786: Add named groups in MatchData#to_s (master...matchdata-names) http://git.io/vIMrz
Ven has joined #crystal-lang
Ven has quit [Client Quit]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
BlaXpirit has joined #crystal-lang
ponga has quit [Quit: Leaving...]
Ven has joined #crystal-lang
ponga has joined #crystal-lang
<unshadow> I found a really weird bug: https://github.com/manastech/crystal/issues/787
Ven has quit [Read error: Connection reset by peer]
BlaXpirit has quit [Quit: Quit Konversation]
<unshadow> Is there a way using gdb to show the backtrace live ? without the need to kill\pause the process being debugged
<unshadow> ?
Cidan is now known as zz_Cidan
Ven has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
<ponga> crystal lang 1.0.0 expected date?
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
<ponga> OSX brew install crystal only fetches 0.6.1
<ponga> unshadow: that's what i did
<unshadow> oh.. they you should clone the git, and run it from there, so you can use version 0.7.3
<ponga> wait, what
<ponga> unshadow: it asks for github authentication, can i use mine
<unshadow> when ? when you want to clone ?
<unshadow> or for the homebrew thingy ?
<ponga> its weird,
<ponga> remote: Repository not found.
<ponga> fatal: repository 'https://github.com/manstech/homebrew-crystal/' not found
<ponga> oh i forgot a
<ponga> damn it
<ponga> ok now it fetches 0.7.3
<ponga> i wonder what has changed, it only fetched 0.6.1 before
<unshadow> :)
<ponga> and all of sudden i made typo , and retried it, works now
<ponga> i will never understand computer's feeling
<unshadow> just make sure crystal --version shows 0.7.3
<ponga> the weird part was that i did "brew uninstall crystal" then "brew install crystal"
<ponga> it still installed 0.6.1
<unshadow> maybe you needed to use the "tap" command to refresh the repo or package info ?
<unshadow> I'm using Linux so i'm not 100% on what those do TBH
<strcmp1> unshadow, i dont know how you might get a backtrace in that situation, or the tooling available. it would be cool if from another thread, you could print the callstack for another thread somehow. anyway definitely not possible since they have just segfault :P
<strcmp1> but did you try the 'timeout' library? is it even available in crystal?
<strcmp1> in ruby it uses threads so it probably wont work even if it were
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<strcmp1> yeah there's no timeout.cr in the repo
<unshadow> It could be coll to have somekind of a backtrace of frames for each function happening
<strcmp1> yeah
<unshadow> cool*
<strcmp1> did you try ^C?
<strcmp1> i guess you could try setup a handler for SIGINT, but dont know what useful stuff you could print
<unshadow> I use ^C and it pauses the program, and then I can do "bc" or "frame n" to show the backtrace, but I want it to print it while it runs
<strcmp1> maybe its the regex, and not gsub?
<strcmp1> if you swap it for a string does it still hang?
<unshadow> strcmp1: not sure, I'm trying to debug the hang, to see why it does that
<strcmp1> yeah
<unshadow> my first susspecion was that it comes from the Regex
<unshadow> but then I wanted to be more specific to the code I posetd
<unshadow> so..
<strcmp1> if you want to debug it, then probably easiest to clone the repo, edit the gsub method yourself, and add debugging calls to see how far it gets, where it blocks, etc.
<unshadow> yap, done , added, now lets try :)
<strcmp1> gl
<unshadow> strcmp1: I think I found it :)
<strcmp1> what is it?
<unshadow> Issue is with def gsub(pattern : Regex) (line 951 of string.cr), while match is looping endleslly
<strcmp1> can probably work around it by using a string instead
<unshadow> strcmp1: what do you mean ?
<strcmp1> does gsub only have a method for regex?
<unshadow> Nope, also for char to char replacment
<unshadow> def gsub(char : Char, replacement)
<unshadow> also string
<unshadow> def gsub(string : String, replacement)
Ven has joined #crystal-lang
<unshadow> yeha, using string seems to work, but it will only work for this example test, not for my whole project :(
<unshadow> >> a = "Testing"; a.gsub("ti", "123"); puts a
<DeBot> unshadow: Testing - more at http://carc.in/#/r/2st
<unshadow> >> a = "Testing"; a.gsub(/ti/, "123"); puts a
<DeBot> unshadow: Testing - more at http://carc.in/#/r/2su
<unshadow> >> a = "Testing"; a.gsub(/.*ti.*/, "123"); puts a
<DeBot> unshadow: Testing - more at http://carc.in/#/r/2sv
<unshadow> >> a = "Testing"; a = a.gsub("ti", "123"); puts a
<DeBot> unshadow: Tes123ng - more at http://carc.in/#/r/2sw
<unshadow> strcmp1: I'm not sure this will work with string ;)
<unshadow> "/#{IAC}( [#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]| [#{DO}#{DONT}#{WILL}#{WONT}] [#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]| #{SB}[^#{IAC}]*#{IAC}#{SE})/"
<strcmp1> yeah. i dont think so either
<unshadow> btw, I'm getting a crash for this Regex, missing terminating ] for character class at 89 (ArgumentError)
<strcmp1> hm not sure, i think you will want to Regex.escape all the strings youre creating the regex from.
<strcmp1> that might fix it.
<unshadow> running on "testing" XD
<unshadow> missing terminating ] for character class at 89 (ArgumentError)
<strcmp1> yeah you didnt close a character class in that example, or the strings youre inserting into the regex have a '[' somewhere. id guess.
<strcmp1> >> Regex.escape "/foobar"
<DeBot> strcmp1: # => "/foobar" - http://carc.in/#/r/2sx
<strcmp1> >> Regex.escape "/[foobar]"
<DeBot> strcmp1: # => "/\\[foobar\\]" - http://carc.in/#/r/2sy
<unshadow> >> string = "testing"; string.gsub(/#{IAC}([#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]|[#{DO}#{DONT}#{WILL}#{WONT}][#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]|#{SB}[^#{IAC}]*#{IAC}#{SE})/, "whh")
<DeBot> unshadow: Error in line 4: undefined constant IAC - http://carc.in/#/r/2t2
<unshadow> true true
<unshadow> strcmp1: http://carc.in/#/r/2t4 what do you think ?
<strcmp1> unshadow, i think you should call Regex.escape on the strings you insert into the regex.
<unshadow> I did
<unshadow> it looks like maybe the Regex is the fault
<unshadow> Oh... you mean the chars ?
Dreamer3_ is now known as Dreamer3
<unshadow> strcmp1: you were right, the issue is with one of the chars http://carc.in/#/r/2tz
<strcmp1> unshadow, g1,g2, and g3 arent being substituted in your regex, you forgot #{}.
fowlduck has quit [Remote host closed the connection]
jababb has joined #crystal-lang
<jababb> How does JSON.parse() or Hashes really work?
Ven has quit [Read error: Connection reset by peer]
<jababb> obj has this type; (Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type))
<jababb> do I need to explicitly do is_a? and then obj["key"] ?
<jababb> mm, then it works http://play.crystal-lang.org/#/r/2ub
Ven has joined #crystal-lang
<jababb> I am assuming it doesn't have as explicit as I had to do there:: http://play.crystal-lang.org/#/r/2ue
<jhass> jababb: the idiomatic way is to use json_mapping
Ven has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
<jababb> jhass: thanks, just what I needed!
<jababb> do you know if it works well with nested anonymous objects? I see I can do { result: {type: Hash }} -- but I assume I can expand Hash with its own json_mapping
<jhass> so for your example http://play.crystal-lang.org/#/r/2uw
strcmp1 has quit [Quit: Leaving]
<jhass> a bit verbose sadly, I should look into adding my root key idea
<jababb> mm ok, so I need to explicitly map each nested level
havenwood has quit [Ping timeout: 256 seconds]
<jhass> yeah
<jababb> ok thanks a lot, and I agree it's a bit verbose :D
<jababb> being able to do something similar to what you can do in golang with anonymous structs would have been nice
<jhass> never touched go so no idea how that looks
<jhass> my idea would be to add something like result: {type: Array(Hero), root: "heroes"}
<jhass> cut out the unnecessary middleman
sandelius has joined #crystal-lang
<jababb> but yeah I guess adding root would help quite a bit
strcmp1 has joined #crystal-lang
strcmp1 has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven_ has quit [Ping timeout: 250 seconds]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
strcmp1 has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
fowlduck has joined #crystal-lang
fowlduck has quit [Ping timeout: 256 seconds]
waj has joined #crystal-lang
<crystal-gh> [crystal] jhass opened pull request #789: Add root option to json_mapping fields (master...json_mapping_root) http://git.io/vIytt
<jababb> jhass: :)
Ven has joined #crystal-lang
<unshadow> strcmp1: It's all excaped, still same error --> http://carc.in/#/r/2uz
<unshadow> *escaped
<unshadow> I think maybe I should open an issue for this, seems like a bug
waj has quit [Quit: waj]
zz_Cidan is now known as Cidan
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fowlduck has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
jtarchie has joined #crystal-lang
Ven has joined #crystal-lang
ponga has quit [Quit: Leaving...]
waj has joined #crystal-lang
unshadow has quit [Quit: leaving]
havenwood has joined #crystal-lang
jababb has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
NeverDie has joined #crystal-lang
wuehlmaus has quit [Remote host closed the connection]
BlaXpirit has joined #crystal-lang
asterite has joined #crystal-lang
wuehlmaus has joined #crystal-lang
fowlduck_ has joined #crystal-lang
bcardiff has joined #crystal-lang
fowlduck has quit [Ping timeout: 265 seconds]
Ven has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vISfy
<crystal-gh> crystal/master 9fc51fd Ary Borenszweig: Fixed String#gsub to handle empty string and regex. Related to #787
<crystal-gh> crystal/master 7bd0dbe Ary Borenszweig: Escape null characters in regexes for PCRE. Fixes #787
<crystal-gh> crystal/master f6e30d3 Ary Borenszweig: Added docs for the recent `union?` and `union_types` macro methods
Ven has joined #crystal-lang
waj_ has joined #crystal-lang
waj has quit [Ping timeout: 255 seconds]
waj_ is now known as waj
<travis-ci> manastech/crystal#2466 (master - f6e30d3 : Ary Borenszweig): The build passed.
kostya has joined #crystal-lang
Excureo has quit [Remote host closed the connection]
Excureo has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xd1le_ has joined #crystal-lang
datanoise has joined #crystal-lang
<xd1le_> jhass: thanks btw, saved a lot of time
<jhass> yw
xd1le_ has quit [Quit: WeeChat 1.2]
asterite has quit [Ping timeout: 246 seconds]
shama has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
bhishma has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #786: Add named groups in MatchData#to_s (master...matchdata-names) http://git.io/vIMrz
Cidan is now known as zz_Cidan
<travis-ci> manastech/crystal#2467 (master - c0abcbc : Ary Borenszweig): The build passed.
waj_ has joined #crystal-lang
waj has quit [Ping timeout: 256 seconds]
waj_ is now known as waj
mdz_ has joined #crystal-lang
kostya has quit [Quit: Leaving]
<travis-ci> will/crystal#5 (master - c0abcbc : Ary Borenszweig): The build passed.
<crystal-gh> [crystal] kostya opened pull request #790: base64 optimize decode (master...base64_opt) http://git.io/vI98t
NeverDie has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vI9wZ
<crystal-gh> crystal/master 5266b94 Konstantin Makarchev: base64 optimize decode
<crystal-gh> crystal/master 3f5d7ac Ary Borenszweig: Merge pull request #790 from kostya/base64_opt...
NeverDie has quit [Read error: Connection reset by peer]
NeverDie has joined #crystal-lang
zz_Cidan is now known as Cidan
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<travis-ci> manastech/crystal#2469 (master - 3f5d7ac : Ary Borenszweig): The build passed.
vikaton has joined #crystal-lang
luislavena has joined #crystal-lang
NeverDie has joined #crystal-lang
bcardiff1 has joined #crystal-lang
NeverDie has quit [Max SendQ exceeded]
bcardiff has quit [Ping timeout: 258 seconds]
NeverDie has joined #crystal-lang
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #crystal-lang
jbomo has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
ponga has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
jbomo has left #crystal-lang [#crystal-lang]
<luislavena> hello folks, checking here since I cannot find anything on GitHub, anyone implementing something like DataObjects (DO) adapter pattern?
<jhass> I've only seen activerecord (though unlike the rails/ruby version)
asterite has joined #crystal-lang
<asterite> luislavena: o/
<ponga> hi
<luislavena> jhass: yeah, saw active_record.cr, but not looking at ORM (yet), but more low level but unified interface
willl has quit [Quit: Connection closed for inactivity]
<ponga> when do you guys expect cry-1.0.0 will release?
<jhass> shortly after it's ready for that
<asterite> No idea, really. We have to sit down with waj and build a Roadmap: things that we'd like the language, std, and tools to have at that point
<asterite> A Roadmap would be something really nice to have, so anyone can take bits of tasks and implement them if they want :-)
<luislavena> asterite: hello there :)
<asterite> luislavena: cómo va? :-)
<ponga> jhass: asterite if anyone of you studied formal computer science courses/degree can you recommend me a CS101 style book
<ponga> i really lack the principles too much
<ponga> i don't even know what kernal is and had to google it
* ponga is sad for being dumb
<jhass> mmh, I basically only had a book for math
<asterite> ponga: I studied CS but didn't finish my studies. I was close, though. I needed to start/finish the thesis and then also the Language Theory course (no kidding here)
<asterite> ponga: what are you interested in learning? algorithms? complexity?
<ponga> asterite: is it common in the CS field for one who had not completed the course start career?
<jhass> yes, very
<ponga> asterite: i do natural language processing , i come from linguistics, language teaching, philosophy of language
<asterite> ponga: you mean, start working without CS studies?
<ponga> i work myself to write a AI chatbot
<ponga> asterite: no i meant " without finished degree "
<asterite> I'm missing something in that question: "is it common in the CS field for one who had not completed the course start career?". Is it common.. what?
<ponga> sorry i missed "to"
<ponga> is it common in the software field for ones who had not completed the course TO start their career and work?
<ponga> and thanks jhass for response
<asterite> At least here it's very common. I started working at the same time I started studying
<asterite> but I knew a bit about programming before I started working
<ponga> asterite: interesting, i never really studied anything related to language itself at university, i just took normal boring philosophy courses
<ponga> i feel kinda empathic
<jhass> see, CS is solving someone else's problem with computers
<ponga> that's what i believe it is
<jhass> you're constantly learning just enough of a to you foreign domain to solve that problem
<ponga> solving an issue in machine way
<ponga> hm
<jhass> as such people who can adapt quickly to new material and/or with diverse backgrounds are very welcome
<ponga> true however very often i feel i need to learn some basic
<jhass> and if "all" you can do is translating terms of a different domain to a domain a programmer can understand, that's incredibly valuable already
<ponga> for example i still don't know how to install a thing from tar.gz(tar ball?)
<jhass> well, a tarball is just a bunch of files
<ponga> thank you jhass you are being very kind
<jhass> a zip, rar or whatever
<jhass> compressed bunch of files
<ponga> today i tried to use tar ball for crystall cos my brew install command kinda was messed up
<ponga> got the tar ball, unzipped it in home folder, and didn't know what to do for next step
* ponga felt bad that moment
<jhass> well, did you look at the files that you got from it?
<jhass> digging into stuff and being curios, trying out is a core requirement to a good programmer IMO
<ponga> wow
<ponga> jhass: thank you i figured it out
<jhass> ;)
<ponga> just run crystal in /bin
<jhass> see, that's how I learned 80% of what I know
willl has joined #crystal-lang
<ponga> now i need to learn how to run this without cd into it, i think it was something about editing $path thingi in vim or smethng
<ponga> i will try
waj has quit [Ping timeout: 252 seconds]
<ponga> jhass: so you don't have a degree in computer science?
<jhass> well, working on it
<ponga> wow
<asterite> ponga: did you do `brew update` ?
<ponga> i mean it could sound dumb, but how did you get a job in first place? do you work in software field?
<ponga> asterite: yes i did brew update! i figured it out today myself sir!
<jhass> well, tbh I don't have a job yet, went straight from school to university
<ponga> i used the exprience from "rvm get head"
<jhass> and don't need to work to finance that due to some circumstances
<ponga> then i thought "maybe this thing works like rvm too, it needs a newer version to fetch newer crystal, after all they are all package mangaers"
<ponga> im proud
<asterite> :)
<jhass> but at least to me a CS degree doesn't mean much
<ponga> thanks jhass, for answering , i want to apologise if the question was sensitive
<jhass> I know a lot of people that have one that I'd never hire
<ponga> lol
<jhass> and equally many that don't and who I'd hire any time
<ponga> maybe this is first time me seeing harsh jhass
<ytti> i think higher education should be reserved to people with academic interest
<ytti> now higher education is factory
<ytti> where people go, since they feel they are investing in future
<jhass> yeah, agreed especially in CS
<ytti> not because they are genuinely interested in academia
<ponga> seems like 'higher education is factory' is a problem with every developed society
<ytti> academia is important and academics should be compensated better
<ytti> but we should have MUCH less people receiving higher education
<ponga> i agree too
<ponga> asterite: if i was only interested in writing scripts for my NLP scripts, i would worry far less, but im into more general stuff too. for instance i like crystal and if i had the skill i want to contribute too
<ponga> this motivates me to learn fundamentals and jargons
<ponga> this was reason of asking for a good book
<jhass> did you read something like Chris Pine's learn to program?
bcardiff1 has quit [Quit: Leaving.]
mdz_ has joined #crystal-lang
<ponga> nop
<ponga> is that book good
<jhass> I see it generally recommended by those who read it
<jhass> https://www.bloc.io/ruby-warrior/#/ is a fun way too
asterite has quit [Quit: Page closed]
<ponga> im doing ruby warrior now and its very good
<ponga> it helps me learn workflow and order
NeverDie has quit [Ping timeout: 246 seconds]
BlaXpirit has quit [Quit: Quit Konversation]
NeverDie has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
bcardiff has joined #crystal-lang
mdz_ has quit [Ping timeout: 244 seconds]
shama has quit [Remote host closed the connection]
bcardiff has quit [Client Quit]
shama has joined #crystal-lang
luislavena has quit []
bcardiff has joined #crystal-lang
bcardiff1 has joined #crystal-lang
bcardiff has quit [Read error: Connection reset by peer]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
bcardiff1 has quit [Ping timeout: 252 seconds]
datanoise has quit [Quit: WeeChat 1.2]
mdz_ has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
NeverDie has quit [Ping timeout: 264 seconds]
bhishma has quit [Ping timeout: 252 seconds]
Dreamer3 has quit [Read error: Connection reset by peer]
Dreamer3 has joined #crystal-lang
<crystal-gh> [crystal] will opened pull request #791: Non-matching captures return nil instead of empty string (master...regex-nils) http://git.io/vIQnb
bcardiff has joined #crystal-lang
vikaton has quit []
ponga has quit [Quit: Leaving...]
waj has joined #crystal-lang
havenwood has quit [Ping timeout: 264 seconds]