Blabberbox:Random blog-like posts from pftq.Share on Twitter

Performance Issues in SQL Server 2014

October 10th, 2015 | Posted by pftq in Blabberbox | #
I just spent the last week trying to figure out why some of my SQL queries were suddenly taking hours to run on a large dataset when they used to take seconds on an older machine.  The queries I have use a lot of subqueries and left-joins across several tables with hundreds of GB of data each.  At first I thought it might be because my dataset has grown to the point my queries were no longer efficient.  Perhaps I had too many joins or subqueries that were not using the indexes on the table.  I actually tried removing every case of "OR" condition in my queries, which seemed to help a little but nowhere near bringing down the hour or so it still took to run.  After messing with indexes and re-arranging queries non-stop, it turns out it's because of an update to cardinality estimation on the back-end in Microsoft SQL Server 2014.

Luckily, you can disable the cardinality estimation update on a query-by-query basis by doing:
Quote
96 unique view(s)

Wasting Through Time

October 3rd, 2015 | Posted by pftq in Stories | #
This was another story idea I got as a dream.  I suppose it reflects my mood lately with everyone seeming to get older around me, not just physically but mentally as well.

=========================

Two friends have known each other all their lives.  They are able to time travel but only by skipping forward in time.  They've been doing that for a while and have experienced centuries of history past by, but one day, one of the friends loses this ability.  

The other...[More]
75 unique view(s)

Breaking People to Their Core - Complete

September 18th, 2015 | Posted by pftq in Blabberbox | #
This is an older piece I started writing a while ago and finally completed:
https://www.pftq.com/blabberbox/?page=Breaking_People_to_Their_Core

It sheds a bit of light into my thought process for understanding people and what drives them.
275 unique view(s)

Skydome Theater

September 13th, 2015 | Posted by pftq in Ideas | #
Imagine an open, dome-shaped theater the size of a football stadium, where instead of looking towards screen on the far wall, everyone looked to the sky.  It would be like stargazing, except as the movie is about to start, the stars fade away and another world fills the sky for as far as the eye can see.  People would be lying on their backs instead of sitting hunched forward on their seats.  It'd almost feel like being in a rocket about to take off vertically.  Perhaps there would be chairs that rotate backwards to a lift-off position and actually elevate slightly off the ground as the movie begins.

This is something that's been churning in the back of my mind for a while.  From a design standpoint, the theater would obviously be limited in capacity and can only show one movie at a time for the all the space allotted, but I think the experience would be phenomenal, especially for very visual, cinematic films.  Capacity is also used in a very technical...[More]
174 unique view(s)

iPad Pro - 3 Years After the Surface Pro

September 9th, 2015 | Posted by pftq in Blabberbox | #
     This 2012 comic "Surface Tension" by Joel Watson is pretty hilarious in that it nailed the exact year Apple would release their version of the Surface, complete with the exact name to Apple's version of the keyboard touchcover (comic called it the "Smart Cover Touch").


     For all the hype around Apple finally releasing a direct competitor to the Surface though, there are some things still quite apples vs oranges.  The biggest one would be the fact Apple's iPad Pro still runs on the ARM chipset and iOS, as opposed to a full-fledged computer operating system like the Surface does.  The event today highlighted how much faster the iPad Pro's chipset was than most other computers' on the market, but at the end of the day, it continues to only runs iOS apps and not full programs like on a laptop.  This point somehow seems to get missed in all the hype.  This makes the iPad Pro quite literally just a bigger, faster iPad despite the new "Pro" suffix to its name.

    ...[More]
203 unique view(s)

Poker Guide

September 6th, 2015 | Posted by pftq in Random Stuff | #
The gist of how I basically play poker:
1. Play like a moron who always bets.
2. Play like a moron who always folds.
3. Only bet when you have something.
4. Bet whenever you think they think you think you might have something.
5. Never bet.  Only call or raise when someone bets into you and you have something.
6. Restart at a random step.

As you can probably guess, my hand usually doesn't matter to my decision.  And when playing in real life, I often don't look at my hand at all.

