The cap on a bottle of liquid laundry detergent doubles as a measuring cup.
Most brands instruct the consumer to "fill to line 1 for medium loads." Line 1 on this cap is about 1cm from the bottom, as shown in the photo below.
As well, when you put the cap back on the bottle, the cap and bottle are designed so that any residual detergent that remains in the cup drains back into the bottle.
I thought everyone knew that until the day I saw my wife pouring the detergent directly into the washing machine.
Not only do you waste money using more detergent than you need to, the excess detergent produces lots of suds that muck up your drain pipe.
If you want to reduce your ecological footprint, this is one way to do it.
Saturday, April 25, 2020
Measure Your Laundry Detergent
Thursday, January 23, 2020
View Internet Header of an Email Message in Modern Outlook Client
One should always examine the Internet Header of a suspicious email. Yet, when Microsoft upgraded Outlook, this has become more difficult than just right-clicking and choosing View Header. Instead, you'll first have to open the message (a cringe-worthy action), and then navigate to File and Properties as described here.
I can never remember the procedure. Besides, I want to see the header before I open the message!
So I wrote a macro that displays the beginning of the header in a message box. Then it offers the choice of whether to copy the header content to the clipboard, which would allow for pasting into a new message to the IT department (for example).
Then I added a button to Quick Launch and bound it to the macro. The upshot is that I can select the message in my Inbox list of messages, press the button, and see the header!
Here's the code, which I couldn't have completed without the help of the Slipstick code sample. Please be careful of unintended wrapping of code, particularly for the value of PR_TRANSPORT_MESSAGE_HEADERS constant!
Sub HeaderReview()
' Copy Message Header contents of selected Mail Item to the Windows Clipboard.
' See: https://www.slipstick.com/developer/code-samples/outlooks-internet-headers/
' 2020-01-23 LG Created from CopyToClipboard dated 12/13/04
Dim objCB As New DataObject ' Clipboard object
Dim ol As New Outlook.Application
Dim oe As Outlook.Explorer
Dim mi As Outlook.MailItem
Dim strMH As String ' Mail Header
Set oe = ol.ActiveExplorer
If oe.CurrentFolder.DefaultItemType = olMailItem Then
Const PR_TRANSPORT_MESSAGE_HEADERS = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
Dim olkPA As Outlook.PropertyAccessor
Dim i As Integer
Set mi = oe.Selection.Item(1)
Set olkPA = mi.PropertyAccessor
strMH = olkPA.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS)
Debug.Print strMH
i = MsgBox(strMH, vbYesNo, "Copy Message Header to Clipboard?")
Select Case i
Case vbYes
objCB.SetText strMH
objCB.PutInClipboard
End Select
Else
MsgBox "Sorry, HeaderReview() supports only Mail items at this time.", _
, "HeaderReview() Help"
End If
End Sub
I can never remember the procedure. Besides, I want to see the header before I open the message!
So I wrote a macro that displays the beginning of the header in a message box. Then it offers the choice of whether to copy the header content to the clipboard, which would allow for pasting into a new message to the IT department (for example).
Then I added a button to Quick Launch and bound it to the macro. The upshot is that I can select the message in my Inbox list of messages, press the button, and see the header!
Here's the code, which I couldn't have completed without the help of the Slipstick code sample. Please be careful of unintended wrapping of code, particularly for the value of PR_TRANSPORT_MESSAGE_HEADERS constant!
Sub HeaderReview()
' Copy Message Header contents of selected Mail Item to the Windows Clipboard.
' See: https://www.slipstick.com/developer/code-samples/outlooks-internet-headers/
' 2020-01-23 LG Created from CopyToClipboard dated 12/13/04
Dim objCB As New DataObject ' Clipboard object
Dim ol As New Outlook.Application
Dim oe As Outlook.Explorer
Dim mi As Outlook.MailItem
Dim strMH As String ' Mail Header
Set oe = ol.ActiveExplorer
If oe.CurrentFolder.DefaultItemType = olMailItem Then
Const PR_TRANSPORT_MESSAGE_HEADERS = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
Dim olkPA As Outlook.PropertyAccessor
Dim i As Integer
Set mi = oe.Selection.Item(1)
Set olkPA = mi.PropertyAccessor
strMH = olkPA.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS)
Debug.Print strMH
i = MsgBox(strMH, vbYesNo, "Copy Message Header to Clipboard?")
Select Case i
Case vbYes
objCB.SetText strMH
objCB.PutInClipboard
End Select
Else
MsgBox "Sorry, HeaderReview() supports only Mail items at this time.", _
, "HeaderReview() Help"
End If
End Sub
Thursday, November 21, 2019
Open Org Mode Links With Default Windows Application
I've been using Org Mode for several years.
One Org Mode quirk is that the links in Org files always open in the Emacs editor, by default. Click a link to Emacs_reference_card_v25.pdf on your hard drive and you might end up with a buffer that starts with this content...
%PDF-1.5
%
3 0 obj
<<
/Length 4340
/Filter /FlateDecode
>>
stream
I finally figured out a way to tell Emacs to open such "external" links with the default Windows application. The multi-part solution involves first specifying all such links with a Special Prefix. I chose "file:". It's lame, I know, but it's also how you'd prefix an address for your web browser to open a local file.
So, for the PDF above, the link would look like this:
file:C:\emacs-25.2_64\doc\Emacs_reference_card_v25.pdf
The second part of the solution is to figure out which application on Windows you'd like to use to open the file "properly." Rather than specifying multiple programs, such as a PDF reader for PDF files, a spreadsheet program for XLS/ODS, a word processor for DOC/ODT, etc., I decided that the single Windows command START already knows how to open all the programs on my computer.
If you were to enter the following in a command prompt, the program associated with the PDF extension would open the target file (assuming the file exists).
START C:\emacs-25.2_64\doc\Emacs_reference_card_v25.pdf
But there's a slight complication. If the link contains a space or other delimiting character, you'll need to surround the file path with quotes like this: "C:\Path With Spaces\My PDF.pdf". Unfortunately, START interprets quoted content as the title specification. Therefore, invoking the following would merely open a command prompt window with the title C:\Path With Spaces\My PDF.pdf
START "C:\Path With Spaces\My PDF.pdf"
So to get START to work as intended, you'd want to invoke it thusly:
START "DUMMY_TITLE" "C:\Path With Spaces\My PDF.pdf"
So having figured out the proper way to open file links, we create a function to implement it:
(defun ludditegeek-open-ext (path-to-media)
(shell-command (concat "start \"ludditegeek-open-ext\" " path-to-media)))
Note that I chose to use the function name as the text for the title. No matter, if all goes well, START will close the command prompt after it carries out the command -- most likely you'll never see the window. For debugging, you could include the /WAIT switch, in which case you'll see the window, and the application will be listed in Task Manager with the title included.
Another thing to note here is that strings are defined in Lisp as characters enclosed in double-quotes. But the title also requires double-quotes! So I used a backslash character to escape the double-quote characters that are used to define the title.
The third part of the solution is to employ org-add-link-type to define the "file" link:
(org-add-link-type "file" 'ludditegeek-open-ext)
I call it with eval-after-load. Here, finally, is what you can put in your .emacs:
(eval-after-load "org"
'(progn
;; Create links in Org thusly:
;; [[file:/path/to/ppt.pptx][name of ppt]]
;; [[file:"/path with spaces/to/pdf.pdf"][name of pdf]]
;; [[file:/path/to/video.mkv][name of video]]
(defun ludditegeek-open-ext (path-to-media)
;; Use Windows start command to open default application.
;; Note that first parameter to START is the command prompt window's title,
;; necessary for links that are enclosed in "", such as links with spaces.
(shell-command (concat "start \"ludditegeek-open-ext\" " path-to-media)))
(org-add-link-type "file" 'ludditegeek-open-ext)
))
I hope you find this useful!
One Org Mode quirk is that the links in Org files always open in the Emacs editor, by default. Click a link to Emacs_reference_card_v25.pdf on your hard drive and you might end up with a buffer that starts with this content...
%PDF-1.5
%
3 0 obj
<<
/Length 4340
/Filter /FlateDecode
>>
stream
I finally figured out a way to tell Emacs to open such "external" links with the default Windows application. The multi-part solution involves first specifying all such links with a Special Prefix. I chose "file:". It's lame, I know, but it's also how you'd prefix an address for your web browser to open a local file.
So, for the PDF above, the link would look like this:
file:C:\emacs-25.2_64\doc\Emacs_reference_card_v25.pdf
The second part of the solution is to figure out which application on Windows you'd like to use to open the file "properly." Rather than specifying multiple programs, such as a PDF reader for PDF files, a spreadsheet program for XLS/ODS, a word processor for DOC/ODT, etc., I decided that the single Windows command START already knows how to open all the programs on my computer.
If you were to enter the following in a command prompt, the program associated with the PDF extension would open the target file (assuming the file exists).
START C:\emacs-25.2_64\doc\Emacs_reference_card_v25.pdf
But there's a slight complication. If the link contains a space or other delimiting character, you'll need to surround the file path with quotes like this: "C:\Path With Spaces\My PDF.pdf". Unfortunately, START interprets quoted content as the title specification. Therefore, invoking the following would merely open a command prompt window with the title C:\Path With Spaces\My PDF.pdf
START "C:\Path With Spaces\My PDF.pdf"
So to get START to work as intended, you'd want to invoke it thusly:
START "DUMMY_TITLE" "C:\Path With Spaces\My PDF.pdf"
So having figured out the proper way to open file links, we create a function to implement it:
(defun ludditegeek-open-ext (path-to-media)
(shell-command (concat "start \"ludditegeek-open-ext\" " path-to-media)))
Note that I chose to use the function name as the text for the title. No matter, if all goes well, START will close the command prompt after it carries out the command -- most likely you'll never see the window. For debugging, you could include the /WAIT switch, in which case you'll see the window, and the application will be listed in Task Manager with the title included.
Another thing to note here is that strings are defined in Lisp as characters enclosed in double-quotes. But the title also requires double-quotes! So I used a backslash character to escape the double-quote characters that are used to define the title.
The third part of the solution is to employ org-add-link-type to define the "file" link:
(org-add-link-type "file" 'ludditegeek-open-ext)
I call it with eval-after-load. Here, finally, is what you can put in your .emacs:
(eval-after-load "org"
'(progn
;; Create links in Org thusly:
;; [[file:/path/to/ppt.pptx][name of ppt]]
;; [[file:"/path with spaces/to/pdf.pdf"][name of pdf]]
;; [[file:/path/to/video.mkv][name of video]]
(defun ludditegeek-open-ext (path-to-media)
;; Use Windows start command to open default application.
;; Note that first parameter to START is the command prompt window's title,
;; necessary for links that are enclosed in "", such as links with spaces.
(shell-command (concat "start \"ludditegeek-open-ext\" " path-to-media)))
(org-add-link-type "file" 'ludditegeek-open-ext)
))
I hope you find this useful!
Thursday, October 17, 2019
Quickly Delete Many Excel Worksheets
In "Reverse the Order of Worksheets in an Excel Workbook" I show a VBA module that I wrote in order to reverse the order of several dozen worksheets in an Excel file.
Each tab contains a summary of data for a week. After a few years, I had amassed over 100 worksheets. So I decided I would split the workbook; each one would contain only one year's worth of data. The workbook for 2018 would have only the 2018 worksheets; 2017 workbook, the 2017 worksheets; etc.
I copied the massive workbook to a 2018 workbook, from which I'd delete all but the 2018 worksheets. Ditto for 2017, 2016, and, oh yes, 2019, as well.
Unfortunately I found this to be exceedingly tedious. There didn't seem to be a way to delete multiple worksheets quickly and without many keystrokes and/or mouse clicks. At best, I was able to select the six tabs that could be displayed at one time by clicking the left-most tab and shift-clicking the right-most tab. Then I could right-click and delete the selected tabs. But I'd have to do that about 20 times for each workbook!
So instead, I wrote the following VBA module to do it effortlessly. Note that each worksheet is named with the date in YYYY-MM-DD format. (So the worksheet for today would be named 2019-10-17. ) This module was used to delete all the 2019 worksheets. Rather than write a nested loop to cycle through multiple years, I decided to change the year in the code manually.
Each tab contains a summary of data for a week. After a few years, I had amassed over 100 worksheets. So I decided I would split the workbook; each one would contain only one year's worth of data. The workbook for 2018 would have only the 2018 worksheets; 2017 workbook, the 2017 worksheets; etc.
I copied the massive workbook to a 2018 workbook, from which I'd delete all but the 2018 worksheets. Ditto for 2017, 2016, and, oh yes, 2019, as well.
Unfortunately I found this to be exceedingly tedious. There didn't seem to be a way to delete multiple worksheets quickly and without many keystrokes and/or mouse clicks. At best, I was able to select the six tabs that could be displayed at one time by clicking the left-most tab and shift-clicking the right-most tab. Then I could right-click and delete the selected tabs. But I'd have to do that about 20 times for each workbook!
So instead, I wrote the following VBA module to do it effortlessly. Note that each worksheet is named with the date in YYYY-MM-DD format. (So the worksheet for today would be named 2019-10-17. ) This module was used to delete all the 2019 worksheets. Rather than write a nested loop to cycle through multiple years, I decided to change the year in the code manually.
Sub DeleteNewWorksheets()
' 2019-03-24 TG Created to clean up status records
Dim Sheet As Worksheet
Dim Book As Workbook
Dim n As String
Dim alerts As Boolean
Dim i As Integer
alerts = Application.DisplayAlerts
Application.DisplayAlerts = False
Set Book = ActiveWorkbook
i = 0
For Each Sheet In Book.Sheets
n = Left(Sheet.Name, 4)
If n = "2019" Then
Debug.Print "Deleted " & Sheet.Name
Sheet.Delete
i = i + 1
End If
Next
Application.DisplayAlerts = alerts
MsgBox "Deleted " & i & " sheets.", vbInformation, "DeleteOldWorksheets Notification"
End SubSaturday, June 15, 2019
Plunging Into Celsius
“What is that in Celsius?” asked my European coworker on the other end of an international conference call. We had started the call by saying how cold it was in the Northeast, -21°F exactly, so I was already asking Google to convert it for me.
“About -30°C,” I replied, not missing a beat.
That’s when I asked myself, “Why do I still use the Fahrenheit temperature scale?” I decided to switch the units on my favorite weather app and take the plunge to Celsius.
“Isn’t switching to Celsius hard for an old person like you?” you might ask. Well, I know that water freezes at about 0°C and boils at about 100°C. Also, I was already accustomed to using Celsius at work, so I knew that room temperature is about 25°C, at least for a warm room. (I allow my house to stay much cooler in Winter.)
Given these three F-C equivalents, it’s easy to deduce temperatures that lie between 32°F (0°C) and 77°F (25°C) by using ratios. For example, 12°C, a temperature that is halfway between 0°C and 25°C, is also halfway between 32°F and 77°F, and that’s 55°F. Likewise, the “quarter points” are 6°C (44°F) and 18°C (66°F), a typical room temperature in Winter.
Below 0°C, I rely on the fact that for every one degree change in Celsius, there is a 1.8° change in Fahrenheit. As well, for every 2°C change, we experience a 3.6°F change. So -4°C would be about 7°F below 32°F, or 25°F.
On the upper end of the weather temperature scale, you might get a 35°C forecast, which is 10°C higher than room temperature, or 18°F above 77°F, or 95°F, which (unfortunately) my European coworkers experienced recently.
Have you guessed that I dislike warm weather?
I’m not sure I’ll bother using Celsius in cooking or baking. First, if I change the units on the oven, my wife will be very upset. But then I’d also have to convert all the recipes we’ve accumulated. I don’t see any point in that.
So will you also switch the units in your weather app from Fahrenheit to Celsius?
“About -30°C,” I replied, not missing a beat.
That’s when I asked myself, “Why do I still use the Fahrenheit temperature scale?” I decided to switch the units on my favorite weather app and take the plunge to Celsius.
“Isn’t switching to Celsius hard for an old person like you?” you might ask. Well, I know that water freezes at about 0°C and boils at about 100°C. Also, I was already accustomed to using Celsius at work, so I knew that room temperature is about 25°C, at least for a warm room. (I allow my house to stay much cooler in Winter.)
Given these three F-C equivalents, it’s easy to deduce temperatures that lie between 32°F (0°C) and 77°F (25°C) by using ratios. For example, 12°C, a temperature that is halfway between 0°C and 25°C, is also halfway between 32°F and 77°F, and that’s 55°F. Likewise, the “quarter points” are 6°C (44°F) and 18°C (66°F), a typical room temperature in Winter.
Below 0°C, I rely on the fact that for every one degree change in Celsius, there is a 1.8° change in Fahrenheit. As well, for every 2°C change, we experience a 3.6°F change. So -4°C would be about 7°F below 32°F, or 25°F.
On the upper end of the weather temperature scale, you might get a 35°C forecast, which is 10°C higher than room temperature, or 18°F above 77°F, or 95°F, which (unfortunately) my European coworkers experienced recently.
Have you guessed that I dislike warm weather?
I’m not sure I’ll bother using Celsius in cooking or baking. First, if I change the units on the oven, my wife will be very upset. But then I’d also have to convert all the recipes we’ve accumulated. I don’t see any point in that.
So will you also switch the units in your weather app from Fahrenheit to Celsius?
Saturday, June 08, 2019
Pandora Music Streaming Tweak -- Change the Station Image
I've been a Pandora subscriber since 2006, and I have a couple of well-tweaked stations. But one of my favorite stations was stuck with the ugly album art of the song that was used as the station seed. I couldn't find a way to replace the image, and Pandora help had nothing to offer. So here's how I changed the image:
- Log in to Pandora.
- Select the station from your collection.
- Click the icon to edit the station. (At this time, it looks like a pencil.)
- From here you can change the station Name, Description, and Thumb History, but most importantly, the "Seed" that the station evolved from, which is in the section called "Station Created From."
- (If there are multiple "seeds" in this section you can skip this step.) Click "+ Add Variety" to add a new "seed" and choose a favorite song whose album cover you prefer.
- Delete the top-most "seed" to set the album cover from the next "seed" as the station image.
- You can continue this process until the "seed" that has your favorite album art occupies the top spot.
- At this point, you can add back the deleted "seeds" as described in step 5. But for a mature station, you probably don't need to do this, especially if you've been diligent with the thumbs up button.
Thursday, August 09, 2018
Show Column in Outlook With Email Purge Date
If you're running Outlook in an Exchange environment, and the administrator has defined a Retention Policy, you can use the following kludge to configure Outlook to display a column of dates that the emails will be deleted on. It's a kludge because the configuration doesn't actually retrieve the Retention Policy from Exchange -- it's up to you to find out what it is and then add it to the configuration.
Select your Inbox and then right click on the message list header and select Field Chooser.
Click the down arrow next to Frequently-used fields and scroll down to User-defined fields in folder.
Click New... and then enter PurgeOn in the Name box, and scroll down the Type box and select Formula.
Enter in the Formula box the DateAdd function that will return a date that's X number of days or months after the message Received date. For example, if the Retention Policy is 18 months, enter this into the box: DateAdd("m",18,[Received]). (The first parameter "m" specifies "Month" as the interval. The number in the second parameter defines the number of intervals, or months in this case. The third parameter represents the each message's received date.) Then click OK.
Drag the new PurgeOn field that you just created to the header in the position that you'd like the column to appear.
Close Field Chooser and resize the columns so that the dates in the new PurgeOn field display properly.
Note that the dates in the PURGEON column are 18 months later than the dates in the received column.
Unfortunately it seems that each folder (Inbox, Sent Items, etc.) requires its own User Defined Field. The [Received] field is appropriate for use in the Inbox. You might use DateAdd("m",18,[Sent]) in the Sent Items folder.
Again, this is a kludge. If an administrator changes the Retention Policy on the Exchange Server, your new field will ignore the change and blithely continue to show dates based on the old policy. It may be possible to write a VBA procedure that would run on startup, retrieve the Retention Policy from Exchange and define the PurgeOn field programmatically. Let me know if you get that working!
A subset of this solution appeared on Microsoft TechNet on 2018-08-09.
Select your Inbox and then right click on the message list header and select Field Chooser.
Click the down arrow next to Frequently-used fields and scroll down to User-defined fields in folder.
Click New... and then enter PurgeOn in the Name box, and scroll down the Type box and select Formula.
Enter in the Formula box the DateAdd function that will return a date that's X number of days or months after the message Received date. For example, if the Retention Policy is 18 months, enter this into the box: DateAdd("m",18,[Received]). (The first parameter "m" specifies "Month" as the interval. The number in the second parameter defines the number of intervals, or months in this case. The third parameter represents the each message's received date.) Then click OK.
Drag the new PurgeOn field that you just created to the header in the position that you'd like the column to appear.
Close Field Chooser and resize the columns so that the dates in the new PurgeOn field display properly.
Note that the dates in the PURGEON column are 18 months later than the dates in the received column.
Unfortunately it seems that each folder (Inbox, Sent Items, etc.) requires its own User Defined Field. The [Received] field is appropriate for use in the Inbox. You might use DateAdd("m",18,[Sent]) in the Sent Items folder.
Again, this is a kludge. If an administrator changes the Retention Policy on the Exchange Server, your new field will ignore the change and blithely continue to show dates based on the old policy. It may be possible to write a VBA procedure that would run on startup, retrieve the Retention Policy from Exchange and define the PurgeOn field programmatically. Let me know if you get that working!
A subset of this solution appeared on Microsoft TechNet on 2018-08-09.
Friday, April 13, 2018
Too Much Soap – Too Much Trouble
The effect of using too much laundry detergent makes for a funny, suds-filled scene in the movies. But the real problem occurs the next time someone does laundry. All those suds fill the drain line causing turbulence during the rinse cycle, which leads to an overflowing filler tube and a flooded laundry room.
I’d been trying to get my wife to measure the detergent with the cap according to the label. But she always felt the need to do it her way. And her way has been to pour the detergent directly into the washer tub, as if adding creamer into coffee. We’d usually get some overflow in the drain line, and suds would emerge in the adjacent shower.
It’s for this reason I would always buy the cheapest (most watered-down) detergent. Unfortunately, one day she decided to buy some ultra-concentrated product. The flood from repeated washings was significant.
I cleaned it up and then set up an electric heater to dry out what I couldn’t remove. In order to plug in the heater, I unplugged the washer. So my wife was prevented from running the washer for a few weeks. That gave me time to snake the drain line (just in case) and run several wash loads with the correct amount of soap. After a couple of loads, the machine drained better than it ever had before. I left it this way for a couple of weeks. In fact, she got mad about that – she wanted to do laundry herself. Imagine, someone offers to do the laundry for you and you get mad because you can’t do it yourself!
Eventually she settled down enough that she was willing to show her the proper way to:
1. Read the label.
2. Pour the correct amount into the measuring cup.
3. Pour the measured amount from the cup into the tub.
4. Not rinse the cap under the running water.
5. Load the tub right away with clothes.
The last two points are also important. If you place the cap under the gushing water, suds will form. Also, if you don’t put the clothes in right away suds will form. I actually add the detergent after loading all the clothes, making sure to pour it into the water farthest from the water source.
It was amazing that my wife watched and listened to me patiently while I demonstrated the correct way to do laundry. I didn’t think it was possible. But it happened, and it felt like my birthday, Christmas and Father’s Day all lumped into one! Even more amazing is that she’s been doing a lot of laundry over the past couple of weeks, and we’ve had no overflowing water or subs in the shower. Still, I’m keeping the ultra-concentrated detergent out of sight indefinitely.
I’d been trying to get my wife to measure the detergent with the cap according to the label. But she always felt the need to do it her way. And her way has been to pour the detergent directly into the washer tub, as if adding creamer into coffee. We’d usually get some overflow in the drain line, and suds would emerge in the adjacent shower.
It’s for this reason I would always buy the cheapest (most watered-down) detergent. Unfortunately, one day she decided to buy some ultra-concentrated product. The flood from repeated washings was significant.
I cleaned it up and then set up an electric heater to dry out what I couldn’t remove. In order to plug in the heater, I unplugged the washer. So my wife was prevented from running the washer for a few weeks. That gave me time to snake the drain line (just in case) and run several wash loads with the correct amount of soap. After a couple of loads, the machine drained better than it ever had before. I left it this way for a couple of weeks. In fact, she got mad about that – she wanted to do laundry herself. Imagine, someone offers to do the laundry for you and you get mad because you can’t do it yourself!
Eventually she settled down enough that she was willing to show her the proper way to:
1. Read the label.
2. Pour the correct amount into the measuring cup.
3. Pour the measured amount from the cup into the tub.
4. Not rinse the cap under the running water.
5. Load the tub right away with clothes.
The last two points are also important. If you place the cap under the gushing water, suds will form. Also, if you don’t put the clothes in right away suds will form. I actually add the detergent after loading all the clothes, making sure to pour it into the water farthest from the water source.
It was amazing that my wife watched and listened to me patiently while I demonstrated the correct way to do laundry. I didn’t think it was possible. But it happened, and it felt like my birthday, Christmas and Father’s Day all lumped into one! Even more amazing is that she’s been doing a lot of laundry over the past couple of weeks, and we’ve had no overflowing water or subs in the shower. Still, I’m keeping the ultra-concentrated detergent out of sight indefinitely.
Monday, April 02, 2018
Trump vs. Amazon
“I have stated my concerns with Amazon long before the Election. Unlike others, they pay little or no taxes to state & local governments, use our Postal System as their Delivery Boy (causing tremendous loss to the U.S.), and are putting many thousands of retailers out of business!”
— Donald J. Trump (@realDonaldTrump) March 29, 2018
Look who’s complaining about Amazon not paying taxes! It’s He-Who-Will-Not-Release-His-Tax-Returns!
— Donald J. Trump (@realDonaldTrump) March 29, 2018
Look who’s complaining about Amazon not paying taxes! It’s He-Who-Will-Not-Release-His-Tax-Returns!
Saturday, November 18, 2017
How to Use Excel Pivot Tables to Summarize Continuous Data
Suppose you have a set of data points that represent some quantity in a volume. It could be temperature in a solid, for example. How can you use a Pivot Table find the average temperature in a region on the solid’s surface?
Well, if you’re lucky, the region is rectangular, bounded by some Xmin and Xmax and Ymin and Ymax. Then you can use the built-in Label Filters.
I created a set of data for this article with -20<=X<=20, -20<=Y<=20, -20<=Z<=20. The temperature is a function of X,Y,Z using the (arbitrary) formula =2.5*X+0.25*Y^2+2.5*SIN(Z).
First, set up the Pivot Table and chose the option to Allow multiple filters per field.
In the screenshots below, we define a Region with Label Filters in the PivotTable Rows within X=[-2,8] and Y=[5,7]. The function is not dependent on the Z coordinate – we’ll use a Page Filter to constrain Z to 0. As can be seen in the status line of the fourth screenshot below, the average temperature in that region is 16.67 degrees C.
But suppose the region is more complicated than a rectangle, or you want to summarize multiple regions?
You can define a function in VBA to “discretize” the data, as shown in the code sample, below.
Option Explicit
Function Region(rngX As Range, rngY As Range, rngZ As Range) As String
Const regA_Xmin = -2#: Const regA_Xmax = 8#
Const regA_Ymin = 5#: Const regA_Ymax = 7#
Const regB_Xmin = -6#: Const regB_Xmax = -3#
Const regB_Ymin = 5#: Const regB_Ymax = 7#
Const regC_Xmin = -2#: Const regC_Xmax = 8#
Const regC_Ymin = -5#: Const regC_Ymax = -3#
Const regD_Xmin = 9#: Const regD_Xmax = 12#
Const regD_Ymin = 5#: Const regD_Ymax = 7#
Const regE_Xmin = 16#: Const regE_Xmax = 18#
Const regE_Ymin = -15#: Const regE_Ymax = -7#
Dim x As Double, y As Double, z As Double
x = rngX.Value: y = rngY.Value: z = rngZ.Value
If x >= regA_Xmin And x <= regA_Xmax And _
y >= regA_Ymin And y <= regA_Ymax Then
Region = "Region A"
ElseIf x >= regB_Xmin And x <= regB_Xmax And _
y >= regB_Ymin And y <= regB_Ymax Then
Region = "Region B"
ElseIf x >= regC_Xmin And x <= regC_Xmax And _
y >= regC_Ymin And y <= regC_Ymax Then
Region = "Region C"
ElseIf x >= regD_Xmin And x <= regD_Xmax And _
y >= regD_Ymin And y <= regD_Ymax Then
Region = "Region D"
Else
Region = "NA"
End If
End Function
The function accepts three Range type parameters, each of which are intended to be the address of a single cell. It returns one of five strings: Region A, Region B, Region C, Region D, NA.
The first four constants that are defined in the first two lines are minimum and maximum X and Y coordinates for the region that were defined in the previous example with Label Filters. So the string “Region A” is returned if X and Y are within those X-Y intervals.
When we type in cell E2 =Region(A2, B2, C2) and then fill down, Excel calls the function for each of the cells that the formula occupies and then puts the result in that cell. It can take several seconds for all the cells to be
populated, even with an i5 processor.
And the calculation can increase the drain on the battery if you’re doing
this unplugged / on the road.
But when it’s complete, you can set up your
Pivot Table with the regions in the row.
The average of the temperature values for Region A is shown in cell B5
below as 16.67.
Wednesday, November 01, 2017
Introduction to CLCL Tools
CLCL is the clipboard manager that I prefer. But it’s lacking in extensive documentation, at least for those who don’t know Japanese. I figured out how to configure the Tools that it comes with, so I thought I’d share that with you.
This procedure assumes that you already know how to download, install and run the main program.
Download the Tools from http://www.nakka.com/soft/clcl/index_eng.html . There are two ZIP files (tltxt002_eng.zip and tlutl002_eng.zip, as of this writing) that provide DLLs with the functions that serve as tools. Copy the DLLs from those ZIP files into the directory in which the CLCL executable resides. While you’re at the Nakka website, you might as well download the other ZIP files that provide ability to manage as wider range of file formats. Copy their DLLs, too. As of this writing, there are two: fmtrtf002_eng.zip; fmtmeta002_eng.zip .
Invoke Tools from the Viewer menu, then choose Tool Setup…
Click the Add… button.
In the DLL textbox, enter the path and filename of one of the tool DLLs, for example, C:\Program Files (x86)\CLCL\tool_text.dll . If you click the Browse button, you can use a File Dialog box to navigate to and select the DLL.
Now choose one of the Tools to add. I find &Edit to be useful, so choose that. OK your way back out.
Use the same procedure to try out the other tools.
Tuesday, October 31, 2017
Where Should You Stick Your Function?
Let's say you need to create a VBA function to use in a spreadsheet. Where do you put it? Quick answer, put it in a module.
In Excel, press Alt-F11, Ctrl-R (to set focus to the Project Explorer). Right click on VBAProject (xls_name), where xls_name in the file name of your workbook. Select Insert Module.
A blank code window should appear and the cursor should be positioned in it. This is "Module1" where you can enter your code, such as...
Option Explicit
Function FortyTwo(r As Range)
If r.Value = 42 Then
FortyTwo = "Forty-Two"
Else
FortyTwo = r.Value
End If
End Function
If you enter 1, apple, and =6*7 in cells A1, A2 A3, here's what you get as output if you enter =FortyTwo(A1) in cell B1 and drag down to B3:
Of course, if A3 contained =6*9 you should also get Forty-Two, but that's a programming challenge for another day.
In Excel, press Alt-F11, Ctrl-R (to set focus to the Project Explorer). Right click on VBAProject (xls_name), where xls_name in the file name of your workbook. Select Insert Module.
A blank code window should appear and the cursor should be positioned in it. This is "Module1" where you can enter your code, such as...
Option Explicit
Function FortyTwo(r As Range)
If r.Value = 42 Then
FortyTwo = "Forty-Two"
Else
FortyTwo = r.Value
End If
End Function
If you enter 1, apple, and =6*7 in cells A1, A2 A3, here's what you get as output if you enter =FortyTwo(A1) in cell B1 and drag down to B3:
Of course, if A3 contained =6*9 you should also get Forty-Two, but that's a programming challenge for another day.
Sunday, July 02, 2017
The Dreaded Non-Disclosure / Non-Compete Agreement
If you work in the USA tech industry, you've probably been asked to sign a non-disclosure / non-compete agreement with a new employer. It may be that even your current employer asked you to sign a new one.
If you're not familiar with it, let me describe it for you in a nutshell: Anything you witness or produce on company time becomes the property of your employer. Even if you think of something, if you thought of it on company time, that idea is your employer's property. This explains a lot of what I've observed during my career -- many coworkers are so poignantly aware of this that the second they clock in, they empty their minds completely of thoughts and go about their duties thoughtlessly.
If asked to sign a non-disclosure / non-compete agreement, what should you do? This ebook from IEEE should help:
https://www.ieeeusa.org/members/IPandtheengineer.pdf
Good luck!
If you're not familiar with it, let me describe it for you in a nutshell: Anything you witness or produce on company time becomes the property of your employer. Even if you think of something, if you thought of it on company time, that idea is your employer's property. This explains a lot of what I've observed during my career -- many coworkers are so poignantly aware of this that the second they clock in, they empty their minds completely of thoughts and go about their duties thoughtlessly.
If asked to sign a non-disclosure / non-compete agreement, what should you do? This ebook from IEEE should help:
https://www.ieeeusa.org/members/IPandtheengineer.pdf
Good luck!
Sunday, June 04, 2017
Hard Drive Thrashing? Maybe It's Windows Update
In a previous post, I wondered if my computer problems were due to AntiVirus interfering with Windows Update.
Perhaps. But there's definitely a problem with Windows Update. The following seemed to get rid of the excessive and endless thrashing of the hard drive:
http://www.cagedrat.com/microsoft-windows/microsoft-windows-updates-cab-files-filling-up-hard-drive/
And yes, I plug in my computer and set it to Stay Awake before downloading and installing updates.
Perhaps. But there's definitely a problem with Windows Update. The following seemed to get rid of the excessive and endless thrashing of the hard drive:
http://www.cagedrat.com/microsoft-windows/microsoft-windows-updates-cab-files-filling-up-hard-drive/
And yes, I plug in my computer and set it to Stay Awake before downloading and installing updates.
Wednesday, May 17, 2017
Some Things Never Change
For over two thousand years, engineers had to contend with manufacturing issues. We're still doing that today...
"... its design conception exceeded the engineering precision of its manufacture by a wide margin—with considerable cumulative inaccuracies in the gear trains, which would have cancelled out many of the subtle anomalies built into its design."
From the Wikipedia page "Antikythera mechanism," Google's feature for today, 2017-05-17.
https://en.wikipedia.org/wiki/Antikythera_mechanism
"... its design conception exceeded the engineering precision of its manufacture by a wide margin—with considerable cumulative inaccuracies in the gear trains, which would have cancelled out many of the subtle anomalies built into its design."
From the Wikipedia page "Antikythera mechanism," Google's feature for today, 2017-05-17.
https://en.wikipedia.org/wiki/Antikythera_mechanism
Sunday, April 23, 2017
Dummies Data Visualization Links
The following links are listed in Data Visualization for Dummies:
https://www.edwardtufte.com/tufte/
http://visual.ly/
http://chartporn.org/
https://excelcharts.com/posts/
http://flowingdata.com/
Seems to be more for artists than for engineers, though.
https://www.edwardtufte.com/tufte/
http://visual.ly/
http://chartporn.org/
https://excelcharts.com/posts/
http://flowingdata.com/
Seems to be more for artists than for engineers, though.
Thursday, March 30, 2017
A Better Way to Link to a Slide in PowerPoint
I've written about how to force Excel to use absolute paths in its links by specifying the Hyperlink Base That works in PowerPoint, too. Unfortunately, it interferes with PowerPoint's ability to follow internal links (links to other slides in the document).
Here's a workaround for that. It allows you to link to another slide in the same PPT even if you have Hyperlink Base set to some location. This was tested on PowerPoint 2003.
There are two parts to this. The first part is to create a "bookmark" at the slide you want to link to. Do this by creating a “Custom Slide Show”. It's analogous to adding a bookmark in Word (but, regrettably much more complicated and less intuitive).
1. In version 2003, choose Slide Show from the menu and then Custom Shows...
2. Click the New... button.
3. Enter a name for the Show in the uppermost textbox for the slide that you want to link to. For example, you might enter "Detailed Analysis".
4. In the left box, click on the slide that you want to "link to". Then click the Add >> button. (You can add multiple slides.)
5. Click OK and then Close.
The second part creates the link to it. When you click the link, it will run a mini slide show that consists of the target slide(s).
1. Select some text that you'd like to make into a hyperlink, for example, "Please see the Detailed Analysis".
2. Press Ctrl-K (or right-click on the selection and choose Hyperlink).
3. Click "Place in this Document" on the left.
4. In the scroll box that opens, scroll down to find "Detailed Analysis" (or whatever) under Custom Shows and click it. (If you see only Custom Shows, click the plus sign to the left of it).
5. Click the "Show and return" checkbox.
6. OK your way out.
The really neat thing is that the "link" persists even if slides are added before the target slide. This is an awesome improvement over the conventional bookmark mechanism in which you're limited to linking to a slide number. On the other hand, the hyperlink works only during a Slide Show. There is no option to right click and open hyperlink. So if you like to present in “edit mode” it won't work.
Also, navigation is a bit wonky. When you click on the link, PPT will show the target slide, as expected. But Alt-Left (the universal keystroke for "Back") doesn't return you to the previous slide. In order to go back, you have to tell PPT to advance to the next slide (press PgDn, for example) to get back to the previous slide. Pressing PgUp will cause PPT to ring the error bell at you. Don't worry. After a few dings, you'll get the hang of it.
Even if you don't need to set Hyperlink Base, you might prefer this method over the simpler method of linking to a slide. Because if that slide's position changes, the simple link won't work the way you intended.
Let me know if you find this useful. And if anyone knows this “GadiN” who reported the problem, please thank him or her for me and share this method.
Here's a workaround for that. It allows you to link to another slide in the same PPT even if you have Hyperlink Base set to some location. This was tested on PowerPoint 2003.
There are two parts to this. The first part is to create a "bookmark" at the slide you want to link to. Do this by creating a “Custom Slide Show”. It's analogous to adding a bookmark in Word (but, regrettably much more complicated and less intuitive).
1. In version 2003, choose Slide Show from the menu and then Custom Shows...
2. Click the New... button.
3. Enter a name for the Show in the uppermost textbox for the slide that you want to link to. For example, you might enter "Detailed Analysis".
4. In the left box, click on the slide that you want to "link to". Then click the Add >> button. (You can add multiple slides.)
5. Click OK and then Close.
The second part creates the link to it. When you click the link, it will run a mini slide show that consists of the target slide(s).
1. Select some text that you'd like to make into a hyperlink, for example, "Please see the Detailed Analysis".
2. Press Ctrl-K (or right-click on the selection and choose Hyperlink).
3. Click "Place in this Document" on the left.
4. In the scroll box that opens, scroll down to find "Detailed Analysis" (or whatever) under Custom Shows and click it. (If you see only Custom Shows, click the plus sign to the left of it).
5. Click the "Show and return" checkbox.
6. OK your way out.
The really neat thing is that the "link" persists even if slides are added before the target slide. This is an awesome improvement over the conventional bookmark mechanism in which you're limited to linking to a slide number. On the other hand, the hyperlink works only during a Slide Show. There is no option to right click and open hyperlink. So if you like to present in “edit mode” it won't work.
Also, navigation is a bit wonky. When you click on the link, PPT will show the target slide, as expected. But Alt-Left (the universal keystroke for "Back") doesn't return you to the previous slide. In order to go back, you have to tell PPT to advance to the next slide (press PgDn, for example) to get back to the previous slide. Pressing PgUp will cause PPT to ring the error bell at you. Don't worry. After a few dings, you'll get the hang of it.
Even if you don't need to set Hyperlink Base, you might prefer this method over the simpler method of linking to a slide. Because if that slide's position changes, the simple link won't work the way you intended.
Let me know if you find this useful. And if anyone knows this “GadiN” who reported the problem, please thank him or her for me and share this method.
Saturday, March 18, 2017
Is AntiVirus as Bad as Malware?
I've been using and recommending AVG AntiVirus Free for over a decade. Whenever a new computer's trial version of Symantec AntiVirus would expire, I'd uninstall it and install AVG.
But when I accepted the upgrade to version 16, I lost the ability to control its update schedule. It's no longer possible to disable automatic updates. Now the only option is to accept automatic updates whenever they become available. Users even lost the ability to force an update.
That's a big problem. I once hosed a system when AVG updated during a Windows Update. That was when I decided to disable automatic updates and run them manually with a simple right click of the taskbar icon.
I still have the install file for AVG 15. Unfortunately, it downloads the full installer from the Internet and then installs the latest version.
I considered doing away with AntiVirus entirely. But I'm not the only user of the computers -- the other users will need to have the safety net of an AntiVirus program.
So it's time to shop for a new AntiVirus program!
But when I accepted the upgrade to version 16, I lost the ability to control its update schedule. It's no longer possible to disable automatic updates. Now the only option is to accept automatic updates whenever they become available. Users even lost the ability to force an update.
That's a big problem. I once hosed a system when AVG updated during a Windows Update. That was when I decided to disable automatic updates and run them manually with a simple right click of the taskbar icon.
I still have the install file for AVG 15. Unfortunately, it downloads the full installer from the Internet and then installs the latest version.
I considered doing away with AntiVirus entirely. But I'm not the only user of the computers -- the other users will need to have the safety net of an AntiVirus program.
So it's time to shop for a new AntiVirus program!
Friday, February 03, 2017
Adventures in Email Debugging
On Wednesday I was unable to download my personal email on my work computer. Since downloading personal email at work is something I probably shouldn't be doing anyway, I didn't look into the matter right away.
And besides, my set up is a bit complicated, actually. The email client is Outlook, which is used in IMAP mode to work with the Exchange email server. But I also use Outlook to connect to Yahoo's POP and SMTP servers for my personal mail. But not directly.
Outlook is configured to connect to Firetrust's Benign (0), which is set up to listen on a local IP address. And Benign is configured to connect to POPFile (1). So any one of those three programs could be at fault, or the Yahoo POP server could be down, or the IT department might've blocked the necessary ports.
I figured I'd restart my computer eventually. But I was running a long script, and I didn't want to do a restart at that time. So I first I stopped and restarted POPFile and then Benign. And then Outlook.
When that didn't help, I fired up Firetrust's Mailwasher Pro (2), just to see if I could connect to the Yahoo POP server and download message headers. I could. So at least the POP port 995 (for SSL) was still open on the router.
Then I set up a new Outlook email account profile that would connect directly with the Yahoo mail server. That worked, too. So Outlook was still okay. That meant Benign or POPFile was at fault.
I decided to check out the POPFile website first. And there I read in the news listing, “The Windows version of POPFile 1.1.3 is no longer compatible with some SSL servers...” True it was dated back to September 2015, but if Yahoo just upgraded its server, then it would make sense.
I downloaded and installed the SSL updater that POPFile provided (3) and got it all working again in a jiffy.
So if anyone else out there is using POPFile as an intermediary between Yahoo and his or her email client, be prepared to use this technique to get it working again.
(0) http://www.firetrust.com/products/benign
(1) http://getpopfile.org/
(2) http://www.firetrust.com/products/mailwasher-pro
(3) http://getpopfile.org/downloads/updateSSL-mk2-for-POPFile-1.1.3.zip
And besides, my set up is a bit complicated, actually. The email client is Outlook, which is used in IMAP mode to work with the Exchange email server. But I also use Outlook to connect to Yahoo's POP and SMTP servers for my personal mail. But not directly.
Outlook is configured to connect to Firetrust's Benign (0), which is set up to listen on a local IP address. And Benign is configured to connect to POPFile (1). So any one of those three programs could be at fault, or the Yahoo POP server could be down, or the IT department might've blocked the necessary ports.
I figured I'd restart my computer eventually. But I was running a long script, and I didn't want to do a restart at that time. So I first I stopped and restarted POPFile and then Benign. And then Outlook.
When that didn't help, I fired up Firetrust's Mailwasher Pro (2), just to see if I could connect to the Yahoo POP server and download message headers. I could. So at least the POP port 995 (for SSL) was still open on the router.
Then I set up a new Outlook email account profile that would connect directly with the Yahoo mail server. That worked, too. So Outlook was still okay. That meant Benign or POPFile was at fault.
I decided to check out the POPFile website first. And there I read in the news listing, “The Windows version of POPFile 1.1.3 is no longer compatible with some SSL servers...” True it was dated back to September 2015, but if Yahoo just upgraded its server, then it would make sense.
I downloaded and installed the SSL updater that POPFile provided (3) and got it all working again in a jiffy.
So if anyone else out there is using POPFile as an intermediary between Yahoo and his or her email client, be prepared to use this technique to get it working again.
(0) http://www.firetrust.com/products/benign
(1) http://getpopfile.org/
(2) http://www.firetrust.com/products/mailwasher-pro
(3) http://getpopfile.org/downloads/updateSSL-mk2-for-POPFile-1.1.3.zip
Saturday, January 14, 2017
On the Benefits of Social Media
Today's Soup to Nutz comic strip by Rick Stromoski is definitely blog worthy...
http://www.gocomics.com/soup-to-nutz/2017/01/14
If you can't follow the link, it's simply that Babs remarks to her brother Roy-boy,
http://www.gocomics.com/soup-to-nutz/2017/01/14
If you can't follow the link, it's simply that Babs remarks to her brother Roy-boy,
I'm so glad I live in a time when there's social media... In the old days it took weeks, even months... before finding out that someone was an idiot."Naturally I posted it to Facebook.
Subscribe to:
Posts (Atom)




