jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals 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
jsaak has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 272 seconds]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
joshcarter has quit [Quit: Connection closed for inactivity]
ome has joined #crystal-lang
jsaak has quit [Ping timeout: 276 seconds]
trapped has quit [Read error: Connection reset by peer]
jsaak has joined #crystal-lang
matp has quit [Ping timeout: 272 seconds]
willl has quit [Quit: Connection closed for inactivity]
jsaak has quit [Ping timeout: 276 seconds]
dhk has joined #crystal-lang
dhk has quit [Ping timeout: 276 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
wiiw has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vK0hr
<crystal-gh> crystal/master 38f156f Ary Borenszweig: Fixed #2998: Parse error when using division inside hash value
jsaak has joined #crystal-lang
<travis-ci> crystal-lang/crystal#38f156f (master - Fixed #2998: Parse error when using division inside hash value): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/144904807
jsaak has quit [Ping timeout: 250 seconds]
matp has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jsaak has joined #crystal-lang
iwwi has joined #crystal-lang
wiiw has quit [Ping timeout: 264 seconds]
iwwi is now known as wiiw
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jsaak has quit [Ping timeout: 252 seconds]
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 258 seconds]
ome has quit [Quit: Connection closed for inactivity]
rubes has joined #crystal-lang
<rubes> Hello, I was wondering if the docs here: https://crystal-lang.org/docs/index.html
<rubes> are good enough to learn the language even if I have had 0 exposure to Ruby
<rubes> I know ruby is not a requirement but when I was learning Scala I had to re-learn Java to understand some things
<BlaXpirit> rubes, sure. there's nothing better than this, anyway
<BlaXpirit> and it's not like this is a huge book. 100% worth reading
<txdv> If you have a solid C and Ruby background, crystal is ez
<txdv> if you lack on the ruby ... you might not appreciate some things
<rubes> Thanks for both answers, I have a solid C background
<rubes> 0 Ruby background, I will still play around with it and maybe learn very basic Ruby
rubes has quit [Quit: Page closed]
pawnbox has quit [Remote host closed the connection]
<BlaXpirit> well this is a fun error. best part is the punchline at the bottom: https://bpaste.net/show/9c2098ee172a - WTF
jsaak has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jsaak has quit [Ping timeout: 244 seconds]
akwiatkowski has joined #crystal-lang
<txdv> how do I convert one enum to another?
pawnbox has quit [Remote host closed the connection]
<txdv> nevermind
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<txdv> tw
pawnbox has joined #crystal-lang
sebler_ has joined #crystal-lang
sebler has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jsaak has joined #crystal-lang
efi has joined #crystal-lang
jsaak has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 240 seconds]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 250 seconds]
Philpax has joined #crystal-lang
<txdv> is there something like RAII in crystal-lang?
<jhass> what's RAII again?
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
<tilpner> Pretty much the worst common programming acronym, "Resource Acquisition Is Initialization" or "things are destroyed at the end of the scope".
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<jhass> so in a GC'd language that'd be a precise GC?
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<txdv> jhass: like it the variable lives on the stack, once it gets out of scope, the finalizer is called and shits getting cleaned
<txdv> also, is there something like rubies ->(x) { |x| } ?
trapped has joined #crystal-lang
<txdv> o yeah, proc
<tilpner> jhass - No, precise is something else here. They (RAII and GC) are also not mutually exclusive, though perhaps a little tricky to combine.
<tilpner> If we consider reference counting garbage collection, that would also work. The reference count would decrease at the end of the scope, and the destructor/drop-code/finalizer runs as soon as the refcount reaches zero.
<jhass> so basically finalize for struct's? no, we don't have that (yet)
<tilpner> Almost: For RAII to be useful, we need a "finalize" that runs when the scope (e.g. lexical scope, if on stack) ends. Exactly then, not at some unspecified point in the future. This is relevant when using finalizers for resource management, e.g. closing files or sockets, as well as releasing a mutex lock.
<tilpner> Which, I suppose, could be *exactly* what you mean.
<jhass> I think so :)
pawnbox_ has quit [Remote host closed the connection]
jsaak has joined #crystal-lang
pawnbox has joined #crystal-lang
<txdv> is there like a variable which holds the value of the value psased to a case?
<txdv> some $1 trickery?
pawnbox has quit [Ping timeout: 246 seconds]
<RX14> there shouldn't be
<RX14> just use a variable
<txdv> yeah, i'm probably overcomplicating shit
<jhass> case foo = bar; when X; x(foo);
<txdv> o yeah the inline assignment
<BlaXpirit> txdv, instead of RAII blocks are used
<BlaXpirit> open_file("blah.txt") do |f|; f.dsfgshdsrhr; end
<BlaXpirit> resource is freed at the end of block
<FromGitter> <sdogruyol> i'm sure that this has been answered before but what's the crystal equivalent of ```[data].pack "H*"```
<jhass> Slice#hex
<FromGitter> <sdogruyol> "String".to_slice.to_hex then?
<jhass> I guess?
<jhass> depends on what you're doing
<FromGitter> <sdogruyol> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5788d57a196179690edcf3d4]
<FromGitter> <sdogruyol> practically i'm rewriting this in Crystal
<FromGitter> <kofno> How does http://crystalshards.xyz determine which projects to index?
<FromGitter> <sdogruyol> @kofno depending on the star_count and recent index
<jhass> that looks weird, wth the packs
<FromGitter> <sdogruyol> this is the Crystal version as of now https://gist.github.com/sdogruyol/9a470d8984e027d4847da7ee78faa578
<FromGitter> <sdogruyol> not working though
<FromGitter> <sdogruyol> well the Ruby code is shitty because it needs to be symetrical to a .NET library
<FromGitter> <kofno> I just found it neat that some code I pushed to github last night was already listed.
<jhass> limiting the input to 0-9a-f seems to severely harm input entropy, oh well
<FromGitter> <sdogruyol> jhass: it's a mess but can't do anything :/
<jhass> unpacked is just wrong there as a variable name too...
<jhass> anyway, the ruby code passes the "hex"ed key to the hmac, yours passes whatever the original is
<FromGitter> <sdogruyol> well like i said it's messy ..
<FromGitter> <sdogruyol> how can i hex it?
<jhass> you already do when setting it as key
<jhass> ah nvm
<jhass> whatever data is is passed to the hmac where you pass ENCRYPTION_KEY
<jhass> or rather the result of unpacked_data = encrypted_data.unpack("H*")[0].upcase ?
<jhass> this all seems so so wrong...
<FromGitter> <sdogruyol> haha, yeah
<FromGitter> <sdogruyol> so my question still remains
<FromGitter> <sdogruyol> how can i convert a string to hex based?
<jhass> my answer remains
<jhass> you already do while setting the key
<FromGitter> <sdogruyol> how about the IV?
<jhass> oh
<jhass> >> "foo".to_slice.hexstring
<DeBot> jhass: # => "666f6f" - https://carc.in/#/r/13v3
pawnbox has joined #crystal-lang
<jhass> so Slice#hexstring, not Slice#hex or Slice#to_hex
<jhass> not sure why to_hex is public anyway
<FromGitter> <sdogruyol> :P
<FromGitter> <sdogruyol> this is so f****** up
<FromGitter> <sdogruyol> i mean the encryption stuff lol
<FromGitter> <sdogruyol> i don't even know wtf i'm doing just some random mambo jambo
ponga has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <sdogruyol> jhass and how can i convert a hexstring back to normal?
<FromGitter> <sdogruyol> ```encrypted_data = cipher.update data.to_slice.hexstring```
<FromGitter> <sdogruyol> actually just this to_s data.to_slice.hexstring
<jhass> does our cipher.update even return the encrypted chunk?
<jhass> and if so as hexstring?
<jhass> hell, does Ruby's even?
<FromGitter> <sdogruyol> well the ruby version just works
<FromGitter> <sdogruyol> god knows how lol
<jhass> luck
<FromGitter> <sdogruyol> haha, that must it :P
<FromGitter> <sdogruyol> be*
<FromGitter> <sdogruyol> seems like it does
<jhass> I think the unpack and upcase in the Ruby code does just nothing most of the time
<jhass> this is so terrible
<jhass> I'm afraid it's too messed up to guess the right things from reading the code
<jhass> gotta be able to play with it
<FromGitter> <sdogruyol> well, if you want i can share the files to play with via pm
sdogruyol has joined #crystal-lang
ponga has quit []
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vKExz
<crystal-gh> crystal/master 9df0011 Ary Borenszweig: String#+(String): don't create an extra string if either of them is empty
<crystal-gh> [crystal] asterite opened pull request #3000: Fixed #2999: allow '~' in HTTP header value (master...feature/fix_http_header_value) https://git.io/vKExQ
soveran has joined #crystal-lang
<travis-ci> crystal-lang/crystal#9df0011 (master - String#+(String): don't create an extra string if either of them is empty): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/145019102
Philpax has quit [Ping timeout: 252 seconds]
<crystal-gh> [crystal] MakeNowJust opened pull request #3001: Fixed #2999: A bug not to allow '~' in HTTP header value (master...fix/header-bug) https://git.io/vKuem
matp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sebler_ has quit []
<crystal-gh> [crystal] asterite closed pull request #3000: Fixed #2999: allow '~' in HTTP header value (master...feature/fix_http_header_value) https://git.io/vKExQ
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKukX
<crystal-gh> crystal/master c672515 TSUYUSATO Kitsune: Fixed #2999: A bug not to allow '~' in HTTP header value
<crystal-gh> crystal/master 024418d Ary Borenszweig: Merge pull request #3001 from MakeNowJust/fix/header-bug...
<mose> remote meetup is about to start
<travis-ci> crystal-lang/crystal#024418d (master - Merge pull request #3001 from MakeNowJust/fix/header-bug): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/145037073
jsaak has quit [Ping timeout: 246 seconds]
matp has joined #crystal-lang
jsaak has joined #crystal-lang
jsaak has quit [Ping timeout: 250 seconds]
Ven has joined #crystal-lang
Oliphaunte has quit []
sdogruyol has quit [Quit: Connection closed for inactivity]
soveran has quit [Remote host closed the connection]
jsaak has joined #crystal-lang
<RX14> that was fun
<mose> nice presentation
<mose> if it gets monthly that can be very interesting
<RX14> i think monthly would be a bit too much, unless we can get some good new topics
<mose> can be shorter
<FromGitter> <sdogruyol> Yeah i think 2 month is good
<RX14> i meant too short lol
<FromGitter> <sdogruyol> Or 45 days
<RX14> hmmn
<RX14> we could sync it with the release schedule!
<mose> I meant like 15-20 minutes
<FromGitter> <sdogruyol> RX14 nice idea
<RX14> so we have one just after/before a release to talk about the changelog
<RX14> which would be really interesting
<RX14> if we don't get a release schedule before 1.0 we can still plan a date so we can do a meetup around then
Oliphaunte has joined #crystal-lang
willl has joined #crystal-lang
kulelu88 has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
Oliphaunte has quit [Remote host closed the connection]
soveran has joined #crystal-lang
alanwillms has joined #crystal-lang
<alanwillms> Anybody here knows how to handle the new crystal-website and crystal-book repositories?
<FromGitter> <sdogruyol> i really think that we need more premium sponsors to support us towards 1.0 and beyond!
<jhass> alanwillms: what do you mean with how to handle?
soveran has quit [Remote host closed the connection]
<alanwillms> Previously crystal-lang had a branch called gh-pages. I ran a command and it would convert HAML to HTML, GitBook to HTML, and then I just had to git push
<alanwillms> Now crystal-website do not host the Gitbook HTML files, but if you browse to /docs they are there
<alanwillms> Is there any third repository that joins crystal-website and crystal-book?
<jhass> no, they just push the built HTML to S3
<alanwillms> hmm
Oliphaunte has joined #crystal-lang
<alanwillms> is it safe? what if I use those credentials to put a picture of a cat at /docs/index.html ?
<jhass> they're encrypted
<jhass> that's what the secure: means
<alanwillms> ah ok
Oliphaunte has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
sdogruyol has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
alanwillms has quit [Quit: Saindo]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
icezimm has joined #crystal-lang
efi has quit [Ping timeout: 250 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Renich has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
jware has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
jware has left #crystal-lang [#crystal-lang]
jware has joined #crystal-lang
jware has quit [Quit: Leaving.]
<BlaXpirit> so I have a very weird question...
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<BlaXpirit> I have a class Obj, variable ptr : Obj* and an object obj = Obj.new
<BlaXpirit> if I write ptr = pointerof(obj) will that count as a reference in terms of garbage collection (keep it alive)?
<jhass> pretty sure it will
Oliphaunte has quit [Remote host closed the connection]
<BlaXpirit> jhass, and now for the crazy part: if I were to tell C code to do that assignment instead
<jhass> boehm gc simply scans all memory allocated through it for pointers it gave out
<jhass> plus the stack I guess
Oliphaunte has joined #crystal-lang
<BlaXpirit> so uh Lib.c_assign(pointerof(ptr), pointerof(obj)) - will obj be kept alive?
<BlaXpirit> ^the function would do *arg1 = arg2
<jhass> if you keep a reference to ptr I would expect so
<jhass> or as long as its stackframe is alive
<BlaXpirit> yeah... well I hope this doesn't bite me later
<BlaXpirit> but sounds good. thanks.
<jhass> it's certainly a pretty weird thing to do :P
<BlaXpirit> oh you have no idea what weird things i'm doing
<Yxhuvud> you, and the world at large.
Dreamer3 has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Renich has quit [Quit: leaving]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang