# Section with Julia exercises, contests and equivalences with other languages

**URL:** <https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116>\
**Category:** Meta Discussion\
**Created:** [September 18, 2018, 10:22am UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116 "2018-09-18T10:22:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [September 18, 2018, 10:22am UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/1 "2018-09-18T10:22:56Z")

</div>

I think it would be a good a idea to have a category on the forum with:

- A collection of typical tasks solved with Julia.
- A daily or weekly contest where somebody raise an exercise or problem and others post their solution. It can have two categories, simple ones to learn, and another with the fastest, shortest or more original solution.
- A thread or interactive sheet to add typical R, Python or Matlab instructions and its equivalent Julia ones. I know there are already some collections, but we could collect and improve them.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 18, 2018, 11:55am UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/2 "2018-09-18T11:55:11Z")

</div>

> [@Juan](#):
>
> A collection of typical tasks solved with Julia.

Um, more or less everything? Julia is used for diverse problems, ranging from natural language processing to astrophysics.

> [@Juan](#):
>
> somebody raise an exercise or problem and others post their solution

This is more or less happening every 30 minutes on average (depending on time of the day). We just don’t treat it as a contest, which I think is better.

> [@Juan](#):
>
> typical R, Python or Matlab instructions and its equivalent Julia ones

[See the manual](https://docs.julialang.org/en/stable/manual/noteworthy-differences/) for an overview. Doing something more detailed is an option, but has the downside the the important things get lost in the noise.

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [September 18, 2018, 3:42pm UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/3 "2018-09-18T15:42:36Z")

</div>

I understand what you say but I mean to put some of those things on an specific thread organized as a collection of exercises, problems, contests, summaries…

And I’m not speaking about natural language processing or astrophysics problems, just simple problems, though some of first could be used as an example.

For example once I needed an efficient ways to reshape huge data from long to wide format using R and data.table:

And I got this answer from Uwe, the usual methods consumes too much memory.

> <https://stackoverflow.com/questions/41163500/transform-from-wide-to-long-without-sorting-columns>

```julia
setDT(mydata)

# add unique row number to join on later 
# (leave `ID` col as placeholder for all other id.vars)
mydata[, rn := seq_len(.N)]

# define columns to be reshaped
measure_cols <- stringr::str_subset(names(mydata), "_\\d$")

# melt with only one id.vars column
molten <- melt(mydata, id.vars = "rn", measure.vars = measure_cols)

# split column names of measure.vars
# Note that "variable" is reused to save memory 
molten[, c("variable", "measure") := tstrsplit(variable, "_")]

# coerce names to factors in the same order as the columns appeared in mydata
molten[, variable := forcats::fct_inorder(variable)]

# remove columns no longer needed in mydata _before_ joining to save memory
mydata[, (measure_cols) := NULL]

# final dcast and right join
result <- mydata[dcast(molten, ... ~ variable), on = "rn"]
result

```

It would be great to have a collection of similar things for Julia.

---

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [October 30, 2018, 2:06pm UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/4 "2018-10-30T14:06:06Z")

</div>

Something like the “Python Cookbook”. Yeah, that would be nice.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 4, 2018, 6:47pm UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/5 "2018-11-04T18:47:38Z")

</div>

See [Rosetta Code](http://www.rosettacode.org/wiki/Rosetta_Code).

---

<div class="post-metadata">

**Author:** ![VinodV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinodv/32/32733_2.png) [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Post date:** [March 28, 2022, 1:59am UTC](https://discourse.julialang.org/t/section-with-julia-exercises-contests-and-equivalences-with-other-languages/15116/10 "2022-03-28T01:59:04Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.
