## Challenge 2016 conclusion and 2017 Challenge

I started 2016 with a 1-year, self-imposed contract to improve my diet significantly. I needed something that could not fail, because I was desparate. And it worked. In 2016, I cut back 90% of sweets and snack foods (crackers, bread etc), and lost almost 25 pounds. Here is a screenshot of data I put in Monitor Your Weight app:
It was challenging, but in retrospect I nailed all the essential elements that were required so that I couldn’t fail and I couldn’t defeat myself: I identified the most important times and venues for my “bad eating habits”, I made a promise that would cost a lot to break, I made the promise to people close to me so that I wouldn’t have the nerve to sneak the bad stuff (it would mean lying to those people when I spoke to them next!); I gave myself some opportunities to enjoy treats once in a rare while, and minimized the impact on social interactions.
So in 2016, I had almost no bread, no crackers, no cereals (except oats), no “bread spreads” (jam, nutella, honey), no pancakes or french toast or cake or chocolate bars, the list goes on. I say “almost” because I did have some of these during family trips, meals out, birthdays, etc, but these were once every few weeks compared to several times a day for snack foods!
I replaced these with salads (I discovered how easy it is to make really yummy ones!), oats, eggs, cheese, peanut butter, nuts, dried fruit like figues, dates, prunes and raisins, cold cuts like salami and ham and turkey, canned fish like salmon and tuna, avocados, olives, bacon, bananas, apples, pears, melon, lemon, grapefruit, to name but a few.
So my “fast” sugar intake (ie. the sugar that can quickly be digested and causes spikes in your blood glucose levels) dropped dramatically. I noticed that my salt intake probably increased a bit (I didn’t measure this, just based on the foods I eat), but seems ok on average. I notice that I can eat vegetables that I didn’t previously like much: I started “tasting” non-sweet foods again!
I still have 5 lbs to go but mostly for 2017, I want to continue to eat more healthily. My contract will be similar but a little more relaxed. Just a little, I don’t want to go back to my pre-2016 eating habits, and I don’t want to loose more than 5 lbs.
So the contract this year is thus:

## Healthier Eating 2017 for Oliver

