Wednesday, October 31, 2018

Genetic algorithms and the Zodiac killer’s 340 cipher

A few weeks ago there was a Travel Channel special about the Zodiac killer hosted by the Mysteries at the Museum guy.  As usual, I actually tuned in the watch the previous show but was too lazy to change the channel when this special started.  Anyway, there was a serial killer active in the 60's and 70's who was never caught, dubbed the Zodiac killer.  The killer left behind a series of ciphers, some of which have yet to be decoded.

That got me thinking... has anyone ever tried using an evolutionary/genetic algorithm to solve the cipher?  Well, who knows, but let's give it a try!

What’s a Genetic Algorithm?

It’s an approach to solving a problem that mimics natural selection in the natural world.  Wikipedia has a much more detailed definition.  We’ll start with a set of “candidate” solutions, measure and select the fittest candidates, then combine the fittest candidates to create a new generation of candidates.  Repeat hundreds or thousands of times, and you might end up with an optimal solution.

This is especially useful when optimization is necessary and a "brute-force" approach isn't practical.  One example would be to find which out of 100 songs would fit best on a 60 minute CD.  You could go through and evaluate every possible combination.  Or... try a genetic algorithm.

In this case,  not knowing which letters are repeated as cipher symbols, there would be over one quadrillion possible combinations, which is far too many to test and analyze.  We need a better way to find a solution.  Enter the genetic algorithm...

Candidates

Ideally we’d start with candidates that are as strong as possible.  In this case I figured minimal effort would involve randomly matching the 62 cipher symbols to letters.  To be sure we don’t end up
With 62 “Z” or “Q” letters, let’s also take into account the general probability of a letter occurring in the English language.  

Having too few candidates might not offer enough diversity and you’ll converge on a non-optimal solution.  Too many candidates and it might affect performance or take too long to converge.

static public class RandomLetterGenerator
    {
        /// <summary>
        /// Dictionary of letters and their probability of occurring in the English language
        /// </summary>
        static private Dictionary<char, double> dictLetterProbabilities = new Dictionary<char, double>()
        {
            {'e',.1116},{'a',.0850},{'r',.0758},{'i',.0754},{'o',.0716},{'t',.0695},{'n',.0665},{'s',.0574},{'l',.0549},{'c',.0454},{'u',.0363},{'d',.0338},{'p',.0317},{'m',.0301},{'h',.0300},{'g',.0247},{'b',.0207},{'f',.0181},{'y',.0178},{'w',.0129},{'k',.0110},{'v',.0101},{'x',.0029},{'z',.0027},{'j',.0020},{'q',.0020}
        };
        static public Random r = new Random();
        /// <summary>
        /// Gets a random character a-z taking into account the probability of a letter occurring in a word.
        /// </summary>
        /// <returns>A character</returns>
        static public char GetWeightedRandomChar()
        {
            double next = r.NextDouble();
            double sum = 0;
            // Keep adding probabilities until the sum is greater than the random double.  The current letter is then the one returned.
            foreach(KeyValuePair<char,double> kvp in dictLetterProbabilities)
            {
                sum += kvp.Value;
                if (sum >= next)
                {
                    return kvp.Key;
                }
            }
            return null;
        }

    }


Fitness/Selection

Now that we have a set of candidates, we need a way to measure which are the best.  This is usually referred to as the “fitness” of a candidate.  I chose to check what percentage of the 340 characters match the 1000 most common English words.  We’ll just take a substring of the 340 characters with a length that matches the longest word in our “Dictionary”, removing a character until we match a word or run out of characters.  This will give preference to longer words over shorter words.  Otherwise we’d just end up with a bunch of one and two letter word matches.  Next, loop until all 340 characters have been exhausted.

You could set your algorithm to stop after a certain fitness is found, or if it doesn’t improve after N consecutive generations.  My solution runs through N generation regardless of if the fitness is improving or not.  This lets me watch how it progresses while I'm testing the solution.

Crossover

After we find the fittest candidates, we should remove the least fit and mate/crossover the fittest of the generation to replace them.  How you crossover two candidates and how many you cull involves some trial and error.  

The point where you crossover is called, amazingly, the “crossover point”.  In our case we have 62 symbols, so my program randomly selects a number between 0 and 61. Any symbol before the chosen index gets copied from the first candidate and any symbol after or equal to that index is copied from the second candidate.  Combine the two and you have a new candidate created from the strongest of the previous generation.  

Also, my algorithm finds a random mate within the population.  I’ve seen some algorithms mate 1&2, 3&4, etc, but randomizing it seemed to produce better results in this case.  This algorithm also keenest the fittest of each generation.  A “true” genetic algorithm would only have offspring in the next generation.  However, keeping the fittest candidates from the previous generation produced better results in this case.  Again, you can customize the process however you see fit.  It will involve some trial and error.



/// <summary>
        /// Crossover between two candidates.  The crossover point is a random point in the cipher key.
        /// </summary>
        /// <param name="c"></param>
        /// <param name="mutationProbability"></param>
        /// <returns></returns>
        public Candidate MateWith(Candidate c, double mutationProbability)
        {
            string newCipher = string.Empty;
            if (r == null)
                r = new Random();
            // Randomize a mutation
            if (r.NextDouble() <= mutationProbability)
            {
                char[] charArray = CipherKey.ToCharArray();
                charArray[r.Next(0, CipherKey.Length - 1)] = RandomLetterGenerator.GetWeightedRandomChar();
                CipherKey = new string(charArray);                               
            }
            // Randomize the crossover point
            int crossoverPt = r.Next(0, CipherKey.Length-1);
            for (int i=0;i<crossoverPt;i++)
            {
                newCipher += CipherKey[i];
            }
            for(int i=crossoverPt;i<c.CipherKey.Length;i++)
            {
                newCipher += c.CipherKey[i];
            }
            return new Candidate() { CipherKey = newCipher,Fitness=null };
        }

Mutation

Notice mutationProbability in the snippet above.  That's because we also need to add mutation into the mix.  Every time two candidates are mated, there should be a small chance of one or more letters being switched.  This helps add diversity to the candidate pool and helps prevent premature convergence to a lower fitness solution.  What percentage and how many letters to switch?  That’s up to you.  My program flips one letter for the sake of simplicity.

Results?

Unfortunately, I wasn’t able to reach a solution that made any sense.  Finding an excuse to incorporate an evolutionary algorithm was worth it for me though.  There are some cloud based text analytic APIs out there.  Perhaps incorporating something like that would improve the outcome.  I wasn't able to reach any meaningful solution, but maybe you can improve on the idea and find a solution that makes sense!

The full C# source code can be found on github for your review .(https://github.com/1000littleideas/Zodiac340).

The textbox on the left will display the fittest candidate thus far while the textbox on the right displays the fittest candidate from each generation.  It ended up at just over 70%, but there were a lot of two/three letter words that didn't combine to mean much.




Wednesday, October 24, 2018

You might have nightmares...

Your favorite scary movie, carving a pumpkin, or maybe memories of going door to door asking for candy; we all have certain things that get us in the Halloween spirit.  Well, it’s that time of the year again, and I’ll be listening to scary podcasts to set the Halloween mood.  Only listening to a story and allowing your mind to paint the scenery often enhances the desired effect.  Below are a few podcasts out of the many great podcasts available.  So, put in your earbuds, start up a podcast, and prepare to be scared!

Lore
An award-winning podcast by Aaron Mahnke that details scary or unusual history.  Lore is also a TV show on Amazon Prime Video.  Aaron has a number of novels out there and a second podcast titled Cabinet of Curiosities.  If you enjoy Lore, give that one a listen too.


The NoSleep Podcast
The premier fictional horror podcast.  There are hundreds of hours of well-produced content for you to pore over.  Many skilled voice actors, composers and artists contribute, including the founder David Cummings. 


Knifepoint Horror
Most of the stories are written and narrated by Soren Narnia.  There’s not much music and usually no other contributors.  However, his stories are very well written, and his narration, which I’d liken to a friend telling you a tale, keeps your attention until the end of the story.  Highly Recommended.


Tales To Terrify
With a plethora of stories in their backlog and quite a few different narrators, you’ll find plenty of variety here.  Also, the intro narration by Stephen Kilpatrick is usually interesting and well thought out.

Creepy
Created and narrated by Jon Gritz, you’ll find a lot of worthwhile content here.  If you prefer The NoSleep Podcast, you’ll definitely enjoy Creepy.
https://www.creepypod.com/

All of these podcasts have many, many hours of free content, so what are you waiting for?

Tuesday, September 11, 2018

Recording Audio

So you have your recording interface, a mic or instrument, Cakewalk downloaded, and you want to record some audio? Let's do it!

Test the Audio Output

  1. In the Control Panel or Settings in Windows, select "Sound" or "Manage Audio Devices".  Search for one of these in the Windows search bar if you're not sure where to find it.
  2. On the "Playback" tab, be sure your audio interface is enabled and selected as default.  It should have a green check next to it.
  3. Next, make sure your audio interface is default on the "Recording" tab.  My Focusrite 18i8 is connected to my desktop, and I'm currently on my laptop, so imagine "Microphone" is your audio interface.
  4. .
  5. If either is not enabled or checked, right click the entry and enable/ set it to default.
  6. Right-click the playback audio interface again and click "Test".  You should hear sound.  
  7. If not, be sure the volume is up and that you have the latest drivers for your device.  If that fails, check your manual and see if your audio interface has a free support line or email.

Audio Options

  1. Open Cakewalk by BandLab and start a new "Basic" project. (Either on the startup screen or File>New). 
    File>New


    Or the Cakewalk Start Screen

  2. Edit > Preferences > Devices
  3. Choose your audio interface under "Input Drivers".  
  4. Under "Output Drivers" choose the interface connected to your speakers or headphones.

Add an Audio Track

  1. If you opened a "Basic" project, you'll already have an audio track and can move on to the next session.
  2. If not, right-click the track row header column and select "Add Audio Track"

Set the Audio Track to Record

  1. Click the red "Record" button on the Cakewalk ribbon.
  2. On your Audio track, click the red record button.  You'll only want to click on the track(s) you want to record.  Be careful to disable this when you want to move on to a new track, lest you overwrite other tracks.
  3. Click the "I" drop-down and select your audio interface as the input to your audio track.
  4. The "O" (Output) drop-down should be set to "Master".
  5. Your "Master" bus on the left should be set to your audio interface's Output Driver.  Click the drop-down to change it.  The "Master" bus will also be your main volume control.
What is a bus?  A bus is an audio channel where you can control the result of several tracks at once.  For example, lets say you have three different guitar tracks and you need to raise the volume of all three guitars and add some reverb.  You could raise the volume and add reverb on all three tracks, or you could send all three tracks to a "Guitar" bus.  Then you would raise the volume and add the reverb once to the Guitar bus.

Input Echo

Click this button if you want to hear what you're recording as you record.  This can be helpful sometimes, or give you the preview of some real-time effects you have on a track.  However, if your audio interface has some latency (delay), it will sound like you're echoing and can throw you off, so use with caution.

Mute

As you might imagine, muting the track will stop it from playing back.  I sometimes mute the track if I'm going to record several takes in one fell swoop on the same track, that way I don't hear the other takes while I'm recording the next one.  I'll post a step-by-step on how to do this later

Maintain Tempo with a Metronone

