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>
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
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
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]