Sunday, April 07, 2019

How to Become a Great Gun Designer

MK (of AK-47 fame ) : When I was a young boy, there was not a single door lock around that I wouldn't have disassembled to see what was inside and how they worked. I was very young and fascinated by machines. But, in my village, there was no chance to study machines.



"I read in some book, maybe holy scripture that all that is complex is not useful and all that is useful is simple. This is my whole life's motto." -- love that one :) So does Steve Jobs (late).

Wikipedia : .. a self-taught tinkerer who combined innate mechanical skills with the study of weaponry to design arms that achieved battlefield ubiquity.

So, to sum up, what have the Russians given the world? The AK-47, Tetris, and.. you tell me..

Where Is Your PERSONAL.XLSB (Personal Macro Workbook) Located?

For a change, Google didn't just spit out the answer right away..


What you do :

  1. Make it visible (View Tab > Unhide > PERSONAL)
  2. Press F12

And you get to see.. In my case :

C:\Users\<name>\AppData\Local\Packages\Microsoft.Office.Desktop_weirdbuchofchards\LocalCache\Roaming\Microsoft\Excel\XLSTART

Tuesday, April 02, 2019

Pat Sweet : Thou Shalt Be an Engineering Leader

Got into blogging because he enjoyed writing ( https://youtu.be/oxlq8R2AmQo : 14:35 - he loved mentoring - being asked good questions by junior engineers, especially non-technical ones )

What is Leadership not?

Management
Charisma (B. Gates, Darwin E. Smith, etc are not charismatic, but were successful)
Technical Mastery
Innate - you can learn
For senior staff only

Is :

Good stewardship
Practising good habits
Selflessness
Action oriented (bold)
Concern for followers
People-focused

Eisenhower : Getting people to want to do what you want them to do ( motivation :)

A balance of personal humility with intense professional will. (Level 5 Lship)

How :

Have purpose
Set goals
Read, read, read
Train continuously
Look for opportunities - volunteer - new projects, new initiatives, cold case files.

Thursday, March 28, 2019

Building a Live Calculator (Complicated) in Excel

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!

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

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! ✨

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>

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

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 :)

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 :

  1. Perceive, believe (look, see, believe)
  2. Stay calm (use humor, use fear to focus)
  3. Think/analyze/plan (get organized, set up small, manageable tasks)
  4. Take correct, decisive action (duh, when your out there, how do you know what's "correct")
  5. Celebrate your successes
  6. Count your blessings
  7. Play (sing, play mind games, recite poetry, count anything, do math problems in your head)
  8. See the beauty
  9. Believe that you will succeed (one that really cracks me up. A to-do list! Idiot!)
  10. Surrender (let go of your fear of dying)
  11. Do whatever is necessary (really? was this guy getting paid for the number of words in the book?)
  12. 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!