What matters more is what you think they have and whether they behave consistently.  If they make bets that are consistent with one hand for a while but suddenly make a bet that is inconsistent to that, they are probably lying.
1040 unique view(s)

Back to Tokyo

September 5th, 2015 | Posted by pftq in Stuck in My Head | #
Back to Tokyo by Seiichi Kyoda
389 unique view(s)

Bamboo Tapestry

September 5th, 2015 | Posted by pftq in Stuck in My Head | #
Bamboo Tapestry by Seiichi Kyoda
387 unique view(s)

Earthbound - Home Sweet Home Orchestra

September 5th, 2015 | Posted by pftq in Stuck in My Head | #
387 unique view(s)

The Power of Fate and Irony

August 26th, 2015 | Posted by pftq in Blabberbox | #
     With the advent of my newest project Autodidactic I, which premises itself on harnessing the power of "fate and irony," I thought it'd be timely to explain just what that means and how it is actually more literal than one might think.  At its core, it's about setting up the least likely situations to always be in your favor, what others perceive to be your worst case scenarios to actually be your best case.  You set yourself up such that the most ironic thing that can happen to you is the best thing that could happen to you, and everything else falls in line behind that.  This is a lot of the thinking that bleeds into most of my endeavors, whether it be in my trading, planning my life, or even just making sure I get from point A to point B on time.

     It sounds a bit like superstitution or voodoo, but it really is more about planning, psychology, and just staying ahead of the game.  When planning any sort of event or organization, for example, the biggest mistake one often makes is leaving open that 0.0001% chance that things go terribly wrong.  Instead take that and flip it on its head.  Make the 0.0001% case the case where everything goes terribly right.  In practice, I often *seem* like the more conservative risk taker on any team (despite my super left-field ideas and approaches to things),  but when the unthinkable happens, it's to my favor.  What better irony than the safest plans thriving in absolute chaos? And there's nothing to say you can't simply be so in control (or so impervious to a lack of control) that it just looks like you're passive when you've actually already set plans in motion to take over the world.  It's about always knowing your edge cases and putting them in alignment with your goals.  It's about eliminating chance from the equation and only leaving open possibilities that help your cause.  When the unthinkable happens, you win, and when it doesn't, life just continues as usual.

     The other aspect is just mental, when you declare the most absurd things with no expectation they happen, when you jinx or counter-jinx things, when people give up at the exact moment they should have doubled down, etc.  This definitely sounds much more like superstition now, but think of all the situations in the past where you or your friends jinxed things and how often these ironic situations actually came true.  Words have meaning, whether they leave a guilt chip in the back of someone's mind or make yourself doubt your best judgement (too good to be true, unwillingness to go against what you just said, etc).  The key again is to let the things you think most absurd always be in your favor but also in a psychological aspect.  If someone else is doubting something (often you), let them be on the losing side of the ironic outcome and not yourself.  If someone is about to give up but thinks something will work out right as they quit, be on the receiving side of that luck.  Sometimes, it's almost like witchcraft, where in order to ensure my success, I purposely make sure there are enough people thinking or making a claim they'll regret, where they unintentionally jinx themselves such that, in the (misleadingly) remote chance they're wrong, it leads an outcome most extremely in my favor.  Think of famous last words; often times I purposely get someone to declare verbally the opposite of what I want just to jinx him.  This extends to all other activities mental and psychological - trading, poker, etc. If someone is about to exit a trade they think they'll regret doing so, take that as a sign that trade will probably work.  If someone thinks they'll fold a good hand, let that be in your favor if it comes true.  Often times, my reputation in poker is that of a blind better with beginner's luck, when in actuality I'm letting my opponents self destruct against themselves.  It's letting people's own irrationality and biases get the better of them... at least, that's the politically correct way of putting it.

    ...[More]
2286 unique view(s)

In Search of a Standing Desk...

August 20th, 2015 | Posted by pftq in Blabberbox | #
In the mean time, this will have to do, though it's not as adjustable as I'd like.


At worst, I suppose I can go back to my lie-down desk if I get tired.



The desk is from Japan, called a Super Gorone Lie-Down Desk.  Was super hard to find and had to ship internationally.
1238 unique view(s)

