The other day, a Twitter user (David Buchanan, @David3141593) posted a message that gained some attention. It has an attached JPEG file, with an image of William Shakespeare. If you save a copy of the JPEG file, and unzip it as if it were a ZIP file, it unzips into the complete works of Shakespeare.…… Continue reading About that JPEG/ZIP/Shakespeare hybrid file
In order to decode and display a JPEG image, you have to know what “color type” (or “color model”) it uses. There are several possibilities that your software probably ought to handle: Grayscale YCbCr (transformed from RGB) RGB YCCK (transformed from CMYK) CMYK Unfortunately, if you look at all the bits and bytes that make…… Continue reading How is a JPEG image’s color type determined?
As of this writing, the largest known prime number is 277232917-1. “Not large enough!”, I say. Let’s write a computer program that will print out a larger prime number. No, not a program that will take billions of years to run. It should take only a few minutes. There is a small catch. Hardly worth…… Continue reading Large prime numbers
This post is about programming a Windows Win32 application, mainly one that uses the console (command line). It summarizes the results of some tests I performed. Maybe you ported a Unix utility to Windows, but you find that it doesn’t work with filenames that contain Japanese characters. This information may help, though specific recommendations will…… Continue reading Summary of some Win32 I/O character encoding behavior
The dwarf planet Eris is sometimes closer to Earth than Pluto is. That’s no secret. Wikipedia’s article on Eris even has a chart similar to the one below. But I feel like this fact has been strangely ignored in the whole is-Pluto-a-planet debate. Eris is a tiny bit smaller in diameter than Pluto, though it’s…… Continue reading When will Eris be closer than Pluto?
Maybe you’ve heard of the Milankovitch cycles, one of which involves changes to the eccentricity of the Earth’s orbit, as it is perturbed by other objects in the Solar System. Suppose you want to depict this with a diagram, using a circle, and an ellipse of exaggerated eccentricity. You could just draw any old random…… Continue reading How to draw an elliptical orbit
[I suggest reading my earlier post, The Big Bang, before this one.] The observable universe (OU) is the part of the universe that we can, at least in principle, observe, from a designated vantage point at a given place and time. This post is my attempt to figure out in more detail exactly what the OU…… Continue reading The observable universe