non-aristotelian has quit [Quit: non-aristotelian]
Tortice has joined #crystal-lang
Tortice has quit [Remote host closed the connection]
robacarp has quit [Ping timeout: 240 seconds]
robacarp has joined #crystal-lang
<FromGitter>
<cpunion> Hi, is there a library to parse numbers with unit likes “1936300Ki", “1024M” etc.?
rohitpaulk has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter>
<Grabli66> Hi! I compiled hashlink for raspberry pi 3 (arm7). And then i am tried to launch simple program compiled to hashlink. But i got an error "Illegal instruction" on launch. Anyone know whats wrong?
<FromGitter>
<Grabli66> Ooops
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 244 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<proyb6> @cpunion Your name is almost similar to mine, I would rather do regex since it’s so easy to write your own custom API of different units
shmibs has quit [Remote host closed the connection]
shmibs has joined #crystal-lang
<FromGitter>
<girng> i LOVE crystal!
<FromGitter>
<drum445> @j8r Seems like a lot of people just jumped on the hate train, it isn't bad at all imo. Has some problems, but what language doesn't
<FromGitter>
<drum445> Amen @girng
<FromGitter>
<yxhuvud> regarding the hacktober fest, someone should tell them that the octoberfest is actually mostly in september :P
<FromGitter>
<fusillicode_twitter> Hi guys, sorry as usual for the bothering, but I'm facing a problem that I would like like to solve with Crecto and its changesets but I fear that I need some custom code around it
<FromGitter>
<fusillicode_twitter> Here's the problem
<FromGitter>
<fusillicode_twitter> I have some validations that I would like to have but that are not related to the schema. ⏎ My use case is this: I get some random strings that I need to validate and convert to the proper types before saving a record inside the db. ⏎ If there are some validations errors however I still want to save the record with default "fallback" values (in general just null). ⏎ Right now I'm trying to
<FromGitter>
<bajro17> @proyb6 What you think about it
<FromGitter>
<bajro17> I buy it also few min before
flaviodesousa has joined #crystal-lang
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<proyb6> I feel Chapter 8 is too short on advanced topic, I feel there should be more? Perhaps, the source code example should tell you the level of difficulty from beginner to intermediate seem okay for newbie, C programmers or professionals might want more could look elsewhere
<FromGitter>
<proyb6> I learn to read it a lot better than resources on the web
<FromGitter>
<vladfaust> Hey, Gian D, take a look at github.com/vladfaust/validations.cr
<FromGitter>
<fusillicode_twitter> Hi @vladfaust I already took a look at it and if I should go with a validation shard it would totally be my first choice! ;) ⏎ But as I was already using Crecto to handle the DB and a few models I was wondering if its changesets could have been used to address my problem 🤔
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter>
<KevinSjoberg> I just noticed running `crystal spec -h` does not show all available options. Looking at https://github.com/crystal-lang/crystal/blob/0.26.1/src/spec.cr#L69 I clearly see more options not present in the help output. For instance, `--fail-fast` isn't present in the output, but running `crystal spec --fail-fast` works perfectly.
<FromGitter>
<KevinSjoberg> Is this a bug? If so, would you care for a pull request?
<FromGitter>
<bew> try `crystal spec -- --help`
<FromGitter>
<KevinSjoberg> @bew yep, that did it. I assume, that's not how we want to have it?
<FromGitter>
<bew> `crystal spec -h` gets you the help infos of the `crystal` command, not the spec
<FromGitter>
<KevinSjoberg> But running `crystal spec -h` give me output related to `spec`, but incomplete. I'd assume `crystal spec -h` give me spec related output. Doing `crystal spec -- -h` is not intuitive. I understand why it works, but not sure it's what you'd expect coming from other CLI interfaces.
<FromGitter>
<bew> `crystal spec -h` is not related to spec in any way..
<FromGitter>
<bew> it's related to basic build options
<FromGitter>
<KevinSjoberg> @bew how is this true? `crystal init -h` and `crystal spec -h` clearly give me different help output. For instance, `crystal spec -h` tell me I can use `--no-color` to disable coloured output. Which it does.
<FromGitter>
<bew> `crystal spec ...` is basically `crystal run spec/**/*_spec.cr`
<FromGitter>
<bew> there are some special cases like colors that are handled in the crystal command, and forwarded to the spec when run, and for all unknown `crystal` options, they are forwarded directly to the spec (that's why `--fail-fast` works)
<FromGitter>
<KevinSjoberg> I see. Would it be of interest to change this behaviour? Naturally, I feel that `crystal spec -h` should give spec-specific instructions.
<FromGitter>
<KevinSjoberg> I definitely open to be convinced otherwise. Maybe I'm missing something crucial. :)
<FromGitter>
<bew> no idea if this should change, maybe remove the special cases and make the behavior more generic, or simply have a note at the end of `cr spec -h` to tell the user that full spec lib help is available with `cr spec -- --help`
<FromGitter>
<KevinSjoberg> Yeah, that would be helpful as well. As a first step, making it more clear is perhaps the best choice.
<FromGitter>
<bew> would be nice to also add `-h` in addition to `--help` in the spec lib, because currently it crashes ^^
<FromGitter>
<bew> feel free to open an issue about this
<FromGitter>
<KevinSjoberg> I will. I'll take a stab at it tonight. :slight_smile:
<FromGitter>
<proyb6> @S-YOU I wonder how do you use C malloc and read_file in Crystal?
<FromGitter>
<bew> like any other c code call from crystal i guess
<FromGitter>
<codenoid> this makes my route won't loaded
<FromGitter>
<vusaalab> How is you experience with command line ffmpeg , I am looking a stable web framework to make it works as API, any suggestion
<FromGitter>
<fridgerator> I havent used it in quite a while, I was only using it for personal stuff and usually end up using HandBrake if I need to do some video stuff
<FromGitter>
<fridgerator> Kemal, Amber and Lucky all work as an api, I would suggest any fo those
<FromGitter>
<vusaalab> @fridgerator Thanks!
<FromGitter>
<fridgerator> Maybe look at their api's to see which you like best
<FromGitter>
<elorest> > Kemal, Amber and Lucky all work as an api, I would suggest any fo those ⏎ ⏎ seconded.
<FromGitter>
<jwoertink> is this a good use for `spawn` or, could this lead to other issues like memory leak or whatever?
<FromGitter>
<newtonapple> d
DTZUZO_ has quit [Quit: WeeChat 2.0]
DTZUZO has joined #crystal-lang
<jokke>
is there a way to know at compile time whether a file is being used as the main for a program?
<RX14>
jokke, no, and the best way to work around that is to structure your app as a library with a small stub entrypoint.cr which requires your code then calls MyApp.run
<jokke>
yeah
<jokke>
i think that's cleaner too
Tortice has joined #crystal-lang
<jokke>
RX14: i just pushed a shard that defines executables and postinstall but after i pulled it as a dev dep it's binary isn't copied into bin/
non-aristotelian has quit [Quit: non-aristotelian]
<FromGitter>
<ohenepee> This is a part of my code ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ What am I doing wrong exactly? and how do I correct it since I supposed *media* would be `nil` or a `string` at some point. [https://gitter.im/crystal-lang/crystal?at=5bb7eb45ae7be9401609c6cd]
<FromGitter>
<jwoertink> you need `property` in front of `media` and `caption`
<FromGitter>
<jwoertink> well, assuming this is all inside of a class
<FromGitter>
<jwoertink> not sure if property works outside of a class
<FromGitter>
<jwoertink> oh, and maybe give them default values since you state they are `String` as opposed to `String?` ?
<FromGitter>
<j8r> @ohenepee avoid using `as(String)` also
<FromGitter>
<j8r> do like `if (filemame = part.filename).is_a? String`
<FromGitter>
<j8r> same with media, i guess
<FromGitter>
<j8r> or not, don't know the whole code
Tortice has quit [Read error: Connection reset by peer]