yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
unn4m3d has quit [Ping timeout: 260 seconds]
unn4m3d has joined #crystal-lang
unn4m3d has quit [Ping timeout: 240 seconds]
unn4m3d has joined #crystal-lang
<FromGitter>
<faustinoaq> Hey, I just reading something about Lua, and... how awesome lua language is 🎉 ⏎ ⏎ @veelenga Thank you for https://github.com/veelenga/lua.cr ! 😄
<FromGitter>
<bew> yeah, Lua is really cool, it's actually my 3rd best language after C & Crystal :P
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
<FromGitter>
<faustinoaq> Yeah 👍
<FromGitter>
<bew> off topic: @faustinoaq if you're on linux, there's a cool window manager written mostly in Lua https://awesomewm.org/ (to be exact, it's not a window manager, but a framework to write your own in Lua)
<FromGitter>
<bew> this is what I use since 3 years now, it's pretty cool to have full control over how the WM looks like & behave, all in Lua :)
<FromGitter>
<Blacksmoke16> heres a question for you
<FromGitter>
<Blacksmoke16> say i have an array of granite models, of two different types
<FromGitter>
<Blacksmoke16> when the array is of one model type i am able to call .to_h on it
<FromGitter>
<Blacksmoke16> however when trying it with mixed types i get a
<FromGitter>
<Blacksmoke16> `
<FromGitter>
<ezrast> @Blacksmoke16 The compiler considers unions of sibling types to be the same as the base type: https://carc.in/#/r/3sce
<FromGitter>
<ezrast> so you'll get that if any subclass of `Granite::ORM::Base` doesn't implement `#to_h`, even if you're not using that subclass
<FromGitter>
<Blacksmoke16> hmm ok, thanks for explaination
<FromGitter>
<ezrast> To be more accurate: sibling *classes*, not types. Else every union would just collapse to `Object`.
unn4m3d has quit [Ping timeout: 264 seconds]
unn4m3d has joined #crystal-lang
<FromGitter>
<Blacksmoke16> what would be the proper way to handle this?
<FromGitter>
<faustinoaq> @bew Oh, nice, Thank you for sharing! 😄
<FromGitter>
<bew> RX14 you around?
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 264 seconds]
<FromGitter>
<ezrast> @Blacksmoke16 You can split up the array or use `item.to_h if item.responds_to? :to_h`.
<FromGitter>
<Blacksmoke16> hero! thanks!
<FromGitter>
<Blacksmoke16> now i have a new question
<FromGitter>
<Blacksmoke16> why does that work since it would always be true in my case?
<FromGitter>
<Blacksmoke16> or is that just adding safety for the complier?
<FromGitter>
<ezrast> Just a safety thing. I can't tell you how `responds_to?` actually works though; looks like magic to me.
<FromGitter>
<Blacksmoke16> :P fair enough, makes sense thanks
<FromGitter>
<bew> RX14: 'was looking at https://github.com/crystal-lang/distribution-scripts/commit/bc320f21edb40622ec0e294995c8dc42e0e81f17 that you made to fix #5610, but I don't really understand how that fixes anything.. I don't really know how the distribution scripts works, so this is purely hypothetical: your fix changes a config option for building `libgc`, but when I install crystal (e.g in archlinux) with my package
<FromGitter>
... manager (with a package built by the distribution scripts right?), it doesn't install `libgc`, but rather rely on the archlinux's package `gc` that ships the `libgc` library. So how does your change fixes that issue? (or maybe it doesn't? Am I missing sth?)
straight-shoota has quit [Ping timeout: 264 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 256 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 256 seconds]
Papierkorb has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
<crystal-gh>
[crystal] carlhoerberg opened pull request #5880: Enqueue senders in Channel#close (master...enqueue-senders) https://git.io/vx2Vr
unn4m3d has quit [Ping timeout: 240 seconds]
<FromGitter>
<ArtLinkov> Groogy you here?
unn4m3d10 has quit [Ping timeout: 264 seconds]
unn4m3d10 has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
Groogy has quit [Disconnected by services]
Groogy_ is now known as GRoogy
GRoogy is now known as Groogy
<Groogy>
Yepp ArtLinkov
Groogy2 has joined #crystal-lang
<FromGitter>
<ArtLinkov> Went over the math, all in all it looks good. ⏎ But I wanna ask you more questions to try and understand the problem better. Let's move to a private chat so that we won't kill the guys with all the math :)
<FromGitter>
<ArtLinkov> *and gals (if there are any here)
<Groogy>
Oh eh then I'll have to get on Gitter I guess
<FromGitter>
<Groogy> There we go I guess
<FromGitter>
<Groogy> also thanks a lot for helping out
<FromGitter>
<bararchy> @Groogy you look like a metal fan :) ⏎ you like Opeth ?
<Groogy>
Haha no I am not a metal fan
<Groogy>
I listen to Jazz actually
<FromGitter>
<bararchy> that's cool :)
<wuehlmaus>
or the combination of Jazz and Metal, early Brecker Brothers :)
straight-shoota has joined #crystal-lang
shalmezad has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<FromGitter>
<fridgerator> Opeth is good
<FromGitter>
<bararchy> @fridgerator a man after my own heart ;)
<FromGitter>
<plainas> Can I not create an empty array of Any type?
<FromGitter>
<plainas> myarray = [] of Any <--- this is not valid code
<FromGitter>
<bararchy> no
<FromGitter>
<bararchy> you can't :)
<FromGitter>
<bararchy> that's the whole point in type system
<FromGitter>
<bararchy> haha
duane has quit [Ping timeout: 264 seconds]
<FromGitter>
<bararchy> or do Array(Object | Int | Float | String | Char).new`
<FromGitter>
<bararchy> lol
<Groogy>
you can also do it with a intermediary glue struct/object
<Groogy>
but yeah what are you trying to do?
<FromGitter>
<plainas> I am parsing arbitrairy JSON, I solved the problem with JSON::Any. I am porting a nodejs app line by line, I'll narrow the type down after I get it to work.
<FromGitter>
<plainas> I agree that such need is usually a symptom of poor design. There isn't much point into parsing something not knowing what to look for.
duane has joined #crystal-lang
heaven31415 has joined #crystal-lang
guilleiguaran has joined #crystal-lang
<FromGitter>
<plainas> Ok, another silly question... I don't wrap my code in a module nor a class. What is the easiest way to make a variable accessible in the scope of that file? Like, side effected from inside functions
duane has quit [Ping timeout: 252 seconds]
<FromGitter>
<j8r> that's bad, shame! :)
<FromGitter>
<j8r> create at least a struct, and have a `@myvar : String`
duane has joined #crystal-lang
<FromGitter>
<j8r> or you can use a constant to be very global across your program, `MYVAR = "some string"`
<FromGitter>
<j8r> the good practice is to have a file for each Class/Method or even method of a Class or a Method, if your code is big
<FromGitter>
<plainas> It's just that it is an unecessary construct to throw a script together
<FromGitter>
<plainas> I am checking the documentation, does a source file create a scope? Is there anything like in python where a file is a module by default?
<FromGitter>
<plainas> like this?
<FromGitter>
<plainas> ``````
<FromGitter>
<j8r> no, a file has no particular feature
<RX14>
@plainas you can have constants at the top level but not variables
<RX14>
you have to do something like
<FromGitter>
<j8r> but you can have methods that return a variable!
<RX14>
module MyScript; class_property foo : Sting; end
<RX14>
and then MyScript.foo =
<RX14>
ok you can have variables at the top level but you can't use those variables in methods
heaven31415 has quit [Ping timeout: 256 seconds]
straight-shoota has joined #crystal-lang
salvor has quit [Ping timeout: 240 seconds]
salvor has joined #crystal-lang
salvor has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
<FromGitter>
<j8r> yes @plainas, the best is to use a Class or Struct (if you don't handle lots of data)
<FromGitter>
<j8r> this way you can do fine grained tuning of the scopes
<yxhuvud>
is it worth the trouble supporting anything less than windows 10?
<RX14>
yes
<shalmezad>
Depends on the field. If you're in medical you already know the answer as you grumble about having to spin up your windows XP VM.
<RX14>
very much yes
<RX14>
whats the point in supporting windows 10 only
<yxhuvud>
because everything else is old as heck?
<RX14>
OK sure if you decide to drop support for unsupported windows releases
<yxhuvud>
and declining
<RX14>
thats at least understandable
<RX14>
but windows 7 will get support for many years
<RX14>
so will 8 and 8.1
<RX14>
I booted up windows 95 on a 486 yesterday
<RX14>
it'd be cool to support that
<shalmezad>
Windows 7 until 2020, windows 8 until 2023 for extended support.
<RX14>
a whole 8MiB of ram
<FromGitter>
<mlobl> I've done some consulting for Deutsche Bank in the past, and they just recently migrated from Lotus Notes lol. Many business will be stuck in the past for decades
<yxhuvud>
note that mainstream support is ended for both windows 7 and 8, and generally speaking the systems running longer won't get new fancy languages installed on them anyhow.
<yxhuvud>
because they are changed as little as possible because it is hell to maintain it
<That_Guy_Anon>
i wonder in how many years the banking system ditches its last xp machine
<heaven31415>
is machine with windows 10 more secure than with xp?
unn4m3d10 has quit [Read error: Connection reset by peer]
unn4m3d10 has joined #crystal-lang
greenbigfrog has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
greenbigfrog has joined #crystal-lang
straight-shoota has quit [Ping timeout: 260 seconds]
<RX14>
i'd never put an XP machine outside an air gap
straight-shoota has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 264 seconds]
unn4m3d10 has joined #crystal-lang
straight-shoota has quit [Ping timeout: 276 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 248 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 256 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 276 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<FromGitter>
<bararchy> RX14 I've seen XP servers open to the world as RDP points
<FromGitter>
<bararchy> My eyes watered that day
<RX14>
oh i'm under no illusions that people are completely ignoring my idea of sanity
<RX14>
there's plenty of XP boxes out there
<RX14>
but I wouldn't recommend that
<FromGitter>
<j8r> they can act as very sweet honey pots
raz has quit [Ping timeout: 252 seconds]
raz has joined #crystal-lang
raz has joined #crystal-lang
raz has quit [Changing host]
heaven31415 has quit [Ping timeout: 246 seconds]
straight-shoota has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
t0nyandre is now known as t0nyaway
<FromGitter>
<Jens0512> If a PR with changes to the Makefile comes in, if im not already there, i’d love to do a review.
<FromGitter>
<Jens0512> Just saying 👀
<FromGitter>
<Jens0512> So, i’d be happy if someone pinged me. But I’ll try to stay on the lookout myself...
<FromGitter>
<sdogruyol> so you are Makefile guru @Jens0512 👍
<FromGitter>
<bew> you can simply watch the crystal repository, so you can be notified anytime there is something happening, if you only care about issues/PRs about the Makefile (no idea why, but eh why not!) you can unsubscribe from every other things you don't want to follow :)
candle_ has joined #crystal-lang
heaven31415 has joined #crystal-lang
tilpner has quit [Remote host closed the connection]
tilpner has joined #crystal-lang
<FromGitter>
<Jens0512> I love Makefiles yes. I used to watch the repo, but my email got pretty flooded. :D
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
Groogy_ has joined #crystal-lang
<FromGitter>
<bararchy> I'm hacing hell of a time to get circleci working on my private repo :\
<FromGitter>
<bararchy> can I somehow tell circleci to use the repos Dockerfile ?
<FromGitter>
<wrq> there is a weird space getting in there
<FromGitter>
<bew> so it's not recognized as a space
<FromGitter>
<wrq> that space after the quote in your example is U+00A0
<FromGitter>
<wrq> a nbsp space
<FromGitter>
<bew> ok, the ascii value of a space is 32, your spaces are 160
<FromGitter>
<wrq> not whitespace because its not there
<FromGitter>
<yorci> so how can i remove it?
<FromGitter>
<wrq> are you on a machine with an odd locale? your OS might be changing the space from your keyboard into a different character
<FromGitter>
<wrq> I'm not really sure
<FromGitter>
<yorci> no no, that string came from html source code of a website
<FromGitter>
<wrq> OH, ok
<FromGitter>
<wrq> so in that case, if you're scraping strings like that, you will need to use regex or get dirty and do it manually, but you'll need to sanitize your strings and remove unnecessary characters like that
straight-shoota has quit [Ping timeout: 256 seconds]
<FromGitter>
<wrq> that shows those troublesome characters, and the Char class has some different methods to check out, depending on whatever exactly you're doing
<FromGitter>
<drosehn> wrt windows, check: https://en.wikipedia.org/wiki/Usage_share_of_operating_systems ⏎ and you'll see that there are probably more machines running Windows7 than running Windows10 (which matches my own experience). caveat: The last data point in that chart is March 2017, and here we are in March 2018. But I'm still confident that supporting Windows 7+8 is worth the extra effort over supporting Windows10.
<FromGitter>
<drosehn> I'm kinda surprised that I haven't hit that before. (that's true in ruby, too. not specific to crystal)
<FromGitter>
<bew> `By default, characters whose code points are greater than 127 never match \d, \s, or \w, and always match \D, \S, and \W, although this may vary for characters in the range 128-255 when locale-specific matching is happening. These escape sequences retain their original meanings from before Unicode support was available, mainly for efficiency reasons. If PCRE is compiled with Unicode property support, and the
<FromGitter>
... PCRE_UCP option is set, the behaviour is changed so that Unicode properties are used to determine character types`
<crystal-gh>
[crystal] Sija opened pull request #5882: Use Char for single char strings (master...use-char-for-single-char-strings) https://git.io/vxa7D
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 260 seconds]
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 240 seconds]
guilleiguaran has quit [Quit: Connection closed for inactivity]
unn4m3d has joined #crystal-lang
unn4m3d11 has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
unn4m3d11 has quit [Read error: Connection reset by peer]
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d10 has quit [Ping timeout: 240 seconds]
unn4m3d has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 256 seconds]
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Ping timeout: 240 seconds]
<oprypin>
drosehn, basically your distro should compile PCRE with Unicode support