veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

293
active users

#pythoncode

0 posts0 participants0 posts today
TechKeysX<p>Tuple instead of Lists in Python:<br>Use a tuple instead of a list in Python when you need an immutable, hash able, and faster collection of fixed items.<br><a href="https://mastodon.social/tags/PythonTips" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonTips</span></a> <a href="https://mastodon.social/tags/PythonTuple" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonTuple</span></a> <a href="https://mastodon.social/tags/LearnPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LearnPython</span></a> <a href="https://mastodon.social/tags/PythonDev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonDev</span></a> <a href="https://mastodon.social/tags/CodingTips" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CodingTips</span></a> <a href="https://mastodon.social/tags/Immutable" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Immutable</span></a> <a href="https://mastodon.social/tags/PythonCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonCode</span></a> <a href="https://mastodon.social/tags/DevLife" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DevLife</span></a> <a href="https://mastodon.social/tags/TupleVsLis" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TupleVsLis</span></a></p>
Risto A. Paju<p>The recent stipplings and partitionings reminded me of this demo from about 2 years ago. In short, it's a Hilbert curve where the iteration level varies by the colour value. I wanted to make some small changes, but I ended up rewriting it completely. The shader approach seemed needlessly heavy and redundant for something that works more naturally on a CPU. But mostly it was just a fun exercise in looking at the same problem from a different angle.</p><p>The first picture shows the original idea. With the new idea, I wanted to get rid of the slanted lines; the result doesn't feel any better to me, but I guess it's interesting in its own way.</p><p><a href="https://mathstodon.xyz/tags/hilbertcurve" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hilbertcurve</span></a> <a href="https://mathstodon.xyz/tags/planefillingcurve" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>planefillingcurve</span></a> <a href="https://mathstodon.xyz/tags/spacefillingcurve" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>spacefillingcurve</span></a> <a href="https://mathstodon.xyz/tags/lineart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lineart</span></a> <a href="https://mathstodon.xyz/tags/linedrawing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linedrawing</span></a> <a href="https://mathstodon.xyz/tags/singlelinedrawing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>singlelinedrawing</span></a> <a href="https://mathstodon.xyz/tags/pythoncode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pythoncode</span></a> <a href="https://mathstodon.xyz/tags/opengl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opengl</span></a> <a href="https://mathstodon.xyz/tags/algorithmicart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorithmicart</span></a> <a href="https://mathstodon.xyz/tags/algorist" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorist</span></a> <a href="https://mathstodon.xyz/tags/mathart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mathart</span></a> <a href="https://mathstodon.xyz/tags/laskutaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>laskutaide</span></a> <a href="https://mathstodon.xyz/tags/ittaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ittaide</span></a> <a href="https://mathstodon.xyz/tags/kuavataide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kuavataide</span></a> <a href="https://mathstodon.xyz/tags/iterati" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iterati</span></a></p>
Risto A. Paju<p>I came across this halftoning idea sometime last week. While the idea was relatively easy to understand and fun to implement, I've spent quite a lot of time trying to make the result look nice.</p><p>In each row, the image is split into bins containing roughly the same sum of lightness value. This is nice to implement when the number of lines/bins is a power of 2, so we can recurse with a binary split. Thus the line density varies by average lightness. The problem is that density is considered along the x-axis. If things change a lot between rows, the lines get slanted, so they appear more dense. Here I've included some averaging between neighbouring rows to make thing a bit smoother.</p><p>I'm also including a fun glitch from the early tests. The line-density system includes the set of point coordinates and the graph structure (which point is connected to which). What happened here is my generic graph generator that simply finds the nearest neighbours of each point. So in the light areas that are compressed horizontally, the nearest neighbours were left and right.</p><p><a href="https://mathstodon.xyz/tags/halftoneart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>halftoneart</span></a> <a href="https://mathstodon.xyz/tags/lineart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lineart</span></a> <a href="https://mathstodon.xyz/tags/patterns" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>patterns</span></a> <a href="https://mathstodon.xyz/tags/texture" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>texture</span></a> <a href="https://mathstodon.xyz/tags/pythoncode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pythoncode</span></a> <a href="https://mathstodon.xyz/tags/opengl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opengl</span></a> <a href="https://mathstodon.xyz/tags/algorithmicart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorithmicart</span></a> <a href="https://mathstodon.xyz/tags/algorist" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorist</span></a> <a href="https://mathstodon.xyz/tags/mathart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mathart</span></a> <a href="https://mathstodon.xyz/tags/laskutaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>laskutaide</span></a> <a href="https://mathstodon.xyz/tags/ittaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ittaide</span></a> <a href="https://mathstodon.xyz/tags/kuavataide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kuavataide</span></a> <a href="https://mathstodon.xyz/tags/iterati" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iterati</span></a></p>
Risto A. Paju<p>Minimum spanning tree of a dithered image, 4096 vertices. Model: Swetlana</p><p><a href="https://mathstodon.xyz/tags/spanningtreeyoungandsweet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>spanningtreeyoungandsweet</span></a> <a href="https://mathstodon.xyz/tags/minimumspanningtree" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>minimumspanningtree</span></a> <a href="https://mathstodon.xyz/tags/primsalgorithm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>primsalgorithm</span></a> <a href="https://mathstodon.xyz/tags/graphtheory" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>graphtheory</span></a> <a href="https://mathstodon.xyz/tags/halftoneart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>halftoneart</span></a> <a href="https://mathstodon.xyz/tags/lineart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lineart</span></a> <a href="https://mathstodon.xyz/tags/pythoncode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pythoncode</span></a> <a href="https://mathstodon.xyz/tags/opengl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opengl</span></a> <a href="https://mathstodon.xyz/tags/algorithmicart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorithmicart</span></a> <a href="https://mathstodon.xyz/tags/algorist" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>algorist</span></a> <a href="https://mathstodon.xyz/tags/mathart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mathart</span></a> <a href="https://mathstodon.xyz/tags/laskutaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>laskutaide</span></a> <a href="https://mathstodon.xyz/tags/computerart" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>computerart</span></a> <a href="https://mathstodon.xyz/tags/ittaide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ittaide</span></a> <a href="https://mathstodon.xyz/tags/kuavataide" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kuavataide</span></a> <a href="https://mathstodon.xyz/tags/iterati" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iterati</span></a></p>