Info about the types of hairbrushes to buy more of:
1. Goody Woodgrain Brush #04391
2. Goody Boar Bristle Round Brush #17886
3. Conair Detangling shower comb #13385Z
Wednesday, August 8, 2012
Tuesday, August 7, 2012
Excel decoding and adding times
Writing this Excel task taught me a lot of nice tips and tricks! The job was: A comma delimited file had a column of times not quite in a standard format, the times were for "on" and "off" events, I had to total the elapsed time between each "on" and "off". To do this, I had to decode the timestamp into Excel time format, verify that each on and off matched by comparing that the other column contents matched, and then add each total time.
New column 1: The source column has timestamps in this format: "2012/03/29_11:06:46" Set cell format of the new column to Date expressed as 1/1/2001 13:30. Then use this formula:
=DATEVALUE(MID(E3,1,10))+TIMEVALUE(MID(E3,12,8))
The following links contained all the information needed to figure this part out:
http://superuser.com/questions/274494/convert-text-string-to-date-time-format
https://exceljet.net/formula/convert-date-string-to-date-time
New column 2: Compares the "ON/OFF" column in the current and adjacent rows, along with the other identification column data to determine if the ON event matches the off event:
=IF(OR((AND(D3=$N$1, B3=B4,C3=C4,F3=F4,G3=G4,H3=H4, D4=$O$1)),(AND(D3=$O$1, B3=B2,C3=C2,F3=F2,G3=G2,H3=H2, D2=$N$1))),"Matched","Oops")
$N$1 and $O$1 contained the strings ON and OFF for comparison purposes. There was a much harder way to do this without just creating cells to compare to, but this way was just so much simpler.
This link demystified the syntax for OR and AND in conjunction with IF:
http://www.experiglot.com/2006/12/11/how-to-use-nested-if-statements-in-excel-with-and-or-not/
Here are a couple of links on the problem of trying to do an equate comparison on text cells. They too feel that the solution that I went with is a fallback and inelegant, but list it anyhow:
http://superuser.com/questions/284022/comparing-two-strings-in-excel
http://www.mrexcel.com/archive/Formulas/2870.html
New column 3: If the row is an "OFF" with a matching "ON" then print the total elapsed time. If not, print a blank string. This shows how I continue to cling to visual readability in the output. The basic test uses new column 2, comparing it to another preconfigured cell $P$1 that has the word "Matched" entered.
=IF(AND(D3=$O$1,J3=$P$1),I3-I2,"")
New columns 4 and 5: Cell format is time as 39:00:00. First cell of each column contains 0. Checks one of the other identity columns for whether it's an "A" or "B" ON/OFF event. If matched, and it's an "OFF" event, then add the time from new column 3 to the running time total, otherwise just use the previous cell's total.
=IF(AND(C3=$Q$1,D3=$O$1,J3=$P$1),L2+K3,L2)
=IF(AND(C3=$R$1,D3=$O$1,J3=$P$1),M2+K3,M2)
Off to the side, I printed a list of one of all of the different options for one of the identity columns, using this handy tip:
http://www.windowsreference.com/ms-office/how-to-extractlist-unique-values-in-a-column-in-microsoft-excel/
New column 1: The source column has timestamps in this format: "2012/03/29_11:06:46" Set cell format of the new column to Date expressed as 1/1/2001 13:30. Then use this formula:
=DATEVALUE(MID(E3,1,10))+TIMEVALUE(MID(E3,12,8))
The following links contained all the information needed to figure this part out:
http://superuser.com/questions/274494/convert-text-string-to-date-time-format
https://exceljet.net/formula/convert-date-string-to-date-time
New column 2: Compares the "ON/OFF" column in the current and adjacent rows, along with the other identification column data to determine if the ON event matches the off event:
=IF(OR((AND(D3=$N$1, B3=B4,C3=C4,F3=F4,G3=G4,H3=H4, D4=$O$1)),(AND(D3=$O$1, B3=B2,C3=C2,F3=F2,G3=G2,H3=H2, D2=$N$1))),"Matched","Oops")
$N$1 and $O$1 contained the strings ON and OFF for comparison purposes. There was a much harder way to do this without just creating cells to compare to, but this way was just so much simpler.
This link demystified the syntax for OR and AND in conjunction with IF:
http://www.experiglot.com/2006/12/11/how-to-use-nested-if-statements-in-excel-with-and-or-not/
Here are a couple of links on the problem of trying to do an equate comparison on text cells. They too feel that the solution that I went with is a fallback and inelegant, but list it anyhow:
http://superuser.com/questions/284022/comparing-two-strings-in-excel
http://www.mrexcel.com/archive/Formulas/2870.html
New column 3: If the row is an "OFF" with a matching "ON" then print the total elapsed time. If not, print a blank string. This shows how I continue to cling to visual readability in the output. The basic test uses new column 2, comparing it to another preconfigured cell $P$1 that has the word "Matched" entered.
=IF(AND(D3=$O$1,J3=$P$1),I3-I2,"")
New columns 4 and 5: Cell format is time as 39:00:00. First cell of each column contains 0. Checks one of the other identity columns for whether it's an "A" or "B" ON/OFF event. If matched, and it's an "OFF" event, then add the time from new column 3 to the running time total, otherwise just use the previous cell's total.
=IF(AND(C3=$Q$1,D3=$O$1,J3=$P$1),L2+K3,L2)
=IF(AND(C3=$R$1,D3=$O$1,J3=$P$1),M2+K3,M2)
Off to the side, I printed a list of one of all of the different options for one of the identity columns, using this handy tip:
http://www.windowsreference.com/ms-office/how-to-extractlist-unique-values-in-a-column-in-microsoft-excel/
unix svn show log
Still getting the hang of command line svn, had to look up show log. This page answered my question and more:
http://stackoverflow.com/questions/4881129/how-do-you-see-recent-svn-log-entries
Most useful was show log -v !!!!
http://stackoverflow.com/questions/4881129/how-do-you-see-recent-svn-log-entries
Most useful was show log -v !!!!
Friday, July 27, 2012
How to search file contents in Windows7
M$, realizing that the built-in file search utility didn't quite work right anyhow when searching file contents in XP, has now made the same utility impossible to use in Windows 7. Thank goodness we will no longer be tempted to try to use it any more. Google searches on the problem so far have yielded no answers except for ridiculously cryptic answers provided by M$ staff. So far, there is no clue in the following links:
http://answers.microsoft.com/en-us/windows/forum/windows_7-files/in-windows-7-i-want-to-search-for-all-files/aadfe1f1-4a33-406b-8e72-bb920efa4f30
http://answers.microsoft.com/en-us/windows/forum/windows_7-files/search-file-contents-in-windows-7/44920b75-ff71-4683-96eb-04055d090273
The short answer is install Cygwin, or in my case I was able to use the "Find in files" option in TextPad to do what I needed
http://answers.microsoft.com/en-us/windows/forum/windows_7-files/in-windows-7-i-want-to-search-for-all-files/aadfe1f1-4a33-406b-8e72-bb920efa4f30
http://answers.microsoft.com/en-us/windows/forum/windows_7-files/search-file-contents-in-windows-7/44920b75-ff71-4683-96eb-04055d090273
The short answer is install Cygwin, or in my case I was able to use the "Find in files" option in TextPad to do what I needed
Sunday, July 8, 2012
Renaming large groups of files with find
My normal inclination is to use xargs coupled with find to do something batch-y like renaming groups of files across a whole directory tree, but I've had a lot of trouble getting the syntax perfect for using something like cp with xargs. It turns out that the find at the start of the chain has a -exec argument that allows multiple uses of the found file name no fuss no muss like xargs should. The command is:
find . -name "*.htm" -exec cp -p {} {}.original \;
The key seems to be in the \; at the end, which I guess that I wasn't doing right before.
Here the site that had the info that got me this breakthrough; it's in somebody's comments near the bottom:
http://csm.mech.utah.edu/content/2011/03/01/use-of-the-shell-xargs-command/
find . -name "*.htm" -exec cp -p {} {}.original \;
The key seems to be in the \; at the end, which I guess that I wasn't doing right before.
Here the site that had the info that got me this breakthrough; it's in somebody's comments near the bottom:
http://csm.mech.utah.edu/content/2011/03/01/use-of-the-shell-xargs-command/
Tuesday, June 26, 2012
Recent nice sed commands
Here are two nice sed calls that I did today:
To delete 6 lines out of every file that has a particular line in it:
grep -n "The number of passes was" | xargs -L1 -t sed -i -e '/The number of passes was/,+6d'
To delete all lines containing a match out of every file:
grep -n "$start_" | xargs -L1 -t sed -i -e '/\$start_/,+1d'
the -t in xargs is just to echo which files were altered to the screen, the -i in sed is modify in place (very handy), the +1 before the d in the second command was probably unneccesary.
To delete 6 lines out of every file that has a particular line in it:
grep -n "The number of passes was" | xargs -L1 -t sed -i -e '/The number of passes was/,+6d'
To delete all lines containing a match out of every file:
grep -n "$start_" | xargs -L1 -t sed -i -e '/\$start_/,+1d'
the -t in xargs is just to echo which files were altered to the screen, the -i in sed is modify in place (very handy), the +1 before the d in the second command was probably unneccesary.
Sunday, June 3, 2012
Refridgerator Filter
For our Whirlpool refrigerator, model # ED2KHAXVQ01, the replacement filter seems to be PUR 4396841, which at the moment we can still buy at Lowes. It's the two-port, "Fast Fill" type. The box additionally says "Replacement cartridge #P2RFWG2 for Filter Model # P2WG2L, P1WG2L, P2WG2 and P1WG2". The filter can be ordered online at www.whirlpool.com/accessories, no doubt if you can navigate a nighmarish selection maze of course.
Subscribe to:
Posts (Atom)