Eventually you may have some type of percussion to maintain tempo while you record.  Until then, we can set a metronome within Cakewalk.
  1. Find the tempo field on the Cakewalk ribbon.  It probably reads 120 by default.
  2. Think of a tempo that suits what you want to record.  Remember that tempo equals beats per minute.  
  3. Move all the way back to the beginning of the song.  You can set different tempos throughout the song later, but for now we want the same tempo throughout.
  4. Click the 120 and change it to the beats per minute you want.  Don't worry, you can change it later.
  5. Enable the "Metronome on Record" and "Metronome on Playback" buttons if they're not already enabled.  If you don't want the metronome to sound on playback or record, you can disable these later.
  6. Click the play button and listen to the metronone.
  7. Doesn't sound quite how you'd like?  Feel free to peruse the advanced metronome options.

Adjust Volume on Your Instrument and Interface

Before we record, be aware of all the places you need to have the volume turned up.  Start as low as possible, and turn it up after you're sure it's working.  
  • The volume knob on your instrument.
  • The volume on your audio interface.
  • The volume in your audio interface drivers and the playback volume in Windows (Control Panel)
  • The volume on the track in Cakewalk/
  • Is your audio track in Cakewalk muted?

Rock and Roll!

Your track is set to record and everything is ready to go, so click the record button and let's hear what you got!

Extra Credit: Loop and Record

Sometimes you're not sure how to sing a part and just want to record a few takes without fiddling with your computer in between each.
  1. Mute the track you're recording.  You don't want to hear previous takes while recording.
  2. Activate looping
  3. Specify which measure/bar you want to start and stop recording.
  4. Otherwise, follow the same recording instructions above.
  5. To hear each take individually, you can move them to separate tracks or mute some of the clips to only hear the ones you need.

Monday, August 27, 2018

Great Balls of Fire

Earlier this evening I had the privilege of witnessing an event called a "fireball". It lasted several seconds, traversed most of the visible sky from my viewpoint, and had quite a long, bright tail.

Apparently a fireball is a very bright meteor.  Meteors are objects burning up in the atmosphere; not to be confused with asteriods or meteoroids which are the same objects floating safely in space.  Whether a meteor is described as a boloid or fireball depends on the intensity of light emitted. Here's a simple graphic that details the differences.

Now I admittedly already knew the basic differences between meteors and asteroids,  but I had never heard of a meteor being a fireball or boloid.  It's always interesting to learn something new.

Unfortunately, I didn't have my phone to take a video, so you'll have to take my word for it.  Well, you'll have to take the word of over 100 people that witnessed and reported the event.  How do I know that?  Anyone can log such an event online at https://www.amsmeteors.org. If enough people report an event, the organization will verify if the phenomenon is legitimate or something else, if I understand correctly.  You can also see a map of all reports for any event, including the event I witnessed.

Edit: Here’s an article with video:
https://www.amsmeteors.org/2018/08/fireball-over-missouri-on-august-27th/

Saturday, August 25, 2018

Recording Interfaces


In the last post we downloaded BandLab.com’s Cakewalk and loaded a demo.  There’s a ton of options and controls to go over, but the next thing you probably want to do is get something of your own recorded!

Whether you want to record voice or an instrument, you’ll need an interface to get the audio into the computer.  Let’s go over the basics of a few options.

The Soundcard You Already Have

You might already have an input interface built in to your computer- the “mic in” on your soundcard.  Not all soundcards have a “mic in” anymore, but if it does, you might be in luck.  Using your standard soundcard may not result in the highest quality recording, but it at least gives you something to try. 


Vocals

For vocals, you could use the mic on a headset, mic on phone earbuds, mic on your webcam or a professional dynamic microphone with an XLR to1/4” cable and ¼” to 3/5mm adapter. 


Guitar

To input a guitar or bass, you could connect the ¼” instrument cable to a ¼”/3.5mm adapter and plug it into “mic in” on your soundcard.  Be sure your instrument is turned all the way up. 
You might notice the recorded audio is very quiet.  For now you can boost the level (along with noise) in Cakewalk after you record.  In more advanced interfaces, you’ll use an amplifier, or put a mic on the instrument which will then be amplified through a preamp.

