# The Olympic Games Paris 2024 are open

**URL:** <https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533>\
**Category:** Offtopic\
**Created:** [July 26, 2024, 10:57pm UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533 "2024-07-26T22:57:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 26, 2024, 10:57pm UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/1 "2024-07-26T22:57:28Z")

</div>

![Paris2024](https://global.discourse-cdn.com/julialang/original/3X/2/5/25c59f130445d91dc541cb0a9bcf83019c9030ad.png)

> **Paris2024**
>
> ```julia
> inc(i,j,x,y) = round(Int,hypot(i-x, j-y)) == 6
> ch(x) = x ? "#" : " "
> n = 0:44
> m = @. inc(n,n',16,8) | inc(n,n',16,22) | inc(n,n',16,36) | inc(n,n',22,15) | inc(n,n',22,29)
> foreach(println, ["\n"; " "^18 * "Paris 2024"; join.(eachrow(ch.(m)))])
> 
> ```

_PS:_  
_Celine Dion, she was magnificent!_

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 27, 2024, 5:16pm UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/2 "2024-07-27T17:16:17Z")

</div>

Nice - I like the brevity - Olympic golfing?!

Here’s your next plotting challenge:

 ![Screenshot 2024-07-27 at 18.20.04](https://global.discourse-cdn.com/julialang/original/3X/b/6/b64b64a4289d4bc2c370c86470173586e95e264c.jpeg)

🙂

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [July 27, 2024, 5:50pm UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/3 "2024-07-27T17:50:33Z")

</div>

Could do it, but with considerable pain in calculating all those circles intersections, plus arc segments, plus …

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 27, 2024, 7:10pm UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/4 "2024-07-27T19:10:49Z")

</div>

> [@cormullion](#):
>
> Here’s your next plotting challenge:

![Plots_Olympic_rings_color](https://global.discourse-cdn.com/julialang/original/3X/6/8/68f3c9e40ec9e25e91d421377f6532e09c6eaed6.png)

> **Paris 2024**
>
> ```julia
> using Plots; gr(dpi=600)
> import Plots: partialcircle as pc
> 
> r , f, C = 6, 255, [(8,16), (22,16), (36,16), (15,22), (29,22)]
> cls = [RGB(0,129/f,200/f), :black, RGB(238/f,51/f,78/f), RGB(252/f,177/f,49/f), RGB(0,166/f,81/f)]
> p = plot(frame=:none, aspect_ratio=1, yflip=true, title="Paris 2024",titlefontsize=24)
> foreach(i->plot!(map(x->x .+ C[i], pc(0, 2π, 100, r)), c=cls[i], lw=15, label=false), 1:5)
> foreach(i->plot!(map(x->x .+ C[i], pc(-0.2, 0.2, 100, r)), c=cls[i], lw=15, label=false), 1:2)
> foreach(i->plot!(map(x->x .+ C[i], pc(1.62, 1.9, 100, r)), c=cls[i], lw=15, label=false), 2:3)
> p
> 
> ```

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 28, 2024, 7:11am UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/5 "2024-07-28T07:11:13Z")

</div>

> [@joa-quim](#):
>
> Could do it, but with considerable pain in calculating all those circles intersections, plus arc segments

Indeed, that would be a pain. I cheated by tilting each ring:

 ![Screenshot 2024-07-28 at 08.09.38](https://global.discourse-cdn.com/julialang/original/3X/b/8/b82a23bc44f96e4d157924cab32701147494479b.png)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 31, 2024, 10:01am UTC](https://discourse.julialang.org/t/the-olympic-games-paris-2024-are-open/117533/7 "2024-07-31T10:01:07Z")

</div>

The Paris 2024 Olympic medals by country, sorted in 3 different ways:

```julia
using TableScraper, DataFrames

url = "https://www.bbc.com/sport/olympics/paris-2024/medals"
tbl = scrape_tables(url)
header = tbl[1].columnnames
rows = tbl[1].rows

df = DataFrame(header .=> eachrow(reduce(hcat, rows)))
rename!(df, :TotalTotal => :TOTAL_MEDALS)
df[!, 3:6] = parse.(Int64, df[:, 3:6])
transform!(df, [:GGold, :SSilver, :BBronze] => ((g,s,b) -> (3*g + 2*s + b)) => :TOTAL_POINTS)

sort(df, [:GGold, :SSilver, :BBronze], rev=true)
sort(df, :TOTAL_MEDALS, rev=true)
sort(df, :TOTAL_POINTS, rev=true)

```