Windows 10 as a Server

August 18th, 2015 | Posted by pftq in 42 | #

Running Windows 10 as a Windows IIS server from your desktop...

There are scattered resources out there on how to do this, but they don't seem very complete or concise. Below are my own notes on getting my desktop up and running as a server, so that I can both use it as a desktop and test server code via "http://localhost/" (which will point to C:\inetpub\wwwroot\).

1. Go to Control Panel > Programs and Features > Turn Windows Features On/Off (left panel).
2. Check the...[More]
426 unique view(s)

The 50 Percent Random Lie

August 13th, 2015 | Posted by pftq in Thought of the Day | #
50% does not mean random.  If you beat a grandmaster chess player 50% of the time, you are pretty damn good.
504 unique view(s)

Modeling Resources

August 12th, 2015 | Posted by pftq in 42 | #

Tutorials and other resources for 3D modeling, 3D printing, etc


3D Modeling and Printing for Beginners - Starting point for myself coming from familiarity with Photoshop and Illustrator.
1045 unique view(s)

Reality Check for Startup with $70K Min. Wage

August 1st, 2015 | Posted by pftq in Blabberbox | #
More reality checking on Silicon Valley with the startup that declared $70K minimum wage now hitting hard times because of it:
CEO Who Set Firm's Minimum Wage at $70K Hits Hard Times

Had already pointed out that things like this were unsustainable in my Perfect Storm for Silicon Valley write up a couple months back. It's all well intentioned but overly idealistic with not enough thought put into the consequences.  It's not the first time a company has tried to create somewhat of a utopia for its employees (aka paternalism), but it would be nice to look back on history and not repeat the same mistakes.  One simply has to look back on 19th and 20th century history to find past companies pursuing similar policies (Pullman, Ford, ...). It seems to be a trend now to always charge forward and deny any lessons from the past as old ways of thinking....[More]
138 unique view(s)

Political Correctness is 1984's Newspeak

July 30th, 2015 | Posted by pftq in Society | #
I recently read an article about the University of New Hampshire's "Bias-Free Language Guide" this morning.  At first, I thought it was a joke or satirical post of some sort on political correctness, as it seemed like something straight out of Orwell's 1984, but it was on the college's official site as an actual resource.  It's since been taken down, but it's hard to "unpublish" webpages now, especially if it's been up for years. I managed to save a static HTML copy here: University of New Hampshire's Bias-Free Language Guide (as of Jul.29 2015)

One novel that immediately comes to mind is Orwell's 1984.  When I first read it in high school, most my peers and I thought it very unrelatable, but now it's pretty scary how close we're getting to some of its themes.  Here are some comparisons to illustrate the point:

Orwell's ...[More]
510 unique view(s)

Our Omnipotence

July 23rd, 2015 | Posted by pftq in Thought of the Day | #
Every person is the God of their own world, just pitted against the will of all others out there.
448 unique view(s)

Fairness of Process vs Outcome

July 15th, 2015 | Posted by pftq in Thought of the Day | #
You seek fairness, yet you'd rather we all fail together and never reach our dream than allow any suffering along the way. How is that fair?
570 unique view(s)

Politics and the English Language

July 6th, 2015 | Posted by pftq in Recently Read | #
548 unique view(s)

Hear the Pictures and Not the Words

July 5th, 2015 | Posted by pftq in Essays | #
     "What do you see when you hear this music?" I once asked someone.
     To my surprise, he said, "Nothing."
     "Really?" I asked.  "Not even a story or anything?"
     "Nope.  I just like how it sounds.  Why? What do you see?"
     It still surprises me whenever I come across others who can be appreciating the same work before us but seeing nothing at all.  It never really occurred to me until after college that others might only hear the sound or see the word, the notes, or the colors.
     I still remember a conversation several years back where several coworkers were debating whether thought was organized based on what language one spoke.  "Of course not," I wanted to say, "Otherwise what would you be thinking as a child before you knew any language?" But the debate simply moved towards whether children had any real thoughts...[More]
704 unique view(s)