Before you buy any of the options above, be sure to check out the more advanced options below, which might offer better results.
Basic soundcard connections
(click to enlarge)

USB Microphones

Maybe you only want to record voice for podcasts, voice-overs, or music?  Want a quick, simple setup and high quality results?  You might be looking for a USB microphone.  Most have a convenient low-latency (low delay) headphone jack that you can use to monitor how you sound.  Some will come bundled with recording software.  Any of them will work with Cakewalk, though, so I'd recommend using whichever is easiest to learn.

If you plan on recording instruments or multiple microphones at once, however, I'd check out the multiple input audio devices below along with a solid condenser microphone (more on that in a later post).  Otherwise, plug one in and get started on your voicework!  Here's a few USB Microphones to consider:

USB microphone setup
(click to enlarge)

The Blue Yeti

Truth be told, I haven't actually used this one before, but it's held in high regard within the podcasting community.  Also, it can be had for just over a hundred bucks which is very reasonable when it comes to microphones.



Rode USB Microphones

Rode has been making high-quality microphones for years.  The Rode NT-USB is a condenser microphone that's meant to be used for broadcast or music, while the Rode Podcaster is geared solely toward broadcasting, but can be connecteed to an iPad for use in Garageband or other apps.



Audio-Technica ATR 2100-USB

Want a mic with a more reasonable price, but don't want to sacrifice sound quality?  Try out this Audio-Technica mic.
There are quite a few other quality USB microphones out there, but these three are a good place to start your search.  Also, like with any audio equipment, be sure to purchase from an authorized seller to guarantee the manufacturer warranty.  On Amazon, which I've linked to, be sure the seller is Amazon.com or a legitimate electronics retailer.



USB/ Thunderbolt Audio Interfaces

Need more versatility?  Maybe you want to record vocals and electric guitar at the same time on different tracks, or maybe you and the rest of your band want to record at the same time?  You'll need a full multiple-input USB Interface.

One of the most significant features will be the count of inputs and outputs on the device.  Be sure that it has enough to fit your needs.  Most have instrument direct inputs for recording guitars and XLR inputs for any type of microphone.  Although most include it, be sure that it has phantom power in case you want to purchase a condenser microphone at some point.

Considering outputs, you might want to connect to a mixing board, speaker/monitors, headphones, etc.  You can also actually chain some usb interfaces together for recording sessions with many inputs.  Most geared towards home use have a dedicated 1/4" headphone output with a dedicated headphone volume control too.  This will eliminate the need for purchasing a separate headphone amplifier.

