Python: Removing Matrix columns that contain NaN

Removing Matrix columns that contain NaN. This is a lengthy answer, but hopefully easy to follow.
def column_to_vector(matrix, i):
return [row[i] for row in matrix]
import numpy
def remove_NaN_columns(matrix):
import scipy
import math
from numpy import column_stack, vstack

columns
= A.shape[1]
#print("columns", columns)
result
= []
skip_column
= True
for column in range(0, columns):
vector
= column_to_vector(A, column)
skip_column
= False
for value in vector:
# print(column, vector, value, math.isnan(value) )
if math.isnan(value):
skip_column
= True
if skip_column == False:
result
.append(vector)
return column_stack(result)

### test it
A
= vstack(([ float('NaN'), 2., 3., float('NaN')], [ 1., 2., 3., 9]))
print("A shape", A.shape, "\n", A)
B
= remove_NaN_columns(A)
print("B shape", B.shape, "\n", B)

A shape
(2, 4)
[[ nan 2. 3. nan]
[ 1. 2. 3. 9.]]
B shape
(2, 2)
[[ 2. 3.]
[ 2. 3.]]


As an Amazon Associate I earn from qualifying purchases.

Setting TensorFlow Python on MacBook Pro (yet TBD)

In the "free moment" (2-4AM?) I would like to set up TensorFlow on my Mac.

https://gist.github.com/ageitgey/819a51afa4613649bd18

but that will have to wait until I get to it.


As an Amazon Associate I earn from qualifying purchases.

Why free AWS is not a good solution for Machine Learning research.

The free Amazon AWS instance t2.micro gives me the memory error when running my Machine Learning exercises (normalization of a large data set).

---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
in ()
----> 1 X_normalized = normalize_color_intensity(X_train)
Looking closer t2.micro has following congiguration: 1 CPU 1 GB RAM So basically it is as I was running my stuff on less than a Rasberry Pi (4 cores, 2GB RAM). Ouch! To surpass my MacBook Pro (4 cores 16GB RAM) I would have to run it on t2.2xlarge with: 8C PU 32 GB RAM Which is $0.376 per hour, or $279 per month. The AWS is a good option for short sessions when very powerful computer instances are needed, and it is good for corporate web servers, but for normal researcher who needs to run experiments day in and day out I would recommend  to buy gaming machine with top GPU, or two.


As an Amazon Associate I earn from qualifying purchases.

Configuring AWS instance for Python & Jupyter Notebook server

The configuration of Amazon (AWS) Linux instance with Python Jupyter Notebook for Machine Learning.

Starting the AWS instance is out of scope, plenty of tutorials are available, however, start it in the region that GPU instances such as p2.xlarge are available.

Python

Some Python is already installed
$ python --version
The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install
$ python3 --version
Python 3.5.2

Installing Conda (Anaconda)

conda --version
conda: command not found


~$ mkdir Downloads

~$ cd Downloads/

Download conda (find the newest conda install script)

The full version of Anaconda saves you time in the long run so you do not have to log into the server and install missing packages.

full version (455.91M @ 23.0MB/s takes 20s)
https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh

mini (not recommended): 
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh


~/Downloads$ wget https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh
~/Downloads$ bash Anaconda3-4.2.0-Linux-x86_64.sh
Follow the instructions and accept defaults
... a lot of packages get installed ...


PATH=/home/ubuntu/anaconda3/bin 

You need to refresh the terminal with the new bashrc settings.


$ source ~/.bashrc
$ conda --version
conda 4.2.9
$ python --version
Python 3.5.2 :: Anaconda 4.2.0 (64-bit)
$ jupyter --version
4.2.0 
As you can see we are in pretty good shape already!

Configure iPython (Jupyter Notebook)

$ ipython
Python 3.5.2
IPython 5.1.0
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password: Verify password: ..
Out[2]: 'sha1:5dsfdsfdsfsdfdsfdsfdsfdsfsdfdsfsfds'
In [3]: exit


Copy the password sha1 hash to use later in the configuration file:
c.NotebookApp.password=


CREATE CERTIFICATE


$ cd ~
$ mkdir certificates
$ cd certificates/
$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
Generating a 1024 bit RSA private: /home/ubuntu/certificates
... follow the instructions ...
~/certificates$ ls
mycert.pem

 

Jupyter Notebook Server Configuration



$ jupyter notebook --generate-config
Writing default config to (note it is .jupyter, not .ipython): 
/home/ubuntu/.jupyter/jupyter_notebook_config.py



$ vi /home/ubuntu/.jupyter/jupyter_notebook_config.py
press "i" for INSERT mode



c = get_config()

### Kernel Configuration


# plotting should always be inline

c.IPKernelApp.pylab = 'inline'


### Notebook Configuration


c.NotebookApp.certfile = u'/home/ubuntu/certificates/mycert.pem'

c.NotebookApp.ip = '*'

# server does not have GUI browser

c.NotebookApp.open_browser = False

# generated in iPython shell with password() function

c.NotebookApp.password = u'sha1:9f____your_own_____cc'

# Make sure you open port 8888 in your AWS instance

# and run only one jupyther notebook

c.NotebookApp.port = 8888


Press ESC :wq to WRITE and QUIT vi



Make working directory where you synch your git



~$ mkdir dev

Start the Notebook Server

Normally, I start the notebook in the terminal and it closes when I close the terminal, I prefer to do that.

If you have to run the notebook experiment for a long time (hours, days, weeks) in which case keeping Terminal window is impossible, then you want to start it using:



$ nohup jupyter notebook ~/dev/ &
$ tail -f nohup.out

To shut it down you can look for the process ID (pid) and kill it, or restart the instance.

$ jupyter notebook ~/dev/
[I 15:54:17.847 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 15:54:18.076 NotebookApp] Serving notebooks from local directory: /home/ubuntu/dev
[I 15:54:18.077 NotebookApp] 0 active kernels 
[I 15:54:18.077 NotebookApp] The Jupyter Notebook is running at: https://[all ip addresses on your system]:8888/

[I 15:54:18.077 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).


Running in the browser

Make sure that your AWS has at least these ports open: 
- 22 for secure shell 
- 8888 for notebook 

Make sure you request HTTPS

From your instance grab "IPv4 Public IP" or your elastic IP (for Jupyter Notebook I do not need it)

https://your_aws_public_ip_address:8888/

You may get a HTTPS security warning, but I ignore it (in Chrome: ADVANCED: Proceed...).
You should be prompted to enter your own password.
Jupyter Notebook would be fully usable at this point.




conda update conda













As an Amazon Associate I earn from qualifying purchases.

Installing Ubuntu 18.04 LTS on AMD box using USB stick created on Mac

Overview


I am installing Ubuntu 18.04.1 LTS desktop (as of November 9, 2018) on an old AMD box I had sitting around, the computer has NVidia 1050 I use for TensorFlow Machine Learning.

Download Ubuntu Desktop (amd64)


https://www.ubuntu.com/download/desktop

Prepare USB Drive

Note: At first, I tried 32GB drive, but the target computer did not recognize it, then I switched to a smaller USB stick. I used Disk Utility to format it in DOS FAT 32.
$ diskutil list
/dev/disk2 (external, physical): #:
DOS_FAT_32 UBUNTU18_04 7.9 GB disk2s1

Install UNetBooting

https://unetbootin.github.io/ 




Install disk image (ISO) on the USB drive


  • Check your USB drive name with "diskutil list" (disk2s1 for me)
  • Open "UNetBooting" and select:
  • Diskimage (radio button)
  • ISO file location
  • disk2s1 as the USB Drive
  • click OK, it will take a long while


Insert the USB into the target AMD computer


Enter BIOS Setup

Attach a keyboard to your computer.
Start the computer while pressing F10 key to enter BIOS setup. This might be different for your computer model. 
In the BIOS you may want to TRY to set up USB (or external mass storage device) as first in the BOOT priority. but my computer did not have that option.

Entering the USB boot with ESC, ESC, ESC

I was able to enter USB boot by starting the computer and pressing ESC key repeatedly.

From here I was shown "UNetBooting" utility and had the option to "Try Ubuntu without installing" which I chose.

Ubuntu Starts

My first impression of Ubuntu 18.04 LTS is that it is much cleaner and modern, it is not Mac OS just yet, but it fills nice.
  • I checked the browser and the Internet was on, via Ethernet cable.
  • The resolution is very good, 1920x1080
  • On the desktop, I had the option to "Install Ubuntu", I followed their easy steps.
  • I chose "Erase disk and Install Ubuntu" as I had old windows and Ubuntu 16.04 on it that I did not want to keep. I needed max space for machine learning datasets.
  • The installation process was very pleasant and modern.
  • Once the installation finished, remove the USB and restart the computer.
Happy Ubuntu computing!












As an Amazon Associate I earn from qualifying purchases.

TensorFlow: MacBook Pro: detect which CPU and GPU devices are available

from tensorflow.python.client import device_lib

def get_available_gpus():
    devices = device_lib.list_local_devices()
    #return [x.name for x in devices if x.device_type == 'CPU']
    return [x.name for x in devices ]

print(get_available_gpus())


['/cpu:0']
Currently, I can see and execute only on CPU.

MacBook Pro i7 Late 2013


Device 0: "GeForce GT 750M" CUDA Driver Version / 


Runtime Version 8.0 / 8.0 CUDA Capability Major/Minor version number: 3.0 


Total amount of global memory: 2048 MBytes (2147024896 bytes) 


( 2) Multiprocessors, 


(192) CUDA Cores/MP: 384 CUDA Cores GPU 


Max Clock rate: 926 MHz (0.93 GHz) 


Memory Clock rate: 2508 Mhz Memory Bus Width: 128-bit L2 


Cache Size: 262144 bytes



http://osxdaily.com/2017/01/08/disable-gpu-switching-macbook-pro/


Still not working with TensorFlow
start = timeit.timeit()
print ("starting")

with tf.device('/cpu:0'):
# [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
# Creates a session with log_device_placement set to True.
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
# Runs the op.
print (sess.run(c))
end = timeit.timeit()
print ("elapsed", end - start)


starting
[[ 22. 28.]
[ 49. 64.]]
elapsed -0.0033593010011827573


As an Amazon Associate I earn from qualifying purchases.

XCode

I am receining an error:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools

$ xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ sudo xcode-select -switch /Library/Developer/CommandLineTools
Password:



As an Amazon Associate I earn from qualifying purchases.

CUDA: late 2013 MacBook Pro GPU: GeForce GT 750M 384 Cores

Installing CUDA on MacBook Pro


$ brew update
$ brew upgrade



$ id -g
20

$ sudo chown -R uki:20 *
Password:

$ brew link pcre

$ brew install coreutils swig
Warning: coreutils-8.26 already installed
==> Downloading https://homebrew.bintray.com/bottles/swig-3.0.11.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring swig-3.0.11.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/swig/3.0.11: 754 files, 5.5M


$ brew cask install cuda
🍺 cuda was successfully installed!


$ brew cask info cuda

cuda: 8.0.55

https://developer.nvidia.com/cuda-zone


$ kextstat | grep -i cuda

... com.nvidia.CUDA (1.1.0) ..


$ cd /usr/local/cuda/samples/
$ sudo make -C 1_Utilities/deviceQuery




Makefile NsightEclipse.xml deviceQuery deviceQuery.cpp deviceQuery.o readme.txt


$ /usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery



Device 0: "GeForce GT 750M"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 2048 MBytes (2147024896 bytes)
( 2) Multiprocessors, (192) CUDA Cores/MP: 384 CUDA Cores
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GT 750M
Result = PASS


cuDNN Download

Register.

https://developer.nvidia.com/rdp/cudnn-download

Download file for OSX: cudnn-8.0-osx-x64-v5.1.tgz

and copy the file to your favorite place..

cd ~/Dropbox/dev/NVidia_CUDA/
NVidia_CUDA $ tar zxvf cudnn-8.0-osx-x64-v5.1.tgz
cd $ /cuda/include
$ sudo cp cudnn.h /usr/local/cuda/include/
cd ../lib/
$ sudo cp libcudnn* /usr/local/cuda/lib/

Add to your bash_profile

########## CUDA cuDNN ########## created: February 6, 2017
export DYLD_LIBRARY_PATH="/usr/local/cuda/lib":$DYLD_LIBRARY_PATH