I hereby make the following pledge to myself and to my SUPPORTERS:
• I can only eat ADDICTION_FOODS in the following RARE SITUATIONS:
• Festivity meals: birthday dinner, Christmas dinner or brunch, etc;
• Social events: dinner get-togethers, restaurant with others, coffee with a colleague, cottage/vacation, etc;
• LIMITATION: during events that span multiple meals (example: weekend at cottage), I can only eat ADDICTION_FOODS that are served to me.
• One-time special events (example: my son’s first pancakes!);
• When my weight is under 170 pounds and there has been more than 7 days since I consumed any ADDITION_FOODS;
• LIMITATION: I am allowed one “portion”, about 300 cals.
• When my weight is below 165 lbs.
• ADDICTION_FOODS is any of the following:
• breads and spreads: loaf, pita, naan, croissant, bagel, etc, nutella, jams, honey etc.
• high-carb cereals (like Cheerios, Corn Flakes, Rice Crispies, etc; whole grain cereals like rolled or steel cut oats are ok; all bran/bran buds are ok, granola-type cereal as additive to other cereal are ok)
• pancakes and crepes.
• crackers and potatoe/cereal chips (tortilla, etc).
• cookies, cake, pastries, struddels, etc.
• chocolate bars, rochers, turtles, and similar assortments of junk food.
• juice and beverages from cartons and jugs, even if they are 100% pure fruit; coconut water is ok.
• SUPPORTERS are those listed below. Their name appearing here indicates they approve of this challenge and they will not try to sabotage it (this clarification is likely only important for my kids!):
• Monique L.
• Bobby and Elena
• Mike F.
• Donna E.
• Karim A.
• Melina S.
• Jim N.
• Wolf S., Gloria, Eddie, Nico and “Crispy” their wascally puddy cat
• Whenever I consume ADDICTION_FOODS, I must log it to MY LOGBOOK, vieweable at anytime by my SUPPORTERS.
• The PERIOD of this pledge is from Jan 3rd 2017 to Dec 31st 2017
• PENALTY: In order to increase the odds of success of this excruciating challenge, I promise to give each SUPPORTER the sum of CAN$100 if I FAIL. • FAILURE to fulfill this pledge is defined as eating any ADDICTION_FOODS outside of the RARE SITUATIONS described above, within the PERIOD of this contract. Thanks to all my supporters! Cheers, Oliver p.s. A couple people have expressed concern that this is a zero carb diet. Quite the opposite! “Healthy carbs” are amazingly easy to get: vegetables, fruit, whole grains, nuts and beans, and you only need around 200g per day!. I eat plenty of those every day; what else is there to eat, when ADDICTION_FOODS are eliminated! So no worries! ## War on carbs addiction challenge 2016: creativity Well, not being able to eat bread or cereal at home or office (see Stopping my carbs addiction challenge for 2016) sure has an impact on breakfast, lunches at work, and eating between meals. Forces you to be creative: • breakfast: pretty much the only two types of breakfast are: • Some form of eggs: boiled, scrambled, poached; with either some taboule, humus, cream cheese, tomatoes, etc, anything that can add a bit of variety and is not bad for you. I quite enjoy these actually. Certainly more variety than peanut butter and jam every morning. • Some form of porridge: i have developed an awesomely good porridge, with crushed nuts, raisins (the lowest sugar ones, which so far means sultana), dates, chia, flax, milk. This is the base anyways, can add frozen fruit too, yogurt. Using the 2 min cook-time oats is great, easy to prepare. • lunch: can’t do sandwiches, so: • cold cuts • taboule, humus, nuts • veggies like cucumber, tomatoes, celery, olives, avocado (which is actually a fruit!) • cheese • left-overs from dinner • salad based on any of the above • clementines, apples, bananas, kiwi, etc • between-mean snacks: • prunes, dates, raisins • nut mixes • clementines, apples, bananas, kiwi, etc • cold-cuts, cheese • peanut butter, alone or with apple or banana slices or celery I heard on the radio that having to be creative is a good exercise for the mind. So this is an added benefit to this food regimen! And been loosing about 2 pounds per week for this 1st month. ## War on sweets 2016 It is now 20 days that I have been following my “challenge”, adhering religiously to my “contract” described at Stopping my carbs addiction: Challenge for 2016. The 1000$ consequence may seem silly but it is one of the reasons that this has worked 100%: there is no way I’m going to cheat 10 people of a $100 each by sneaking foods mentioned in that contract. So, 20 days, not one cheat. And actually, no regret, no bitterness about ignoring all those wonderfully yummy foods at home, store and office. The only sweets I had were allowed per that page: • was at a ski chalet Jan 8 with my daughter, 1/3 of a chocolote bar shared with her • a cookie when i had lunch with my daughter during her saturday dance lunch break I think that allowing for some strategically defined “breaks” is another big factor in this success: the breaks are not at home so that there is no ambiguity about whether it is ok; i.e., at home, office, and car, zero tolerance; when eating out with friends/colleagues, allowed. This way, when I have a craving, I can just remind myself that there will surely be an opportunity soon. I picked zero tolerance in the 3 most common places that I find myself eating addictive foods; there is no subjectivity in zero. Also, allowing myself to have sweets when eating out with others means I’m not a burden to others, and that may also seem silly, but over time being a burden to others decreases one’s resilience. Now I just have to last till the 25 day mark as the first part of that challenge: lasting as long as the average duration of new-years resolutions! ## War on carbs 2016: update So, after two days of lower-carb-challenge-2016, I’m really happy , this is working so well: I have resisted without a problem to pancakes, various yummy loafs of bread we have at this time of year, muffins, cereal, marzipan covered chocolates, etc… even pizza! (although I deliberately did not put pizza on my list — I don’t have it often enough to worry about its impact on my health). Not one ADDICTION_FOODS item since the first minute of the year! Although the thought of grabbing an item that I see on the counter or table has happened many, many times over the past 48 hours (again, it’s that time of year, yummy stuff lying around!), all I have to do is remind myself of the$1000 dollars I would have to pay to my group of supporters, and boom, thought gone, no regrets.

