Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:03
    kramerul synchronize #12404
  • Aug 19 18:56
    asterite ready_for_review #12405
  • Aug 19 18:56
    asterite edited #12405
  • Aug 19 17:43
    asterite labeled #12405
  • Aug 19 16:38
    Blacksmoke16 labeled #12405
  • Aug 19 16:38
    Blacksmoke16 labeled #12405
  • Aug 19 16:02
    asterite synchronize #12405
  • Aug 19 16:01
    asterite opened #12405
  • Aug 19 15:34
    kramerul synchronize #12404
  • Aug 19 15:23
    kramerul synchronize #12404
  • Aug 19 15:13
    kramerul synchronize #12404
  • Aug 19 15:10
    kramerul synchronize #12404
  • Aug 19 15:08
    Blacksmoke16 labeled #12404
  • Aug 19 15:08
    Blacksmoke16 labeled #12404
  • Aug 19 15:08
    Blacksmoke16 labeled #12404
  • Aug 19 15:06
    wonderix opened #12404
  • Aug 19 14:20
    asterite closed #12403
  • Aug 19 12:42
    straight-shoota milestoned #12403
  • Aug 19 12:42
    straight-shoota milestoned #12403
  • Aug 19 12:03
    asterite synchronize #12403
Distinct
@distinct
Is there a way to find the line this is happening on?
Bar Hofesh
@bararchy
@distinct Where to you do .as Float or .to_f32 in your code ?
is it in more then one place ?
From IRC (bridge bot)
@FromIRC
<Groogy> Morning!
<Groogy> Oh thanks @bararchy, how did you find it? :⁠P
<Groogy> There's not much there right now, working on the backend structure right now
Rishav Sharan
@rishavs

Hi
I am sending a post request from my browser on a kemal webapp as:

            var id_token = googleUser.getAuthResponse().id_token;
            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'https://localhost:3000/Oauth2/google/tokensignin');
            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xhr.onload = function() {
              console.log('Signed in as: ' + xhr.responseText);
            };
            xhr.send('idtoken=' + id_token);

in my routes, i have a post route set up as ;

post "/Oauth2/google/tokensignin" do |env|
  puts "Token Received!"
  puts "Token received as: #{env.params.body["id_token"]}"
end

Browser console shows that a post request was made. however, the code in the route is not executing. ANy idea what am i doing wrong?

From IRC (bridge bot)
@FromIRC
<Yxhuvud> groogy: https://github.com/Groogy/boleite/blob/master/src/boleite/math/vector.cr#L38 <-- off by one error I think. I'd use N.times {|i| }
<Yxhuvud> I didn't know it was possible to put numbers into the generic argument to the type algebra. That is a nice thing to know of
Bar Hofesh
@bararchy
Groogy: I'm stocking you ;) (tbh I just brwose daily in the shard.xyz to find interesting new projects)
From IRC (bridge bot)
@FromIRC
<Groogy> Yxhuvud haha yeah several people were suprised when I showed the vector code some days ago
<Groogy> They were "Well that doesn't work anyway" "Well it compiles so...." "wat?"
<Groogy> though the argument is really really limited, it isn't actually a number it seems, it just gets expanded like a macro [[N}} it seems like
<Groogy> or something to that effect, been a lot of trial and errors
<Groogy> TL;DR - it feels very much like a work in progress feature
Johannes Müller
@straight-shoota
and is not documented anywhere ;)
but as your use case shows, there are valid applications (beside StaticArray)
From IRC (bridge bot)
@FromIRC
<Groogy> yeah would be nice if it would accept like some math and if you could save it into a CONST as that doesn't work right now
<Groogy> though that might be something from C++ that I am just used to do
Johannes Müller
@straight-shoota
you could probably wrap this in a macro... but it's not as nice
From IRC (bridge bot)
@FromIRC
<Groogy> dat makes me go "Wat"
Johannes Müller
@straight-shoota
very experimental^^
Rishav Sharan
@rishavs

Hi
I am sending a post request from my browser on a kemal webapp as:

            var id_token = googleUser.getAuthResponse().id_token;
            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'https://localhost:3000/Oauth2/google/tokensignin');
            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xhr.onload = function() {
              console.log('Signed in as: ' + xhr.responseText);
            };
            xhr.send('idtoken=' + id_token);

in my routes, i have a post route set up as ;

post "/Oauth2/google/tokensignin" do |env|
  puts "Token Received!"
  puts "Token received as: #{env.params.body["id_token"]}"
end

Browser console shows that a post request was made. however, the code in the route is not executing. ANy idea what am i doing wrong?

Some help?

Akzhan Abdulin
@akzhan
@rishavs please ask for kemal at https://gitter.im/sdogruyol/kemal
Rishav Sharan
@rishavs
thanks @akzhan . i dont think its a kemal issue. i am making some very basic mistake in how post or xhr is supposed to work.
Akzhan Abdulin
@akzhan
Is your JS page originated on same resource - http://localhost:3000?
please read about CORS, looks it’s your problem. https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Rishav Sharan
@rishavs
thanks! i will check it out .
Ghost
@ghost~55586c4815522ed4b3e08557
@straight-shoota look at #4722 I think you mixed compile-time vs runting printings
Akzhan Abdulin
@akzhan
@rishavs you should know that ACAO header should be set to referrer site, not to ‘*’, for https protocol.

something like (pseudocode):

acao = «*» 
if ( request->referer || '' )  =~ /^(https?\:\/\/)(.*?)\/(.*)$/
  acao = «#{$1}#{$2}"
end
response.add_header "Access-Control-Allow-Origin», acao

I don’t know kemal, so please adapt it by yourself.

Akzhan Abdulin
@akzhan
I’m sorry, forgot that Gitter message edits looks ugly for IIRC.
Ghost
@ghost~55586c4815522ed4b3e08557
one that accept a block and one who dosn't @NARKOZ
look the second, there is a yield that will inline the passed block
Nihad Abbasov
@NARKOZ
how comes that methods don't get overwritten?
Ghost
@ghost~55586c4815522ed4b3e08557
because a method that accept a block and one that doesn't are 2 different methods, they don't override each other, even though they have the same name
@bew I was dumb :(
From IRC (bridge bot)
@FromIRC
<Groogy> And back from lunch
<Groogy> it would be nice though if the number could work as any other number in the example I showed
<Groogy> If you switch out the NUMBER constant for the N generic argument it works as expected
Ghost
@ghost~55586c4815522ed4b3e08557
@straight-shoota it got me more than once!
From IRC (bridge bot)
@FromIRC
<Groogy> also thanks Yxhuvud, commited fix now
Johannes Müller
@straight-shoota
@bew Where did you find this final word?
I understood @bcardiff in https://github.com/crystal-lang/crystal/issues/236#issuecomment-302734259 (3) as it would be preferable to change precedence
this aspect got lost though in the remainder which was about top level macros
Ghost
@ghost~55586c4815522ed4b3e08557
@straight-shoota right, that was what I remembered, but can't find it again