$ brew cask install java
$ brew install bazel





(carnd-term1) uki@Uki-PEs-MacBookPro 16:46 tensorflow $ TF_UNOFFICIAL_SETTING=1 ./configure


Please specify the location of python. [Default is /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python]: /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python


Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:


Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] N


No Google Cloud Platform support will be enabled for TensorFlow


Do you wish to build TensorFlow with Hadoop File System support? [y/N] N


No Hadoop File System support will be enabled for TensorFlow


Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] y


XLA JIT support will be enabled for TensorFlow


Found possible Python library paths:


/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Please input the desired Python library path to use. Default is [/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages]






Using python library path: /Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Do you wish to build TensorFlow with OpenCL support? [y/N] N


No OpenCL support will be enabled for TensorFlow


Do you wish to build TensorFlow with CUDA support? [y/N] Y


CUDA support will be enabled for TensorFlow


Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:


Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:


Please specify the location where CUDA toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify the Cudnn version you want to use. [Leave empty to use system default]:


Please specify the location where cuDNN library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.


You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.


Please note that each additional compute capability significantly increases your build time and binary size.


[Default is: "3.5,5.2"]: 3.0


INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.


............


INFO: All external dependencies fetched successfully.


Configuration finished





bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-0.6.0-py2-none-any.whl


As an Amazon Associate I earn from qualifying purchases.

Almond milk, heavy whipping cream and coconut oil shake

Keto rule of the thumb is to stay below 40g of sugar per day.

I love whole milk, but since milk has about 11g of sugar per 240ml (~3 teaspoons of sugar) and for many people, milk is bad news anyway, I decided to explore alternatives.

Here is my recipe for a milk-like shake:

- 3/4 glass of organic almond milk
- 1/4 glass of heavy whipping cream
- a spoon of organic coconut oil
- a spoon of Maca powder (this changes the taste, I would say, for worse)
- few raspberries for flavor (a cup is 5g, so few is not a big deal)
- coffee if you need a boost

I warm up the shake so the coconut oil melts (76F+) and I blend it for a couple of seconds.

It is not bad, please send me your recipes.


As an Amazon Associate I earn from qualifying purchases.

Is water retention caused by allergens? (Mushrooms)

I have been steadily losing excess weight on the keto diet, which is good; I have a few more to go before my optimal Spartan weight.

I monitor my "dry weight" every morning before I drink or eat and after I use the restroom.

Yesterday, I ate mushrooms in the sauce, which I know I am allergic to because of allergy tests I did and the fact my mouth is tingling after I eat them.

I did not feel good in the evening; my stomach was upset, but there were no major events. I took NyQuil to knock me out, but it did not really help, except for making me really drowsy this morning.

Other than that, yesterday I had a good diet of 2 eggs, hummus, bulletproof coffee, a lard-fried filet mignon, and some bigos (sour cabbage hunter stew).

This morning I have gained a little weight, yet, I was expecting to loose some.

I suspect my allergic reaction caused some water retention (swelling). In fact, I have read that when people cleanse, the first few pounds they lose are water.

Please comment if you suspect otherwise or if you had a similar observation.



As an Amazon Associate I earn from qualifying purchases.

Managing (removing) Anaconda (conda) environments

I needed to remove some of the unused Anaconda (conda) environments:



$ conda info --envs
# conda environments:
#
CarND-TensorFlow-Lab /Users/ukilucas/anaconda3/envs/CarND-TensorFlow-Lab
IntroToTensorFlow /Users/ukilucas/anaconda3/envs/IntroToTensorFlow
py3 /Users/ukilucas/anaconda3/envs/py3
py35 /Users/ukilucas/anaconda3/envs/py35
root * /Users/ukilucas/anaconda3





to do so I use command


$ conda env remove --name IntroToTensorFlow







$ conda info --envs

# conda environments:

#

py35 * /Users/ukilucas/anaconda3/envs/py35

root /Users/ukilucas/anaconda3




(py35) $ python --version

Python 3.5.2 :: Anaconda 4.2.0 (x86_64)




As an Amazon Associate I earn from qualifying purchases.

Updating Anaconda TensorFlow on Mac for use with jupyter notebook

