Article on CNN.com entitled “Where fat goes when you lose weight” by Ruben Meerman and Andrew Brown of New South Wales University has a scroller at the top showcasing “the 10 most filling foods for weight loss.” The list:
- Baked potato
- Bean soup
- Greek yogurt
- Wheat berries
Their exemplary smoothie recipe is “put ice and fat-free milk or yogurt in a blender, add in fruit and give it a whirl. Sounds great. Skim milk and ice. Yum. Well, it might be a little lower calorie than Rhonda Patrick’s micronutrient smoothie, so I guess it’s got that going for it.
On Linux command line, the
which command will help you find which executable is tied to a shell alias. For example, if you want to know what python executable is being called when you type
python on the command line, you can do
$ which python
and it will print out the path to the python executable.
On Windows command line (cmd.exe), the analogous command is
This doesn’t work for builtin shell commands like
dir (Windows) or
cd (Linux) because they don’t actually point to an executable anywhere in the file system, they are built in to the shell.
Things are a bit different on Windows 10 Powershell compared to the plain old cmd.exe of yore.
In powershell, here is what you do if you want to view the contents of your Path variable. First, open up a powershell terminal. Then, enter the following command:
> echo $env:Path
The contents of your Path variable will be printed to the terminal. You can also just type
To change the Path variable, you can assign to it using the equals sign:
> $env:Path = "foo"
Don’t worry, doing this will only change your Path for the current Powershell. If you mess something up, you can open a new Powershell and it will have the default Path setting.
If you merely want to append (add) to the existing Path variable, you can do it like so:
> $env:Path = "$env:Path;foo"
This command will append
foo to the Path. The semicolon
; is the path separator on Windows systems.
Here are some super-useful keyboard shortcuts for working with Virtual Desktops on Windows 10:
Ctrl + Win + D: Create a new Virtual Desktop
Ctrl + Win + Right/Left Arrow: Switch to next/previous Virtual Desktop
Win + Tab: Task View, then Tab to highlight your Virtual Desktops, Ctrl + W to close the selected one, or Enter to switch to it.
This one requires some explanation: The Task View shows all your open windows laid out in a tiled fashion, similar to Alt + Tab. However, you can take your fingers off the keys after pressing Win + Tab and the Task View remains active and, furthermore, the open windows are shown across all monitors on your system (so you can see which windows are on which monitors).
From Task View, you can also manage your Virtual Desktops. At the bottom of the screen, you will see all your Virtual Desktops. If you only have one desktop, you will only see a “New Desktop” button in the lower right. By pressing the Tab key, the cursor will move down to the Virtual Desktop area and you can then use the arrow keys to highlight a Virtual Desktop. With a Virtual Desktop highlighted, you can then press Ctrl + W to close it, or press Enter to switch to it.
This book isn’t very good. I will not finish it. The main thesis seems to be that nations with “inclusive” institutions succeed, while those with “extractive” institutions fail. This view seems overly simplistic — obviously, there is a continuous spectrum between wholly inclusive or wholly extractive (side note: I am not sure these terms are ever precisely defined). Perhaps the authors, Daron Acemoglu of MIT and James A. Robinson of Harvard University, seek to classify an institution on the balance of its inclusive and extractive qualities. The authors never seem to form a theory of what causes an institution to become inclusive or extractive.
I am giving away this book because it has sat on my shelf for years. It is surprisingly dust-free.
Here is a direct example of a stupid statement, which I, on a whim, just happened upon by opening to a random page (pp. 318 “The Virtuous Circle – The Slow March of Democracy”):
“The conservative English commentator Edmund Burke, who steadfastly opposed the French Revolution, wrote in 1790, ‘It is with infinite caution that any man should venture upon pulling down an edifice, which has answered in any tolerable degree for ages the common purposes of society, or on building it up again without having models and patterns of approved utility before his eyes.’ Burke was wrong on the big picture. The French Revolution had replaced a rotten edifice and opened the way for inclusive institutions not only in France, but throughout much of Western Europe. But Burke’s caution was not entirely off the mark. The gradual process of British political reform, which had started in 1688 and would pick up pace three decades after Burke’s death, would be more effective because its gradual nature made it more powerful, harder to resist, and ultimately more durable.”
This whole paragraph is stupid. The French Revolution was a bloody disaster. The Reign of Terror was called that for a reason. France eventually recovered. England’s reforms, by the author’s own words, were more effective, powerful and durable because they occurred more gradually. How do these two anecdotes prove Burke wrong about using “infinite caution” when reforming a culture’s longstanding institutions?
I had a little trouble installing the correct driver for the printer but eventually got it to work — here is how it went.
The manufacturer says the driver is already included with Windows OS:
However, I could not complete the driver setup instructions because the setup program (Add Printer) hung when I clicked on the “Windows Update” button, as directed.
So, as a first workaround I did the following:
- I chose from the “generic” list of Brother drivers the one called “Brother Laser Type1 Class Driver.”
This worked just fine for a few prints I needed to do before I found some time to troubleshoot.
Later, I opened up the printer properties window and clicked the “New Driver” button:
Then, find and click “Brother” in the Manufacturer list. Then click “Windows Update.”
Wait a minute or two for it to finish downloading the drivers, and then the Printers list should show a bunch more drivers. Find “Brother HL-5250DN” and select it, then proceed through the rest of the dialogs to finish it out.
Once that is done, you should be back in the “Properties” dialog window. Make sure to click OK or Apply so that the new setting is saved.
I am now attempting to follow Microsoft Tech Support’s recommendation:
- Install a Registry entry. Instructions here.
- Open command prompt and type the following commands:
- Enter credentials and try to sync files again
The Registry Entry part has me download a
.reg file containing the following lines:
Windows Registry Editor Version 5.00
The file downloaded with a
.txt filename extension and so I had to first change this to
.reg. Then, I double clicked the file and OK’d through the dialog boxes. When completed, I got a confirmation message saying that the registry entry was added successfully.
Executing the commands at the command prompt shutdown and restarted the OneDrive client. I have two OneDrive for Business drives sync’d to my desktop — both were shut down by the first command and both were started by the second command.
Upon starting, the OneDrive clients appear to be checking each file for changes.
Next, I logged into portal.office.com via both Internet Explorer and Firefox. I then opened OneDrive and went into my SharePoint library. I first tried clicking the “Sync” link in Internet Explorer, which did not work. I next tried the same in Firefox, and got the following popup:
“Microsoft OneDrive” is the option that worked — “OneDrive.exe” just opened up my existing synced OneDrive on my hard drive.
And now, all is well and the SharePoint library has synced to my local hard drive!
I stumbled around for a little bit with this one. The path to the Python executable must be set in the configuration settings for the Atom autocomplete-python package, and the part of the path with the executable filename must include the
.exe filename extension.
For example, the full path to my WinPython executable is
C:\Users\UserName\WinPython-64bit-22.214.171.124Qt5\python-3.5.3.amd64\python.exe. Entering this path exactly as shown here worked.
TL; DR: create a file called
.jupyter\ in the WinPython settings directory (e.g.
C:\Users\user\WinPython-64bit-126.96.36.199Qt5\settings\.jupyter\jupyter_qtconsole_config.py) and write the line
c.ConsoleWidget.font_size = 12, where the number is what you want the font size to be, in points.
On my Windows machine, for my Python setup, I use WinPython because it is super easy to set up, it’s self-contained, and, if I muck up anything, it is very easy to delete the install and start over. IDEs like JetBrains PyCharm can also be easily set up to point to the WinPython interpreter as well (File > Settings > Project > Project Interpreter) so you can benefit from all the IDE code completion, module analysis, introspection etc etc.
WinPython also comes with a ton of useful modules and “plugins” — Jupyter, IPython (and Qt Console), Spyder, and all the Scientific Python libraries: Numpy, Scipy, Pandas, Matplotlib, etc etc. Python is already “batteries included” — Winpython is like “nuclear reactor included.”
Reloading a Python module can be useful if you are doing interactive testing and development. For example, say you are making incremental changes to a function and with each change you want to poke at it in an interactive console. Or, perhaps you are working in a Jupyter notebook rather than an interactive console. Same idea.
In Python 3.4 and greater, do this:
In Python 3 prior to 3.4 do this:
In Python 2, do this:
A word of caution from the
When a module is reloaded, its dictionary (containing the module’s global variables) is retained. Redefinitions of names will override the old definitions, so this is generally not a problem. If the new version of a module does not define a name that was defined by the old version, the old definition remains.
This effect can be demonstrated by calling
dir() on a loaded module before and after removing some module variables and reloading the module.
Here are some useful references: