David Amos Profile picture
Feb 9, 2022 8 tweets 3 min read Read on X
Today's #JuliaLang doodle with Javis.jl is recreating a classic...
Look closely at the circles. Are the curving at all?

Here's the code:

(I'm sure there's a better way to do this, I just haven't completely figured out Javis yet!)
I think disks work better than circles for this:
I also cleaned up the code and added some comments to hopefully make it easier to understand what's happening:
And here's the Gist: gist.github.com/somacdivad/b9b…
Adding more disks is pretty fun. Here's N=12:
And here's 24:
And finally, 100:

(keep in mind no part of this is actually rotating!)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with David Amos

David Amos Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @somacdivad

Apr 6, 2022
Day 3 of "Learn IPython in 10 Days" is HERE 🚀🐍

Learn how IPython reduces context switching by giving you access to the system shell from within the REPL itself.

Read the full tutorial, or continue reading this thread for the condensed version.

davidamos.dev/using-ipython-…
You can execute system shell commands from within IPython by prepending them with the ! character.

Everything on the line after the ! gets passed verbatim to your system shell.
For example, to see your current working directory, type !pwd into an IPython input prompt and press Enter:

In [1]: !pwd
/Users/damos
Read 28 tweets
Apr 5, 2022
DAY 2 of Learn IPython in 10 Days is HERE 🚀

Read the lesson on the course website, or view the rest of this thread for a condensed version!

davidamos.dev/ipython-basics/
One of the first things you'll notice about IPython is the syntax highlighting: Image
By default, keywords like def and built-in function names like print() are displayed in green, function names in a function definition, like greet() in the example above, are displayed in blue, and strings are displayed in yellow.
Read 29 tweets
Apr 4, 2022
The built-in Python shell is BORING 🥱

You deserve a better Python REPL 🐍 🔥

That’s why I’m starting this free 10-day mini-course to teach you how to effectively use the IPython REPL.

ipython.readthedocs.io/en/stable/inde…
For the next 10 days I’ll tweet a short thread with some tips for getting the most out of IPython.

We’ll cover everything from getting IPython installed to mastering magic commands and more.

You’ll learn how IPython can reduce friction in dev workflows and boost productivity.
Let’s start with getting IPython installed and set-up using one of my favorite tools: pipx.

github.com/pypa/pipx
Read 21 tweets
Feb 22, 2022
The #JuliaLang REPL is amazing.

Here are 3 things I love about it:
1/ The Built-in Package Manager

With the Julia REPL open, press the right square bracket ] to drop into the 𝙿𝚔𝚐 REPL where you can install packages and manage Julia environments.

There's no need to install a separate package manager. It comes with every Julia install.
The support for Julia environments is one of my favorite parts. Inside the 𝙿𝚔𝚐 REPL, type:

𝚊𝚌𝚝𝚒𝚟𝚊𝚝𝚎 /𝚙𝚊𝚝𝚑/𝚝𝚘/𝚎𝚗𝚟𝚒𝚛𝚘𝚗𝚖𝚎𝚗𝚝

to activate the environment at the path, or create a new one if it doesn't exist.
Read 14 tweets
Feb 8, 2022
A Tale of Two NaNs (A #Python 🧵)

(Plus a bonus experiment in Twitter fonts that may end disastrously)
NaNs are annoying.

You can’t tell if they’re in a list:

>>> 𝚏𝚕𝚘𝚊𝚝(“𝚗𝚊𝚗”) 𝚒𝚗 [𝟷, 𝟸, 𝚏𝚕𝚘𝚊𝚝(“𝚗𝚊𝚗”)]
𝙵𝚊𝚕𝚜𝚎
You can end up with more than one NaN in a set:

>>> 𝚂 = {𝟷, 𝟷, 𝚏𝚕𝚘𝚊𝚝(“𝚗𝚊𝚗”), 𝚏𝚕𝚘𝚊𝚝(“𝚗𝚊𝚗”)}
>>> 𝚂
{𝟷, 𝚗𝚊𝚗, 𝚗𝚊𝚗}

But they also aren’t 𝘪𝘯 the set:

>>> 𝚏𝚕𝚘𝚊𝚝(“𝚗𝚊𝚗”) 𝚒𝚗 𝚂
𝙵𝚊𝚕𝚜𝚎
Read 17 tweets
Feb 8, 2022
I've learning to make animations with Javis.jl and came up with this little doodle tonight. Nothing fancy, just getting my feet wet!
And here's the code: Image
Colors make it better
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(