Picture taken at Brass Mill Center in Waterbury. 30 second exposure at f/22 ISO 400 from (cheap) tripod with remote release. Canon EOS 5D Mk III through an EF 24-105mm IS lens.
The spikes around the lights in the image are called diffraction spikes, and are caused by the camera's aperture. Different shaped apertures create different patterns in the light. In this case the aperture is an 8 bladed construction, which causes the 8 radial spikes. (If you look at the flare in the top right corner you can see the shape of the aperture projected onto the image.)
Friday, September 29, 2017
Wednesday, September 27, 2017
A brief study in optimization (Part 1)
Wait, what is a triangle square number?
To understand what a triangle square number is, we first need to look at what a triangle number and square number are. Triangle numbers are numbers of the form 1 + 2 + 3 + ... + n. They have a neat property in that if you have a triangle number of things you can arrange them into an equilateral triangle. As in -
A square number is just a perfect square, like you learned about all those years ago in math class. A square number can be represented mathematically as n * n (or n2). Similar to the triangle number, if you have a square number of objects, you can arrange them into a square.
A triangle square number is a number that's both. Like 36, which is 6 * 6 so it's a square number, and 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 so it's also a triangle number.
Ok, so what does that mean to me?
Nothing. It's just a basic example we can use to look at algorithm design, and an iterative process for improving it. Also, stop being so judgemental, you're a figment of my imagination.
Point taken. Where do we start?
Next time we're going to start with the naive implementation, then work forward towards a better solution. Hopefully you learn something along the way.
* I stole the whole "arguing with an imaginary foil" thing from Ken over at Popehat. He's better at it than I am. No, I have no shame.
Tuesday, September 26, 2017
Be a coder! Not really.
Recently saw this on the Twitters:
It uses a function defined elsewhere, but there are actual side effects of running this code, namely a popup message box.
Why am I being pedantic?
Does she genuinely care about getting more people involved in the industry? No idea. Does the ham-fisted approach come across as genuine? Nope. Pandering to kids who are excited about programming does nothing to actually engage them. You just end up looking like the old guy with his hat sideways.
She really should have hired a better programmer to write that crap. Here's a couple problems:<script>— Ivanka Trump (@IvankaTrump) September 26, 2017
let PM = "signed";
if (PM === "signed") {
let CODING = "4 All";
}
</script> pic.twitter.com/QRKQPgbxjW
- Variable names. What the hell is PM? Why are your variable names in all caps? Variable names should be descriptive.
- Declaring PM is unnecessary. It serves no purpose.
- CODING is declared using the 'let' keyword, which in JavaScript means that the variable is declared using block scoping. For you non-programmers out there, that means that as soon as execution leaves the curly braces, the variable CODING is undefined.
- The code does literally nothing. There are no side-effects. Again for the non programmers: the computer is the same before running this as it is after running it, and it produces no effects visible to the user.
if (getQueryVariable("PM") === "signed") { alert("Coding 4 All"); }
It uses a function defined elsewhere, but there are actual side effects of running this code, namely a popup message box.
Why am I being pedantic?
Does she genuinely care about getting more people involved in the industry? No idea. Does the ham-fisted approach come across as genuine? Nope. Pandering to kids who are excited about programming does nothing to actually engage them. You just end up looking like the old guy with his hat sideways.
Friday, September 22, 2017
It's a blog! Kinda. Not really.
This is a blog. There are many like it, but this one is mine.
Realistically, this is just a placeholder site for the domain, so that when people go to it, they actually see something. There may be things from time-to-time that interest me, but no promises, and no apologies.
In the mean time, here are some links:
Realistically, this is just a placeholder site for the domain, so that when people go to it, they actually see something. There may be things from time-to-time that interest me, but no promises, and no apologies.
In the mean time, here are some links:
- My 500px Profile (Photography)
- Popehat
- Eric Turkewitz's New York Personal Injury Attorney Blog
- Lawyers & Liquor (If you're offended by swearing, maybe you'll want to try another one)
Subscribe to:
Posts (Atom)
Programmer vs Software Engineer: The Interview
A common question presented in interviews for developer positions goes something like this: Given an array of numbers, write a function th...
-
A common question presented in interviews for developer positions goes something like this: Given an array of numbers, write a function th...
-
When studying other art forms, like painting, you may be asked to do a study, or a copy of a painting in order to learn about the techniques...
-
Day 28: Bright A bit more experimental today. Edited to make it more ethereal and to soften the edges. And with that Phebruary is ov...