I have been running TensorFlow, but it has been acting up and needed an update.




# Initializing the variables
# init = tf.initialize_all_variables() # older TF 0.11.0-py35_0 conda-forge
init = tf.global_variables_initializer() # newer TF 0.12.1-py35_1 conda-forge



Check what environment you are running, especially if you switch often, or just restarted the computer.


$ conda info --envs
# conda environments:
#
CarND-TensorFlow-Lab /Users/ukilucas/anaconda3/envs/CarND-TensorFlow-Lab
IntroToTensorFlow /Users/ukilucas/anaconda3/envs/IntroToTensorFlow
py3 /Users/ukilucas/anaconda3/envs/py3
py35 /Users/ukilucas/anaconda3/envs/py35
root * /Users/ukilucas/anaconda3


I have been running "nohup jupyter notebook &" command and my Jupyter Notebook did not see my newest TensorFlow environments. I wanted to update my root anyway.

I execute the following:

$ conda install -c conda-forge tensorflow
Fetching package metadata .........
Solving package specifications: ..........
Package plan for installation in environment /Users/ukilucas/anaconda3:

The following packages will be UPDATED:

protobuf: 3.0.0-py35_0 conda-forge --> 3.1.0-py35_0 conda-forge
tensorflow: 0.11.0-py35_0 conda-forge --> 0.12.1-py35_1 conda-forge
Proceed ([y]/n)? y
Unlinking packages ...
[ COMPLETE ]|#####################| 100%
Linking packages ...
[ COMPLETE ]|#####################| 100%
$


Update:

I decided to create my TensorFlow in a new environment because I have Python 3.6:

$ python --version 
Python 3.6.0 :: Continuum Analytics, Inc.



$  conda create -n tensorflow python=3.5 

Another option is DOWNGRADE Python 3.6 to Python 3.5

$ conda install python=3.5






As an Amazon Associate I earn from qualifying purchases.

Fortified Coffee and Tea in no-sugar, keto diet

I have a hard time drinking black coffee, I have tried Starbucks, Caribou, and other, smaller outlets and they all taste somewhere on the spectrum between acidic to burnt.

To maintain a no-sugar, limited calorie diet (I lost 8 pounds since my Chrismas weight) I drink fortified coffee or tea.

When out, in Starbucks I simply ask for "black coffee with heavy whipping cream".

To my surprise, a tablespoon of Organic Valley Heavy Whipping Cream has about 6g of fat and almost no sugar, or proteins. Tasty and perfect coffee, or tea addition.

Of course, the commercial outlets may not have organic grass-fed cream so your mileage will vary. last time I asked Starbucks had "Prairie Farms" brand, which is not organic as far as I know.

At home, I have an option of blending the cream, coconut oil (or pure MCT) and grass-fed butter for optimal whole day goodness. When I want to feel like a young God, I add a teaspoon of Maca powder which gives it a specific, however, not disagreeable taste.

The fortified coffee makes easier to skip meals. This is not true fasting, but better than no fasting at all.

The benefits of intermitted fasting, no-sugar diet are already well known and studied:

- prevents (and kills) cancer
- prevents hypertension (ADD kids) and food comma periods
- prevents degeneration of brain that is a primary concern in the aging population
- is one of the few ways to promote production Human Growth Hormone and creation on new brain cells for adults
- balanced fat calorie input diet prevents diabetes 2 and white fat deposits
- coffee, black tea and especially Japanese powdered green tea is full of healthy anti-oxidants

The above take care of the MOST of the reasons why adult people die, so if you do not smoke and look both ways when you cross the street (that should include no texting and driving) you increase your chances of healthy life by at least 30% percent.

No sugar diet is very pleasant as you do not feel hungry all the time and you feel your energy levels to be very constant. The switch to no sugar diet can be quite painful for the first few days, sugar is an addictive substance very similar to heroin. Limiting the refined sugars is a good first step, after a while, you can start cutting other sugar sources (in order):

- refined sugars including high fructose corn syrup
- rice
- grains (pasta)
- potatoes
- corn
- grains (bread)
- natural maple syrup (has many health benefits)
- honey (has many health benefits)

