That is, say you have a complex equation that tells you how Y depends on x - a closed for expression basically.
But, you want to tabulate x for Y - that is, someone gives you a table of Y values and now, you want to fill in the x values - remember, you only have the equation for going the other way!
Thanks to Charlie Nuttelman - the nutty professor, we have a solution..
Here's what you do...
Get up to speed on the bisection method for problem solving. That is, you want to know what x gives f(x) = Target. So, cast the problem as f(x) - Target = 0 and now find the x that zeroes the LHS. If you're guaranteed only one root in a particular range, you can use bisection. I know... read up!
Implement the bisection! That is the first row is
min , f(min)-Tgt , (min+max)/2 , f(mid)-Tgt, max , f(max)-Tgt
2nd row is (now using g for f - Tgt to save my fingers :)
min = IF( g(min_prev_row)*g(mid_prev_row) < 0, min_prev_row, mid_prev_row ), g(min), mid=…
you get the idea :) I hope :)
Once you have the 2nd row done, you just drag that guy down to 20 rows (at which point your guaranteed to be within (I think) 0.1% of the final solution)
NOTE that the Tgt must exist in cell of the sheet so you can refer to it later.. Capture also the result (mid from row 20 of your drag) into another cell..
Then, you set up a table with
Tgt_val , =<cell where you captured the "answer" - see two lines above >
5
10
15
20
…
valN
valN+1
…
Yes, it's not pretty that one column has something that looks like a header and the other has a reference to another cell - what can I say - M$ is not Apple.
Now, select all of this - from the Tgt_val cell to the bottom right cell of these two columns and then go to Data > What if Analysis > Data Table
For the Column Input Cell, you give it the cell where Tgt exists - which your bisection iteration table uses..
And that's it! Thank you Mr. Jerry Lewis. You'll impress a few folks with this one!
Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Thursday, March 28, 2019
Saturday, March 23, 2019
Microsoft Is (not) Evil
How the hell does a company get to this size having overlooked such a basic feature for 30 years? Damn! Even Cadence has it.
Undo!!
Yes, for manual changes, you can undo. Run a macro and,... you're screwed.
Anyhow, to make up for it, they do let you create a macro to toggle the highlight colour of a cell :
Sub toggle_hilite()
With Selection.Interior
If .Color = 16777215 Then ' 25 bits all 1
.Color = 65535
Else
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End If
End With
End Sub
Undo!!
Yes, for manual changes, you can undo. Run a macro and,... you're screwed.
Anyhow, to make up for it, they do let you create a macro to toggle the highlight colour of a cell :
Sub toggle_hilite()
With Selection.Interior
If .Color = 16777215 Then ' 25 bits all 1
.Color = 65535
Else
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End If
End With
End Sub
Monday, February 11, 2019
What Makes a Fighter Pilot - From Deep Survival By Laurence Gonzales
The rigid person is a disciple of death - from the Tao Te Ching
| Laurence Gonzales : Psychologists who study survival say that people who are rule followers don’t do as well as those who are of independent mind and spirit. When a patient is told that he has six months to live, he has two choices: to accept the news and die, or to rebel and live. People who survive cancer in the face of such a diagnosis are notorious. The medical staff observes that they are “bad patients,” unruly, troublesome. They don’t follow directions. They question everything. They’re annoying. They’re survivors. |
He's the kind of person who, when you tell him something, he gets it right away. He's a good athlete. He's competitive. He can stand up in front of a hundred people and speak on something he doesn't know about. He'll just do it. He won't hesitate. He's a creature of habit and a perfectionist. (a fighter pilot)
(LG was born in 1947 in St. Louis, Missouri and grew up in Houston and San Antonio, TX)
Saturday, February 09, 2019
Shame On CodeCademy - Corrupting Young Minds :)
Just kidding, but, why not be correct, in addition to whetting peoples' appetite.
In their lesson :
If you want to find out more about Regex, read more at MDN's regex article.
To see it in practice, let's use the pattern attribute in our HTML!
Instructions
1. We might also want to limit usernames to only letters and numbers (and not special characters like ! or @).
To add this validation, add a pattern attribute and set it to: "[a-zA-Z0-9]+" in the first <input> element.
Incorrect maestro! First character may not be a numero. So, it's [a-zA-Z][a-zA-Z0-9]+
These guys have thought of everything. Inspect their page with Chrome, and you see :
👋 Hi there!
Looks like you're using the developer tools on our site.
While you're in the area, how about popping over to https://careers.codecademy.com?
We're hiring for passionate, talented engineers, and would love to hear from you! ✨
In their lesson :
To see it in practice, let's use the pattern attribute in our HTML!
Instructions
1. We might also want to limit usernames to only letters and numbers (and not special characters like ! or @).
To add this validation, add a pattern attribute and set it to: "[a-zA-Z0-9]+" in the first <input> element.
These guys have thought of everything. Inspect their page with Chrome, and you see :
👋 Hi there!
Looks like you're using the developer tools on our site.
While you're in the area, how about popping over to https://careers.codecademy.com?
We're hiring for passionate, talented engineers, and would love to hear from you! ✨
Monday, February 04, 2019
Saturday, February 02, 2019
A Gorgeous Scrollbar - Courtesy of Chris Coyier
Why won't the guy clearly tell people how it's done? I searched and ended up having to reverse engineer. His CSS style-sheet, once you de-obfuscate, is about a 1000 lines long!
<style type="text/css">
html {
--maxWidth:1284px;
scrollbar-color:linear-gradient(to bottom,#ff8a00,#da1b60);
scrollbar-width:30px;
background:#100e17;
color:#fff;
overflow-x:hidden
}
html::-webkit-scrollbar {
width:30px;height:30px
}
html::-webkit-scrollbar-thumb {
background:-webkit-gradient(linear,left top,left bottom,from(#ff8a00),to(#da1b60));
background:linear-gradient(to bottom,#ff8a00,#da1b60);
border-radius:30px;
-webkit-box-shadow:inset 2px 2px 2px rgba(255,255,255,.25),inset -2px -2px 2px rgba(0,0,0,.25);
box-shadow:inset 2px 2px 2px rgba(255,255,255,.25),inset -2px -2px 2px rgba(0,0,0,.25)
}
html::-webkit-scrollbar-track {
background:linear-gradient(to right,#201c29,#201c29 1px,#100e17 1px,#100e17)
}
</style>
<style type="text/css">
html {
--maxWidth:1284px;
scrollbar-color:linear-gradient(to bottom,#ff8a00,#da1b60);
scrollbar-width:30px;
background:#100e17;
color:#fff;
overflow-x:hidden
}
html::-webkit-scrollbar {
width:30px;height:30px
}
html::-webkit-scrollbar-thumb {
background:-webkit-gradient(linear,left top,left bottom,from(#ff8a00),to(#da1b60));
background:linear-gradient(to bottom,#ff8a00,#da1b60);
border-radius:30px;
-webkit-box-shadow:inset 2px 2px 2px rgba(255,255,255,.25),inset -2px -2px 2px rgba(0,0,0,.25);
box-shadow:inset 2px 2px 2px rgba(255,255,255,.25),inset -2px -2px 2px rgba(0,0,0,.25)
}
html::-webkit-scrollbar-track {
background:linear-gradient(to right,#201c29,#201c29 1px,#100e17 1px,#100e17)
}
</style>
Let's dole out some credit where it's due : you can learn some cool stuff from Brad at his YT vid.
It strikes me while I'm watching it that - Rob Percival is lame - if you look at how he reverse-engineers the BBC page... man! Get yourself a Brad video!
Then it strikes me a while later - who are the geniuses at GOOG to have the vision to create such tools to put power in the hands of the laity? I've heard Pichai being given the credit for proposing Chrome..
Then it strikes me a while later - who are the geniuses at GOOG to have the vision to create such tools to put power in the hands of the laity? I've heard Pichai being given the credit for proposing Chrome..
Friday, February 01, 2019
Crimes Against Humanity : Laurence Gonzales
OMG! What a tedious ass this guy is. I can't help thinking - one of my greatest acts of survival is getting through his cowpat of a book. Doesn't he realize people who pick up such books are busy? And goddam it! At the end, he tells you want to do to survive - in a 12 point list. Really? You expect people to remember drab writing - or do you expect them to write the steps down and keep the piece of paper under their foot inside their shoe for the time they're actually pinned in a rapid river?
Jeez! Some of the stories are cool - but, think for a minute - he didn't make those up - he just tells you about them. What did Gregory David Roberts say when asked why he didn't just tell his own story instead of fictionalizing it? Answer - creating is much harder. It's easy to narrate events.
Bottom line - all of this guy's original writing is trash and you're saving yourself a lot of time skipping over it. Maybe the Kindle version lets you do that.
If he gave you some exercises you could do everyday, that would be something. A mnemonic you could use to remember the tips? That would help. Anything but serial listing of mundane ideas.. Please.. oh what a tedious ass!
The key point that this guy missed - none of the "survivors" he deifies read his book. If they had, they'd probably be dead, if not from not making it out of their ordeals, definitely from boredom.
Without knowing much, I can say one thing about survival - you can't read a book and miraculously have the odds increase in your favour. Now, if he described exercises and lists of things you could carry, that would be different.
I'd say - always have a ziplock bag with some dry material that you might be able to use to start a fire :)
And just after this, maybe between this and what comes two pages later, he took a month long vacation. No other way to explain this :
See - something better. Still, a whole book and hardly a word about meditation. Sure, he mentions Zen and all that, but not much of what *YOU* can do on a daily basis to increase the odds..
If this guy really wants to do his audience a favour - why not do some quality research and talk about what kinds of badges the survivors had racked up *before* the ordeal - compared to the bucket kickers - how many more workshops, books, etc had they under their belt?
Again, driving home my point :
Not a bad time to mention : Practice doesn't make perfect. It makes permanent. Perfect practice makes perfet!
Jeez! Some of the stories are cool - but, think for a minute - he didn't make those up - he just tells you about them. What did Gregory David Roberts say when asked why he didn't just tell his own story instead of fictionalizing it? Answer - creating is much harder. It's easy to narrate events.
Bottom line - all of this guy's original writing is trash and you're saving yourself a lot of time skipping over it. Maybe the Kindle version lets you do that.
If he gave you some exercises you could do everyday, that would be something. A mnemonic you could use to remember the tips? That would help. Anything but serial listing of mundane ideas.. Please.. oh what a tedious ass!
The key point that this guy missed - none of the "survivors" he deifies read his book. If they had, they'd probably be dead, if not from not making it out of their ordeals, definitely from boredom.
Without knowing much, I can say one thing about survival - you can't read a book and miraculously have the odds increase in your favour. Now, if he described exercises and lists of things you could carry, that would be different.
I'd say - always have a ziplock bag with some dry material that you might be able to use to start a fire :)
In putting his own to-do list together, I'd say he's missed the point of his own book. Consider what he says about Nick Williams @ Squaw Valley : Many factors contributed to Williams' surviving what would have killed most people. He was extremely fit, jogging and roller blading the steep hills of San Francisco. He was a graduate of the Naval Academy and had been a Marine fighter pilot. And he'd had the drive, strength, and character to climb the corporate ladder; he was president and CEO of Premisys Communications, a company with $100 million in annual sales at the time. So, as a spokesman for the hospital that treated Williams put it, "His mental toughness was unreal."
Can you get that by reading the dumbass list that G puts together? You decide. Can you read and act, or does it take years of hard work developing habits to :- Perceive, believe (look, see, believe)
- Stay calm (use humor, use fear to focus)
- Think/analyze/plan (get organized, set up small, manageable tasks)
- Take correct, decisive action (duh, when your out there, how do you know what's "correct")
- Celebrate your successes
- Count your blessings
- Play (sing, play mind games, recite poetry, count anything, do math problems in your head)
- See the beauty
- Believe that you will succeed (one that really cracks me up. A to-do list! Idiot!)
- Surrender (let go of your fear of dying)
- Do whatever is necessary (really? was this guy getting paid for the number of words in the book?)
- Never give up (year, right - same theme - a to-do list! Idiot!)
And just after this, maybe between this and what comes two pages later, he took a month long vacation. No other way to explain this :
The real heroism of the astronauts is not in the risks they take - any idiot can throw his life away - but in the much more arduous lengths to which they go to protect themselves from harm. They know that adventure becomes folly when you stop looking out for number one. It's not selfishness, it's that fine distinction between going forth boldly and going forth blindly, a balance between dedication to the mission and informed caution. It takes real skill to strike that balance, and at their best, adventurers are both bold and cautious. That means knowing where the envelope ends, and moreover, knowing yourself well enough to estimate correctly just how far beyond it you can go and still get back.
See - something better. Still, a whole book and hardly a word about meditation. Sure, he mentions Zen and all that, but not much of what *YOU* can do on a daily basis to increase the odds..
If this guy really wants to do his audience a favour - why not do some quality research and talk about what kinds of badges the survivors had racked up *before* the ordeal - compared to the bucket kickers - how many more workshops, books, etc had they under their belt?
Again, driving home my point :
I've watched as astronauts such as Bob Cabana, G R and J Newman, who did the first assembly of the International Space Station, become master of their mission. They studied everything, practiced every move, and trained half a decade for a task that took two weeks. It's the secret of their success. By the time they get to the real mission, it seems like just one more drill. It's familiar, and that allows clear thinking. A panicked mind is a useless mind. (Bingo - build up cognitive reserve).
Not a bad time to mention : Practice doesn't make perfect. It makes permanent. Perfect practice makes perfet!
Friday, January 25, 2019
Eye Pogue on Your Windows PC
Wha?
You want to save your eyes - meaning, if the stuff on the monitors is too bright, you want to hit CTRL+#+c to invert colours. How?
(this is the easy part.. Open Windows Settings and *then* in the "Find a Setting" search field, you type "Color filter settings". While you're typing, it's prompted you with what you're looking for as a drop down. Choose that. Click the selector to turn ON filters (just for now). Then, go down and change from "Grayscale" to "Inverted (reverse colors on the display)". Then, check the box to "Allow the shortcut key to .." )
Good? Excellent. Now. What do you do when your background image is dark and the page you're viewing is mostly white. If you invert one, the other monitor gives you grief.
See, I wouldn't know how to solve this if I hadn't dabbled in CSS. One solution - which is basically opening a dummy webpage whose background is black solves the problem wanting working on monitor without the filter, where the stuff is mostly dark and controlling the display on the other one-- In this case, you merely open one of your bookmarks in Chrome. Bookmark a file that has this :
Now, a quality hack (I think) would be to use AHK to launch Paint on a large image that is essentially just a black background :) How many bytes would such a file take? 50 KB believe it or not - for basically 0 info!! Or maybe about 10 bits of info..
You want to save your eyes - meaning, if the stuff on the monitors is too bright, you want to hit CTRL+#+c to invert colours. How?
(this is the easy part.. Open Windows Settings and *then* in the "Find a Setting" search field, you type "Color filter settings". While you're typing, it's prompted you with what you're looking for as a drop down. Choose that. Click the selector to turn ON filters (just for now). Then, go down and change from "Grayscale" to "Inverted (reverse colors on the display)". Then, check the box to "Allow the shortcut key to .." )
Good? Excellent. Now. What do you do when your background image is dark and the page you're viewing is mostly white. If you invert one, the other monitor gives you grief.
See, I wouldn't know how to solve this if I hadn't dabbled in CSS. One solution - which is basically opening a dummy webpage whose background is black solves the problem wanting working on monitor without the filter, where the stuff is mostly dark and controlling the display on the other one-- In this case, you merely open one of your bookmarks in Chrome. Bookmark a file that has this :
<!DOCTYPE html>
<html>
<head>
<title>Black!!
</title>
<style type="text/css">
body {
background-color: black;
}
</style>
</head>
<body>
</body>
</html>
<html>
<head>
<title>Black!!
</title>
<style type="text/css">
body {
background-color: black;
}
</style>
</head>
<body>
</body>
</html>
Now, a quality hack (I think) would be to use AHK to launch Paint on a large image that is essentially just a black background :) How many bytes would such a file take? 50 KB believe it or not - for basically 0 info!! Or maybe about 10 bits of info..
Monday, January 21, 2019
Yikes! How Did *I* Fall For This? Sleazy *ds of Kenmore Stamp
https://www.bbb.org/us/nh/milford/profile/catalog-shopping/kenmore-philatelic-inc-0051-5000301/complaints
Jeez! If it seems too good to be true, it *is*. Damn!!
Kenmore Philatelic, Inc. Response
02/13/2017
To whom it may concern, This letter is the response to a complaint filed by the above mentioned person. Enclosed are copies of both the front and back for the reply card that we received with the information for ****** ********* in ********* *** As you can see there is nothing suspicious or curious about the card received. All of the required information was filled out completely and postage was applied to the card. we have spoken with the father and We have removed the charge and closed the account. On occasion, a well-meaning grandparent or family friend will fill out an ad or a child, which may be the case here. Again, as stated previously, the account has been cleared of any charges and the account is now closed. If you should have any additional questions or require any further information, please feel free to contact me directly. can be reached via telephone at 503-673-1745 x220, or via email judsonekenmorestamp.com or by fax at 603-673-3222. Sincerely,
Jeez! If it seems too good to be true, it *is*. Damn!!
Kenmore Philatelic, Inc. Response
02/13/2017
To whom it may concern, This letter is the response to a complaint filed by the above mentioned person. Enclosed are copies of both the front and back for the reply card that we received with the information for ****** ********* in ********* *** As you can see there is nothing suspicious or curious about the card received. All of the required information was filled out completely and postage was applied to the card. we have spoken with the father and We have removed the charge and closed the account. On occasion, a well-meaning grandparent or family friend will fill out an ad or a child, which may be the case here. Again, as stated previously, the account has been cleared of any charges and the account is now closed. If you should have any additional questions or require any further information, please feel free to contact me directly. can be reached via telephone at 503-673-1745 x220, or via email judsonekenmorestamp.com or by fax at 603-673-3222. Sincerely,
Subscribe to:
Posts (Atom)