The next challenge is to keep this up for a couple of weeks, since 2 weeks is the average length of time that people hold their resolutions. The next one after that will be 2 months, since I have been able twice in the past to change my diet for a couple months (although not as completely as in this challenge). And final is to do it for the rest of the year.

So, only 8712 hrs to go! (just kidding, I’m not counting the hours like this).

## Stopping my carbs addiction: Challenge for 2016

I hereby declare war on carbs!! I can’t control myself! I have tried many times but they keep coming back and haunting me! I keep gaining weight every year, clogging up my arteries, etc. I must try something different, something that will give me the necessary strength to resist: make it too expensive to fail. So:

I hereby make the following pledge to myself, and to those whose name appears below:

• I will not eat ADDICTION_FOODS at home, in the car, or at work (together with sleep time, this covers 95% of my time)
• I am allowed to eat ADDICTION_FOODS if I am eating out at a restaurant, as long as it is for a meal
• Exception allowed: Group snack at restaurant, or snack alone if traveling, and GORP while hiking/snowshoeing/xc-skiing
• I am allowed to eat  ADDICTION_FOODS at someone’s place
• ADDICTION_FOODS is any of the following:
• bread (sandwich, flat, croissant, etc)
• boxed cereals (like Cheerios, Raisin Bran, Corn Flakes, Rice Crispies, etc)
• nutella and jams
• pancakes and crepes
• crackers and chips
• cookies, cake, pastries, struddels, etc
• chocolate bars, rochers, turtles, and similar assortments of junk food
• juice and beverages from cartons and jugs, even if they are 100% pure fruit
• The period of this pledge is from Jan 1st 2016 to Dec 31st 2016 (but likely to be renewed each year for the rest of my life!)
• Failure consists in the following:
• Eating any of ADDICTION_FOODS in the conditions described above, during the year 2016
• In order to increase the odds of success of this crazy yet wise endeavor, I promise to give each of the following people the sum of CAN\$100 as soon as I fail to uphold this contract, in return for their moral support:
• Bahanzai (Thanks dude for being the first official supporter!)
• Jeremy
• Bobby
• Elena
• Monique
• Melina
• Matt
• Carolyn
• 1 more TBD
• Support by those listed implies the following:
• By having their name on this list they pledge to act in good faith and to not intentionally sabotage my efforts! 🙂
• If I fail, I will write a shameful post on this blog, you will receive the money within a few days, and this endeavor and contract ends. BTW this contract also ends if I keel over and die of any cause whatsoever, except if the autopsy determines without a doubt the cause of death to be the consumption of ADDICTION_FOODS!

Thanks to all my supporters! Cheers,

Oliver

Posted in Self. Tags: . 4 Comments »

## Relocating a python 3.x virtual environment in Windows 7

I created a simple python virtual environment a year ago and today needed to move it to a different location on my laptop. Problem is that several files within the python virtual environment (VE) contain the path to the folder that contains the virtual environment. So if you just move the folder, various batch files, .py scripts, and *.pyc files contain the path hardcoded in them.

Oddly, I didn’t find much on google about relocating VE’s; mostly about how it can’t really be done.

So I tried the following, for Python 3.x virtual environments:

1. From the Windows Explorer, navigated to the python VE (example: c:\oldfolder\py_34)
2. Did a search (using the Search Box) for __pycache__
3. Selected all the __pycache__ folders and deleted them: this is safe because if the cache folders don’t exist, python recreates them at next import of associated packages/modules
4. In notepad++, did a search & replace of “c:\oldfolder” for “c:\newfolder” on all *.bat and *.py files under c:\oldfolder
5. Verified by doing search for “c:\oldfolder” on all files (no filtering) in c:\oldfolder that no reference to oldfolder were left
6. Move the oldfolder to new location

For Python 2.6 and 2.7 VE, instead of searching for __pycache__ I searched for *.pyc and deleted everything found. This is safe because *.pyc files are automatically regenerated next time imported, if they don’t already exist.

Seems to work so far: I can activate the VE, start python, and import some standard and 3rd party packages. If I find out over the next couple weeks that something more subtle broke, I will update this post.

## Coax FM antenna 75 ohm unbal

We have a 1990’s stereo system that works great: amp/tuner with multiple inputs (CD, etc), CD player (used to have tape deck but don’t work). Needed antenna so could listen to radio: 75 ohm unbalanced, coax but not the standard TV coax:

I had an FM dipole “T” antenna for indoor use, but the connector is two little hooks:

Problem solved!

## Remove duplicate files on Windows 7

My wife’s external drive master file table and possibly part of the partition got corrupted a few days ago because she didn’t “eject” it while connected to her Windows 7 laptop (it was connected to her docking station and she disconnected the laptop from the dock). This was evident when we connected the drive to my laptop and we got the error “File or directory is corrupted or unreadable”.

In all likelyhood the files were still there, just not reachable because the MFT had been damaged. I tried a couple of recovery tools like Eeasus Recovery and Recuva. Although both found the files on the drive, the free version of Easus only supported recovery of up to 2 gigs and Recuva blocked at 57% of stage 2. What worked though is Window’s plain old chkdsk /r, which took several hours but did lots of repairs.

The only problem with most of those recovery tools in such a situation as when the MFT is damaged is that there is no way for the tool to know if the file it finds had been deleted. So many of the files it recovered were duplicates that had been “moved” from one place to another on the drive. So now I need a duplicates finder.

I tried these:

• Auslogics Duplicate File Finder: did not allow to select which copy to keep; in my case, I want the duplicate that is in root folder to be deleted, in other cases, I want the duplicate in some other folder to be deleted, yet in others, I want both copies to be kept where they are.
• Easy Duplicate Finder: my antivirus would not allow me to download due to fraud warning
• antitwin: same thing as previous
• Duplicate Cleaner Free: uses openCandy, yuk!
• fast duplicate file finder: works well, found more than expected, good guess on which ones to keep by default, shows list before you decide what to do and you can bulk select based on a couple simple rules

So Fast Duplicate File Finder is the winner for free and powerful and no spamware (adware, open candy, etc).

Yes, the wireless signal in my wife’s home office is not so good, causing significant frustration for main user of that space. And I’m the IT dept, it’s time to fix this. The house has 7 cat5e cables going from the enclosure in the basement to the various rooms in the house to provide phone service, as well as 2 cat5e for internet, and 5’ish coax cables to provide cable TV. My wife’s office has one of the two internet cables, the other is in the kitchen. My own office has the DSL modem, router with wifi, home PC, etc. I don’t want to put the modem and router in my wife’s office: too messy there, if and when I need to access physical devices I need to have access without having to move piles of papers 😉 So router staying in my office. Problem then: how to connect my wife’s office to the wired network.

Solution: wire my office to the multi-media enclosure that is in the basement, wherein the above wiring all converges. This is easy to do because even though my office doesn’t have a cat5e port, it has a phone port with a cat5e cable, which contains 4 pairs of wires: on pair for the phone, and the other 3 pairs unused. Turns out you don’t need 4 pairs for 100 Mb/s networking (you do for gigabit, if I’m not mistaken). So I went and bought a Leviton cat5e quickport jack:

you put the unused 3 pairs of wires in the color coded slots at the back of the jack, following the “B” color scheme (there is an “A” scheme, don’t know what it is for). The leviton website has some videos, one of them indicates to use the “B” scheme.

However, the 3 cat5e twisted pairs going from my office to the basement are not connected to anything in the enclosure. And the other end of the cat5e that goes from my wife’s office to the basement is not connected to anything in the basement.

Solution: use a “data/voice module” by leviton, which has several cat5e jacks with slots in which to put cat54 wires. This could complete the solution: put the module in basement enclosure, plug cat5e from wife’s office in jack X, and connect wires from my office cat5e pairs (3) into the corresponding slots for jack X.

However, I also want to have the other cat5e, the one going to the kitchen, on the LAN. To support this, I installed a network switch near the enclosure. Now I have the two builtin cat5e (the ones from my wife office and kitchen) going to the switch, and one short cat5e going from the data module jack X to the switch. One gotcha is which wire to connect to which slot on the module. The module has a colored tip between each pair of slots, but there is no slot identification that allows you to know “this slot for wire #N”. A video on leviton.com showed that you put the solid color wire at the bottom slot of every slot pair, assuming the module is upright (you can read the wording on it).

To polish things up, I installed a 3-port wall cover in my office so I can have the phone, coax, and cat5e nicely secured into the wall.

The result is this:

With the above setup, I can easily install an extra quickport jack in any room that has a phone jack, wire the extra twisted pairs to the data module, and connect the corresponding jack  to the network switch, to extend LAN other other parts of the house (I may need to get an 8-port switch instead of 4-port, as I’m already using 3 of the 4 available ports).

## installing python pip & virtualenv from scratch

The documentation to install pip and virtualenv on Windows, starting from only a Python installation and no other tools, is in several places, and although pretty good, not always that clear. Note that latest pip (1.4) does not work on Python < 2.6.

1. run the python command to download setuptools (the shell prompt will depend on your setup and on Linux the slashes will be forward rather than backward):

C:\>\Python27\python.exe -c “import urllib; urllib.urlretrieve(‘EZ_SETUP_URL’, ‘ez_setup.py’)”

where EZ_SETUP_URL is the URL given on the setuptools installation page where it shows to download ez_setup.py via wget. Don’t be concerned that the wget is discussed in the Unix section and you are on Windows: the urlretrieve function does the same as wget, but cross-platform. At the time of this post, when setuptools 1.1.6 was the most recent version, this was https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py.

C:\>\Python27\python.exe ez_setup.py

3. Now latest setuptools is installed. Next, get pip installation script:

C:\>\Python27\python.exe -c “import urllib; urllib.urlretrieve(‘GET_PIP_PY_URL’, ‘get-pip.py’)”

where GET_PIP_PY_URL is the URL of the get-pip.py script mentioned on the PIP installation page. At the time of this blog post, it was https://raw.github.com/pypa/pip/master/contrib/get-pip.py.

C:\>\Python27\python.exe get-pip.py

6. Now install virtualenv using the newly installed pip:

C:\>\Python27\Scripts\pip install virtualenv

7. Create a virtual python environments:

C:\>\Python27\Scripts\virtualenv myprojinstall

where myprojinstall is an example virtual environment name for testing your project’s installation. Usually find it useful to specify –system-site-packages so that packages in the host python are available in the virtual environment.

8. Activate the new environment: open a command console, and run \path\to\env\Scripts\activate.bat.

You must repeat the last two steps for every virtual environment needed.

To use a different python version than the one in whcih virtualenv is installed, use -p \path\to\python.exe when creating the virtual environment:

C:\>\Python27\Scripts\virtualenv –system-site-packages -p \python26\python.exe myprojinstall

This saves you from having to run the first 5 steps for every additional python version that you need to virtualize. Note that both pip 1.4 and virtualenv 1.10 currently support python >= 2.6.