Show newer

As it's time for my morning coffee (the coffee not the biscuits), it's as good a time as any to share my one of my favourite analogies

_(narrated from a -viewpoint but general enough for in general)_

**The Coffee Machine - Function analogy**

Let's make some coffee…

_[read on]_

/1

people who use , is there any link on what flavour of Markdown and what features it has or doesn't have?

Just tried using the triple back tick ``` to create a code block but it didn't seem to work. Single back ticks are fine

I'm going to tweet about one of my projects every day until I run out, using the #projects hashtag

I encourage others to do the same. Let's talk about (and boost) our projects together!

sqlite-utils is a combined Python library and CLI tool for creating and manipulating SQLite databases: sqlite-utils.datasette.io/

It can do a lot of different things! I have a series of blog posts talking about the most interesting features here: simonwillison.net/series/sqlit

@johnspartan@twit.social I (and many others) use PyCharm. But VSCode is also very widely used

@johnspartan@twit.social depends what you’re looking for, but Python is very broad in terms of applications and it’s definitely a fun language

@peterdrake and yes, the article linked later has the full code etc…

@peterdrake I have been doing this (on Twitter) for a few months now, but this is an old post (from Twitter, recycled here) so the images didn’t have them. I now autogenerate these snippets which makes adding the code in ALT text easy

is for serious stuff, sure, but one of the most fun modules is the `turtle` module, but…

I know, I can hear you say: "That's just for drawing simple, boring drawings, right"

Think again! Here's a great learning project that is not merely a "boring set of squares!"

You can follow the detailed step-by-step tutorial here [WARNING: game is addictive and may adversely affect your productivity!]

thepythoncodingbook.com/2022/0

You'll find me easily on Twitter too if you're on there as well. That's a bigger account and get's a lot of interesting conversations going with others in the world

You can see the sort of things I'm interested it there (until this timeline fills up a bit): twitter.com/s_gruppetta_ct

Show thread

So, this thread could serve as my my

I'm Stephen. I used to be a physicist (as you can guess from the thread above) but now I focus on communicating about Python and programming and teaching coding

You can expect more varied content from me, all related to in , from science-y stuff like this, to fun animations using the `turtle` module (no not those boring ones!) and general Python for those learning to code at beginner and intermediate levels

Show thread

There's a lot more than can fit in a single thread.

If you want to read more detail, and go through the step-by-step writing of the code to decompose & recostruct *any* image, read full article here:

/16

thepythoncodingbook.com/2021/0

Show thread

And therefore, you can reconstruct the image by adding all of those sinusoidal gratings together.

The more gratings you add, the closer the result is to the actual image

/13

Show thread

Now, here's the "magical" part of theory.

*Any* image is made up of lots of sinusoidal gratings. So, the 2D Fourier Transform of an image gives you thousands of pairs of dots, and each pair represent a sinusoidal grating.

/12

Show thread

Now, if you have lots of gratings superimposed on each other, the gives you a pair of dots for each of the components

/11

Show thread

You can find the parameters of a sinusoidal grating by using the 2D .

The dots shown contain the amplitude and phase of the grating. Their position from the centre gives the frequency, and their orientation represents the orientation of the grating.

/10

Show thread

Or even better, you can use a function of both x and y to make any grating

/9

Show thread

There's one more parameter that defines a sinusoidal grating: the phase. Gratings with a different phase are shifted with respect to each other…

/7

Show thread
Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.