I have grown on bread, so cutting it was very hard for me, but it is worth it.

Feast Days

Some people call it "cheat days", but I do not like this terminology. Every week, usually on weekend I feast which means eating what I crave. In my case that would be a fresh Polish donut with raspberry filling. This is very natural to feast after fasting, people are adapted to that and it was a natural process over the last couple of million years of evolution.

People fasted when hunted, or migrated, then fasted. Note, the modern humans who managed to wipe out mammoths, and our meat loving cousins Neanderthals started to split at least 250,000 years ago. You are not supposed to marry your cousins, but we know our ancestors did, hence they were not truly different species. We have been the fat-eating, ketone-buring hunters for a long time!

Finally, it is very important to note that our ancestors would constantly snack on leafy vegetables, nuts, and roots as they were able to find them while on the prolonged hunt, or move to a new area. You should not skimp on vegetables in your diet.







As an Amazon Associate I earn from qualifying purchases.

My Grand Plan

My Grand Plan — 18 years from now in 2035 I will be 62 years old.
How do I imagine myself then?

Location, location, location.

I will be living in a place that is a maximum one hour away from the major National Forest boundary, preferably located in wild mountains. This place could be Bellevue or Redmond, WA, or Portland, Oregon. The importance of the location cannot be overstated. I have spent every moment of my youth in the mountains, often cutting school to go hiking or skiing. And, I hope, to spent the autumn of my life in nature as well. There is nothing that makes me feel better than a mountain-top vista after a strenuous hike in the chill of the subalpine meadow. I have lived almost all my adult life in (techno-bubble) Chicago. A city person cannot understand the highlander's longing for mountains.


I am not sure if I will be able to instill the same love of nature in all my daughters, I hope I will, Lili seems to love nature already. I hope that in the next 18 years, I will spend countless vacations with my girls hiking and camping in the wild.

Health

There can be a little joy of surroundings if one has no health. I am approaching my health holistically, in multiple ways.

Cancer, dementia and heart problems.


Short of major accidents, these big three, sooner or later, will claim most of the people. It is not "some probability" like being struck by lightning, rather, it is more like loading a 30 round magazine, lining 100 people in the row and pulling a trigger in one sweeping motion, no less. All of us stand in that row. All of us, no exception.


Thankfully, we know the cause and how to prevent them, these diseases are sometimes called "diabetes type 3" and it is caused, majorly, by sugar.


Our ancestors ate everything they could find. When they came across a bee hive, they would gorge on sweet, sugary honey. When they found a patch of sweet berries, they would not leave until they had their fill and then some.
We are designed to crave and eat all sugar we can and we are designed to store it as fat for later.


The problem is the sources of sugar in nature are extremely rare, next time on the vacation in a national park make a note of all the sugar sources. When you hear bees buzzing, try to find their hive in the tree tops. See if you can collect more than a bucket of wild berries in a day, except in the late summer when it is a good idea to gain few pounds before winter anyway. When people ate sugar it was called feasting, and it was a very rare occasion.


Humans were designed to go on for few days on minimal nourishment -- something you could carry in a small pouch while on the fast-paced hunt or on the move to a new campsite, these multi-day trips were a rule, not an exception. People would be eating mostly the leafy plants as they found them, nuts, roots and supplementing that with the equivalent of venison jerky and fat (smoked bacon).




Fasting

We know that fasting prolongs life.
Avoiding sugar and proteins has an enormous benefit that most people do not realize.


Note that I mentioned sugar and to some degree dietary proteins, not fat. When our diet is missing the sugars but has fats, your body reverts to the natural state of fat burning, whether the fat comes from tree nuts, bacon, or your own love handles.





Humans, for almost 100% of the last 250,000 years were in the state of a fat-burning ketonic state, the dietary changes have changed this only recently.


Cancer starts with a single cell mutation. Each one of us harbors many cancerous cells for years before they become so malignant that our health gets affected, then, it is often too late.


Cancer feeds on glucose (a simple sugar) which our bodies do not store. When no dietary sugar is present, we create only small amounts of glucose from proteins. Cancer has a very hard time surviving when we are in the fat-burning mode. In the ketonic state, you start purging your organism of the cancer cells that you did not know you had.


