The most important things to do are:

- Install updates!
- Have an anti-virus program installed.
- Use a password manager.
- Don’t give out your passwords no matter what.
- Don’t click links in email.
- If it looks or feels “funny” or “strange” or “wrong” don’t do it!

First, a bit about me and my credentials. My name is Ian Greenhoe. My profession is computers, and has been for the past 24 years. I’ve programmed them, administered them, and secured them — sometimes all at the same time. I’ve secured and protected personal computers, professional computers, and servers. I’ve made web servers for companies. I’ve worked for the company who literally is the world’s best at protecting against, catching, and cleaning up after the Chinese hackers. I’ve even created my own Linux distribution. My CV goes into some more of the details if you’re interested.

I could go on, but you get the point. So let’s move on to expanding on the above points.

First, installing updates. This is critical. There are literally bad people out in the world who take updates and reverse engineer (find out on a very technical level) what the changes were. They will then take this knowledge and use it to make malware (evil software) that can walk straight into computers that haven’t installed the updates.

Every major operating system — Windows, Mac (OSX), iPhone (iOS), Android (Linux), Chrome OS (Linux), Smart Devices (Mostly Linux), Linux, other modern Unix variants, and many others — has put significant effort into making it easy to install updates. Often annoying, but easy. Despite this, it is still hard to get people to install them. Don’t be one of *those* people — *Just Do It* and install those updates!

Next, it is vitally important to *have anti-virus (“AV”) software* installed and running on any desktop or laptop. Those same people who look at the software updates also look for other ways to break in. Some of those ways are pretty nasty and scary. Yes, I know a bunch of those details, and I have occasional nightmares about them — and I don’t scare about computer stuff easily.

While AV software won’t catch everything, it will catch many things. Think of it like a vaccine for your computer without bad side effects. Again, *Just Do It.*

*Use a password manager.*

Passwords are something that comes up time and again. They’re an annoying necessity, and used poorly they are worth (almost) nothing at all. You’re not supposed to reuse them, they need to be difficult to guess, and geeks were the ones choosing the “best practices” until recently. While it is *possible* to brute force memorize a random 12 letter password, it is difficult and unnecessary. (Yes I can memorize them, yes I have, and no, I don’t recommend it.)

This is why I recommend a password manager. My wife and I use 1Password on our laptops and phones, as it makes all of the passwords available on all of our devices. I’ve also heard good things about LastPass. There are others, but I’m not familiar with them. The way that the password manager works is that it securely stores all of your passwords for you, and you only need to memorize one password.

Here’s what I recommend:

- Choose a good password. Here’s a link about good, strong passwords: https://xkcd.com/936/
- Write it down using pen and paper. When you’ve got it memorized, put it in a secure location such as a safe or a safety deposit box.
*No matter how tempting, don’t put this in any electronic file, email, etc.*The only place this should touch your computer or smart phone or tablet in when you enter it into your password manager. - Use that password for your password manager.
*Do not use it for anything else!* - Use the password manager to create and store unique passwords for everything else that wants a password. Minimum 12 random characters and two symbols and 14 or 16 is better.

The goal here is to push all of your passwords from “one website was stupid and now everyone has your password” to what I like to call “GFL” (Good F***ing Luck).

Please keep in mind that physical items (such as paper) are *always* easier to secure than anything in a computer.

The next one is simple: *Do not ever give out passwords.*

Do not give passwords to the nice person from the bank who called you. Do not email passwords to the nice person who just wants to help you. Do not give out passwords to the person on the phone claiming to be from your company’s IT department. Don’t enter it into that handy form. Don’t write it down for some person, no matter how helpful or nice they are. *Just DON’T do it!*

The one possible exception is for spouses, parents, siblings, and children. Ask yourself “Do I trust this person to not clean out my bank account?” If the answer is yes, then you might consider giving them your password.

Next, *don’t click links in email*. A favorite tactic among evil hackers is to send you a link to you claiming to be about something safe or innocuous. They may even make it look like it’s coming from a friend, relative, coworker, boss, or colleague. Yes, really.

Always be suspicious. If you just signed up for something and they tell you that you’ll get a confirmation email, that is probably ok. An email claiming to be from your bank with a link? Forward it to your bank and then delete it. If you think the email is from someone you know, calling them is not a bad thing to do. The conversation can be as short as “did you send this?” It’s important to get a voice or video confirmation — text communications are far to easy to fake.

