Perhaps the best known fractal of all: the Mandelbrot set.
Since I was already working on Python code that would render an image given a function (for a future post), I figured that I might as well render fractals with it.
Perhaps the best known fractal of all: the Mandelbrot set.
Since I was already working on Python code that would render an image given a function (for a future post), I figured that I might as well render fractals with it.
The newest chapter in my quest to collect entirely too much data / back up All The Things!: GitHub.
Basically, I want to back up all of my own personal GitHub repositories along with any from organizations that I am involved with. Strictly speaking, this is a little strange, since it’s unlikely that GitHub is going anywhere soon and, if it does, we are likely to have fair warning. But still, it’s nice to have a local copy just in case GitHub is down.
Been a while since I’ve actually tackled one of the Daily Programmer challenges, so let’s try one out. From a week and a half ago, we are challeneged to make an adjacency matrix generator, turning a graphical representation of a graph into an adjacency matrix.
Input:
a-----b
|\ / \
| \ / \
| / e
| / \ /
|/ \ /
c-----d
Output:
01110
10101
11010
10101
01010
Every once in a while1, I find myself with an AWS access key and need to figure out who in the world it belongs to. Unfortunately, so far as I’ve been able to find, there’s no way to directly do this in either the AWS console or with the AWS api.
Recently at work, we were trying to get an application that uses websockets working on an AWS instance behind an ELB (load balancer) and nginx on the instance.
If you’re either not using a secure connection or handling the cryptography on the instance (either in nginx or Flask), it works right out of the box. But if you want the ELB to handle TLS termination it doesn’t work nearly as well… Luckily, after a bit of fiddling, I got it working.
Update 2018-05-31: A much easier solution, [https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/](just use an ALB):
WebSocket allows you to set up long-standing TCP connections between your client and your server. This is a more efficient alternative to the old-school method which involved HTTP connections that were held open with a “heartbeat” for very long periods of time. WebSocket is great for mobile devices and can be used to deliver stock quotes, sports scores, and other dynamic data while minimizing power consumption. ALB provides native support for WebSocket via the
ws://
andwss://
protocols.
When you’re starting out on a simple web application, eventually1 you will reach the point where you need to store some form of persistant data. Basically, you have three options2:
There are all manner of pros and cons to each, in particular how easy they are to get started in, how well they fit the data you are using, and how well they will scale horizontally (adding more machines rather than bigger ones).
Another backup post, this time I’m going to back up my data from the Moves App (step counter + GPS tracker). Theoretically, it should be possible to get this same data from the app as part of my iOS Backup series, but the data there is in a strange binary format. Much easier to use their API.
Edit March 2020: It seems the page ‘your highlights’ page on Amazon no longer exists, so this script no longer works. I’ll probably see if I can pull them from Goodreads instead now that the integration is there or directly from my Kindle, but for the moment, this script does not work.
As part of an ongoing effort to backup all the things, combined with a rather agressive 2015 Reading List, I wanted to the ability to back up any sections that I’ve highlighted on my Kindle. Unfortunately, Amazon doesn’t seem to have an API to do that, but why should that stop me?
Using a combination of Python and the Python libraries Requests and BeautifulSoup1, it’s entirely possible to write a Python script that will log into Amazon, get a list of all of the books on your account, and download the highlights for each.
Let’s do it!
On 4 March 2014, YouTube deprecated the v2.0 API for YouTube (source). One of the unfortunate side effects was that RSS feeds for user uploads were included in what was deprecated.
Previously, you could get an RSS feed with a link of the form: https://gdata.youtube.com/feeds/base/users/{user}/uploads
For the longest time, even after the deprecation, those links still worked, but a couple weeks ago, more and more of the video feeds I was subscribed to started redirecting to YouTube Help account. As thrilling as that channel is, it’s not what I’m looking for.
Let’s fix it.
A few days ago an interesting article came across my RSS feeds: It’s All Greek (or Chinese or Spanish or…) to Me. Basically, in English, when you’re confused, you’ll often say ‘It’s all Greek to me’. It turns out that man (if not all) languages around the world have a similar saying, but the target varies. Luckily, Wikipedia has a lovely page about it: Greek to me.