sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter>
<Blacksmoke16> is there a good way to support a method like `def foo(value, flag = false)` that delegates to `def foo(*values, flag = false)` without causing infinite recursion?
<FromGitter>
<Blacksmoke16> like use the first if only 1 input, use the other for more than 1?
<FromGitter>
<elementio:salt-rock-lamp.ems.host> What about `foo(val1, val2, *vals)`, if you want to use multiple dispatch like that
<FromGitter>
<elementio:salt-rock-lamp.ems.host> In other languages I'd have 2 separate functions, or rely on higher order functions to "pack" or "unpack" the positional parameters as needed
<FromGitter>
<Blacksmoke16> ended up with just making it 1 function with splat, and just require you used a named arg for the flag value
<FromGitter>
<Blacksmoke16> lol this is a first `Error: do you maybe have a typo in this 'intiailize' method?`
<FromGitter>
<Blacksmoke16> but it was correct :P
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
andremedeiros has quit [Client Quit]
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 260 seconds]
<FromGitter>
<rishavs> Is there a way to limit the max request size in an http server? I was wondering if this can be a possible DOS vector.
hendursaga has joined #crystal-lang
hendursa1 has quit [Ping timeout: 240 seconds]
_ht has joined #crystal-lang
<FromGitter>
<oprypin:matrix.org> @rishavs: put it behind nginx anyway
<FromGitter>
<rishavs> you are right sir. I am being an idiot today. lol. I guess I need more coffee....
Nekka has quit [Quit: zzz]
Nekka has joined #crystal-lang
Nekka has quit [Client Quit]
Nekka has joined #crystal-lang
Nekka has quit [Ping timeout: 252 seconds]
Nekka has joined #crystal-lang
mipmip has joined #crystal-lang
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 246 seconds]
postmodern has joined #crystal-lang
mipmip has quit [Ping timeout: 245 seconds]
mipmip has joined #crystal-lang
<FromGitter>
<Sija> Hi all, I have a Crystal-oriented post to review for anyone interested - https://sija.pl/en/notes/crystal-docset-for-dash-app π Any criticism or comments are more than welcome, thanks! :)
<FromGitter>
<tenebrousedge> @Sija looks good to me π
<FromGitter>
<Sija> @tenebrousedge thanks for the feedback πββοΈ
mipmip has quit [Ping timeout: 252 seconds]
<straight-shoota>
@Sija Do you realize the API docs are available as a targz for every release? There's really no need to crawl the website for that
<FromGitter>
<tenebrousedge> huh, I didn't take a look at the scripts
<FromGitter>
<Sija> @straight-shoota I do, but that was easier :P
<straight-shoota>
How so?
<FromGitter>
<Sija> And `/reference/` still needs to be dl-ed
<FromGitter>
... U+F900-U+FAFF, U+FE10-U+FE19, U+FE30-U+FE52, U+FE54-U+FE66, U+FE68-U+FE6B, U+FF01-U+FF60, U+FFE0-U+FFE6, U+1B000-U+1B001, U+1F200-U+1F202, U+1F210-U+1F23A, U+1F240-U+1F248, U+1F250-U+1F251, U+20000-U+2FFFD, U+30000-U+3FFFD. All other characters are halfwidth characters.
mipmip has quit [Ping timeout: 245 seconds]
<FromGitter>
<Blacksmoke16> yup, sounds right ^
<FromGitter>
<Blacksmoke16> so this is prob something like `for each char in a string reduce the size, adding 1 for halfwidth and 2 if the char is in this list of fullwidth`
<straight-shoota>
yeah
<FromGitter>
<tenebrousedge> yes, but visual width is probably a different property
<FromGitter>
<oprypin:matrix.org> @Blacksmoke16: so we have figured out what that php function does. but what functionality are you actually looking for?
<FromGitter>
<Blacksmoke16> porting some PHP code and it was using that
<straight-shoota>
The only use case I can think of is when you want to calculate the width of a string in a monospaced font. Usually that's just the number of characters. But full-width chracters are are two characters wide.
<straight-shoota>
Then there's still zero-width charachters, though
<straight-shoota>
What purpose does it have in the PHP code you're porting?
<FromGitter>
<tenebrousedge> it's probably incorrect in that code
<straight-shoota>
I'd bet on that, too ^^
<FromGitter>
<oprypin:matrix.org> same
<FromGitter>
<Blacksmoke16> ```code paste, see link``` β β is for some CLI stuff so i assume they're using it to know how to build the CLI elements so everything is even no matter the chars used [https://gitter.im/crystal-lang/crystal?at=60846a16ae90f368409f883b]
<FromGitter>
<tenebrousedge> unless a character is zero width or an em dash or...
<straight-shoota>
okay, that sounds a lot like the use case I came up with
<FromGitter>
<oprypin:matrix.org> i think that it misses more cases than it satisfies. so just don't bother and use .size
<postmodern>
if you want to define an interface that accepts any object which defines a certain method (ex: each_byte(&)), is that possible or do you leave the type definition blank and let the compiler handle things?
<straight-shoota>
let the compiler handle things
<FromGitter>
<oprypin:matrix.org> postmodern, yea just leave it blank
<FromGitter>
<oprypin:matrix.org> wait.. not sure we both meant it the same way
<FromGitter>
<oprypin:matrix.org> leave the type restriction black
<FromGitter>
<oprypin:matrix.org> blank*
<FromGitter>
<oprypin:matrix.org> no interface
<FromGitter>
<Blacksmoke16> on a related note, i need to fix my fonts all i see are boxes :S
<oprypin>
Blacksmoke16, install noto-fonts
<FromGitter>
<Blacksmoke16> i imagine its just not that simple, didnt seem to help?
<FromGitter>
<oprypin:matrix.org> maybe not enough things were restarted and/or caches flushed
<FromGitter>
<Blacksmoke16> think i need to add them to X11 or something sec
<FromGitter>
<oprypin:matrix.org> uh i think X11 does not participate in font rendering
<FromGitter>
<tenebrousedge> fontconfig is probably a thing
<FromGitter>
<Blacksmoke16> :shrug: wiki said you need to added via a `FontPath` entry in xorg.conf
<FromGitter>
<Blacksmoke16> it needed to be*
<FromGitter>
<tenebrousedge> anything mentioning `xorg.conf` is likely outdated
<FromGitter>
<oprypin:matrix.org> @Blacksmoke16: that is wrong or is done for some other purpose
<FromGitter>
<Blacksmoke16> ah it was under the "manual install" instructions
<FromGitter>
<Blacksmoke16> anyway i rebooted as well, will see if i still notice them
<FromGitter>
<Blacksmoke16> and yea prob just going to use `.size` and worry about it if/when it becomes an issue
<FromGitter>
<Sija> @straight-shoota It finally clicked why did I before ignore the docs tar file - it complicates the flow for the `master` docs
<FromGitter>
<oprypin:matrix.org> @Sija: i wouldn't choose to even download the docs like that, would rather build them
<FromGitter>
<Sija> yeah, I thought of that but seemed like an overkill
<FromGitter>
<BracketMaster> currently checking out crystal - does superator work in crystal?
<FromGitter>
<BracketMaster> or really - any way to do custom operators?
<FromGitter>
<Blacksmoke16> idk what that is so im going to go with no
<straight-shoota>
but that only runs via rosetta, not on the M1, right? You still need to cross-compile for that.
<straight-shoota>
*natively on the M1
<jhass>
yeah, it runs everything through rosetta
<jhass>
but one barely notices
DTZUZU has quit [*.net *.split]
xybre has quit [*.net *.split]
straight-shoota has quit [*.net *.split]
markmarkmark has quit [*.net *.split]
Nekka has quit [*.net *.split]
bougyman has quit [*.net *.split]
repo has quit [*.net *.split]
hendursaga has quit [*.net *.split]
deavmi has quit [*.net *.split]
chachasmooth has quit [*.net *.split]
Vexatos has quit [*.net *.split]
avane has quit [*.net *.split]
richbridger has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
r0bby has quit [*.net *.split]
duane has quit [*.net *.split]
Stephanie has quit [*.net *.split]
maxpowa has quit [*.net *.split]
Seich has quit [*.net *.split]
Xeago has quit [*.net *.split]
fifr` has quit [*.net *.split]
sorcus has quit [*.net *.split]
Flipez has quit [*.net *.split]
astronavt has quit [*.net *.split]
oz has quit [*.net *.split]
early has quit [*.net *.split]
badeball has quit [*.net *.split]
johnny101 has quit [*.net *.split]
DTZUZU has joined #crystal-lang
xybre has joined #crystal-lang
bougyman has joined #crystal-lang
straight-shoota has joined #crystal-lang
markmarkmark has joined #crystal-lang
repo has joined #crystal-lang
Nekka has joined #crystal-lang
hendursaga has joined #crystal-lang
early has joined #crystal-lang
johnny101 has joined #crystal-lang
badeball has joined #crystal-lang
entel has quit [Ping timeout: 261 seconds]
Flipez has joined #crystal-lang
oz has joined #crystal-lang
astronavt has joined #crystal-lang
sorcus has joined #crystal-lang
Stephanie has joined #crystal-lang
duane has joined #crystal-lang
Seich has joined #crystal-lang
maxpowa has joined #crystal-lang
fifr` has joined #crystal-lang
Xeago has joined #crystal-lang
astronavt has quit [Max SendQ exceeded]
libneko[m] has quit [Ping timeout: 258 seconds]
ProjectEpsilon has quit [Ping timeout: 258 seconds]
Liothen has quit [Ping timeout: 245 seconds]
chachasmooth has joined #crystal-lang
deavmi has joined #crystal-lang
avane has joined #crystal-lang
Vexatos has joined #crystal-lang
Vexatos has quit [Quit: ZNC Quit]
deavmi has quit [Ping timeout: 260 seconds]
<FromGitter>
<BracketMaster> its definitely slower
<FromGitter>
<BracketMaster> But I'm assuming M1 support is planned?
<straight-shoota>
It's technically already supported. But there is an unrelated issue with LLVM 11 which prevents upgrading.
astronavt has joined #crystal-lang
deavmi has joined #crystal-lang
dostoyevsky has joined #crystal-lang
<FromGitter>
<BracketMaster> well - I tried building it - I had to use Crystalx86 include in crystal sources - and it complained about linking arm64 code to x86 code