Presonus and Focusrite make quality units that are pretty popular, but there's also other quality brands that have been out there for decades like Tascam, Behringer and Apogee.
A few common connections
(click to enlarge)
Decide how many mics you'll be using (XLR inputs), how many instruments/devices you'll be connecting directly (1/4" inputs) and how many headphones/speakers you'll be using.  You might directly connect a bass, and just run some EQ in Cakewalk.  Or, you might have a DI Box, Line 6 device, Effects processor, etc to use the 1/4" line in.

Of course you can purchase a headphone amp to split the signal further, or connect another mic preamp unit to a line-in, but to save space it would be ideal to get as much as possible in the original unit.  Take a look at the images in the Amazon links, check out some of the reviews and remember you can't go wrong with the quality of any of these units.


Singer Songwriter

These units will give you enough flexibility to sing and record at the same time.


Focusrite Scarlett 2i2

  • 192kHz max sample rate. (CDs are 44.1kHz.  DAT is 48kHz, so this is usually way more than enough.)
  • Two XLR inputs with preamp or two 1/4" instrument inputs
  • 48V Phantom power for condenser mics
  • Software Bundle (will still work with Cakewalk, though)
  • Dedicated headphone output and two balanced 1/4" outputs for studio monitors


Focusrite Clarett 2Pre

     Same as the Scarlett 2i2, except:
  • The mic preamps are slightly better sounding with "Air" technology, 
  • There's two more 1/4" outputs for monitors or mixers.
  • The chassis has a brushed aluminum face
  • It uses USB-C instead of the more common, older USB-B. So, be sure you have a USB-C port on your computer.
  • It has MIDI in/out.  This comes in handy if you have MIDI instruments.  I'll go into more depth on MIDI in future posts


Presonus AudioBox USB 96 2x2

  • 96kHz max sample rate; again, more than enough
  • Two XLR inputs with preamp or two 1/4" instrument inputs
  • 48V Phantom power for condenser mics
  • Software Bundle (will still work with Cakewalk, though)
  • Dedicated headphone output and two balanced 1/4" outputs for studio monitors
  • MIDI in/out


Presonus AudioBox iOne


  • 96kHz max sample rate
  • 1 XLR input and one 1/4" instrument input
  • Phantom Power
  • Software Bundle.  Also integrates with an iPad App using an MFi connection.
  • Dedicated headphone 1/4" output and a set of 1/4" outputs for monitors



Record the whole group at once!


Focusrite Scarlett 18i8

This is the interface I currently use.  I'd definitely recommend it.  Maybe in a later post I'll do a more in-depth review.
  • 192kHz max sample rate.
  • 4x XLR or 1/4" instrument inputs and 4x 1/4" line inputs, along with 1x ADAT optical input.  Using the optical input, you can chain two units together to get the 18 inputs from the name.
  • Two dedicated headphone outs
  • 48V Phantom Power
  • MIDI I/O
  • Software Bundle.  
  • Two dedicated headphone 1/4" outputs and a 4x 1/4" outputs for two sets of monitors


Focusrite Clarett 4Pre

     A newer version of the Scarlett 18i8 with a few improvements:
  • The mic preamps are slightly better sounding with "Air" technology, 
  • The chassis has a brushed aluminum face
  • Also integrates with an iPad App using an MFi connection.
  • It uses USB-C instead of the more common, older USB-B. So, be sure you have a USB-C port on your computer.

 


Presonus Studio 1810

  • 192kHz max sample rate; more than enough
  • 2x XLR or 1/4" combo inputs, 2x XLR mic/line/Hi-Z inputs and 4x 1/4" line inputs
  • S/PDIF or ADAT/Toslink optical input and a S/PDIF output.
  • 48V Phantom power for condenser mics
  • Software Bundle (will still work with Cakewalk, though)
  • 2x dedicated headphone outputs,6x balanced 1/4" outputs for studio monitors or other devices.
  • MIDI in/out




Sunday, August 19, 2018

Cakewalk (Sonar) by BandLab


It’s a great time to be a musician.  The ability to self-publish and record at home has opened doors for musicians that were closed to all but a select few only several years ago.  Relatively inexpensive software and hardware is readily available. 

The only thing better than inexpensive is… free!  So, when I found out that Cakewalk by BandLab, previously known as Cakewalk Sonar, was free, I jumped at the chance to download it.  Cakewalk is a multi-track audio/midi application that until recently cost hundreds of dollars.
  1. Sign up at https://www.bandlab.com/ and download the Cakewalk Desktop App.
  2. Run the installation and open the software.
  3. Open any of the demo projects.

  4. Click "play" on the top toolbar
  5. You should hear the song after a few seconds.  Take a look around at the multiple tracks and various controls.
  6. If you don’t hear any audio, be sure your volume isn’t muted.  Also, check that the audio device connected to your speakers is listed and selected in Edit>Preferences>Audio>Devices>Output Drivers
      The rest of bandlab.com seems useful too, although I’ve yet to try any of the collaborative features.  I’ll post more about using basic midi and audio with Cakewalk in the near future.  Don't want to wait?  There are plenty of books out there. Until then, tinker around to your heart’s content.

Thursday, August 16, 2018

Starry Nights and Bokeh Shapes


The other day I found myself looking for an interesting setting for a newborn photo.  Based on this post that details how to construct custom bokeh shapes with a DSLR, I decided to create a “starry night” background.
  1. Create a board with points of light.
    1. Get a large piece of black cardboard.  I got mine for a few bucks at Hobby Lobby.
    2. Punch holes of varying sizes in the cardboard.  I used a hammer and punch, but you could use scissors or anything else that would create a hole.  Vary the sizes a little to make it interesting.
      Cardboard with holes punched
    3. Next, we need a light source to shine through the holes and appear as stars.  I used a lamp and two different flashlights behind the cardboard.  Several light sources helped vary the intensity and color of light passing through the holes
  2. Create the shapes.  Check out this post for details on creating your own, or buy an already made set.
  3. Star shape with a quick tape job
    • I created the exact size of circle and shape I wanted on the computer and printed it directly to the construction paper.  I’m guessing that could jam your printer, so please try at your own risk!  Paint, PowerPoint, Sketchup, AutoCAD, Word or many other applications would do the trick.
    • Manually focusing (unfocusing in this case) first without the construction paper, then adding the bokeh filter afterwards worked for my photo.  Using a tripod would help with manual focus too.
    • Set your camera to aperture-priority and use the highest aperture setting to start.  Also, try different distances from the board.
    • A quick test shows that the effect will work, but all the stars having exactly the same shape didn’t look as good as I thought.  Therefore, I decided to skip the bokeh shapes on this one.    
      Bokeh shapes seem to work
  4. The baby is on a white blanket over a soft, padded surface.  The white blanket also gives the unintended effect of looking like a cloud.  The end result is below.  Keep in mind that I’m not a paid professional, only an amateur.  Also, be sure that the baby doesn’t roll off and is properly supported! 
    Baby dreaming
Have any photography tips you’d like to share?  Let me know in the comments.

Tuesday, August 14, 2018

Out with the old...

What to do with old electronics?  Donate to Charity?  That's always a good choice.  Recycle at a place like Best Buy?  Most would agree that's better than immediately ending up in a landfill.  Or my favorite, store the item in the basement for years, thinking you might one day need the item again, only to dispose of it years later.  Yeah, that’s me more often than not.

Nowadays though, as you may already know, there’s many options for selling or trading in certain electronic items to give them a second spin and to get a small return on your initial investment. 
Case in point, I recently replaced my iPhone 6 with a new iPhone 8.  Instead of letting my iPhone 6 collect dust until it was totally worthless, I decided to search out options for selling or trading it in. 

decluttr


There’s quite a few options out there, but I’m only going to review the one I used, decluttr.com.  They offered the highest bid to buy my phone, and I even found a coupon code to add 10% to the value.  All in all it was about 30% higher than offers from the few other sites I checked.

How does it work?  First, they ask you a few simple questions to help you grade the quality of your phone.  Next, you're immediately able to view the amount they’ll pay.  If you agree and want to continue, they’ll generate a free shipping label for you that must be used within a time frame specified in their instructions.  All you need is your phone, a box, and some packing materials.

I received emails at every step in the process, making it very clear what was happening.  I also apparently forgot to unlink the phone from my iCloud account, so they sent a clear email allowing me to remedy the situation and continue along the process.

Finally, within about a week from beginning to end I had the money in my PayPal account and one less thing cluttering up my basement.

Amazon Trade-In


Newly flush with virtual funds, I was inspired to get rid of my iPhone 4S.  Unfortunately, that was a little too old to show up on decluttr.com, so I used Amazon Trade-In, which works about the same way.  They’ll also ship the item back for free if for some reason they grade it at a lower level than you.  I’ve used Amazon to trade in CDs and console video games in the past with great success.  Anyway, they end up putting Amazon credit in your account.


Overall, I’d recommend decluttr or Amazon Trade In based on my limited experience with them.  Hopefully this helps you make a decision if you’re considering either.

Genetic algorithms and the Zodiac killer’s 340 cipher

A few weeks ago there was a Travel Channel special about the Zodiac killer hosted by the Mysteries at the Museum guy.  As usual, I actually...