Some years ago I was working on interlocking board game tiles so that you could have a small box that would turn into a large game. Some point between then and not it occurred to me that each side of each hex needed to have 2 connection points, not one.
If you need a super easy way to reset your MySQL or MariaDB root password because you locked yourself out, this is how it can be done.
- Login as root@yourhost
- Shutdown any remote access as your server will be without password for a few moments.
- Edit /etc/my.cnf, and under the [server] section, add
- Restart MySQL
- Login and update the password with a query like this:
# mysql MariaDB> use mysql; MariaDB> update user set Password=PASSWORD("yourpass"), authentication_string=PASSWORD("yourpass") where User='root';
- Remove the “skip-grant-tables” line from /etc/my.cnf
- Restart mysql
You are back in action! Don’t forget to re-enable remote access.
Fage Total whole milk plain yogurt with home made peach jam.
Here is a basic introduction to immutable and immutable types in python.
In python there are two types of data… mutable and immutable. Numbers, strings, boolean, tuples, and other simple types are immutable. Dicts, lists, sets, objects, classes, and other complex types are mutable.
When you say:
a = [1,2,3] b = a
You’ve created a single mutable list in memory, assigned
a to point to it, and then assigned
b to point to it. It’s the same thing in memory.
Therefore when you mutate it (modify it):
b = 3
It is a modification (mutation) of the index
 of the value which
b points to at that same memory location.
However, when you replace it:
b = [0,0,0]
It is creating a new mutable list in memory and assigning
b to point at it.
Check out the
id() function. It will tell you the “address” of any variable. You can see which names are pointing to the same memory location with
Bonus: Every value in python is passed by reference… meaning that when you assign it to a variable it simply causes that variable to point to that value where it was in memory. Having immutable types allows python to “reuse” the same memory location for common immutable types.
Consider some common values when the interpreter starts up. You can see here there are a lot of variables pointing at the memory location held by
abc. cpython, at least, is smart enough to realize that the value `abc` is already stored in memory and because it is immutable, just returns that same memory address.
>>> import sys >>> sys.getrefcount('abc') 68 >>> sys.getrefcount(100) 110 >>> sys.getrefcount(2) 6471
However, a value that is definitely not present would return
2. This has to do with the fact that a couple of references to that value were in-use during the call to
>>> sys.getrefcount('nope not me. I am definitely not here already.') 2
Notice that an empty tuple has a lot of references:
>>> sys.getrefcount(tuple()) 34571
But an empty list has no extra references:
>>> sys.getrefcount(list()) 1
Why is this? Because tuple is immutable so it is fine to share that value across any number of variables. However, lists are mutable so they MUST NOT be shared across arbitrary variables or changes to one would affect the others.
Incidentally, this is also why you must NEVER use mutable types as default argument values to functions. Consider this innocent little function:
>>> def foo(value=): ... value.append(1) ... print(value) ... ...
When you call it you might expect to get
>>> foo() 
However, when you call it again, you prob. won’t expect to get
[1,1] out… ???
>>> foo() [1, 1]
And on and on…
>>> foo() [1, 1, 1] >>> foo() [1, 1, 1, 1]
WHY IS THIS? Because default arguments to functions are evaluated once during function definition, and not at function run time. That way if you use a mutable value as a default argument value, then you will be stuck with that one value, mutating in unexpected ways as the function is called multiple times.
The proper way to do it is this:
>>> def foo(value=None): ... if value is None: ... value =  ... value.append(1) ... print(value) ... ... >>> >>> foo()  >>> foo()  >>> foo() 
As we clean up wood stain from brushes and equipment it contaminates the paint thinner used in the parts washer. The good news is that most of the stain settles to the bottom.
Here is a “funnel” that we designed and had fabricated by Anything Metal in Altoona. It will allow the solids to flow to the bottom overnight, and then we can draw them off and properly dispose of, while dramatically reducing the amount of paint thinner we need to dispose of.
Zech and Ezra made hard candy from scratch. I thought it was great. Next time they will try different flavors.
Here is a box that Zechariah designed in Fusion 360 in about 20 minutes, complete with a hinged lid.
Modern CAD software is amazing.
All of the parts are getting into final position. Getting ready to build it!
The inside of the barrel tumbler needs a polygon (made from wood) in order to (a) give enough “traction” to turn the contents, and (b) protect the barrel from repeated impacts. I’m going to use Oak or Maple to do this. Based on the width and thickness of available material, I chose a 9-sided polygon.
Here is a picture of the CAM operation prepared using Fusion 360. I will make nine of these with just a fraction of an inch extra that I can remove on the jointer while getting a tight fit.
Golden potatoes, black pepper bacon, onions, green peppers, garlic, salt, pepper, and adobo — topped with cast iron fried eggs. A most excellent breakfast.