A lean person (10% body fat) carries about 15 pounds, or more, of fat on them, that is a lot of bacon meals! If you drink plenty of water, eat vitamins and minerals you could live on that for a couple of weeks. Use your brains before trying any extreme diet like that. I am not taking any responsibility for your personal choices. When you have sugar, your body burns the sugar, when you have no dietary sugar, your body burns fat.
However, when you do not eat and you are too skinny to have any fat reserves, your body burns your muscles and eventually you end up in the emergency room -- and if lucky, in psychiatric counseling.


I know muscle wasting is scary news for athletes, yet many athletes are adopting the keto diet. You can very simply prevent muscle wasting by balancing fat ingestions with your body energy needs.


Would eating fat make you fat? It is a math question really. If you burn 2,500 calories every day and eat a pound of bacon you will become leaner. Marines burn 4,000 calories, so adjust to your own needs. The idea is to be "a mean, lean cancer-fighting machine".


For the next 18 years, I will be eating (mostly) carbohydrate free diet. That is no refined sugars, no rice, potatoes, no flour products, and limited sweet fruits. In addition, I plan to make frequent fasts (restricted calorie diet) and, at the end of each of my fast I will feast and celebrate.


The way of hardcore


When I was a kid I "lived" in the trees with all the neighborhood kids, later we spent middle school years in the park on the monkey bars and similar. When I have run the Marine Corps obstacle course, I loved it and I almost beat the San Diego depot time record, in fact, the drill instructors had repeat it, hoping that I will. I did not, but I was close. I do not like gyms that much. I like obstacle courses, mountains, rocks, hardship and winter weather.


When I was young our karate sensei (then I thought a sadist) was running on our bellies, punched and kicked us to test our stance and had us run barefoot in the snow. Now, I see the wisdom of that and I am thankful. Running barefoot in a sweaty kimono in the snow will classify you as "abuser" in court if you try to do it to your kids, but it might be the healthies thing you can do yourself. I hope the "soft belly" culture we currently live in will pass. We need young Spartans with strong bodies and sharp minds.


Financials


It tool me first 15 years of my adult years to get out of poverty and debt, I know I am not the sharpest pencil in the drawer in this aspect, but it is what it is. Last few years I was laboring thru the middle class and for the next 18, I hope I will be able to make some smart investments. I am constantly reading and learning, but unfortunately, the financial freedom takes personality changes as well.


Since I have reached the salary level that exceeds what I consider sufficient, I will be focusing on minimalism, or rather on "essentialism". There is a good book, or two, on the subject, so not need to elaborate. By forgoing the need for "consumerism" and waste I hope to increase the surplus which then I hope to re-invest.


Personal Growth


This easy, I study constantly. I believe that the continous education that takes a significant part of every single day is the only way to survive in the fast changing world. This is especially important in the advent of the AI, when a lot of well defined jobs will be replaced with intelligent software. When studying, you have to constantly push your own boundries, way beyond your comfort level.


As an Amazon Associate I earn from qualifying purchases.

50 cal Muzzle Loader Rifle

Muzzleloading rifles are a different kind of fun. It is true that I got one because of the local laws, but I definitely have caught an ML bug since.

Warning: Proceed with caution, follow manufacturer recommendation as it is possible to blow up your rifle (hands and face) with an incorrect bullet and powder selection. For example, too little powder with too big of a bullet can create a lot of pressure. Generally, the "magnum" rated rifles should not take more than 120 grains of loose black powder or 150 grains of pellets -- there is no need for more as the powder will have no time to burn. There is a very small chance of harm by overcharging with black powder substitute. The projectile, however, has to sit tightly on the black powder load there should be no air space gap (however pellets have an empty core, so no need for the paranoia).
Smokeless should not be used in the muzzleloaders because the smokeless powder should not be compressed.  In addition keep in mind that most of the modern smokeless loads take 15 (cowboy) to 60 grains (in 30-06 max) of powder in comparison to 70 grains of black powder in 45-70, the 7.62x54R has 64 grains capacity so substituting powders would blow up the gun.

