ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
unn4m3d has quit [Ping timeout: 240 seconds]
unn4m3d has joined #crystal-lang
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> data = [ ⏎ Item.new(type_id: 123.to_i64, type_name: "Rhea"), ⏎ Courier.new(contract_id: 12312312.to_i64, reward: 50000), ⏎ Item.new(type_id: 666.to_i64, type_name: "Ark"), ⏎ Item.new(type_id: 99.to_i64, type_name: "Anshar"), ... [https://gitter.im/crystal-lang/crystal?at=5abaf85a35dd17022ea9934b]
<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?)
<DeBot> https://github.com/crystal-lang/crystal/issues/5610 (Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS when allocating many sets)
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter> <ezrast> Like what is going on here? Does `responds_to?` just get to break the rules? https://carc.in/#/r/3scl
yxhuvud has joined #crystal-lang
<FromGitter> <bew> wow that's fun
<FromGitter> <Blacksmoke16> ✨
<FromGitter> <unn4m3d> 👀
ashirase has quit [Ping timeout: 240 seconds]
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Read error: Connection reset by peer]
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
unn4m3d11 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 240 seconds]
unn4m3d10 has quit [Ping timeout: 248 seconds]
duane has quit [Ping timeout: 240 seconds]
duane has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 263 seconds]
That_Guy_Anon has joined #crystal-lang
<FromGitter> <bararchy> @bew I think it fixes it for the omnibus compiler ?
alex`` has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
greenbigfrog has quit [Ping timeout: 265 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
raz has quit [Ping timeout: 265 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
raz has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
commavir has quit [Ping timeout: 246 seconds]
snsei has quit [Remote host closed the connection]
unn4m3d has joined #crystal-lang
unn4m3d11 has quit [Read error: Connection reset by peer]
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
commavir has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d10 has quit [Ping timeout: 264 seconds]
unn4m3d has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
flaviodesousa has joined #crystal-lang
<FromGitter> <Qwerp-Derp> Hello everyone, I made a start to converting the existing libui binding to an OOP library: https://github.com/Qwerp-Derp/icosahedron
<FromGitter> <Qwerp-Derp> If anyone's interested in contributing then don't hesitate to make a PR
<FromGitter> <unn4m3d> 👍
<FromGitter> <bararchy> @Qwerp-Derp sounds interesting, what is your roadmap\goal with this project ?
<FromGitter> <Qwerp-Derp> @bararchy To hopefully convert all of the C calls in the library to a Crystal-ic, OOP fashion
<FromGitter> <Qwerp-Derp> right now I'm working bit by bit to convert the provided controlgallery from C calls to OOP
<FromGitter> <bararchy> cool :) good luck dude. ⏎ When you get some work in and it starts to take shape I'll see where I can help
<FromGitter> <Qwerp-Derp> Thanks :D
straight-shoota has quit [Read error: Connection reset by peer]
<FromGitter> <Qwerp-Derp> How do I cast Int32 to LibC::Int?
straight-shoota has joined #crystal-lang
<FromGitter> <bararchy> 1) as(LibC::Int) ?
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<FromGitter> <bararchy> > 4.as(LibC::Int)
<FromGitter> <Qwerp-Derp> Nevermind, I forgot to type Void* instead of Void
<crystal-gh> [crystal] jhass closed pull request #5878: Fix typo in IO doc (master...patch-1) https://git.io/vxgoA
straight-shoota has quit [Ping timeout: 260 seconds]
straight-shoota has joined #crystal-lang
remix2000 has quit [Quit: milk]
straight-shoota has quit [Ping timeout: 264 seconds]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 260 seconds]
straight-shoota has joined #crystal-lang
Guest1156 has quit [Read error: Connection reset by peer]
Guest1156 has joined #crystal-lang
guilleiguaran has quit [Quit: Connection closed for inactivity]
<travis-ci> crystal-lang/crystal#bc1c7a9 (master - Fix typo in IO doc): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/359243626
<FromGitter> <bew> Huh @Qwerp-Derp no need to cast, it's the same thing
straight-shoota has quit [Ping timeout: 276 seconds]
straight-shoota has joined #crystal-lang
<RX14> @bew if you're using arch's libgc then it doesn't fix it
<RX14> go do a bug report on arch to ask them to add the flag :)
straight-shoota has quit [Ping timeout: 240 seconds]
<wuehlmaus> how do i use a loop going from 100 to 1 by 2 ? i know downto but it does not provide a step other than 1, right?
<jsn-> #step ?
<wuehlmaus> oh yes, thanks
<wuehlmaus> i was just using downto analogue to upto
<FromGitter> <CaDs> 1) step(to: 0, by: -2)... ⏎ https://play.crystal-lang.org/#/r/3se7
<wuehlmaus> ad missed a step
<wuehlmaus> s/ad/and/
straight-shoota has joined #crystal-lang
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 ;)
return0e has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vx2DK
<crystal-gh> crystal/master 400bd0e Mark: Documentation: Add API docs for Array sorting methods (#5637)...
unn4m3d10 has quit [Ping timeout: 240 seconds]
unn4m3d10 has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#400bd0e (master - Documentation: Add API docs for Array sorting methods (#5637)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/359346505
<DeBot> https://github.com/crystal-lang/crystal/pull/5637 (Documentation: Add API docs for Array sorting methods)
<FromGitter> <bararchy> Can circleci build from Dockerfile in the repo and use that for tests ?
benharri has quit [Quit: The Lounge - https://thelounge.github.io]
benharri has joined #crystal-lang
<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
asterite has quit [Ping timeout: 240 seconds]
asterite has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vxaJH
<crystal-gh> crystal/master 0970ee9 Benoit de Chezelles: Fix exit in at_exit handlers (#5413)...
straight-shoota has quit [Read error: Connection reset by peer]
tliff has quit [Ping timeout: 240 seconds]
tliff has joined #crystal-lang
straight-shoota has joined #crystal-lang
<FromGitter> <PlayLights_twitter> Looks like windows has added support for AF_UNIX sockets
return0e has joined #crystal-lang
commavir has quit [Ping timeout: 276 seconds]
commavir has joined #crystal-lang
<RX14> yay
<RX14> but
<RX14> only windows 10
<RX14> and probably not even in a mainline release yet
<RX14> :(
heaven31415 has joined #crystal-lang
benharri has quit [Quit: The Lounge - https://thelounge.github.io]
benharri has joined #crystal-lang
greenbigfrog has joined #crystal-lang
<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?
<yxhuvud> Generally speaking, yes.
<travis-ci> crystal-lang/crystal#0970ee9 (master - Fix exit in at_exit handlers (#5413)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/359408328
<DeBot> https://github.com/crystal-lang/crystal/pull/5413 (Fix exit in at_exit handlers)
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 ?
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
<crystal-gh> [crystal] kostya opened pull request #5881: Spec: add expectations starts_with, ends_with (master...add_spec_starts_with) https://git.io/vxaaw
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
straight-shoota has quit [Read error: No route to host]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Read error: Connection reset by peer]
straight-shoota has joined #crystal-lang
return0e has quit [Read error: No route to host]
<FromGitter> <yorci> https://play.crystal-lang.org/#/r/3sgo ⏎ ⏎ is it normal? what can i do for removing whitespace like in that string?
candle_ has quit [Remote host closed the connection]
straight-shoota has quit [Ping timeout: 268 seconds]
alex`` has quit [Quit: WeeChat 2.1]
straight-shoota has joined #crystal-lang
straight-shoota has quit [Ping timeout: 260 seconds]
straight-shoota has joined #crystal-lang
<FromGitter> <bew> that's weird, it works well on my computer with the same crystal version though
<FromGitter> <wrq> seems to be anomaly with crystal playground? or maybe how pp is working there?
<FromGitter> <wrq> idk, awfully weird
<FromGitter> <bew> https://carc.in/#/r/3sh3
<FromGitter> <bew> @yorci it works well with carc.in
<FromGitter> <bew> so there's a problem with https://play.crystal-lang.org ...
<FromGitter> <yorci> i think its about my string
<FromGitter> <yorci> bcuz i edited ur working examples with my string
<FromGitter> <yorci> not working anymore
<FromGitter> <wrq> is your whitespace some special unicode?
<FromGitter> <yorci> i dont know
<FromGitter> <wrq> what if you retype one of the examples?
<FromGitter> <yorci> not working anymore, whitespace still there if retyped
<FromGitter> <wrq> that is very strange
<FromGitter> <yorci> https://carc.in/#/r/3sh6
<FromGitter> <yorci> @bew its ur example
<FromGitter> <yorci> @wrq and thats urs ⏎ ⏎ https://play.crystal-lang.org/#/r/3sh7
<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]
straight-shoota has joined #crystal-lang
<FromGitter> <wrq> https://carc.in/#/r/3she
<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.
rohitpaulk has quit [Ping timeout: 264 seconds]
<FromGitter> <yorci> https://carc.in/#/r/3sho
<FromGitter> <yorci> weird problem, weird solution :D
<FromGitter> <wrq> good work!
<FromGitter> <yorci> https://carc.in/#/r/3shr
<FromGitter> <yorci> that looks way better
<FromGitter> <bew> you can simply use `delete` https://carc.in/#/r/3shs
<FromGitter> <orbital-harmonix> Help me code galactic GPS. https://youtu.be/w2re4uv-z1U
<FromGitter> <yorci> @bew Thank you!
t0nyaway is now known as t0nyandre
duane has quit [Ping timeout: 256 seconds]
shalmezad has quit [Quit: Leaving]
duane has joined #crystal-lang
<FromGitter> <drosehn> Hmm. Interesting. Apparently this doesn't work: .gsub( /\s/, "")
<FromGitter> <drosehn> so a non-breaking space is not matched by \s
<FromGitter> <bew> ah yes, that's unicode stuff, `\s` probably just matches ascii whitespaces
<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`
benharri has quit [Quit: The Lounge - https://thelounge.github.io]
benharri has joined #crystal-lang
benharri has quit [Client Quit]
benharri has joined #crystal-lang
<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
<oprypin> >> "\u{a0}".gsub(/\s/, "a")
<DeBot> oprypin: # => " " - https://carc.in/#/r/3sir
<oprypin> huh
<oprypin> works in Python, `import re; re.sub(r'\s', 'a', '\xa0') == 'a'`
<oprypin> >> "\u{a0}".gsub(/(*UCP)\s/, "a")
<DeBot> oprypin: # => "a" - https://carc.in/#/r/3sis
<oprypin> :|
<FromGitter> <bew> that's cool
unn4m3d10 has joined #crystal-lang
hightower3 has joined #crystal-lang
unn4m3d11 has joined #crystal-lang
unn4m3d has quit [Ping timeout: 260 seconds]
unn4m3d11 has quit [Read error: Connection reset by peer]
unn4m3d11 has joined #crystal-lang
hightower2 has quit [Ping timeout: 264 seconds]
unn4m3d10 has quit [Ping timeout: 264 seconds]
unn4m3d11 has quit [Ping timeout: 240 seconds]
unn4m3d11 has joined #crystal-lang
unn4m3d has joined #crystal-lang
unn4m3d11 has quit [Read error: Connection reset by peer]
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
unn4m3d10 has quit [Read error: Connection reset by peer]
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang
unn4m3d10 has joined #crystal-lang
unn4m3d has quit [Read error: Connection reset by peer]
unn4m3d has joined #crystal-lang