Guest21319 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest66362
Guest66362 has quit [Client Quit]
vivus has quit [Quit: Leaving]
<hightower2>
When signature do I use if I have def func( *arg), and I need a type of that 'arg'
<hightower2>
s/When/What/g
l0ra has joined #crystal-lang
<FromGitter>
<MrSorcus> > **<hightower2>** When signature do I use if I have def func( *arg), and I need a type of that 'arg' ⏎ ⏎ This? ⏎ ⏎ ```def foo(*args : Int32) ⏎ puts "#{args}" ⏎ end ⏎ ⏎ foo(1, 2, 3)``` [https://gitter.im/crystal-lang/crystal?at=5a1b60b7ffa3e37919c2a2dc]
l0ra has quit [Ping timeout: 255 seconds]
<hightower2>
mrsorcus: right, but I don't know in advance theyll be Int32
<hightower2>
I need something generic/any type
<FromGitter>
<johnjansen> @hightower surely you can narrow the list a little
<hightower2>
That's a "can't do/doesn't help" answer to both suggestions, but thanks for the discussion. I'll leave this particular point unimplemented for no
<hightower2>
now*
l0ra has joined #crystal-lang
<FromGitter>
<johnjansen> @hightower2 my point is more pragmatic, if you want a method that acts on inputs, but the inputs are never the same type then you cant act on them anyway … if you know that when the method gets some types then it can do one thing, and with other types it can do something else, then the other approach is to implement the method with different / appropriate signatures … this totally works, although the
<FromGitter>
... sensibility of using it is questionable
<FromGitter>
<MrSorcus> Try to install package openssl and insert `require "openssl"` to your source file. And compile it. Compiler must find it with ldd (or ld, i don't remember) automatically.
snsei has quit [Remote host closed the connection]
daemonwrangler has joined #crystal-lang
<FromGitter>
<backpackid> Well I had openssl installed at the time I installed crystal. Maybe its my code but I'm getting a SSL_ACCEPT error every time I try to accept a client. Referring to the flag about openssl. https://gist.github.com/backpackid/79db0a8bddbda3108af8003d5817f8fe
<FromGitter>
<backpackid> I'm using curl with -k and --proxy-insecure
<FromGitter>
<Qwerp-Derp> Crystal screams at me, I thought `unless x.nil?` does proper type-checking for nil in the unless block
<Groogy>
the instance variable is not guaranteed to not be nil
<Groogy>
do bar = @bar in the unless
<FromGitter>
<Qwerp-Derp> Wait, it's because `@bar` can be changed in the `unless` block to be a nil value, right?
<Groogy>
yeah
<FromGitter>
<Qwerp-Derp> Ah
<Groogy>
if you call a member method on Foo, suddenly you don't know what @bar is again
<FromGitter>
<Qwerp-Derp> Still, it's pretty annoying to deal with, I have to sprinkle `.not_nil!` everywhere I reference a `@bar`
<FromGitter>
<Qwerp-Derp> And in most of my classes I don't put things like `@bar` in initialization methods, so I can't even change the value to non-nilable because of that
<Papierkorb_>
I can only repeat: If what you do feels bad, it's because it is bad.
<Papierkorb_>
If your classes have all-nilable instance variables, that's a huge sign for poor code design
<Papierkorb_>
Nothing wrong with Crystal, infact, this is a good thing for it to do.
<FromGitter>
<Qwerp-Derp> Hmmm, true
<FromGitter>
<Qwerp-Derp> If I have a class which has some optional fields, is it better to just separate those optional fields out into mandatory fields in a new class?
<Papierkorb_>
Nothing wrong with "optional fields". But how you word it sounds like your classes are too big.
snsei has joined #crystal-lang
<Papierkorb_>
If you have a big amount of nilables, that's poor design. That's a sign for incorrectly modeled classes
snsei_ has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Read error: Connection reset by peer]
<FromGitter>
<bew> Maybe you didnt declared struct foo?
<Papierkorb_>
RX14: You know why
<RX14>
not really
<Papierkorb_>
bew, `foo *foo` gives you an instance of `foo*`, named `foo`. Now there's a collision: `foo` as in `struct foo` in the global scope, and `foo` in the local scope.
<Papierkorb_>
When resolving, local scope wins
<Papierkorb_>
And `foo` of type `struct foo*` can't be instantiated
rohitpaulk has joined #crystal-lang
<Papierkorb_>
It's kinda like doing `foo = String; foo = foo.new; foo.new` in Ruby
<Papierkorb_>
R
<Papierkorb_>
RX14:
<RX14>
but we're defining a variable and using a type
<RX14>
is C really that dumb
<Papierkorb_>
Symbols live in a shared space
<Papierkorb_>
Which is why some projects prefer to use `struct X` over `typedef X`, or use `typedef X_t`
<RX14>
hmm thats annoying
<RX14>
but I see now
<Papierkorb_>
If that's dumb? No idea. It's more funny as now a C lexer and/or the parser has to take scope into account to correctly build the token stream or the AST lul
<Papierkorb_>
Hey RX14, what's this? `foo * bar`
<Papierkorb_>
Is that a statement giving you a bar of foo*, or a multiplication?
<Papierkorb_>
Answer is: Who knows?!
<RX14>
lol
<Papierkorb_>
Why's there no JS event fired when you removeChild() a node -.-;
<RX14>
I can read C but not write it...
<Papierkorb_>
That's nothing compared to C++ lul
<RX14>
yeah i hope I enver get a reason to write C++
<RX14>
never*
<Papierkorb_>
Though one of the biggest issues with C++ isn't even the language, it's that the compilers are slow af
<RX14>
but isn't that a product of the language?
<Papierkorb_>
of the standard? Kinda. But OTOH, with Clang integrated into an IDE, it can give you almost instant feedback, so that's a huge win nowadays
<RX14>
clang wrote one from scratch you would think they'd know how to make compiling C++ fast if it was possible to make fast
<Papierkorb_>
Oh parsing C++ is bad, but not that slow. It's okay.
<Papierkorb_>
As far an editor is concerned, which can do some caching optimizations
<Papierkorb_>
Bindgen spents a considerable amount of time on parsing the C/C++ sources though, about half of the time it takes to generate qt5.cr iirc
<RX14>
well Qt is rather large
<RX14>
crystal is worse re:ide though, you can't even compile any file independantly
<RX14>
you need to specify a root file which actually compiles on it's own
<RX14>
then track the require flow
<Papierkorb_>
Well editors can cheat and simply require `src/*`
<Papierkorb_>
that'll work for most projects
<RX14>
i'd rather they have better defaults
<RX14>
for example in an app use the shards build files as roots
<Papierkorb_>
For the remaining dozen, the shard.yml could host that information
<Papierkorb_>
Maybe it should anyway
<RX14>
and for shards, emulate `require "shard_name"`
<RX14>
so src/shard_name.cr
<RX14>
etc.
<RX14>
or honestly just the spec suite
<Papierkorb_>
But @C, that particular issue never happened to me in practice. What's really annoying is C89 only allowing var declarations at the beginning of a block. And there are plenty projects using C89.
<Papierkorb_>
Another funny thing is how varargs (`...`) are basically the reason why the compiler evaluates arguments from the right to the left. And with `it++` being an expression, this is redily assumed in projects. Uargh.
<Papierkorb_>
Bonus points for seeing `while(it) handle(it++, ++it);`
<RX14>
i never use ++ outside for
<RX14>
and only in i++
<RX14>
otherwise it's always i += 1
<RX14>
just like crystal
<Papierkorb_>
In C++, prefix ++ has the benefit of saving a temporary copy, which post ++ needs
<Papierkorb_>
In C it's the same, but as you can't override ++ anyway, it's a non-issue
<RX14>
i'd never put += in arguments either lol
<RX14>
that's just asking for confusion
<Papierkorb_>
Yeah I always avoided it like the plague
snsei has quit [Ping timeout: 252 seconds]
<Papierkorb_>
`foo[i++] = bar(i);` just screams for issues
<Papierkorb_>
But it's perfectly valid! But putting a `++i` there would break it :)
astronavt has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
astronavt has joined #crystal-lang
<RX14>
the problem is i++ and i += n being expressions
<RX14>
but then sometimes assingment being an expression is useful...
<Papierkorb_>
I don't think it's an issue in itself. That it's readily abused is
<Papierkorb_>
All of the funky snippets I posted I've seen in one form or the other
astronavt has quit [Remote host closed the connection]
astronavt has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
<RX14>
yeah but should it be abusable?
<RX14>
is there a valid usecase?
<Papierkorb_>
`if foo = bar` is super useful
<RX14>
but only is bar has a truthiness
<RX14>
it's only useful in if
<RX14>
so maybe assignment should always return bool: the truthiness of the rhs
astronavt has quit [Client Quit]
<RX14>
not that i'm really suggesting that
<RX14>
but i think it would work
<Papierkorb_>
I'd be more about teaching than restricting
<Papierkorb_>
Crap can be written within any restriction, hence prevent that crap will be written in the first place
<Papierkorb_>
So either we write no code at all, or we teach
<RX14>
true
<RX14>
however the counterpoint is that getting that error can cause someone to come in to IRC and ask:
<RX14>
"why does assignment return bool"
snsei has joined #crystal-lang
<Papierkorb_>
If people end up in IRC and ask (and/or learn how to ask) a question, everyone will learn something from that, usually far beyond what was initially asked
<Papierkorb_>
How often do we in here already end up suggesting architectural changes when someone is fighting nil again
<FromGitter>
<sdogruyol> hey everyone
Papierkorb_ has quit [Remote host closed the connection]
Papierkorb_ has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven is now known as Guest37997
snsei has joined #crystal-lang
<FromGitter>
<bararchy> I want to start working on Crystal binding for Bluez, did anyone played with it yet ?
<FromGitter>
<bararchy> (End goal is to create a program using BLE & crSFML to fly my sons drone using the PC)
snsei has quit [Ping timeout: 250 seconds]
Majost has quit [Ping timeout: 264 seconds]
Majost has joined #crystal-lang
livcd has quit [Ping timeout: 246 seconds]
livcd has joined #crystal-lang
Guest37997 has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 258 seconds]
<Papierkorb_>
So I dared to use a CDN'd version of bootstrap, using the URL with the full version.
<Papierkorb_>
FF suddenly refuses to load it as the integrity hash is wrong. Just why man.
Ven_ has quit [Read error: Connection reset by peer]
<FromGitter>
<bew> first, the 3rd arg in `max_rsp` not `num_rsp`, the latter is returned from the `inquiry` call
<FromGitter>
<bew> also, `ii` should be a buffer (`Slice`) of `inquiry_info` (no idea what this is, should be a struct in your lib binding), of size `max_rsp`
snsei has joined #crystal-lang
<FromGitter>
<bew> which will get filled by the inquiry C function, and the returned `num_rsp` will hold the number of slots it used in the buffer
snsei has quit [Ping timeout: 276 seconds]
<FromGitter>
<bararchy> Thanks @bew I'll try and fix it
<FromGitter>
<bew> and the last for loop is basically a traversal of the `num_rsp` slots (that have been filled with useful values), and using the `bdaddr` field (in the `inquiry_info` struct) to call `hci_read_remote_name` in order to retrieve the name of the thing (into another buffer, `name` in the C code)
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<RX14>
hopefully 0.24.1 will be coming soon
<RX14>
and I want to make the release process tracked with a "changelog PR"
<RX14>
which contains the changelog update PR but is used more generally for discussing and tracking the release as it happens
<RX14>
changelog update commit*
<FromGitter>
<bew> I suppose that when this PR is merged, the release tag is created on th merge commit?
<RX14>
yup
<FromGitter>
<bew> that's be a good idea!
<hightower2>
Papierkorb, do I see it right that by using macros in Cute you create @listeners by making a union of all defined signal signatures?
<Papierkorb_>
?
<Papierkorb_>
No?
hightower2 has quit [Ping timeout: 276 seconds]
Papierkorb_ has quit [Quit: Konversation terminated!]
<crystal-gh>
[crystal] bcardiff pushed 1 new commit to master: https://git.io/vbvrN
<crystal-gh>
crystal/master 6ee1bf9 TSUYUSATO Kitsune: Add `Set#===` as alias to `Set#includes?` (#5269)...
<Papierkorb>
And if I were to block the whole system process in elixir, the VM would be dead
<Papierkorb>
Aha
<Papierkorb>
Well that's not necessary with Crystal
<jokke>
so i set it to 0?
<Papierkorb>
huh?
<jokke>
ah ok you were answering someone else
<Papierkorb>
I don't know how zmq works, nor do I want to read up on it. if it spins up threads by itself, that's fine
<Papierkorb>
if it blocks the user-thread, that's not fine obviously. Do a proper integration
<Papierkorb>
on what is the best way of doing so depends on the library in question
<Papierkorb>
Still, spinning up tons of threads for I/O isn't great, and for a native Crystal solution, wouldn't be necessary.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<Shalmezad> Lol.... playing with some "fun" character issues in ruby right now, came across https://mortoray.com/2013/11/27/the-string-type-is-broken/ ⏎ Decided to try it in crystal. Surprisingly crystal handles most of those cases pretty well.
<FromGitter>
<bew> @bararchy You can use `Slice.new(some_size) { LibBlueZ::InquiryReq.new }` to create a slice of size `some_size` with a lib struct
snsei has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest73722
snsei has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<RX14>
jokke, yes, the only way to really use zmq in crystal is to implement the zmq protocol in crystal
<RX14>
using the C bindings will bring you pain
<RX14>
there's a lot of documentation on the zmq protocol though so i'd give it s shot
<FromGitter>
<bew> 👌 I had the same thought with libxcb, and I'm doing my own binding in Crystal now ;)
<Papierkorb>
The X protocol isn't simple, as opposed to zmq
Guest73722 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wmoxam>
@bew you are writing a from scratch X11 lib in Crystal?
<wmoxam>
that would be quite ambitious 😲
<Papierkorb>
And with wayland on the horizon (or not) ..
<wmoxam>
X11 will be around for a long time I think
<oprypin>
I expect X11 to be in majority at least until 2021
<Papierkorb>
Isn't the latest Ubuntu on Wayland?
<Papierkorb>
And fedora too?
<wmoxam>
I just know that my fav OS has 0 Wayland support 😅
<Papierkorb>
?
<oprypin>
> Wayland Confirmed as Default for Ubuntu 17.10
<wmoxam>
OpenBSD :p
<Papierkorb>
So a huge marketshare already
<Papierkorb>
And Fedora is on wayland too for a while now iirc
<oprypin>
Papierkorb, you realize that like 5% of total ubuntu usage will be on 17.10
<wmoxam>
it's really a Linux thing atm
<Papierkorb>
From what I hear of Wayland I'm not much impressed
<Papierkorb>
the compositor has to do way too much
<wmoxam>
but OTOH if the big Linux distros adopt it that's probably enough to kill X11 for everyone else
snsei has joined #crystal-lang
<Yxhuvud>
oprypin: I think quite many *of the desktop users* of ubuntu run the latest and shinyest.
<Yxhuvud>
server users is a different thing, but don't really matter in a x vs wayland discussion, for obvious reasons
<Papierkorb>
Corporate users prefer the LTS version though
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<Papierkorb>
But KDE doesn't properly support Wayland yet, so I won't be on it whatever happens anyway for quite some time lol
<Yxhuvud>
perhaps. I wonder if there is statistics somewhere
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
woodruffw has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<bew> Yes wmoxam! I plan to build a window manager in crystal , I looked at wayland, it's really great but there's no easy way to build a Wayland compositor, and there's not a lot of libs to build one. I'm waiting (and watching) the wlroots repository which is ctive and very promising about that, but for now I want to learn more X stuff, and building a window manager is easier once you have a good x binding ;)
<Papierkorb>
Binding libxcb isn't implementing the X protocol (which would be kinda insane)
<FromGitter>
<bew> I started by binding libxcb but now I have the project to implement the x protocol myself ;)
<Papierkorb>
... why
<FromGitter>
<bew> With a good Crystal api, fibers, etc ;)
<FromGitter>
<bew> For fun ˆˆ
<wmoxam>
😲 😲 😲
<oprypin>
@bew pls
<FromGitter>
<bew> And I've found that libxcb is mostly generated , so I thought I could generate a crystal implementation too
* wmoxam
falls over
<FromGitter>
<bew> I'm afk for a while now ++ !
rohitpaulk has quit [Ping timeout: 248 seconds]
<RX14>
I wish firefox supported wayland
<RX14>
because wayland is the only way to support mixed-resolution displays
<Papierkorb>
you mean mixed DPI?
<RX14>
yes
<RX14>
derp
<RX14>
I frequestly connect my laptop to external monitors
<RX14>
and it's 1 scaling factor everywhere
<oprypin>
surely there are workarounds like rendering at the same resolution for both
<RX14>
I made a hack to get my terminal to scale correctly, by wrapping it in a script which detected the display of the current workspace and setting the scaling env var
<RX14>
but obviously for firefox which is 1 global instance for all windows its not possible
<Papierkorb>
Well you could use profiles
<RX14>
oprypin, yeah that's not really a good idea
<RX14>
Papierkorb, i don't want to have to deal with different profiles depending on the monitor
<RX14>
that sucks as a solution
<RX14>
different history jusut to change DPI?
<RX14>
having to sync addons and settings to both?
<oprypin>
RX14, yeah just forget it
<RX14>
oprypin, it messes with subpixel font rendering
<RX14>
and it's a lot more heavy
<oprypin>
i dont use subpixel anyway
<RX14>
because you're essentially supersampling your desktop
<oprypin>
that or the opposite
<RX14>
how do your eyes cope oprypin
<oprypin>
better than with subpixel anyway
<RX14>
thing is my scaling factor is only 1.25x
<RX14>
which is great because not having the scaling isn't really a big deal on one hand
<RX14>
but on the other if I wanted to do the upscale/downscale to get the same DPI i'd end up with a massive resolution
<FromGitter>
<bararchy> yeha seems to work, thanks
<FromGitter>
<bararchy> as in, nothing works, but the passing of nil works XD
<jhass>
it's essentially a shortcut to Pointer(X).null fwiw
<FromGitter>
<bararchy> is there a way to tell crystal_lib to just "take everything, ignore prefix" ? it seems that if I don't specify a prefix it wont generate binding
<FromGitter>
<bararchy> jhass, thanks, good to know
<FromGitter>
<bararchy> If anyone can take a look and tell me WTH is going on I would really appriciate it :):)
<jhass>
is there no error retrieval function that would give you more insight?
faustinoaq has quit [Ping timeout: 248 seconds]
<jhass>
well one major difference seems to be you passing 0 for the flags, but I guess it already fails with the open if that doesn't concern you?
<jhass>
did you try just dev_id = get_route(nil) btw?
<FromGitter>
<bararchy> get_route is actually working, it returns `0` which is the relevant dev id (hci0), I can try using `nil` but it seems to be ok nontheless
<FromGitter>
<bararchy> wait....wth
<FromGitter>
<bararchy> used your suggestion and now it wont raise
<FromGitter>
<bararchy> Oo
snsei has quit [Remote host closed the connection]
<jhass>
yeah I'm not even sure the argument is an out param :P
<FromGitter>
<bararchy> "BlueZ is a powerful Bluetooth communications stack with extensive APIs that allows a user to fully exploit all local Bluetooth resources, but it has no official documentation. Furthermore, there is very little unofficial documentation as well. Novice developers requesting documentation on the official mailing lists [1] are typically rebuffed and told to figure out the API by reading through the BlueZ source
<FromGitter>
... code. This is a time consuming process that can only reveal small pieces of information at a time, and is quite often enough of an obstacle to deter many potential developers. ⏎ ⏎ This chapter presents a short introduction to developing Bluetooth applications in C with BlueZ. The tasks covered in chapter 2 are now explaine ... [https://gitter.im/crystal-lang/crystal?at=5a1c6c8e6b5080350f3930c1]
<jhass>
jeez, why paste all that
<FromGitter>
<bararchy> yeha, just for "but it has no official documentation. Furthermore, there is very little unofficial documentation as well"
<FromGitter>
<bararchy> sorry
<FromGitter>
<bararchy> so it seems the only relevant "real" source is the ... source code
<FromGitter>
<bararchy> would it help if I'll provide you the actual source for the function? or the header file
<jhass>
that I can dig out myself, thanks :)
<FromGitter>
<bararchy> just wanna be helpful if I can :) as you are actually helping me out
<FromGitter>
<bararchy> haha
<jhass>
(long) (bdaddr ? bdaddr : BDADDR_ANY)
<jhass>
definitely not an out param :P
<FromGitter>
<bararchy> oh
<FromGitter>
<bararchy> XD
sagax has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<extremety1989> hey guys did anyone tried crysta-jwt ?
<FromGitter>
<extremety1989> crystal-jwt ?
aroaminggeek has joined #crystal-lang
<FromGitter>
<extremety1989> how can i get "HTTP::Headers::Key(@name=\"Authorization Bearer\")": [ ⏎ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJleHAiOjE1MTE3ODY4NzYsImp0aSI6ImNkYjMwMGQ1LWM1NGUtNDk3ZS1hNzgwLTNjODkzMDBhNDQ2NjFjNmZjMzlkLWFjYjgtNDJiOS1iYTY2LTVlYjNkYjRlMDNiODBhZWJmZTE3LTdmOTYtNGE3NS1hOWU1LWRmNzY2MDg1ZDA4NmNlYmRiYmI2LWU4OGUtNDA1Mi04YmU0LWYyYjNmNjBmMDI3ODk3NDI5YzVjL
<FromGitter>
<extremety1989> @Papierkorb im new here, i dont know whhat is RFCs
<Papierkorb>
if you think "they're so large" and not worth your time (That'd only prompt a "wtf?" from my end), then it's more than high time to learn how to navigate technical documentation
<Papierkorb>
RFC is short for Request For Comments, which are open technical documentation documents on the implementation of public protocols
<Papierkorb>
All of the technology that drives the internet is literally documented by them
<FromGitter>
<extremety1989> okey , and how to contact them ?
<FromGitter>
<extremety1989> so what is the problem ?
<Papierkorb>
extremety1989, the RFCs are the actualy docs, and thus contain the correct truth. If e.g. the Crystal HTTP server does something, the RFC is the place to look if it does the correct thing.
<RX14>
and that string has the format "Bearer #{token}"
<RX14>
are you parsing or emitting
<Papierkorb>
Parsing by the looks of it
<Papierkorb>
And generating on the other end
<FromGitter>
<extremety1989> not working ....
<RX14>
well, you just split(" ", 2) then verify [0] is "Bearer"
<RX14>
and then use [1] as the token
<FromGitter>
<extremety1989> @FromIRC can you please write me a code
<FromGitter>
<extremety1989> @RX14 can you please write me code ,
<RX14>
no
<FromGitter>
<extremety1989> ?
<FromGitter>
<johnjansen> haha
<Papierkorb>
9/10
<FromGitter>
<johnjansen> where are the score card emoji’s when i need them
<RX14>
@extremety1989 if you paste your code snippet i might be able to point where the problem is
Creatornator has joined #crystal-lang
<FromGitter>
<bew> you need to understand exactly what you're doing and why, because just copy/pasting from someone on IRC or else is counter-productive and you don't learn anything by doing that
<Papierkorb>
Oh and that right now is security related
<FromGitter>
<crisward> @r3bo0t thanks for the thanks... 😄
<Papierkorb>
So "totally unimportant", just the gateway from all that junk trying to attack you
<FromGitter>
<johnjansen> also is a string split is cryptic, i would suggest implementing anything related to security is rather risky
<jhass>
let's all just hope this is only used for rate limiting access to public data :P
<FromGitter>
<johnjansen> woah … nooooo
<Papierkorb>
johnjansen, in this particular case, as long String#split is properly understood and the optional second argument is used (and its behaviour understood), it's okay when the result is correctly validated imho
<FromGitter>
<extremety1989> 😟
<Papierkorb>
But I'm also a fan of parser-for-everything. Maybe there should be a "one line mini-lexer/parser generator" thing for stuff like this. Dunno if that's a good idea
<RX14>
well that's called regex Papierkorb
<RX14>
it just needs a compiler for crystal
<Papierkorb>
Too easy to fuck up
<FromGitter>
<johnjansen> @Papierkorb im not suggesting there is anything wrong with the split …
<Papierkorb>
johnjansen, fair enough
aroaminggeek has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass>
you could just do a .starts_with? "Bearer " if you want to stay allocation free in the invalid case btw
<Papierkorb>
oh yeah crypto systems allowing for a noop crypto dummy, and people forgetting to turn that off. A classic :D
<FromGitter>
<extremety1989> so which security should i use ?
<Papierkorb>
In your case? At least? Any full fledged framework offering authentication and authorization. Haven't heard of such a thing for Crystal.
<Papierkorb>
But that doesn't help you much, as that you also have to learn and, most importantly, understand
<FromGitter>
<johnjansen> oh boy
<Papierkorb>
Security isn't a freebie at all
<Papierkorb>
Security is a hard issue
<FromGitter>
<extremety1989> as i programmed in PHP, i just implemented my own security, as blockchain exemple ))
<Papierkorb>
...
<FromGitter>
<extremety1989> haha
<Papierkorb>
A blockchain by itself isn't "security"
<FromGitter>
<johnjansen> @Papierkorb you should run for public office ;-)
<Papierkorb>
Even git could be regarded as "blockchain". Just do that if you want to get funded this year.
<FromGitter>
<extremety1989> @Papierkorb yes, but it is secured ))
<Papierkorb>
Against what?
<Papierkorb>
Git is also 'secured'
<jhass>
them russians!
<FromGitter>
<johnjansen> haha
<Papierkorb>
huh I thought we were blaming north korea atm
<FromGitter>
<johnjansen> anyone without your diplomatic skills ;-)
<FromGitter>
<extremety1989> @jhass i am from russia ))
<jhass>
north korea is just a proxy of the russia is just a proxy of china is just a proxy of mossad is just a proxy of iran is just a proxy of north korea is.. wait a sec
<FromGitter>
<extremety1989> i can not get job here
sz0 has joined #crystal-lang
<FromGitter>
<extremety1989> discrimination )))
<jhass>
it's a joint venture of illuminati, bilderberger and reptiloids
<FromGitter>
<johnjansen> what @jhass no mention of the masons
<jhass>
sshh, don't talk about'em
<FromGitter>
<extremety1989> france it is country of masons))
<Papierkorb>
> Because no list of questionable public-key encryption modes could be complete without shoehorning a shared-key encryption mode, the JOSE standards also allow you to use AES-GCM to possibly exchange an AES-GCM key.
<Papierkorb>
lawl
<jhass>
I really want that flat earth guy to go to space with his rocket btw
<jhass>
... and not come back maybe. Should actually fund him
<Papierkorb>
but isn't that rocket only capable of going up 150m or so?
<FromGitter>
<johnjansen> hahaha … im so with you @jhass … i wish someone would give him the damn rocket / money
<Papierkorb>
jhass: No he has to come back to tell how he was wrong. the whole popcorn industry would implode in a blackhole
<jhass>
we should get him in touch with elon
<FromGitter>
<johnjansen> the sooner we get rid of him the better … he’s weakening the gene pool
<aroaminggeek>
He should paint flames on it. because we all know flames make things go faster
<aroaminggeek>
and higher
<FromGitter>
<johnjansen> shame he’s so old … probably damage done already
<FromGitter>
<bew> 550m for the rocket, not high enough probably
<FromGitter>
<bew> he should just climb a mountain, it's easier
<FromGitter>
<johnjansen> as long as he’s dead when he hits the ground
<Papierkorb>
I mean that's still kinda impressive to do for some lone guy to do. on the other hand, "wat"
<aroaminggeek>
one less wingnut, i say...
<FromGitter>
<johnjansen> i dont care if its 10'
<oprypin>
it's getting too "entertaining" here
faustinoaq has quit [Remote host closed the connection]
<FromGitter>
<johnjansen> i dont know why he doesnt buy a boat and motor to the edge … if he’s right
<FromGitter>
<extremety1989> i commented in javascript community channel, nobody responded ahahah
<FromGitter>
<bew> the saloon is opening, who's the barman ? ^^
<Papierkorb>
johnjansen, don't look for logic if there's none
<FromGitter>
<crisward> @extremety1989 it's not easy being a js dev, all those hours waiting for `npm install`
<FromGitter>
<johnjansen> what i want to know is; ⏎ if the earth is flat like a biscuit, whats on the other side? chocolate perhaps?
<FromGitter>
<extremety1989> @crisward ahahah
<Papierkorb>
the dark side of the moon obviously johnjansen
<jhass>
turtles all the way down, actually
<FromGitter>
<extremety1989> it's dark side
<FromGitter>
<johnjansen> i thought the oceans were rising, but if he’s right, all the water should be running off the sides
<Papierkorb>
Can't we convince those people that on the other side, there are human too, unaware of our existence? On how they survive: Actually, our solar system is a binary system! It's all a big scam by the american lizard administration
<jhass>
srsly, most of them believe that picture ^
<FromGitter>
<extremety1989> ahahha american lizard lol
<FromGitter>
<extremety1989> american goverment think that they are police of earth order
<FromGitter>
<johnjansen> its awesome how earth is flat (and therefore i suppose all the other planets are) unyet they are all facing us so nicely
<FromGitter>
<extremety1989> if you do not agree with us, they will bomb you down )))
<FromGitter>
<extremety1989> USA
<FromGitter>
<johnjansen> who is “they"
<FromGitter>
<johnjansen> that will be interesting … since im there
<jhass>
there are no other planets, it's all holes in the sky
<FromGitter>
<extremety1989> and what about aliens ?
<FromGitter>
<johnjansen> ohhhhhhh how silly of me … i guess the sky must be equidistant from every point on earth too?
<jhass>
there's no aliens, we're gods sole creation
<FromGitter>
<extremety1989> who were kidnapped by US secret agency ?
<FromGitter>
<extremety1989> i believe in aliens ))
<FromGitter>
<johnjansen> yeah, thats why we need a border wall … damn illegal aliens
<FromGitter>
<johnjansen> ;-)
<FromGitter>
<extremety1989> @johnjansen you from us ?
<Papierkorb>
and make the klingons pay for it
<FromGitter>
<johnjansen> always mowing lawns and running leaf blowers in the morning
<FromGitter>
<extremety1989> good night ))
<RX14>
that was an... interesting read
<FromGitter>
<johnjansen> haha
aroaminggeek has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]