Saturday, 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?

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:

  1. Log in to Pandora.
  2. Select the station from your collection.
  3. Click the icon to edit the station. (At this time, it looks like a pencil.)
  4. 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."
  5. (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.
  6. Delete the top-most "seed" to set the album cover from the next "seed" as the station image.
  7. You can continue this process until the "seed" that has your favorite album art occupies the top spot.
  8. 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.

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.

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.

Now when you press your hot key to call up the clipboard list, you can right-click on a text entry, then click on Edit to open a simple editor to modify the text.  When you’re done, you can click OK to put the edited content onto the clipboard, replacing the original entry.





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.

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!

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.

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

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.

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.

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!

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

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,
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.

Saturday, October 29, 2016

Traffic Light Improvements For the Age of Mobile Communications

I have an issue with traffic lights.

When I'm stuck right behind an inattentive driver at a red light, I get annoyed when the driver doesn't go right after the light turns green.  I get infuriated when the driver waits so long to go that the light turns back to red again before I can get across the intersection.

That's pretty much the only time I use the horn.  And it occurred to me that the traffic light itself should be equipped with its own horn.  It would beep whenever it turns green, relieving other drivers of the effort of doing so.

Inattentive drivers annoy me even when I'm not behind them.  When they remain stopped at a green light while I'm at the red light for the crossing traffic, they cause the signal to take longer to cycle.  The light stays green longer for them and stays red longer for me.  I say aloud, “Go already, so I don't have to stay here forever!”

A few towns have installed traffic light cameras, which take a picture of the license plates of cars that go through red lights.  But I say that these cameras should be used to monitor the faces of drivers who wait at red lights.  Face recognition would be used to determine whether the driver is paying attention to the light, or whether they are reading e-mail or texting.  The light would stay red until the driver's gaze was focused on driving.

What do you think about this?

Friday, September 30, 2016

Presidential Candidates' Answers to the 2016 Top 20 Science and Technology Questions

For this election cycle, ScienceDebate has included the Green and Libertarian party candidates in its list of 20 questions regarding the most pressing "... Science, Engineering, Tech, Health & Environmental Issues in 2016."

You can read it all here: www.sciencedebate.org

Thursday, August 25, 2016

Fitting Data in Excel and OpenOffice Calc

I've stopped installing Microsoft Office onto my home computers. Instead, I installed OpenOffice on my latest two computers. It does everything I need it to do. Or so I thought.

One day I decided I wanted OpenOffice Calc to perform a polynomial fit to some measurements I'd been taking. So I did what I always do in Excel: create a Scatterplot of the data, add a Trendline, choose Polynomial and its order, and then click the checkboxes to display both the equation and the R2 value on the chart. Except there was no polynomial Trendline!

According to the OO help forums, there really is no built-in polynomial trendline in Calc. But there is an extension called CorelPolyGUI that does the trick.

Unfortunately, I wasn't too thrilled with this extension. My measurements were accumulating every week. With Excel, I'd be able to add new data and watch the scatterplot update the polynomial. But CorelPolyGUI doesn't work that way. The result from CorelPolyGUI essentially is a snapshot that's disconnected from the input data. To get it to update, I found that I had to delete the result and then re-invoke the extension with new data ranges. And that was a big problem – I wasn't sure over what extent of my data I wanted to fit. Perhaps I could get a better fit if I omitted some measurements. So I needed to alter the input range a few times and compare the results.

There is another method, that if you're clever, you can program yourself. It's based on the following set of equations (for a second-degree poly fit):



To get the values of A, B and C, you simply matrix multiply the vector on the left side of the last equation with the inverted 3 x 3 matrix on the right hand side. Once you program this into your spreadsheet, you can alter the data and instantly get the polynomial function to update.

But it turns out there's an even easier way. I found it accidentally in the results from my search for how to fit a polynomial in OpenOffice. It involves using LINEST to operate on array data. The web page^3 describes using LINEST in Excel to perform non-linear curve fitting. It turns out that the OpenOffice Calc LINEST function works the same way, albeit with slightly different syntax. And the syntax is different because of how you define an array in Calc, separating the elements with semi-colons instead of commas.

In retrospect, I see now the same solution in the OO help forums. The user Villeroy attached a spreadsheet with an example that uses LINEST. But instead of raising the range of independent values to {1;2}, he added the X2 column and referenced it in LINEST. Same thing, really, but perhaps a bit less elegant.