Lastly, be suspicious. If it looks or feels “funny” or “strange” or “wrong” don’t do it!

There are a lot of good people out there. Unfortunately, there are also enough evil people that you have to be careful. The evil people try to masquerade as good people. They know how to be polite. They know how to get you to trust them. They want to give you “good deals” that are anything but. They are really good at selecting targets. Don’t be one!

]]>Each of these questions has a direct impact on how the project can be engineered and what tools and techniques you use to engineer it.

1) “Problem?”

That is, the need are you trying to fill. Are you trying to save people a few minutes when typing of a document? Are you making a user interface easier to use? Are you providing control software for life support on Mars? Are you trying to give a bored person something to do for ten minutes?

Starting with a solution statement is almost always a recipe for disaster. Find out what the problem is that needs fixing first before committing to a solution. I have found that by asking what the problem is that actually needs solving, you can radically reduce the complexity of the answer.

2) “Target audience?”

Who are you trying to solve the problem for? Are you trying to solve the problem for your coworkers? For ten million people? For a surgeon in the middle of surgery?

Who your target audience is helps to determine how much polish you need to put on the product. A solution that is acceptable for your coworkers is going to require a lot less work than something to be used by a surgeon. (Unless, of course, you work in a hospital!)

3) “Time to market?”

Simply put, how long you have before the solution needs to be in place. Today? A week? Six months?

The solution to a problem that needs to be solved today is inherently more limited than one that can be solved by next week or next year. Sometimes a problem can’t be solved in its original form in the time frame required. In that case, you need to reduce the scope of the problem or increase the time frame.

4) “Headcount?”

The more people working on a problem, the larger the scope that you can handle. More people also means more communication, more up-front design, and more time needed to handle changes down the line.

5) “Budget?”

Budget can refer to both money as well as (existing) equipment and tools. If you have adequate equipment, you may not need a monetary budget over what is currently allocated. Sometimes, having a monetary budget means you can buy a solution off the shelf and reduce your overall time and effort to solve.

6) “Licensing?”

This means how are you going to sell — or not — the final solution. If you are solving a need for existing customers, is it part of a patch to the existing version or is it to be released in the next major version? Are you giving it away? Are you going to be using a pay-per-use model?

A solution for one licensing model may not work for another. It’s important to be clear up front what you’re going to do so that you don’t end up wasting everyone’s time.

7) “Return On Investment?”

This is perhaps the most open-ended of all of these questions. In a nutshell, how much value will this project give to you and your target audience — is it something that will save some infrequent annoyance, or is it something that will transform lives? The more impact it will have translates directly into how much more you can invest before hitting the break even point.

]]>

Or, more precisely, how it *doesn’t*. RSS is no longer supported in either Mail.app or in Safari.

After reading a bit, I decided to try out Reeder. Nice program, but it has an unfortunate (fatal) flaw: It doesn’t import RSS from Mail.app.

Since I happen to be good with the command line, I shortly came up with a method to extract the RSS feeds. This is a 90% in that the results that it prints have some encoding (such as & for an ampersand.) I’ll post later a 100% solution.

This solution may or may not work with Safari RSS feeds. I’ll post if I see a solution for Safari.

To extract your RSS feeds:

- Run Terminal.app (or any other command line terminal). Terminal.app can be found under your dock at: Applications -> Utilities -> Terminal.app
- Make sure a terminal window is open. In Terminal.app, the following menu option will open a new terminal window for you: Shell -> New Window -> Basic
- Copy and past the following into a terminal window:

find ~/Library/Mail/V2/RSS -name "*.plist" -print0 | xargs -0 grep -hA 1 RSSFeedURLString | grep "<string>" | sed -e 's/.<string>//' -e 's/<\/string>$//'

You’ll now have a list of RSS feeds. Enjoy!

—-

Edited to fix accidental change in the command line.

]]>This puzzle has inspired several computer games — one written in 1990 for MS DOS (called Sherlock) and another written a few years ago for Linux/Windows/MacOS called Einstein.

Both Sherlock and Einstein (the computer game) are played on a 6 by 6 grid of tiles. Each row has a set of items for that row, and each column has a specific series of items from each row.

For example, a specific row could have types of animals — say cats, dogs, horses, birds, and fish. Each specific column would have one of a cat, a dog, a horse, a bird, or a fish. Further, one and only one column would have a cat (or a dog, etc.)

