RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
_whitelogger has joined #crystal-lang
tsundsted has joined #crystal-lang
<FromGitter> <ryanstout> @<applesaucy_> you could shell out to ffmpeg, its a command line tool that can do a ton of video related stuff
<FromGitter> <ryanstout> does crystalshards.xyz take a while to load sometimes for anyone? (It's not on a free heroku dyno or similar is it? Seems like its the first load sometimes)
sz0 has joined #crystal-lang
<FromGitter> <Blacksmoke16> :shrug:
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
tsundsted has quit [Ping timeout: 256 seconds]
<applesaucy_> how would i use ffmpeg command lines in crystal?
<applesaucy_> sorry, i have no idea about this stuff
sz0 has quit [Quit: Connection closed for inactivity]
DmitryBochkarev has joined #crystal-lang
<FromGitter> <mavu> That is one way, I use often.
hightower3 has joined #crystal-lang
DTZUZO has joined #crystal-lang
fifr has quit [Ping timeout: 245 seconds]
fifr has joined #crystal-lang
dostoyevsky has quit [Ping timeout: 245 seconds]
dostoyevsky has joined #crystal-lang
<FromGitter> <drum445> Morning, in Kemal for example, if I open a DB connection using: `@@db : DB::Database = DB.open "mysql://root:password@localhost/test"` and use it across my app, will this scale and pool correctly. The reason I ask is because I presume this only opens one connection, but if the traffic on my site is very large will it deal with the load? ⏎ Hope that makes sense :)
<FromGitter> <j8r> @drum445 you can use a connection pool, as described here https://github.com/crystal-lang/crystal-db/blob/master/spec/database_spec.cr#L6
<FromGitter> <j8r> there is also https://github.com/crystal-lang/crystal-db/blob/master/spec/pool_spec.cr, but haven't/don't how used it
<FromGitter> <drum445> ah nice, thanks. I guess I can keep that in mind if I run into problems. It looks like my way is using a pool just with the default values: http://crystal-lang.github.io/crystal-db/api/0.5.1/DB/Pool.html
medfly has joined #crystal-lang
<FromGitter> <drum445> `max_pool_size (default 0 = unlimited)` - perfect, so it should grow as it needs
<FromGitter> <j8r> anyway to be sure it will 'scale', the best is to benchmark your app
<FromGitter> <drum445> I've used siege on it, but that isn't a very good way I guess
moei has joined #crystal-lang
ashirase has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
<FromGitter> <straight-shoota> @Sija Is there a simple solution to disable raven sending reports when running specs? I tried with `SENTRY_DSN= crystal spec` which kind of works but raven complains about invalid URL when trying to send a message.
<FromGitter> <straight-shoota> Raven.cr (+ Sentry ofc) is really awesome btw. Helps a lot with identifying and solving errors.
<medfly> hi. what's the way to cross-compile crystal itself
<medfly> ?
* medfly would like to try to add a target
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
<FromGitter> <straight-shoota> It's essentially `make crystal FLAGS="--cross-compile --target <target_triple>"`
<FromGitter> <straight-shoota> And on `make deps` + linker command on the target system
<medfly> thanks. I'll give it a shot.
<FromGitter> <drum445> Yeah it uses pooling by default, DB/MySQL driver works great
<FromGitter> <straight-shoota> what target are you working on medfly?
<medfly> trying netbsd
hightower3 has quit [Ping timeout: 246 seconds]
lucasb has joined #crystal-lang
<FromGitter> <straight-shoota> Nice. I guess thatt shouldn't be too complicated
<FromGitter> <yxhuvud> how was it, do we have someone that has made freebsd support?
<FromGitter> <straight-shoota> @myfreeweb has provided most of the latest FreeBSD patches
<jokke> anyone here familiar with openssl? i'm trying to figure out what i need to do to create RSASSA-PKCS1-V1_5 signature
<jokke> s
<jokke> there's a shard openssl_ext
<jokke> but i'm not sure if OpenSSL::Pkey#sign uses that scheme for RSA keys
DmitryBochkarev has quit [Ping timeout: 246 seconds]
<FromGitter> <parruda> Hey guys, sorry to bother you with this, but I’ve been trying to get this to work for days and I was wondering if you could point me in the right direction. I am trying to create bindings for Libcap, and I am struggling to understand how this one should be done: ``` ⏎ typedef struct __user_cap_data_struct { ⏎ ⏎ ``` __u32 effective; ⏎ __u32 permitted; ⏎ __u32 inheritable;``` ⏎ ...
<FromGitter> <parruda> I am trying this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5caca63825686a7dc3009bb2]
<FromGitter> <parruda> how should that `__user ` and `*cap_user_data_t` be represented?
<jokke> that looks really strange to me
<jokke> usually you have typedef struct something { ... } something_else;
<jokke> and then see it being used as something_else
<FromGitter> <parruda> maybe I am lookng at the wrong place
<FromGitter> <parruda> yes I was
<FromGitter> <parruda> what about this one? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5caca8f6a0790b29c98a206a]
<FromGitter> <parruda> so that’s a pointer to a struct?
DmitryBochkarev has joined #crystal-lang
<jokke> yes
<jokke> it's weird to define it that way imho
<jokke> just use what you already wrote and everywhere you see cap_user_data_t being passed, pass a pointer of CapUserDataT
<jokke> but i'm not an expert in c bindings. i've written a few but this still looks weird to me.
<jokke> so it might or might not work
<jokke> but you should find out quickly :)
<jokke> hm i have a question about JSON::Serializable: is it somehow possible to pass any instance level data to a converter to use on to_json in addition to the value itself?
<FromGitter> <Blacksmoke16> mm, got an example?
<jokke> hmm yeah so i have basically a nested json structure where there's a serialized struct ReplaceExpression with getter replace : String. On to_json i would like it to replace the string that would be a template like "%{foo}" with some value that's only known at runtime
<jokke> i'd like to pass it a named tuple where it could then get the values to replace from
<jokke> does that make any sense?
<FromGitter> <straight-shoota> Hey everyone, don't forget to submit questions for tomorrow's Q&A session: https://docs.google.com/forms/d/e/1FAIpQLSftAsd9yLNYA7U9In0Hvitm6uHHE6WRu6VlvsY9lETn2iar3w/viewform?usp=send_form ⏎ Live questions will be possible as well, but sending them in beforehand helps us to prepare for answering them. Thanks =)
<FromGitter> <parruda> stupid question, but how do i read the value of a pointer?
<FromGitter> <straight-shoota> @parruda `pointer.value`?
DmitryBochkarev has quit [Remote host closed the connection]
DmitryBochkarev has joined #crystal-lang
<FromGitter> <Blacksmoke16> @jokke prob could use an overload of `to_json`?
<FromGitter> <Blacksmoke16> which could call the standard `to_json` then do like gsub?
<FromGitter> <parruda> Thank you, it works!
<FromGitter> <parruda> one more question: in C, cap_to_text returns a pointer to a string. ⏎ I got this definition: `fun cap_to_text(cap_p : CapT, length_p : Int32*) : LibC::Char*` ⏎ I read in the docs the `char` is represented as UInt8 in crystal. So how do I get the value of that string? When I puts `cap_to_text(…).value` it returns an integer
<FromGitter> <Sija> @straight-shoota Thanks, I'm happy to hear it! :) Regarding your issue, try setting `SENTRY_CURRENT_ENV=test` instead of `SENTRY_DSN`
coderobe has quit [Quit: '); DROP TABLE users;--]
<FromGitter> <Sija> ```Raven.configure do |config| ⏎ config.environments = %w(production ...) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5cacc261991e7423519aa790]
<FromGitter> <Sija> with `config.environments` set - that should ignore this specific env (`test`)
coderobe has joined #crystal-lang
<FromGitter> <straight-shoota> Yeah, that looks good
<FromGitter> <straight-shoota> I have already come up with `config.current_environment = "test"`. But an environment variable might be better
<FromGitter> <straight-shoota> Is it intended though that despite `configured not to capture errors`, every event is logged as `Sending event xxx to Sentry`?
<jokke> hmm
<jokke> why can't i assign Array(ClassIncludingA | OtherClassIncludingA) to an instance variable of the type Array(Foo | Bar | A)?
<FromGitter> <straight-shoota> jokke, because of variance
<jokke> mh
<jokke> so i have to .as() ?
<FromGitter> <straight-shoota> that won't work
<jokke> oh noes
<jokke> ah i need to map?
<FromGitter> <straight-shoota> you have to actually cast the array items `array.map {|item| item.as(Foo | Bar | A) }`
<jokke> yeah
<jokke> thought so
<jokke> i think i've ran into that once before
<FromGitter> <straight-shoota> Yeah, it happens a lot. This is probably the major shortcoming of the current generics specification.
coderobe has quit [Ping timeout: 245 seconds]
coderobe has joined #crystal-lang
medfly has quit [Quit: leaving]
medfly has joined #crystal-lang
rohitpaulk has joined #crystal-lang
applesaucy_ has quit [Quit: WeeChat 2.4]
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <taylorfinnell> Anyone know of a `XML::Serializable` shard, doesn't seem like one exists but maybe my googling is failing
DmitryBochkarev has quit [Ping timeout: 250 seconds]
<FromGitter> <Sija> @straight-shoota hmm, looks odd, I'd have to look into it
sz0 has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
<medfly> I seem to have trouble building crystal. what's the best bet for an OS that can build it?
<medfly> I
<medfly> I'm extremely not opinionated, I just hit a "give me this OS as an image" on a server hosting thingie
<medfly> my ubuntu 16.04 / 18.04 (?) builds both failed
<medfly> .build/all_spec: symbol lookup error: .build/all_spec: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE, version Pointer(T)::null:Pointer(Tuple(String, String))
<medfly> oh ,I'm still trying ubuntu 18.04, going to try 16.04 then.
<FromGitter> <mavu> I compiled crystal on debian stretch
<FromGitter> <mavu> But , just to be sure, you know that you don't have to compile it, right?
<FromGitter> <mavu> There are debian packages available, and I assume may others too?
lucasb has joined #crystal-lang
<medfly> I'll give debian stretch a shot
<FromGitter> <mavu> on debian, just follow this: https://crystal-lang.org/reference/installation/on_debian_and_ubuntu.html
hightower2 has joined #crystal-lang
<medfly> no luck with that either
<FromGitter> <mavu> what exactly are you doing?
<medfly> I wanted to add a new target. since that wasn't going well, I got the impression the first step I need to do is to build the latest source code before cross-building to the new target
<medfly> but that is failing. I'm running 'make; make spec' which sounds right based on the install instructions
<medfly> Using compiled compiler at `.build/crystal'
<medfly> .build/all_spec: symbol lookup error: .build/all_spec: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE, version spec/std/range_spec.cr:324
<medfly> .build/all_spec
<medfly> Makefile:86: recipe for target 'spec' failed
<medfly> make: *** [spec] Error 127
<FromGitter> <r00ster91> Don't you just want to compile the compiler? Why do you run the specs?
<medfly> I got the impression that's the right thing. so, just make to build it/?
<FromGitter> <r00ster91> `make` alone builds the compiler
<medfly> thanks
<FromGitter> <r00ster91> but `make spec` is for when you want to check that everything works. so that's probably what you want to the at the end
<FromGitter> <straight-shoota> The `undefined_symbol` error looks like you have an incompatible library version
<FromGitter> <straight-shoota> How did you install Crystal on the Ubuntu machine?
<medfly> curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash; apt-get update; apt-get install crystal
<medfly> more or less
<medfly> I guess it's the wrong llvm library
<medfly> they offer several
<medfly> yeah
<FromGitter> <straight-shoota> yup
<FromGitter> <straight-shoota> which Ubuntu and which llvm version are you on?
<medfly> crystal version says LLVM 4.0.0, llvm-config --version says 3.8.1
<FromGitter> <Blacksmoke16> @taylorfinnell not that i know of, could implement it yourself id youd want. wouldnt be *that* hard
<FromGitter> <Blacksmoke16> it gets tricky when you want to have a generic that that supports all use cases, but for a specific case like your app, would be pretty easy
<FromGitter> <straight-shoota> I don't think that's an issue. `crystal version` shows the LLVM version the compiler was built with
<FromGitter> <straight-shoota> It shouldn't matter what you have installed locally, unless you build the compiler (but you only did the specs)
<FromGitter> <taylorfinnell> Yea, @Blacksmoke16 the from_xml is pretty annoying for me at least
<FromGitter> <taylorfinnell> (But I am trying to keep it generic)
<FromGitter> <Blacksmoke16> yea for sure
<FromGitter> <Blacksmoke16> xml is a pita
<FromGitter> <straight-shoota> Oh, wait, `.build/all_spec` so you're building the compiler specs also
<FromGitter> <straight-shoota> Then it's depends on the installed llvm
<FromGitter> <straight-shoota> But AFAIK llvm 3.8.1 should be fine
medfly has quit [Ping timeout: 250 seconds]
hightower2 has quit [Ping timeout: 246 seconds]
moei has quit [Quit: Leaving...]
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
fullforce has joined #crystal-lang
<fullforce> hi