It is an interesting question how the above apply in the case of CVA Optima breech plug for the loose Blackhorn 209 powder as it is possible to put black powder in without compressing it. I did not try it and I do not recommend doing so, but a small amount of TrailBoss, without compression should not harm the rifle. Do not try it.



Powder: You can load your muzzleloader with a "gallery puff" load of few grains of black powder substitute, 30-grain rabbit loads, 80-grain deer loads, up to 150 grains magnum load. The 50 grains is usually listed as the minimum starting load, so use your own judgment.

You could achieve such a variety if you hand load 45-70 Gov, but realistically most people do a single "sweet spot" deer loads.

By comparison, the most popular "Western" load was 40-40, with 40 grains of black powder. The 32-20 is a small game load using 20 grains of black powder. The "buffalo" round used to be 45-70 gov with 70 grains of black powder.

Projectile: You can use 177 round lead ball (50-caliber), 250-grain copper sabot (45-caliber), all the way to 400+ solid-lead muse loads. The selection of the projectile will be dictated by the rifling twist rate:
- 1:30 is fast for magnum hunting with sabots
- 1:50 is medium for versatility
- 1:70 is slow for lead balls

I use 1:28 and I enjoy plinking with round balls, shooting lead slugs and modern aerodynamic bullets this rifle was designed for.

Recently, I have been shooting 150, 100, 50 and 30-grain loads one after the other and decided that I need more "scientific" approach to "zeroing" and shooting a variety of loads.

The problem is that once you "zero" your rifle scope to the bore, all these loads will shoot differently, above or below the target.

Distance: Most of my shooting happens in the woodland, with 75 yards of maximum distance. Occasionally, however, I venture to the openings where I should know my ballistics up to 200 yards.
The fields are often 250-400 yards wide, but at that distance, I would recommend 308, 30-06, 270 Winchester, 7mmRemMag, 6.5 Grendel, or some other flat shooting rifle.

Target: I am interested in the vital area of about 3-inch in diameter (a 6-inch circle).

The math: I have looked up the ballistic coefficients (BC) of the projectiles I will shoot and their muzzle velocity, the BC is somewhat "black magic" estimate that is often inflated by the manufacturer.

- .50 caliber round ball 177 grain has .070 BC
- .50 caliber 250gr AeroLite Powerbelts have .174 BC
- .50 caliber Remmington 250 grain sabot (.451 cal) has .210 BC
- .50 caliber 270gr Platinum Powerbelts have .220 BC (1616fps/100gr, 2000fps/150gr)

Be aware that the speed of the bullet is influenced by:
- the fit of a projectile to barrel (or round ball patch thickness)
- the length of the barrel (longer is better)
- the powder burn rate (WhiteHots are faster)
- the weather (temperature and pressure, hot weather higher pressure)
- the elevation (air thickness, higher you go - less resistance)

I had to look up the velocities as I shot thru my Chrony and I did not get to replace it. I had to generalize them, otherwise, the exercise gets exponentially more difficult:

- 50 grains of powder - 1500 fps
- 80 grains of powder - 1600 fps
- 100 grains of powder - 1750 fps
- 150 grains of powder - 2050 fps


From there, I was able to calculate the estimated trajectory (quadratic function, yeah nerdy):

- yellow for round ball
- blue for 100 grains of black powder with 250-grain bullet
- red for 150-grains of black powder with the 250-grain bullet
- gray for 150 grains of black powder with 270-grain bullet

in the future, I will add lead slugs such as T/C maxi-hunter and Great Plains.

After some try-and-error, I concluded that if I set zero at 50 yards to be about 2 inches high, my "Maximum Point Blank Range" or MPBR will be correct for MOST possible load combinations.

In other words, with zero set at about 20-yards, or 2 inches high at 50 I can shoot my rifle without scope adjustments, or "holding off" the elevation.

Depending on the load my MAXIMUM MPBR distance would be:
- 110 yards for round lead ball over 80-100 grains
- 160 yards for 250-grain bullet over 100 grains
- 180 yards for 250+ grain bullet over 150 grains

Furthermore, if I hold 6-12 inches high, my range goes up to 150, 210 and 240 yards, respectively, for the metal gong shooting.


Your mileage will vary, if you have questions, please comment.





As an Amazon Associate I earn from qualifying purchases.