Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:06
    straight-shoota edited #12547
  • 11:05
    straight-shoota opened #12547
  • 11:05
    straight-shoota labeled #12547
  • 11:05
    straight-shoota labeled #12547
  • 10:24
    straight-shoota closed #11354
  • 10:24
    straight-shoota closed #12536
  • 10:24
    straight-shoota closed #12494
  • 10:22
    straight-shoota ready_for_review #12541
  • 10:22
    straight-shoota synchronize #12541
  • 10:22
    straight-shoota closed #12539
  • 10:21
    straight-shoota closed #12290
  • 10:21
    straight-shoota closed #12537
  • 10:21
    straight-shoota edited #12537
  • 10:20
    straight-shoota milestoned #12545
  • 10:20
    straight-shoota milestoned #12545
  • 05:44
    HertzDevil edited #12546
  • 05:44
    HertzDevil labeled #12546
  • 05:44
    HertzDevil labeled #12546
  • 05:44
    HertzDevil opened #12546
  • 05:20
    HertzDevil labeled #12545
From IRC (bridge bot)
@FromIRC
<riza> I have no problem using bin/crystal to make that work. I just didn't realize that it required doing that.
George Dietrich
@Blacksmoke16
https://github.com/crystal-lang/crystal/blob/master/bin/crystal#L141 wrapper script is setting it to the local compiler for you
yea, stdlib dev is separate from compiler
From IRC (bridge bot)
@FromIRC
<riza> yeah for sure, when I run bin/crystal I get the warning message about the local compiler
emanzx
@emanzx
hi guys.. :-)
can I use this query
SELECT
  time_bucket('86400.0s',"time") AS "time",
  qname AS "domain",
  client_ip AS "IP",
  sum(count) AS "count"
FROM bind_rpz_log
WHERE
  "time" BETWEEN '2022-04-15T06:07:27.34Z' AND '2022-04-15T07:07:27.34Z' AND
  rpz_zone ~* 'feeder.csm.rpzdb.com'
GROUP BY 1, qname, client_ip
ORDER BY 1, qname
in granite?
George Dietrich
@Blacksmoke16
prob could do it as a one off query versus something you could make via the query builder or something
one off query meaning a raw query off the underlying DB::Database instance
Filip Samuel
@1337M0nst3r
why doesn't this work?
a = 2/1
p! a # prints 2.0
sorry, I meant
p! a.round # prints 2.0
George Dietrich
@Blacksmoke16
what would you expect it to be?
Ary Borenszweig
@asterite
I guess an int instead of a float
moe
@moe:busyloop.net
[m]
fixed 😛
George Dietrich
@Blacksmoke16
2 // 1 :wink:
Benjamin Wade
@RespiteSage
"Proposal to add Float#rount to the standard library"
Also, serious question: (x / y).round.to_i is different than x // y, right?
George Dietrich
@Blacksmoke16
they're the same if #round happens to round down
Benjamin Wade
@RespiteSage
Yeah, I see.
Rounding to even is the default for #round, right?
So I guess maybe they're the same all the time if you're using RoundingMode::TO_ZERO?
I'm getting too wrapped up in this..
George Dietrich
@Blacksmoke16
or like (x / y).floor.to_i yea
From IRC (bridge bot)
@FromIRC
<frojnd> Hi there.
<frojnd> I would like to build a simple file server with Kemal. I am looking at apps that are built with Kemal so I can see what's the file structure of source code. Any good examples?
moe
@moe:busyloop.net
[m]
From IRC (bridge bot)
@FromIRC
<frojnd> @moe thank you will take a look right away
3 replies
From IRC (bridge bot)
@FromIRC
<frojnd> Hm hm
<frojnd> But when I try to upload some file I get: Exception: Cannot extract form-data from HTTP request: could not find boundary in Content-Type (HTTP::FormData::Error)
moe
@moe:busyloop.net
[m]
sounds like you'e posting with the wrong content-type
From IRC (bridge bot)
@FromIRC
<frojnd> What is the correct content-type ?
moe
@moe:busyloop.net
[m]
multipart/form-data
From IRC (bridge bot)
@FromIRC
<frojnd> It's a progress but now I see: Exception: Missing hash key: "image1" (KeyError)
<frojnd> curl -v -F image1=value1 upload=@bla.txt http://0.0.0.0:3000/upload
<frojnd> Not sure what that error means
moe
@moe:busyloop.net
[m]
sorry, not sure either (i'm not very familiar with kemal)
From IRC (bridge bot)
@FromIRC
<frojnd> Ha, was looking at wrong code
<frojnd> https://kemalcr.com/guide/ File Upload
From IRC (bridge bot)
@FromIRC
<frojnd> Any ideas how to access public folder?
<frojnd> Like I have uploads there with some files... I would like to access those files within crystal
George Dietrich
@Blacksmoke16
moe
@moe:busyloop.net
[m]
George Dietrich
@Blacksmoke16
nice! congrats!
From IRC (bridge bot)
@FromIRC
<frojnd> @Blacksmoke16 yeah, but when I write get "/uploads" do ... end how do I list everything inside public/uploads ?
George Dietrich
@Blacksmoke16
would have to write something to do that
https://crystal-lang.org/api/HTTP/StaticFileHandler.html provides a way to render an index listing (like you'd get going to that directory in chrome), but not sure if kemal has something similar/equivalent