greenbigfrog has quit [Quit: The server of my BNC just shutdown or got killed!!!]
greenbigfrog has joined #crystal-lang
<FromGitter>
<sdzyba> @Papierkorb, could you please clarify why symbols should be avoided in crystal?
mbarbar 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 [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 [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
vivus has quit [Quit: Leaving]
snsei has joined #crystal-lang
<FromGitter>
<sam0x17> they are numbers that are generated at compile time @sdzyba -- there is no runtime support for going string => symbol or symbol => string, which takes a way a lot of their usefulness as a syntactic stand-in for string (correct me if I'm wrong?)
snsei has quit [Remote host closed the connection]
Alibaba has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
mbarbar has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
DTZUZU has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
watzon_ has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
hallomann is now known as reblunk
rohitpaulk has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
handicraftsman has quit [Ping timeout: 248 seconds]
handicraftsman has joined #crystal-lang
snsei has joined #crystal-lang
mark_66 has joined #crystal-lang
mark_66 has quit [Read error: Connection reset by peer]
mark_66 has joined #crystal-lang
<FromGitter>
<yxhuvud> yes, also the inability to create new unique at runtime can be a bit lacking at times.
<FromGitter>
<sdogruyol> morning everyone
rohitpaulk has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<Groogy>
Morning! o/
<Groogy>
also yeah on Symbols, they are pretty much global enums which is just... bad
<FromGitter>
<bew> to generate the documentation of a project, you can use `crystal docs` in the root of your project, or `crystal docs file.cr` to generate the docs for this file and all required files
<waghanza>
I think we are misunderstanding
<FromGitter>
<waghanza> is there a process (internal to crystal-lang) to generate documentation when pushing on master
<FromGitter>
<waghanza> ?
<FromGitter>
<waghanza> is it a manual command like `crystal docs` launched or a service linked on github ?
waghanza has quit [Quit: Page closed]
<FromGitter>
<bew> ah ok, hmm I guess that for the official doc it's updated on each release, by an automatic `crystal docs` and upload to a remote server, I think RX14 will know better
<FromGitter>
<waghanza> ok
<FromGitter>
<waghanza> I hope he read this message ;-)
<FromGitter>
<Rinkana> What is the best way to convert an array with bytes (`Array(UInt8)`) to an string?
<FromGitter>
<bew> can I ask where this array comes from?
sz0 has joined #crystal-lang
<FromGitter>
<Rinkana> It's being read from a file.
<FromGitter>
<Rinkana> But i don't know how long it will be. It's an string that will be terminated by an null-byte. So i loop the `#read_byte` untill i hit that null-byte. Meanwhile i store the bytes in that array so i can convert it into an string
<FromGitter>
<bew> to read a file (or any IO) to a string you can use `IO#gets_to_end`
<Papierkorb_>
doesn't read like it's a text file
<FromGitter>
<bew> ah yes maybe, but he wants to build a String, so I assumed it would be a text content
<Papierkorb_>
Reading binary data into a string is a recipe for disaster
<FromGitter>
<Rinkana> It's indeed not a text file. It's an proprietary file format for compression
<Papierkorb_>
Rinkana, never tried, but I'd try using `IO#gets` with a delimiter of a NUL char
<Papierkorb_>
Also make sure you get the encoding right
<Papierkorb_>
aka `IO#set_encoding`
<FromGitter>
<Rinkana> Hmm
<FromGitter>
<Rinkana> What is a NUL char in crystal?
<FromGitter>
<Rinkana> ah `'\u0000'`
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<bew> @Papierkorb_ `IO#gets` will return a `String` so it's not a good idea imo
<FromGitter>
<Rinkana> In my case i know it's a string
rohitpaulk has joined #crystal-lang
<FromGitter>
<Rinkana> `name = file.gets('\u0000', true).to_s` works like a charm
<hightower4>
Papierkorb_, your qt5 bindings are usable?
<Papierkorb_>
Dunno? Try them
<FromGitter>
<bew> my best bet would be to read the file content to a Bytes object, get the index of the NUL byte, create a `Bytes` and create a String from where you are to the index you found before.
<Papierkorb_>
bew, that's basically what that method does, on top of multi-byte char awareness
<Papierkorb_>
Which is a plus
<FromGitter>
<bew> a plus?
<FromGitter>
<Rinkana> @bew some of the files are 300mb+
<FromGitter>
<Rinkana> I'm not really keen on loading all that into memory
<Papierkorb_>
the only thing that kinda sucks is it treating the NUL byte as character
<FromGitter>
<bew> ah maybe if the string in question have unicode, the NUL could be found earlier in a unicode char?
<Papierkorb_>
Shouldn't happen
<Papierkorb_>
NUL in a multi-byte sequence, in UTF-8, is still NUL
<Papierkorb_>
Not supposed to happen. Going byte by byte doesn't break anything for that. For other theoretical encodings, it could. But bleh.
rohitpaulk has quit [Ping timeout: 248 seconds]
<crystal-gh>
[crystal] bew opened pull request #5322: Fix typo in IO (master...fix-typo-io) https://git.io/vFxGw
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
flaviodesousa has quit [Ping timeout: 248 seconds]
<Papierkorb>
Groogy: That actually looks like a reasonable place to use something like nuclear. Though if it's so small, I'd actually think about porting/reimplementing it in Crystal
rohitpaulk has joined #crystal-lang
<Papierkorb>
Groogy: I think your nick is great
<Groogy>
huh? You mean the ui?
<Papierkorb>
ya
<Groogy>
ah yeah just porting my c++ ui I made long time ago
<Groogy>
I'm using cute for the hooks, remember?
<Papierkorb>
ah, that, yeah
<Groogy>
it's really nice, the user code is really straightforward
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 [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<kingsleyh> Hello - I've just started learning Crystal - I've got a lot of experience with Ruby so it feels very familiar
<FromGitter>
<kingsleyh> I enjoy coding in IntelliJ - so I've started work on an alternative intellij plugin - it will probably be overtaken by an official one but in the meantime I plan to support this one while I do some crystal coding - https://github.com/intellij-crystal/intellij-crystal