jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.9.1 | Fund Crystals development: http://is.gd/X7PRtI | 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
hangyas has quit [Read error: Connection reset by peer]
elia has quit [Quit: Computer has gone to sleep.]
zz_Cidan is now known as Cidan
A124 has quit [Ping timeout: 268 seconds]
A124 has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
ssvb has quit [Ping timeout: 256 seconds]
ssvb has joined #crystal-lang
CraigBuchek has joined #crystal-lang
CraigBuchek has quit [Client Quit]
A124 has quit [Read error: Connection reset by peer]
A124 has joined #crystal-lang
CraigBuchek has joined #crystal-lang
CraigBuchek has quit [Client Quit]
ssvb has quit [Read error: Connection timed out]
ssvb has joined #crystal-lang
pawnbox has joined #crystal-lang
jwaldrip has joined #crystal-lang
jwaldrip has quit [Client Quit]
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
jwaldrip has joined #crystal-lang
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 252 seconds]
Cidan is now known as zz_Cidan
zz_Cidan is now known as Cidan
pawnbox_ has quit [Remote host closed the connection]
BlaXpirit has joined #crystal-lang
pawnbox has joined #crystal-lang
nakilon has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #1856: Fix: Process still used Dir.chdir (master...std-fix-chdir) http://git.io/vl0bs
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
n0xff has quit [Quit: leaving]
pawnbox has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 268 seconds]
<xAndy> i have an Array(UInt8) and want a string, but i only see string constructiors that take Slice(UInt8) how do i convert my array?
ponga has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bam has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
elia has joined #crystal-lang
Cidan is now known as zz_Cidan
<xAndy> i'm trying to work with the udp socket in listening mode but i need the rmote ip/port of incomming packages
blue_deref has quit [Quit: bbn]
<[spoiler]> xAndy: you could use String.build
<xAndy> [spoiler] you mean a array.each and then insert each element via String.build? thats my workaround but i was hoping there was already a function
<xAndy> thought i'd ask before i reinvent the wheel
ssvb has quit [Ping timeout: 272 seconds]
jwaldrip has quit [Ping timeout: 256 seconds]
nakilon has quit [Ping timeout: 240 seconds]
<[spoiler]> xAndy: what comes to mind is String.new(arr.to_unsafe.to_slice(arr.size)) but its' probably bad
<[spoiler]> because it relies on to_unsafe
globalkeith has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<BlaXpirit> xAndy, String.new(arr.to_unsafe, arr.bytesize)
<BlaXpirit> honestly i have no idea why array still doesn't have to_slice
<BlaXpirit> then you would do String.new(arr.to_slice)
<xAndy> ok thanks i will consider these solutions
<BlaXpirit> no, it's just one solution
<xAndy> ok
<xAndy> now i just have to fingure out the udp socket problem
<[spoiler]> BlaXpirit: I thought it did, i was surprised when i found out it didn't lol
<[spoiler]> BlaXpirit: also, String.new(Array(UInt8)) should also work, imgo
<[spoiler]> imho
pawnbox has joined #crystal-lang
jwaldrip has joined #crystal-lang
<xAndy> i'm trying to listen for udp packets on a port and need the senders ip&port. i understand that upd has no traditional accept loop like tcp but how do i use bind without losing th sender information?
jwaldrip has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
leafybasil has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
<jokke> jhass: do i have to do anything special to output the results of a benchmark?
<jokke> (a puts somewhere)
<BlaXpirit> xAndy, that implementation makes no sense to me
<BlaXpirit> i can only bet nobody has used this UDPSocket seriously
<BlaXpirit> example is broken/outdated as well
<xAndy> BlaXpirit yeah i was hoping that i just didn't understand it propperly or that there was a wrapper i missed
<BlaXpirit> it accepts only one client
<BlaXpirit> and UDP sockets are message-based, and message boundaries seem undefined in this abstraction
<BlaXpirit> god it's so annoying
<jokke> i'm getting data over a tcp socket and i'm expecting some values to be floats
<jokke> i wrote me a benchmark that sends data to that socket and generates the values with rand * 100
<jokke> this however is a problem when the value is a round number
<jokke> the payload is json and it seems that to_json makes a round float an integer on the way
<jokke> so that on the receiving side as Float64 fails
<jokke> any ideas?
<BlaXpirit> jokke, is that really so? give an example
<BlaXpirit> >> 5.0.to_json
<DeBot> BlaXpirit: undefined method 'to_json' for Float64 - http://carc.in/#/r/lo6
<BlaXpirit> >> require "json"; 5.0.to_json
<DeBot> BlaXpirit: in line 21: can't require dynamically - http://carc.in/#/r/lo8
<BlaXpirit> k lol
<xAndy> jokke js and json only know numbers
<jokke> yeh
<xAndy> so the serialization is correct
<BlaXpirit> you are right, jokke
<jokke> yeah
<BlaXpirit> this should not be so, this is a bug, pls report it
<jokke> but how do i deal with this?
<BlaXpirit> ez to reproduce http://carc.in/#/r/lo9
<BlaXpirit> jokke, modify the crystal standard library
<jokke> BlaXpirit: i dunno if that's a bug
<xAndy> BlaXpirit that behaviour is correct
<BlaXpirit> python gives 5.0
<jokke> maybe something like (value as Number).to_f on the receiving side would do the trick
<BlaXpirit> ruby gives 5.0
elia has quit [Ping timeout: 265 seconds]
elia has joined #crystal-lang
<xAndy> v8 and the firefox js vm give 5
<BlaXpirit> xAndy, js doesn't have integers anyway
<xAndy> yes thats why 5 is the correct representation of 5.0 becuase it is the same type
<BlaXpirit> sigh, it's only technically correct
<BlaXpirit> meanwhile, i spent 12 minutes trying to serialize json in rust and i still have no clue how to do it
leafybas_ has joined #crystal-lang
<xAndy> lol
<BlaXpirit> nim gives 5.0
leafybasil has quit [Ping timeout: 268 seconds]
<BlaXpirit> go gives 5
nakilon has joined #crystal-lang
trapped has joined #crystal-lang
nakilon has quit [Ping timeout: 265 seconds]
leafybas_ has quit []
leafybasil has joined #crystal-lang
jwaldrip has joined #crystal-lang
elia_ has joined #crystal-lang
elia has quit [Ping timeout: 255 seconds]
jwaldrip has quit [Ping timeout: 264 seconds]
elia_ has quit [Read error: Connection reset by peer]
<jhass> jokke: you know, you can ask things to the channel too
<jokke> sorry :D
<jokke> i will
<jhass> but no, iirc it prints on its own
<jokke> alright
elia has joined #crystal-lang
Bofu2U has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
zipR4ND has joined #crystal-lang
<zipR4ND> hey all, trying to compile an older project with the new crystal version I get this error: http://pastebin.com/uWd8snbf can anyone help?
leafybasil has quit [Ping timeout: 240 seconds]
leafybasil has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #1856: Fix: Process still used Dir.chdir (master...std-fix-chdir) http://git.io/vl0bs
<jhass> zipR4ND: did you monkey patch any exception classes (maybe without realizing)?
barosl has quit [Read error: Connection reset by peer]
barosl has joined #crystal-lang
<travis-ci> manastech/crystal#6c52fa3 (master - Merge pull request #1856 from ysbaddaden/std-fix-chdir): The build passed. https://travis-ci.org/manastech/crystal/builds/88772164
<DeBot> https://github.com/manastech/crystal/pull/1856 (Fix: Process still used Dir.chdir)
<zipR4ND> jhass: i don't think so. how yould i do it without noticing?
<zipR4ND> jhass: I did inherit from Exception and overloaded the initialize method ..
<jhass> mh, maybe it transitions there, make sure to call super there
<jhass> and do without noticing would be reopening an existing one without realizing it already exists
<zipR4ND> ah ok
<zipR4ND> how do I have to call super for Excpetion#initialize?
elia has quit [Ping timeout: 240 seconds]
zipR4ND has quit [Ping timeout: 252 seconds]
elia has joined #crystal-lang
zipR4ND has joined #crystal-lang
emancu has quit []
<crystal-gh> [crystal] cielavenir opened pull request #1859: Add Array#bsearch, Array#bsearch_index, Range#bsearch (master...bsearch) http://git.io/vl2k6
elia_ has joined #crystal-lang
elia has quit [Ping timeout: 250 seconds]
zipR4ND has quit [Ping timeout: 240 seconds]
McDougal has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 240 seconds]
jwaldrip has joined #crystal-lang
jwaldrip has quit [Ping timeout: 246 seconds]
zipR4ND has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
jwaldrip has joined #crystal-lang
jwaldrip has quit [Ping timeout: 255 seconds]
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
niv has joined #crystal-lang
<niv> hi! checking out crystal, looks awesome so far. quick question though that i cant find the answer to in the docs: is it possible to export crystal functions (or even classes for c++) to be callable from c code?
<jokke> i'm trying to check my code for any memory leaks and started my benchmark with valgrind. Doing this however causes a segfault. the program doesn't segfault if started normally
<jokke> niv: afaik no. Similar to c++ names will be mangled and there's no knowing what the resulting names will be
<jokke> (which is why you can't use c++ libs in c projects either)
<niv> that's a shame. i was hoping there's some kind of utility to generate a header for me
<niv> yeah, i'm aware of the name mangling. i'd be fine with C calling conventions too. just some way to get into crystal from C side
<jokke> niv: your best bet is probably coding some ipc interface for your crystal project which can be used from other languages
<niv> that's my fallback idea, but i'd rather have native performance, not going through shm :)
<jokke> sure
<niv> i'll play around with it a bit. thanks for your feedback :)
<jokke> yw
pawnbox has quit [Remote host closed the connection]
<niv> alright, found the official thread on github .. watching that then
<niv> thanks!
pawnbox has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 265 seconds]
zipR4ND has quit [Ping timeout: 255 seconds]
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Killed (leguin.freenode.net (Nickname regained by services))]
cyjimmy264 has joined #crystal-lang
cyjimmy264_ has quit [*.net *.split]
bjmllr has quit [*.net *.split]
toydestroyer has quit [*.net *.split]
sardaukar has quit [*.net *.split]
avdi has quit [*.net *.split]
iamstef has quit [*.net *.split]
trajing has quit [*.net *.split]
dom96 has quit [*.net *.split]
victor_lowther has quit [*.net *.split]
dom96 has joined #crystal-lang
bjmllr has joined #crystal-lang
iamstef has joined #crystal-lang
avdi has joined #crystal-lang
victor_lowther has joined #crystal-lang
toydestroyer has joined #crystal-lang
McDougal has quit [Quit: Textual IRC Client: www.textualapp.com]
Renich has joined #crystal-lang
fowlduck has joined #crystal-lang
McDougal has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
leafybasil has quit [Ping timeout: 265 seconds]
bam has quit [Ping timeout: 240 seconds]
nakilon has joined #crystal-lang
shama has joined #crystal-lang
elia_ has quit [Quit: Computer has gone to sleep.]
nakilon has quit [Ping timeout: 252 seconds]
Renich has quit [Ping timeout: 260 seconds]
Renich has joined #crystal-lang
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fowlduck has joined #crystal-lang
elia has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zz_Cidan is now known as Cidan
McDougal has joined #crystal-lang
globalkeith has joined #crystal-lang
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cyjimmy264_ has joined #crystal-lang
cyjimmy264 has quit [Ping timeout: 268 seconds]
McDougal has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
elia has quit [Quit: Computer has gone to sleep.]
<niv> what's the easiest/fastest way of transforming the string "test" into a StaticArray(Char, 16)?
<niv> where everything after test is nullbytes
<niv> nevermind :)
<jhass> niv: why StaticArray? if it's null-terminated, to_unsafe / to_slice should be just fine?
<niv> just for kicks i'm re-implementing a reader for a binary format, which has a datatype that's a human-readable ascii-string at most 16 characters long
<niv> but i meanwhile cottoned on to that Char isn't what i want in this case anyways
<niv> but this does bring me to a followup question .. is there anything like .force_encoding / .encoding in ruby? is there iconv support in stdlib? can't find anything like that
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
<jhass> niv: nope, no encoding support yet
<niv> jhass: alright, thanks :)
globalkeith has joined #crystal-lang
leafybasil has joined #crystal-lang
agargiulo has quit [Quit: leaving]
Raimondi has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
elia has joined #crystal-lang
leafybasil has quit []
leafybasil has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
elia has quit [Quit: Computer has gone to sleep.]
elia has joined #crystal-lang
cyjimmy264_ has quit [Quit: http://quassel-irc.org - ????????????? ??????. ?????.]
cyjimmy264 has joined #crystal-lang
ponga has quit [Quit: Connection closed for inactivity]
McDougal has joined #crystal-lang
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blue_deref has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 260 seconds]
McDougal has joined #crystal-lang
McDougal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Renich has quit [Ping timeout: 264 seconds]
Renich has joined #crystal-lang
McDougal has joined #crystal-lang
McDougal has quit [Client Quit]