Here’s a more specific example — let’s say that we have a 4×4 grid. In the first row, we have types of animals (dog, monkey, mouse, goat). In the second row, we have different-colored tiles (red, green, blue, orange). In the third row, we have different numbers of circles (one, two, three, four). In the fourth row, we have letters (A, B, C, D). Now, in each row, we can only have the items specific to that row — we can’t have a mouse in the colors row. When the puzzle is solved, each column will have one item from each row — the first column might have a goat, a blue tile, two circles, and the letter A, and so on for the other columns.

In order to determine which tiles go in which columns, you are given a number of clues. The clues in this puzzle tell you about how the tiles are laid out. There are five types of clues:

- A specific tile goes in a specific location. (Example: the red tile is in the second column.)
- That two tiles (different rows) are in the same column. (Example: The monkey is in the same column as the letter B.)
- That two tiles are in immediately adjacent columns; the tiles may or may not be in the same row. (Example: The two circle tile is in the column adjacent to the tile with the dog.)
- That one tile is to the left (or right) of another. (Example: the letter “C” is in some column to the left of the blue tile — not necessarily adjacent.)
- Lastly, that three tiles are in three adjacent columns. (Example: the red tile is adjacent to the cat, which is then adjacent to the letter “B”.)

I was thinking about how to implement this puzzle in a computer game. In order to do this, you need to be able to create a set of rules that are both consistent and have only one solution.

The first thing that I need to do is to determine what solutions a set of rules match, if any. Well, the brute force approach would be to enumerate the boards one-by-one and see how many boards match those rules.

A quick back-of-the-envelope calculation tells us that this is impractical — for a 6×6 board, there are possible combinations of tiles per row, and with six rows, there are possible arrangements of tiles. This means that brute force is Right Out.

So here’s a first attempt. First, the program should choose “the solution” to the puzzle that it is going to present: some ordering out of the 140 quadrillion possible solutions.

Now we start randomly creating rules that are consistent with our solution.

For each rule that we create, we start looking at the partial solutions that will match that rule and the other — previously created rules — if we create a rule that says “The cat is above the red tile”, we examine the six partial solutions that match this rule (cat and red tile in the first column, in the second column, etc.)

We’ll keep on adding rules just so long as we either:

- Apply all of the rules and still have tiles that we didn’t place somewhere — in which case, we create a rule that matches the tile that we didn’t place.
- Find other solutions — and then we add a rule that matches “the solution” but not the “other solution” that we just found.

Eventually, we’ll get to the point where we have rules that only match our chosen solution.

From experience, we’ll end up with between 10 and 20 rules. Searching through this list is much shorter. At the very worst, we have 15 separate ways that a specific rule can match an empty board. Further, the more rules that have been applied, the fewer number of ways a given rule can match the board. The absolute worst we could see for the number of combinations that we’d need to traverse is

Clearly, this is not an improvement — so what if we *sort* the rules before we try to apply them to the board? The pessimistic option above would become combinations that we would have to check.

Now the question becomes, how do we sort the rules?

Here’s my first stab at how to order the rules:

- All “this tile goes specifically here” rules.
- Any rule mentioning a tile placed by “this tile goes specifically here”.
- Any rules containing tiles that are in the rules from #2 (and now #3).
- Count the occurrences of the tiles in the remaining rules. The more times that a tile occurs, the more “important” it is. Sort the remaining rules by the “importance” of the tiles mentioned therein.

Analysis of this is going to prove more difficult; more on this later!

]]>

Imaginary numbers were created as an attempt to find a solution for the square root of negative one. No matter how hard you try, you can’t find a real number where the square is -1. So mathematicians created a construct called “*i*” which is defined so that . This means that *i* can be considered **a** solution for the square root of negative one — but it isn’t the *only* solution. Per my last post, you can also consider as another solution to the square root of negative one.

When you put real and imaginary numbers together, you get complex numbers. These can be written as . Addition and subtraction are fairly straightforward — . Multiplication is a little more difficult: . Division is a little harder yet:

Once you have these down, working with complex numbers is pretty straightforward. The only weirdness is that you can’t really say if one complex number is larger than another. (For example, is larger than ?). You can tell if two complex numbers are equal: is equal to if (and only if) both and .

Complex numbers are not the only way to deal with trying to find a square root of -1. There is a mathematical construct called quaternions which have not one, but rather three constructs called *i*, *j*, *k* where none of *i*, *j*, or *k* are equal to any of the others, and . Since we want these to be candidates for the square root of negative one, . Any quaternion can be represented then by .

Quaternions are useful. For example, several graphics packages use them to be able to render 3d scenes — *bi* represents the *x* axis, *cj* represents the *y* axis, and *hk* represents the *z* axis (*a* is mostly ignored.) Using quaternions makes a number of transformations (like rotating an object) much easier to represent and calculate.

The problem is that there are some things that quaternions can’t do. Remember that I said that ? Well, it turns out that . Despite how this looks, this is not actually a contradiction, as *i* times *j* is not the same statement as *j* times *i*.

Why? Multiplication was inspired by wanting to find the total number of objects in some number of sets of some number of objects. For example, say that you have 4 boxes of 3 apples. How many apples do you have? 4 times 3 which is 12. Now, let’s say that you have 3 boxes of 4 apples. How many apples do you have now? 12 apples. Are 4 boxes of 3 equal to 3 boxes of 4? Yes, if you look at the total number of apples. No, if you look at the boxes; a pile of 3 boxes is not the same as a pile of 4 boxes. Multiplying real or complex numbers only care about the total number of apples. With quaternions, we care about the boxes as well.

(If you want to know: , , , and .)

By the way, quaternions are not the worst construct for weird properties — there are entire courses in college-level mathematics about constructs that are even weirder.

]]>Why? It’s a perfect example of a function that many people think is well defined, but in reality is not.

What do I mean by “well defined”? I mean a function for which any legal input will provide one, and only one, answer.

The problem is that the square root is considered to be the inverse of squaring something. At best, you can say that the square is the inverse of the square root. This is a subtle, but important, difference.

So: and and . This implies that and and .

This is all fine and dandy — until you consider the negative numbers. Take . Now, if the inverse of the square is the square root, then what is the square root of 81? We see that , so therefore both are candidates for the result of the square root function.

In algebra (where square roots come up often) there are some ways of denoting this. For example, the “number” is taken to mean “either positive or negative 9”. So then the “number” when squared is 81. So you could say that the square root of 81 is . This is still not a real solution to this problem, as all you’ve done is state your uncertainty in a shorthand format. Worse, you have something that *looks* like a regular equation (), but in reality, you are stating that you have 2 equations, one of which is actually true! (Either or , but not both.) Worse yet, for each in an equation, you have twice as many equations that may (or may not) be true.

There are ways to fix this. One solution is to say that the square root only refers to the positive number, that is, we ignore the negative numbers in taking the square root. This means that the square root is no longer a proper inverse of the square function, since .

Another solution is to add some notation to indicate which square root we are talking about. This is typically denoted by putting a plus or minus over the root symbol, so that and . Again, this means that the square root is no longer a proper inverse of the square.

And this isn’t even considering the square roots of negative numbers… (more on this later)

]]>Boffo the Impossible has an amazing trick. Starting at 11:00 am, Boffo puts two balls into a hat, and pulls one out. Every time he gets half-way closer to noon, he puts two balls in, and takes one out. So, at 11:30, he puts two in and takes one out. At 11:45, he puts two in and takes one out. At 11:52:30, he puts two in and takes one out. And so on — he becomes an flurry of activity as he gets closer to noon. At noon, he stops.

The question is: how many balls are left in his hat at 12:01 pm?

The obvious answer is an infinite number of balls, but this is not necessarily correct. The real answer is: any positive whole number of balls between zero and infinity.

Let’s say that Boffo numbers the balls as he puts them in. So that the first two balls (at 11:00 am) are numbers 1 and 2. The second two (at 11:30 am) are numbers 3 and 4. So on, and so forth. For every positive whole number (1, 2, 3, 4, 5, …) you can point to the exact time that he put it in.

Now the question becomes: In what order does Boffo take the balls out of the hat?

The natural assumption is when he puts in 1 and 2, he takes out #1. When he puts in 3 and 4, he takes out #3. When he puts in 5 and 6, he takes out #5. When you look at the problem this way, you clearly have an infinite number of balls (as you have all of the even numbered balls left.)

But… let’s say that Boffo *doesn’t* take the balls out of the hat that way. Let’s say that when he puts 1 and 2 in, he takes out #1. When he puts in 3 and 4, he takes out #2. When he puts in 5 and 6, he takes out #3. Now the problem is changed: *for every ball that Boffo has put in, you can name the time that he takes it out.* Whoa there! This means that you can’t name a single ball that’s left in the hat! Since you can’t name any ball that is left in the hat, there must be no balls left in the hat. (I triple dog dare you to name a single ball left in the hat.)

Now, if Boffo takes out the balls in the order #1, #3, #4, etc. then he has one ball left in the hat. You can construct a simular sequence to leave any number of balls in the hat that you want.

What’s going on here? This is an example of what mathematicians call a *conditionally divergent series* (or a conditionally convergent series depending on your perspective.) Each series like this has what’s referred to as a natural ordering.

For Boffo’s hat trick the natural ordering is: (2 – 1) + (2 – 1) + (2 – 1) + … which is clearly 1 + 1 + 1 + …, which is infinite.

Now, let’s say you reorder the terms, so that you have (2 – 1 – 1) + (2 – 1 – 1) + (2 – 1 – 1) + … You can do this since you have an infinite number of twos and minus ones. This ordering of the sequence is clearly 0 + 0 + 0 + … and so forth. This sums to zero.

The “conditional” part of conditional convergence/divergence is so-called because the result you get is entirely dependent on the sequence in which you sum up the terms.

And now you can say that you’ve had exposure to one of the key parts of advanced calculus. Thanks, Boffo!

]]>What do you have under Unix are what as known as “mount points”. (A more limited version of these are seen in Windows NT/2K/XP/Vista/7 called “reparse points”.) Any directory in Unix can have another filesystem “mounted” on it — that is, it is remapped to some other filesystem on some other location. So you can have /floppy pointing to the floppy disk, /usr pointing to a second partition, /home pointing to a network drive, and even /tmp pointing to a section of memory!

Traditionally under Unix, there are 13 top level directories under “/”. There are an additional 6 that are often seen on modern versions of Unix (such as Linux.)

These are:

- /bin — Where critical non-systems administrator only binaries (aka executables) are held.
- /dev — (Aha!) Where DEVice files are kept. (A device under Unix parlance is anything that isn’t an actual file, directory, or link.)
- /etc — This is where system-wide configuration files live.
- /home — This is where the users’ files are stored.
- /lib — This is where the LIBrary files are stored, (equivalent to .lib and .dll files under Windows.)
- /lost+found — This is where files that have gotten misplaced by the OS turn up. Not as useful with modern filesystems, but was indispensable if your filesystem went belly up in the Old Days.
- /mnt — This was a generic MouNT point, if you had some random filesystem that you just needed to grab a few files from. Some modern Unix variants (Red Hat Linux, for example) have used this as a place to store other mount points. Unix old timers hate this, because that is not what /mnt was originally for.
- /opt — This is where OPTional portions of the operating system were held. This is being phased out in favor of putting everything in either /usr or /usr/local with the advent of modern packaging systems (i.e. installers).
- /root — This is where the root (aka the admin account) account’s files are stored.
- /sbin — This is where the critical systems administrator only binaries are stored.
- /tmp — This is where TeMPorary files are stored.
- /usr — This is where USeR binaries, libraries, etc. are stored. (A quick mention about /usr/local: This is where files that weren’t provided by the maker of the OS are stored.)
- /var — This is where VARious systems files are stored. These include the user’s mail files, files to be printed, outbound email, and cron files (programs to be run at some specific time).

Common non-traditional root entries include:

- /boot — This is where some files (such as the kernel) needed for booting the system are put. Older versions of Unix often stored the kernel directly under /.
- /cdrom — A mount point for CDs.
- /dos — This is where DOS (i.e. Windows) filesystems are mounted. Most often seen on computers that are set up to boot both a variant of Windows and a variant of Linux.
- /proc — This is where Linux stores running PROCess files (and other files that are based on the current state of the computer.)
- /media — A directory that contains mount points for things like CD drives, floppy drives, and USB drives.
- /sys — A newer Linux system file. This is ment to be supercede (parts of) /proc.

Whew! I’ll post more about these later.

]]>I wanted to add a quick note about why I chose the name “dev.ihgreenman.com” for the name of my tech/math blog. I chose it because it has a dual meaning — depending on which side of the Unix/Windows debate you fall upon.

In the Windows/Microsoft world, dev is an abbreviation for developer, development, or development work depending on context.

Under Unix, dev is where device files (pointers to anything that isn’t a file) are stored. More about what this means later.

]]>