- Unsubscribed from all bloomberg publications (I had maybe ~4 in daily digest). I find them redundant, half the good content is hidden behind a paywall, it's verbosely delivered in paragraphs instead of bullets, and it focuses more on politics / international affairs than tech / business / software / finance.
- Supercontest. Made the leaderboard sort the EXACT same as the all-picks, except summed over all weeks and only for completed games. Before, it didn't do the same "1 cover over 2 pushes" etc.
- Trimmed and brined 2 racks of pork spares (10lbs) and 2 racks of beef short (10lbs) for the smoker tomorrow.
- Today's music: snow patrol.
- Bud light launching their seltzer next year:
- Doctor Sleep comes out tonight, Stephen King's sequel to The Shining. It follows the son, Danny Torrance, who escaped the Overlook.
- Between IT, Castle Rock, and now this - I love how much mainstream attention King is getting. Been a fan for many years.
- datetime.fromtimestamp() should always be passed a timezone. Integers are naive, and must be made timezone-aware, otherwise it will have to assume. Some assume UTC, some assume the system-locale tz, you can never be sure. Be explicit instead.
- The UFC fight this saturday is in Russia. Zabit and Greg Hardy on the card.
- Logan Paul vs KSI 2 is also this saturday. Ugh.
- Resolved the 24 payment situation; it had reported confirmation but then rejected it weeks later. Paid for the past 2 months, ensured it was still on autopay with the card swapover. Dude at the front was nice, Joe.
- I'm liking the recent food changes:
- Oats and water raw instead of oat milk in morning shake.
- +Banana +Seeds for the morning for a more complete breakfast.
- Veggies raw in smoothie, rather than juiced. No waste.
- No more lab powders: whey, glutamine, etc. All natural: cinnamon, maca, etc.
- Remember it's much easier in python3: super().__init__()
- Tradebot.
- Finished the entire framework. Now I just need to run tests to optimize. This step is crucial. Selection is easy, but overfitting is also easy.
- Another +1 for the backtrader package. Full-featured, and very well documented.
- You can add analyzers, including final sharpe ratio reports.
- Example output from my quick sma strategy on msft for ytd:

- Wow. Look how many indicators come built-in: https://www.backtrader.com/docu/indautoref/.
- RSI = relative strength index.
- Keep in mind that every single ticker would optimize around a different strategy with different parameters. You can lump markets together with decent accuracy, but things will even then change along a chronological axis. There's no perfect approach for all situations for all time.
Thursday, November 7, 2019
Wednesday, November 6, 2019
- Did some searching for spicy food challenges. Almost all are way north. None in south bay really.
- Supercontest.
- Updated the text in the payment section of the rules.
- Made the saturday email reminder 5pm, not 8pm.
- New banner. Standard wednesday deployment.
- Renamed all the files in the banner archive to include the buyer.
- New rule - you can pay incrementing $5 to take down the previous banner and put yours instead?
- Eg: Person 1 buys standard $5 banner. Person 2 hates it and pays $10 for their own banner. Person 1 gets their $5 returned. Person 3 hates them all and pays $15 for a third banner. Person 2 gets their $10 returned.
- Committed lines, submitted picks.
- Made the rankings grouped properly: https://gitlab.com/bmahlstedt-group/supercontest/issues/134.
- Abstracted the ranking cell color to a common layer, and added it back to all-picks (now that ranks are tie-grouped accurately).
- Final FF moves, got everybody except the defenses in both leagues (7/9 successful waivers).
- Upgraded the citi account in mint.
- Seaborn is a wrapper around matplotlib for visualization in python: https://seaborn.pydata.org/.
- So many people took advantage of the robinhood glitch. This is bad. All the SEC and public attention...wouldn't be surprised if they get temporarily disabled for an audit, or shut down completely as malpractice, or even long-term bankrupted due to poor reputation.
- I'd have to rewrite all my logic around another broker's API. Woohoo.
- I'd also start having to pay commission again. Woohoo.
- The glitch itself:
- With gold, robinhood gives you some margin based on the cash in your account.
- If you buy shares, and then sell them as options, robinhood would double count both in your total value, so it would allocate you more margin. That's the bug.
- You could repeat this until you had infinite money. People were posting screenshots of >1M positions, starting with 1k.
- Went to Clippers/Bucks with Harner.
- Ta-eem grill on Melrose. Mediterranean kosher. Delicious.
Tuesday, November 5, 2019
- Tradebot.
- Read a bit more about backtrader, both for general strategies and specific backtrader syntax.
- Robin-stocks has a ton of useful information. http://www.robin-stocks.com/en/latest/functions.html#getting-stock-information. Basically everything that's available about your account, holdings, and the entire public market.
- Added the full capability to transact remotely. Can login, view all account data, buy, sell, market, limit, etc. Closed the ticket. https://gitlab.com/bmahlstedt-group/tradebot/issues/2.
- Wrote the backtester components.
- Starting money.
- Quantity to buy.
- How and when to buy.
- How and when to sell.
- Commission.
- Online ingestion of yahoo finance data, current and historical.
- Reporting of portfolio performance: gross profit and % change.
- The buy/sell triggers right now are very simple, using basic analytics on the past couple days' closing price. I'm off to the indicators section next, using SMA and then more complicated models.
- A single AA battery has 2000-3000 mAh, about the same as a phone battery.
- Lost both FF games and got 1.5 in sbsc.
- The columns in the user table for email prefs were non-nullable but had no defaults, so registration was broken.
- Got a sentry error. https://sentry.io/organizations/bmahlstedt-org/issues/1315113051/?project=1773879&referrer=alert_email.
- Fixed with a sqlalchemy (clientside) default of True for all. Didn't want a server default to migrate/upgrade the tables for something so simple.
- FF moves. 4 for ESPN, 5 for Yahoo. Lotta bye weeks.
- Under armour dropped 18%, under investigation for fluffing sales numbers.
- Muse again today. Lots to go through. Solid.
- Gonna try vegan protein powder again, from peas and brown rice instead of whey isolates.
- Bought Orgain. $12/lb, similar to my standard Optimum Nutrition bin.
- More carbs (all fiber). Slightly higher fat (couple grams). Slighly lower protein (couple grams).
- Bought sesame and chia seeds.
- Apple donated 2.5B (FB and Google made similar smaller donations) to make bay area housing less insane.
- Edge is the new Microsoft browser (RIP Explorer), and it launches Jan 15. It's built off of Chromium, Google open-source Chrome. Weird.
- Transferred 10k from BOA to Robinhood for the tradebot to experiment with.
- Other options besides GTC: https://www.investopedia.com/terms/t/timeinforce.asp.
Monday, November 4, 2019
- McDonald's fired its CEO because of a relationship with an employee. Yay accountability! I've seen the exact opposite in my career.
- TikTok is owned by a Chinese company, and is undergoing a security audit because of that implication.
- New season of silicon valley started last week.
- Lewy Bodies are deposits of the alpha-synuclein protein on the brain, causing erratic dementia.
- Jeopardy tournament of champions is back, including Holzhauer.
- Quick refresher on numpy. Matrix and linear algebra functionality.
- Quick refresher on pandas. Series is 1d. Dataframe can have more dimensions. Can group, sort, reshape, statistics, all the standards you'd expect.
- Sharpe Ratio is the metric for portfolio success, adjusted for risk.
- (return - risk_free_rate) / standard deviation of excess return
- Return in excess of risk, averaged per unit of risk.
- The higher the Sharpe Ratio, the better.
- Lol stefon diggs on family feud: https://www.youtube.com/watch?v=jFJaJTXvWl0.
- Tradebot:
- Found a fantastic library for backtesting my algotrading strategies: https://www.backtrader.com/docu/quickstart/quickstart/.
- Added a col for average to the dataframe returned by get_data. Used the OHLC mean (just the avg of open, high, low, close). You can also use adjclose, or ignore open. Both are common.
- Rewrote my info fetcher to define urls with py3 fstrings.
- Linear regression with scikit-learn.
- Added the ability to plot the history with matplotlib. sudo apt install python3-tk
- Closed first ticket, as data fetching is basically complete: https://gitlab.com/bmahlstedt-group/tradebot/issues/1.
- Created new ticket for the backtesting, now that I've formulated a handful of strategies: https://gitlab.com/bmahlstedt-group/tradebot/issues/4.
- Business school applications are reducing in quantity. Good. STEM needs more.
- Ordinals, like datetime.toordinal, are integers that indicate the number of days since a specific epoch. They represent dates like YYYY-MM-DD in sortable fashion, or for regression, or for whatever else. They can be relative to the proleptic julian calendar, or proleptic gregorian, or others.
- Unix timestamps are the number of seconds that have elapsed since 1970-01-01 (midnight, the beginning of that day). Every ~31.5 million seconds is a year, so we're at about 1.5 billion.
- Listened to muse most of today.
- A cat ran on the field during the MNF game and delayed it for a couple minutes!
- P/E is great for comparing companies apples-apples, because it's normalized by share price. market value per share / earnings per share (eps). It can go negative, although this will usually just be reported as NA (losses, usually). Higher P/E is obviously more favorable for the outlook of the company.
Sunday, November 3, 2019
- UFC 244, good all around. Prelims had some great finishes. Crazy to have the BMF title fight end with doctor stoppage - he might catch some flak for that. I like masvidal, he's growing on me.
- Canelo fight, was losing but then got the knockout in the 11th.
- Love a good visual comparison between NYC and SF: https://medium.com/conquering-corporate-america/the-difference-between-living-in-new-york-and-san-francisco-3e8ae58832a5.
- Supercontest.
- DST ended. The app handled it well.
- Fixed the sort on pick percentage to properly count failures.
- The logo background-image was conflicting with the css background linear-gradient, so I have the color on the td and the team helmet on a div within the td.
- I really enjoyed the comparisons of amazon (sales %) vs kayak (pay per query), as well as orbitz (sell natively) vs kayak (redirect to sell), when doing my pharmaceutical modeling. Here's a similar comparison between Ben & Jerry's (slow) vs Amazon (fast): https://www.joelonsoftware.com/2000/05/12/strategy-letter-i-ben-and-jerrys-vs-amazon/.
- Watson had some incredible saves in his game against the jaguars this morning.
- The NFL schedule was nicely spread out this week: 1 thurs, 1 sun early, 6 sun morning, 4 sun afternoon, 1, sun night, 1 mon.
Saturday, November 2, 2019
- Ufc data: https://gist.github.com/martj42/695f9a976b7beaa11617840467ac0352.

- Remember to run a bash command from ipython, just start the line with an exclamation mark.
- Tradebot.
- Added all reqs.
- Got live prices with yahoo_fin, at first. It's an extremely simple package, basically just fetching data from yahoo.
- It was only about 400 lines, and was a poorly written package (didn't even specify requirements), so I gutted and rewrote it myself. Condensed to about 100 lines. Delinted.
- Created a ticket to adjust risk based on ISM PMI later: https://gitlab.com/bmahlstedt-group/tradebot/issues/3.
- EPS = earnings per share.
- TTM= trailing 12 months.
- YOY = year over year.
- MRQ = most recent quarter.
- EBITDA = earnings before interest, tax, depreciation, and amortization.
- PEG = price/earnings-to-growth.
- Data fetch capability is complete.
- I now have a few decisions to make, as to the strategy/stance the bot uses to trade:
- Get the day's biggest losers, run regression/ML on the historical data (how far back?) for all 100 to see who is trending positive, and buy at that low. Get the day's biggest winners, and sell any you're holding at that high.
- Use analyst/earnings/stats. Decide which ones, do an instantaneous fetch, and trade based on those numbers.
Friday, November 1, 2019
- I've tried the following crutch sauces for the final hour or two, all under 250 or so to ensure any sugar content doesn't scorch:
- Honey, agave nectar, maple syrup, brown sugar (dry), bbq sauce, mustard, hot sauce.
- Honey is champ, by my own (known) preference, as well as others (blind).
- Mix it with a little more of the dry rub. Delicious.
- All of the avengers dudes (robert downey jr, ryan reynolds, paul rudd,etc) have a fantasy league for charity: https://fantasy.espn.com/football/league?leagueId=48153503.
- Sigur Ros most of today. Good background.
- Ordered some more large candles, I ran out of big coffee table / non-bedroom ones. About $1/oz is a decent average.
- Services have much better product margins than products. I love my industry.
- Disney+ launches this month. I'm very curious about that landscape, and how Netflix/HBO will perform in reaction.
- GitHub renewed its ICE contract and employees are not happy: https://www.latimes.com/business/technology/story/2019-10-31/github-ice-contract-defense. I'm not anti-microsoft, but this is good news for GitLab.
- Always like a good "useful command line tools" article, especially with screenshots: https://www.wezm.net/technical/2019/10/useful-command-line-tools.
- The supercontest app should withstand the end of daylight savings time without any issues. Everything is synced, the machines are configured to the correct timezones, and nothing is hardcoded - it's all referenced and localized in realtime. Lockdown should occur as usual, all the timestamp rerenderings should convert properly, etc.
- Sidenote - part of the reason it occurs at 2am instead of 1am (in general) is so that you avoid any day shift. If at 1am it jumped backed to midnight, there might be confusion.
- Also removed the "check in paid league" for the saturday pick reminder. It does it based on subscription now.
- Played around a little bit with 23andMe.
- Matt Stonie's halloween video yesterday was 122 pieces of candy in 30 minutes: https://www.youtube.com/watch?v=GiN8ZPMUVXY.
- This is 895g, or 2 pounds, of straight sugar.
- New batch of protein bars. Homemade peanut butter (much higher ratio of this than usual), protein powder, oats, oat milk, dates, agave nectar.
- Started mindhunter.
- Niners and Patriots 8-0, Saints and Packers 7-1, Vikings and Seahawks 6-2.
- These are the cardinal divisions:

- The NFC mostly makes sense, with the exception of the cowboys in the east.
- The AFC would mostly make sense if the colts and dolphins switched switch south/east.
- UFC245 press conference. Can't wait. 3 titles on the line. Holloway vs Volkanovski, Usman vs Covington, and Nunes vs Germaine de Randamie.
- The Rock had an announcement at the press conference. Given all the hype, I had thought it was gonna be "I'm gonna fight brock lesnar" or "I'm partnering with the UFC to have fighters on my ninja warrior show" or something meaty. It was just that his media company, Seven Bucks Productions, is gong to be making a movie about Mark Kerr (an older UFC fighter from the Mark Coleman era), and he'll be playing him.
- Elon said he's "Going offline" on Twitter.
- True:

- Worked a little bit on the tradebot.
Thursday, October 31, 2019
- Curry broke his hand last night. This is not gonna be a good year for us. Giannis missed two freethrows back to back also.
- Smoked ribs, both pork spare and beef short. Timing worked out well.
- Replenished foil, gloves, peppercorns, paprika.
- Starbucks rose 7% after all the nitro brew drinks.
- Some person with whatacan@yahoo.com created an account named Burro Ito and submitted picks for the first time this week. I assume it was one of the old players, not a completely random person. The more important note: the app handled it perfectly! They show up on the leaderboard with 0-0-0, the pick percentages are good without divide-by-zero errors, everything is smooth.
- Made the picks route not do any calculation or queries or commit scores or anything if picks were open. Just return.
- Consolidated the friendsgiving gsheet and sent it out. We're now in our 5th year, 5th signup sheet.
Wednesday, October 30, 2019
- SOC 2 is the standard for compliance criteria in data privacy. Third-party vendors and data organizations can be audited with this procedure to make sure they're not doing anything shady with the company's data. https://www.imperva.com/learn/data-security/soc-2-compliance/.
- The Cartman escape rooms is fairly new, and only ~60 teams had tried it so far. Of the 60, only 4 had escaped, and we had the fastest time of the 4!
- Damn, lockheed got a $35B order for 478 F35s.
- Fresh order. They're doing as close as 2hr delivery now.
- More terrible recorder covers. Dead.
- Supercontest.
- Made the min-width styles !important. You don't have to do the same for max-width, those are usually fluid.
- Added arrow back to lb. Made name cols wider. Widened all logo cols.
- Put a useful diverter so that the app doesn't send any emails in dev mode. This is at the very end of the chain (within supercontest.util.email.send_mail) so that you cover as much of the sequence as possible before shorting.
- Nothing is shown on the all-picks page until lockdown now.
- Completely rewrote results, passing the full data through now (covers/pushes/noncovers, for finished/inprogress/unstarted). Now the lb can show each user's record explicitly.
- The sort is updated now: in progress points, completed points, etc.
- Added faded color to the all-picks view as well (instead of header row).
- This was a pretty big update, but mostly backend. Some cool stuff for user.
- Deployed. https://gitlab.com/bmahlstedt-group/supercontest/issues/133.
- Committed lines, checked new emailer (with unsubscribe), submitted my picks.
- Remember, pure functions don't change any global state and aren't affected by any global state. They always have the same return/effect (for the same inputs).
- Lol:

- I always thought structures like NamedTuple or OrderedDict were weird collections designed for lazy programmers. If you need keys, use a dict. If you need order, use an iterable. If you need both, have one of each, not some frankenstein of both. I often keep my data in a dict and then have the sorted results as a separate definition. You're sacrificing performance by doing anything else.
- Sigur Ros for music today.
- Tried a new matcha drink today. 1000x better than the black coffee and matcha.
- Matcha, oat milk, agave, ice, blended.
- World series game 7. Great game. The nationals (a wild card!) won.
- Spotify should have a setting to filter out all the bs. Don't show me live albums, commentary albums, eps with 2 songs, acoustic albums, deluxe albums with weird filler tracks, etc. Just show me their 4 studio albums. Thanks.
- Zuckerberg has been taking a lot of heat for non fact-checking political content on fb (ads, posts, etc), which is admittedly something that very few other platforms do anyway. Twitter then came out and said it will ban all political advertising, starting on Nov 22. SHOTS.
Tuesday, October 29, 2019
- Virgin Galactic IPOed yesterday, high 12.09 low 10.50.
- Alphabet is trying to buy fitbit. Heartrate targeted ads, woohoo!
- Old Five for Fighting albums. Good memories.
- Cartman escape room!
- FF waivers. 1 for espn, 2 for yahoo.
- Considered putting the stock brake lever back on the ducati instead of the red shorty, which might be aggravating my elbow. Whyyyyyyy are hydraulic systems still used. Electronics, electronics, electronics.
- Paid rent. Maid manual citi payment since autopay doesn't activate for first billing cycle.
- Supercontest.
- Moved all the clientside pick verification to functions. Cleaned up the matchups.js quite a bit.
- Added helmets to the rollup.
- Created space between the rollup and the full picks column.
- Added right arrows for the header that shows pick counts and leaguewide percentages.
- Added percentage sign to all percentages.
- Added banner for gjm.
- Vitamix.
- Oat milk. Didn't strain it. It blends it well enough to drink, and then you can just throw out the bottom sediment when finished with the gallon. Healthier, easier, and allows you to fully mix things like dates/bananas.
- Veggie preworkout. Don't need the juicer anymore! And you get the full nutrition. No pulp mess. Higher yield. A little chunky, but I'll mess with ratios.
- Amazon fresh is now free with prime. Wow.
- Matcha arrived today. Good in the smoothies/shake. Didn't really like it straight in black coffee. Needs to be a latte or something creamy with milk.
- Put the search navbar and quick edit buttons back on my blog. Blogging about the blog. Meta.
- Bought 80 lbs of meat and rode home with it on the bike, which was crazy. 40lbs of pork spare ribs and 40lbs of beef short ribs. $210.
- World series game 6.
- Cartman escape room!
Monday, October 28, 2019
- Matcha is essentially the same green tea leaves, but instead of steeping them in hot water, they're stone-ground into a fine powder. I don't need the highest grade, since I use it for smoothies/shakes mostly.
- Ceremonial grade is for mixing with water and drinking as tea (up to $20/oz).
- Culinary grade is for stuff like smoothies, lattes, baking, etc (down to $1/oz).
- Nike CEO swap.
- 12 hours of sleep last night, uninterrupted. Yessir.
- HSBC is the bank. Hulu is owned by Disney.
- The underscore is usually the object for lodash (hehe, nice) in js.
- Joe Rogan is 52. Theo Von and Chris D'Elia are 39.
- Don't just use regular spinners, there are so many cool ones out there: https://www.react-spinners.com/.
- Awesome website, timeanddate.com.
- Supercontest.
- Just Raj, Wes, and Phil haven't paid yet.
- Greg Matthews has this week's banner.
- Changed percentages to show the first decimal place, even if it's zero. This is more consistent. The pick cells are the exception, because 0.5 scores are much rarer, so we coerce whole nums to ints.
- Strongly increased the contrast for picked/nonpicked games, making both brighter.
- Switched from rgba, where it was ~30% and ~6%.
- Now it's hex, at 50% and ~7%.
- Changed unsubmitted picks from table-info blue to orange, to make it extremely obvious that you have not submitted them.
- Removed table-active class coloring for team cells on the matchups tab. Wasn't worth much, especially conflicting with the deliberate cell coloring of the pick process, and the table-hover of bootstrap's css. Left the js to change the cursor to a hand (pointer) tho.
- Reworked the legend. Made it color-white-color again. Added the all-picks vs your-picks difference back.
- Added a template, view, form, route, and model for email preferences. Rather than tangling it in flask_user and hijacking the edit_user_profile template, I built it into a new template/backend using wtforms and flask-wtf directly (also to get more experience with these).
- Note that while wtforms has some built-in model support out of the box, there's a full-fledged pkg for it: https://wtforms-alchemy.readthedocs.io.
- Function to return all emails for users with a specific pref.
- Consolidated all email subject/body/messaging into util/email, so that the text was easy to compare and keep consistent.
- Email options are now available to the user:
- To be notified when picks open.
- To be notified when picks are about to close and they haven't picked yet.
- Colors.
- Hex.
- Hex is just like rgb, with a hex num corresponding to each color channel in red, green and blue. 0 is none, f is full, as you'd expect from hex. So 00f is fully blue. #ff0 is yellow (red and green).
- It's easy to remember from this: 000, with no color at all, is black. fff, the combination of all colors, is white.
- While you can get many colors with 3-digit hex, you can get MUCH more with 6 digit hex (which is the standard nowadays). Each of the standard 3-digit hex colors gets 16 more levels of resolution before moving on to the next one (obviously).
- 3 digit hex = 3 digits of 2^4 = 3 digits of 16 = rgb(R, G, B) where each value is a number from 0-15.
- 6 digit hex = rgb() where each digit is 0-255 (16*16, or 2^8).
- Alpha.
- The A in rgba stands for alpha. The alpha channel is what determines opacity.
- This exists for hex colors too, but only recently with CSS4. The first 6 digits are the color, and the last two digits are for alpha. Similar to rgba: 00 is fully transparent and ff is fully opaque.
- Bootstrap.
- Color ref:
- primary:
#007bff secondary: #6c757d success :#28a745 info: #17a2b8 - warning:
#ffc107 danger :#dc3545 light: #f8f9fa dark :#343a40 - The bg-<> colors are these, with full opacity. The table-<> are the same colors, but with reduced opacity (alpha ~33%).
- Raw beef/pork meat is pink because of myoglobin. When myoglobin is heated up (cooked), it turns brown. When you burn wood (and charcoal, which is already-burnt wood), it produces nitrogen dioxide. This reacts with the myoglobin as it penetrates the meat, creating a stable molecule that doesn't turn brown as it increases temperature. Curing salt (sodium nitrate) does the same thing.
- The pink doesn't change any flavor itself, it just indicates that meat has been cooked slowly enough to not rise in temp before the wood smoke has penetrated a bit, which means you're going to get smoke flavor inside the meat.
Sunday, October 27, 2019
- Supercontest.
- Email reminder worked well last night.
- Submitted about 5 sets of late picks.
- Tie coloring on all-picks was working but not on your-picks. It was comparing team name to coverer correctly, but then team name to PUSH instead of coverer to PUSH.
- Reduced the unpick opacity from 0.3 to 0.2.
- All the new coloring changes worked.
- Did a little research on the flask-user form customization for email preferences.
- Started implementing https://gitlab.com/bmahlstedt-group/supercontest/issues/130.
- Lawrence's bday last night on la tuna was great.
- Venice all day, smoking ribs with Harner's neighbor.
- 1-1 in ff. 1-4 in sbsc.
Saturday, October 26, 2019
- Git repo with the history (amendments) of the constitution: https://github.com/JesseKPhillips/USA-Constitution.
- Remember that Instagram is mostly python, and is one of the biggest scale python implementations across the globe.
- {{ form.hidden_tag() }} tells flask-wtf to use csrf.
- When flask-user templates iterate over the form variable that's made available to jinja, it's just a class passed through the route. The class is just a child of flask_wtf.FlaskForm, and it lists the fields and information about them. You can also define validations here. Example: https://github.com/lingthio/Flask-User/blob/master/flask_user/forms.py#L139.
- The robinhood sell orders completed and the funds settled, so I initiated the withdrawal to boa today.
- Supercontest.
- Updating some basic flask-user structure. Removed the bootstrap_is_hidden_field.
- Changed to proper colgroups for styling whole cols instead of each row, for the min-width in the legends and the matchup borders on all-picks.
- Played with linear and radial gradients for cell coloring. Ultimately went with diagonal stripes for all in-progress games.
- Games that were not picked still have their results show, just at 30% opacity.
- Removed the table stripes. We're doing so much with background color already. This added unwanted contrast.
- Because of bootstrap's table-responsive, min and max width won't work as desired if set on colgroups, even with !important. You have to set it on the cells directly themselves.
- There are many places where some of your intended behavior fights with styles that bootstrap is setting underneath the classes you use. Overall, still very worth it.
- Demian Maia choked out Askren.
Friday, October 25, 2019
- New season of castle rock. This one follows annie wilkes, the bipolar nurse from misery who killed the author.
- House of Spirits was cool, but the most shocking part was the SURPRISE full nudity. They didn't even warn us.
- Riding 100 down the freeway, on the ducati, in the purple suit.
- Router/modem are overheating in the cabinet, gonna leave the door open.
- Talked with bmanning about matlab/c bindings. They have a product called Coder. Functional verification still needs to happen obv, but syntax conversion is automatic.
- Music.
- Kanye released a new gospel album today? It's called JESUS IS KING. It's garbage.
- Old creed. Great. Old eve6. Not as much. Old rob thomas. Not as much. Vertical horizon was pretty good. David Gray and Howie Day. Meh. A little too soft but ok for background I guess.
- Supercontest.
- Fixed the consistent-width cols on all-picks. The logos in the headers had removed min-width.
- Distinguished the finished games from in-progress games by color stripes, not border. If the game is finished, it's the solid color representing the result. If the game is still underway, it's the same color but a white band in the middle. Looks really good.
- Made the legend look a little better, touches on both sides and white bg / black text in the middle.
- Combined both instructions/legend buttons, on all views, into one single help collapse.
- Converted all my inline styling to custom classes. Some basic ones already existed in bootstrap:
- white-space: nowrap -> text-nowrap
- rgb(225, 225, 225) -> text-muted
- display: none -> d-none
- Went through and checked for any inline scripting as well, and handled it.
- Did not minify or bundle the css. It's only like 50 lines.
- Scraped all templates for common macros I could abstract out.
- Scraped all js for common functions I could abstract out. The biggest one was colorPickCell, which contains the logic for checking game status and coverer and stuff to determine how to color the cell, red/green/yellow, and the in-progress band. This included two other helpful functions isGameUnstarted and isGameFinished.
- Used the vitamix for the first time today. It makes a whole world of difference. So satisfied, shoulda bought it years ago.
- TSLA jumped over 10% today. BTC over 40% too (so dumb).
- Shorting kinda defeats the purpose of investment, ya? Tribute to the fact that the market is really there for gamblers, not for supporting good ideas financially.
- Warriors got killed by the Clippers, but it's game 1 and the Clippers are champion contenders.
- Amazon's switch from 2 to 1 day shipping increased revenue by 24% but increased shipping costs by 46% also.
- Bootstrap source css, 10,000 lines: https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css.
Thursday, October 24, 2019
- Record for lines.
- Biggest all time: 27, Steelers over Bucs, 1976.
- Biggest recently: 26.5, Broncos over Jags, 2013.
- Biggest since my app: 22.5, Pats over Jets, 2019.
- Westgate.
- Leaderboard.
- After week 6, the #1 had 27/30 points (90%).
- After week 7, the #1 had 28/35 points (80%).
- They have a mobile app. Downloaded and played with it.
- Called "Fantasy Supercontest" from BookieLab Inc.
- Mine is better:
- All-time stats.
- Desktop and mobile (via browser, but responsive).
- Data API (graphql for web client and python pkg for desktop client).
- Customizable banner.
- Funny feedback form (trivial).
- Localized time.
- In-app rules, page-specific instructions, legend.
- Progress graph (total points vs week).
- Free league.
- Theirs is better:
- Native mobile.
- Full record, covers-pushes-noncovers (mine just has total points).
- Ranking graph (lb position vs week).
- Both have:
- Old seasons, old weeks (historical data).
- Leaderboard. Full percentage.
- Total picks per team per week.
- Weekly summary of teams and players.
- Team logos.
- Not sure:
- Live-update frequency.
- Administration.
- Payment interface.
- Email reminders / notifications.
- Nationals are up 2-0 in the world series.
- Listened to mostly Myles Kennedy (vocals/guitar for altar bridge) and his solo work. Tremonti is still my favorite of the 3, between Tremonti, Cornell, and Kennedy.
- Supercontest.
- Fixed a few small issues due to lowercasing the team names and mapping the statuses. The capilization now is completely confined to the frontend html, through a jinja filter. The backend python/postgres all used uppercase before, but the frontend js does now as well.
- picks_open is now forwarded to js.
- Added logos: https://gitlab.com/bmahlstedt-group/supercontest/issues/128.
- Total size of all 32 logos is 452K in vcs, which is fine.
- A deployment failed because the droplet ran out of disk space (it's 25GB).
- Decided not to do full record (covers-pushes-noncovers). I only pass total points everywhere, I don't plumb which points came from a full cover vs half point from push. It would require some surgery to expose that through the whole chain, and it doesn't add much.
- Backend did all the same pick verifications as frontend except "you picked the opponent" - added it.
- "Ethanol cannot be concentrated by ordinary distillation to greater than 97.2% by volume (95.6% by weight), because at that concentration, the vapor has the same ratio of water to alcohol as the liquid, a phenomenon known as azeotropy."
- Tesla jumped quite a bit after the profit report.
- FB won't move forward with Libra until approved by regulators (sure).
- Google possibly spied on its own employees? https://www.bloomberg.com/news/articles/2019-10-23/google-accused-of-creating-spy-tool-to-squelch-worker-dissent.
- House of Spirits event.
Wednesday, October 23, 2019
- Pulled out of every private investment. Nothing in robinhood, tradeking, or ally. All solium. I'll rediversify again after tradebot reports conclusively successful movements, hopefully after some recession with lower positions.
- There are ~630,000 publicly traded companies in the world. From a data standpoint, it's not ridiculous to do a simple linear regression on all of them through history, with decent resolution.
- Most mobile phones are in the ballpark of 375x800, for design reference (banners etc).
- Made the banner for franky. Deployed.
- Pxlr free online to remove the necessary sections, then intentionally filled in the background white so that the space between the repeated image (bg-secondary) was contrasted.
- Used background-repeat: space, which is much better because it will adjust the x padding between the repetitions responsively for viewport size.
- Background-position: center, just for the case where there's only one instance (mobile).
- And then background-size: contain, with a fixed height as usual.
- Reinstalled gnome-system-monitor for process and resource utilization, uninstalled htop. I already have top for terminal inspection, I want history with my graphical monitor (even if it's only 60 seconds).
- Clippers beat Lakers on opening night.
- Nationals beat Astros for game 1 of the world series.
- Remember:
- sudo apt remove <> will uninstall the package, and the packages that depend on it, but leave the config files.
- sudo apt purge <> will uninstall the package, and the packages that depend on it, and remove the config files.
- sudo apt autoremove will uninstall all packages that were installed as dependencies but the parents aren't around anymore. It's not the best practice to run this.
- sudo apt list --installed
- You shouldn't delete the default ubuntu python installation, there are many system packages that depend on it:
- apparmor* apport* apport-gtk* aptdaemon* apturl* apturl-common* dh-python* foomatic-db-compressed-ppds* gdm3* gedit* gedit-common* gir1.2-ibus-1.0* gnome-control-center* gnome-menus* gnome-online-accounts* gnome-session* gnome-shell* gnome-software* gnome-software-plugin-snap* gnome-terminal* gnome-tweaks* google-chrome-stable* hplip* hplip-data* ibus* ipython3* language-selector-common* language-selector-gnome* lsb-release* nautilus-extension-gnome-terminal* nautilus-share* openprinting-ppds* orca* plymouth-theme-ubuntu-text* printer-driver-foo2zjs* printer-driver-foo2zjs-common* printer-driver-m2300w* printer-driver-postscript-hp* printer-driver-ptouch* printer-driver-pxljr* system-config-printer-common* system-config-printer-udev* tox* ubuntu-drivers-common* ubuntu-release-upgrader-core* ubuntu-release-upgrader-gtk* ubuntu-session* ubuntu-software* ubuntu-system-service* unattended-upgrades* update-manager* update-manager-core* update-notifier* update-notifier-common* usb-creator-common* virtualbox* virtualbox-qt* virtualenv* xdot* xorg* xserver-xorg*
- This is absolutely ridiculous. Python should not be this coupled to the base dist and desktop env.
- Git LFS.
- My pip install was being weird after using lfs. It can't install any pip packages, which means it can't create venvs, run tests, etc. Even after uninstalling git-lfs, it was still pointing at their repo. The default index was still being reported as pypi.
- Deleted this shitty piece of code. It was messing with a bunch of system-level config on my machine. Wiped my python installation as well.
- Removed the .git/hooks/ relevant files: post-checkout, post-commit, pre-push, post-merge.
- https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh.
- Honestly fuck this project. It messed with so much in my system level. It left cruft everywhere with no mechanism for cleanup.
- Tried purge, reinstalling, more for all versions of python, pythonX-pip, virtualenv, pip, etc.
- `curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3` was the start.
- /usr/share/python-wheels is not necessary. It can be empty.
- sudo pip3 uninstall then install virtualenv tox back into the system environment was the fix.
- Joe Rogan got Edward Snowden on the podcast!
- lol:

- Snowden found no evidence of aliens, chemtrails, other gov't coverups, and conspiracy theories, and he had deep access to nearly everything.
- It was basically Snowden talking for 3 hours. Joe was probably the quietest I've ever seen.
- It's scary to live in a world where someone is prosecuted for doing the right thing.
- Departments don't collaborate, they try to work solo to take full credit for accomplishments, just like in a regular job.
- Ultimately, it's just people trying to save their jobs and/or get promotions, just like any other industry. It's just in government, politics, and intelligence.
- WeWork's CEO Adam Neumann is walking away with 1.7B after the buyout, after driving the company and the stock price into the ground. The employees are getting screwed.
- Toggle buttons are better than checkboxes, if there are many items: https://medium.com/@uxmovement/why-toggle-tokens-are-a-better-alternative-to-checkboxes-2b6403e140ff.
- Roasted 5 pounds of peanuts and processed into peanut butter.
- Listened to Chris Cornell most of today (lead singer audioslave, soundgarden). I don't like his solo work as much as Tremonti.
- Reinstalling ansible added python2.7 back to my system. Lol.
- Supercontest.
- https://gitlab.com/bmahlstedt-group/supercontest/issues/127.
- Took the plots that had complementary data (cover/push/noncover by team, and favorite/push/underdog by line) and stacked them all onto the same bar chart (for each complement to 100).
- Plotly is smart enough to sort each individual trace, and then reassign each trace based on similar label. However, if you want to sort across multiple numbers (like primary sort covers then secondary sort on covers+pushes), you should separate the full dataset separately and then build the traces explicitly, rather than having plotly aggregate for you.
- Made them horizontal and colored them with the same colors as table-success/warning/danger, for consistency.
- Committed nellw lines for week 8.
- All text looked good, appropriate relative to picks open/closed, padding, margin, during all phases of line commit.
- Submitted my picks.
- Bootstrap hex colors for table (these are different than the ones for text, buttons, etc).
- table-success: c3e6cb
- table-warning: ffeeba
- table-danger: f5c6cb
Tuesday, October 22, 2019
- Set up the splunk logging composition, for the most part, and then removed it.
- Docker has logger drivers which tell it how to access the logs from the containers. The default is json-file.
- Splunk uses HTTP Event Collection as the logging driver, known as HEC.
- You can run 500Mb/day through Splunk for free.
- Created an account with splunk.com.
- Remember that it takes a minute or two for the splunk server to start. Check for status: healthy in docker-compose ps.
- Added a token that the app container uses to push the http events to a specific url.
- Installed the docker monitoring app inside the splunk interface.
- You need collectord to make it work, you can't just forward it directly from hec. https://www.outcoldsolutions.com/.
- This is way more complicated than it needs to be. I literally just want to tail a logfile from the browser. The docker interface already forwards stdout/stderr from the container.
- I also don't want to bloat the under-resourced DO droplet with a splunkenterprise container. It's built to do way more than I'd use it for.
- Darnold had a passer rating of 3.6 last night. Insanely low. Patriots D are absolutely killing it, they're in the top 10 for all offensive players in fantasy. I lost the yahoo league and won the espn league. Got 2/5 in supercontest.
- In purging some docker images/containers on my laptop, it tried to upgrade the database container to 12 on a new build/pull. That version is incompatible with a db created with 11 (my version), so I pinned it in docker-compose.
- Big Mouth roles I didn't know: John Mulaney is Andrew, Chelsea Peretti is Nick's phone, Kristen Bell is Jay's pillow, and Jordan Peele is Duke Ellington!
- Did blender research.
- Notes.
- I don't need pulse. I only need it for smoothies (and maybe nut butters), I don't use the blender for salsa, grinding herbs, chopping nuts, etc. Plus I still have the ninja if need be.
- I don't need preprogrammed settings. Soups, desserts, smoothies, blah.
- I don't need digital or touch control. Buttons/switches are fine.
- I don't need self-detect and self-clean. Manual control is fine.
- I don't need timers and programmability. It's not an oven.
- I don't need an app to pair with it wirelessly (lol).
- Vitamix.
- Given all the above, the 5200 is the right fit.
- There are a couple more features to consider.
- The classic series blenders have 2hp motors, while the smart series blenders have 2.2hp motors.
- The smart series blenders are a bit smaller (low profile 64oz container).
- The smart series blenders are a bit quieter.
- Those 3 features aren't worth it to me.
- Its usual price is $450, there was one available for $400. The base is red, but worth the $50 discount. Ordered.
- Camelcamelcamel is a great price tracker for buying expensive items on amazon. You can see the most/least expensive it has been, and even set up alerts where it will email you.
- Bought a huge batch of shelled, skinned, blanched, unsalted peanuts. They're much cheaper in bulk than other nuts - down as low as $2/lb. I bought 10lbs at $3/lb. At costco, the packages of pecans/cashews/etc are $8/lb, and that's a great price already.
- Downloaded paypal for my phone.
- Greg bought week 9 for the sbsc banner. Franky has week 8. Jcriss paid but still needs to send the graphic, so he'll probably get week 10.
- Netflix issued 2b of corporate bonds to fund new content, adding debt.
- WeWork is in a bad place.
- FF waivers. 3 for yahoo, 2 for espn.
- Used the new razor. Cleanup was easy, since it catches all the hair. Cleaning the unit is easy, just run under the tap (full or taken apart). It's a close shave. I need to get used to the motion/pressure so it gets everything.
- Updated the banner_archive (.gitignored):
- 2019-01-niners.svg
- 2019-02-warriors.svg
- 2019-03-williamstown_basketball.svg
- 2019-04-moon_landing.txt
- 2019-05-meats.jpg
- 2019-06-ducati.jpg
- 2019-07-britney_spears.txt
- Made the static/README.md always show build status successful for the stack view, since the gitlab project is private. The regular readme still points to the actual build badge, updating in realtime.
- Started the new season (9) of AHS. It's called 1984, and it's an 80s camp horror theme (which I'm a big fan of).
- Would be nice if spotify had a simple feature like "save for later" where you could add artists (or albums, or songs) to a list to go through whenever you wanted. I often find a few new artists, and then find a couple more good suggestions in "related artists", but there's no way to keep those artists queued in the app to go through later.
- My laptop battery:


- Discharge, normal use, full brightness: ~12.5%/hr. Total time ~8hrs. Linear.
- Discharge, idle, closed: ~0.25%/hr. ~2% over 8hrs. Linear.
- Charge, normal use, full brightness: ~50%/hr during the linear portion to ~85%SOC. Total time ~3hrs. Logarithmic toward the end.
- Google Keep can do bulleted lists by default, just type an asterisk then space on a new line.
- Moved a few longer term items from blogger to google keep.
- The new batch of protein bars is even better than the previous, which is saying a lot.
- Made all my gitlab projects private, and transferred them all from my user namespace to my group namespace. Updated all remotes, on my laptop and the droplet.
- Updated the readme in the fivesquared project to shrink the images to a reasonable size. They now display side-by-side.
- Al Noor lunch with Corey/Harner.
- Tradebot.
- Created and configured the repository in gitlab.
- Enabled autodevops at first to play with it. It created a pipeline with 3 jobs: build, code_quality, and test. If would have added a deployment job as well, but you need a kubernetes cluster. The first job, build, failed and stopped. The default command was `herokuish buildpack build`. I don't need autodevops for this project, so I disabled it.
- Added a very basic .gitlab-ci.yml pipeline instead. Just runs pylint via tox.
- Created both tickets, one for analysis and the other for buy/sell.
- Useful advice: when performing any sort of corrective action (filing a complaint, etc) against a party in a non-face-to-face manner, pretend you're a third-party witness. You won't be discounted as disgruntled, and they'll perceive more weight around the incident if it's apparently large enough to be reported by a witness.
- LFS for prod db backups and the banner archive.
- curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
- sudo apt-get install git-lfs=2.9.0
- cd ~/code/supercontest
- git lfs install
- git lfs track "backups/"
- git lfs track "supercontest/static/img/banner_archive/"
- git add .gitattributes
- Then commit and push as usual.
- You can run `git lfs status` to see which files are going to git and which are going to lfs.
- Added the sbsc production db backups to git lfs. Added the banner_archive as well.
- Listened to some good old Tremonti solo work today. Lead vocals/guitar for creed/alterbridge.
- GitLab has template files for .gitignore, .gitlab-ci.yml, LICENSE, and Dockerfile that you can add to any project. Example: https://gitlab.com/bmahlstedt-group/tradebot/new/master. They will come prepopulated with whatever environment syntax you want (Python, for most my cases).
- Ducati is owned by Lamborghini, which is owned by Audi, which is owned by Volkswagen.
- Went through some different lists of folks' "stocks you'll never sell". Curated them into ones I actually cared about. Removed ones that didn't look amazing (unless your basis was 10 years ago). Removed the ones that I don't believe in (general electric GE, etc). Removed the ones that I don't want to support (mcdonalds MCD, etc). The remainder is obvious. The big players with consistently linear positive trends. After some recession to reduce the position, these would be good ones to dump some excess into (or weight more highly in the tradebot, as a qualitative boost since it's a quantitative tool).
- AMZN
- GOOG
- MSFT
- DIS (disney)
- IDXX (idexx laboratories: products and services for animal food and stuff)
- ILMN (illumina, inc: genetics)
- BAM (brookfield asset management: equity)
- RACE (ferrari)
- BA (boeing)
- LMT (lockheed martin)
- INTC (intel)
- CSCO (cisco)
Monday, October 21, 2019
- Meal prep.
- Made new batch of oat milk. With dates this time. Extra filtered.
- Made new batch of cashew butter. Because it's much more doughy than the other nut butters, add a bit of olive or coconut oil to cream it out.
- Made new batch of protein bars. Getting the ratios closer to perfect every time.
- 2lbs nuts, roasted 400F 10m.
- 3 bananas.
- 4-8oz pitted dates (about 40, 1 pack).
- 10 scoops protein powder.
- 1 cup oats.
- Salt sprinkle.
- Maia/Askren this saturday and then Masvidal/Diaz the next.
- Supercontest.
- Added the sbsc gmail account to my phone so I can monitor there, and get push notifications.
- Banner.
- Ross wants week 12 (needs to pay).
- Jcriss bought a week but hasn't specified which yet.
- Greg, Jeremy, and Franky have all expressed interest in a later week.
- There are 10 weeks left.
- Celery (backed by redis + rabbitmq) would probably be 1000x better than flask-apscheduler for my background cron jobs.
- I could expose a REST API for the direct models. There are tons of flask extensions to do so. Picks, changing leagues, roles, some of the admin stuff; it would all get a little easier. Plus then you can autobuild the documentation with swagger. It's a little different than the graphql api, which is just for user querying. I'm not going to do this now, because the added value isn't crucial for this app.
- https://gitlab.com/bmahlstedt-group/supercontest/issues/126.
- Minified the html (in prod) using flask-htmlmin. The text responses are condensed. It strips comments, extra whitespace, etc. It's still quite readable without prettyprint (unlike minified js). You access this on the elements tab of devtools (like you'd expect), not sources like for js files.
- Made team names on your-picks lowercase with capital, rather than fully upper.
- Max-width on name columns for all-picks and lb, so any user making their name gigantic doesn't wreck the responsive few. Overflow is hidden. Added the full name to the tooltip so that you can see it hovered if it's cut off normally.
- Made the int/float renderer pre-round to 1 decimal place properly, handling the X.0 case.
- It's annoying that companies are taking political stances on topics completely unrelated to their industry, simply for compounding reputation + appeal to new fanbases. Categorization, classification, identity politics, call it whatever you want - it's moving focus away from the actual values and individuals, which can't help the actual values and individuals. https://marker.medium.com/why-companies-need-to-pick-a-political-side-9fd5541da81d.
- This badge is pretty cool: https://github.com/sourcerer-io/hall-of-fame. Shows your top contributors.
- Checked out a meat market that I hadn't been to before (manhattan and manhattan basically).
- They had an ok selection, but not a wide variety of raw cuts. More like a nicer grocery store with preseasoned dinners. They didn't stock elk, but you can call on thursdays and add it to their weekly order.
- Costco business center still the best around here by far.
- The entity code for a linebreak is 
- Big Mouth is a super underrated show. There are so many clever bits and current social commentaries. There's even the artistic display with the musical portions.
- It's obviously not feasable to gasoline home delivery for a car owner, since a full tank is ~100lbs, and you'd need it every couple weeks. But for motorcycles? I need 3 gallons to fill it up completely. That's like a few gallons of milk every month, which is well within the means for a service like amazon fresh.
- There's a home delivery service called filld: https://filld.com/. It's $5/gal for premium, and a $5 delivery fee.
- You can order an above-ground fuel tank directly from Atlas: https://www.atlasoil.com/products/93e10lv. Minimum 150lbs, at $4.04/lb. 91-93 octane, but has 10% ethanol.
- I would totally do this for home use, if I were in a static location. It would last me a couple years, and be super convenient. It's a little risky though; basically a bomb on your property.
- The elastic stack is elastic search, logstack, and kibana (ELK). Beats is a fourth application that's sometimes included. It's similar to splunk and nagios, a full operational monitoring system. You can aggregate logs, monitor the system, all profiles/processes/nodes/etc, dashboards, metrics, other visualizations.
- This is amazing:
-

Sunday, October 20, 2019
- The dew point of water is a function of dry temperature and relative humidity, but 50-60F is usually pretty close.
- Switched 24, uber, and digital ocean (verizon was already migrated) over from the prime rewards card to citi, for 1% additional cash back.
- Placed Fresh order. Arrived same day.
- Watched El Camino (the Breaking Bad movie) with Harner.
- World series starts Tuesday, Astros vs Nationals.
- Niners still undefeated babyyyyyyyyyy. 6-0.
- Looks like I'll probably lose both FF games this week, and 2/5 for sbsc.
- Got the nice shaver delivered.
- Clean it under the tap after every use. You can take it apart.
- Clean it in the full machine once a month. The cleaning fluid needs replacement about once a year.
- Charging takes an hour. The battery lasts about 50m with the shaver on.
- Hold the power button for 3 seconds to enable/disable the travel lock mode.
- Supercontest.
- Added sticky-top to the navbar, which means that it scrolls down on the banner but then when the main navbar gets to the top, it stays! It's not supported on every browser but chrome is fine.
- Only two late pickers this week (marcus and cam).
- Added a user icon from font awesome for the profile dropdown on the navbar.
- Removed the dropdown-divider elements. I didn't like the spacing it added because the link should be clickable in the whole area, and overwriting the margin/padding wasn't worth the simple benefit of the line.
- Moved all the variable forwarding (python ->js) to a separate template file to keep it together and separate.
- You can't just pass the whole g object because it's not json-serializable.
- Moved harner to the paid league.
- Did a deployment in the thick of Sunday football while games were live. No prob. Downtime is <5 minutes.
- The statistics template was gitignored because it was in a directory named data. Fixed. https://sentry.io/organizations/bmahlstedt-org/issues/1288047383.
- The help collapse button in the contest view header needed ml-auto. The instructions/legend buttons already had it, but the collapse didn't.
- Added the full font awesome stylesheet so that the icons load a little faster.
- Made it so that late picks will send the confirmation to the admin as well.
- Made the all-picks page have consistent fixed widths for the team abbreviation columns.
- Added an abbreviation map for the nfl scorestrip's statuses, so it prints Final and Not Started and stuff.
- Verified that all divisions for percentages (usually possible points or num_picks) are protected with DivisionByZero error handling, so that users can register anytime (with 0 picks) and not break the service.
- Added tooltips on the lb for total picks for the week (all users), total picks for the season (one user), and total picks for the season (all users).
- Moved all percentage calculation to the frontend. The backend just has the numerator and denominator data. The frontend does the division to calculate percentages as necessary. This was moved to a macro to keep it consistent. It handles the divide-by-zero case.
- Added a really useful rollup to the left of the all-picks view, showing the status colors of all 5 picks in a convenient glance. This also consolidated the picks_open and !picks_open views, which this template had a few conditionals for.
- Don't use the scope attribute for td elements (in html5). It's only for header, to specify whether it's a header for a row or a col.
- You can't just + arrays in js like in python, you must concat or something like const newArr = [...oldArr1, ...oldArr2];
Saturday, October 19, 2019
- Greg Hardy (former Carolina Panther, beat his girlfriend up, bad guy) won his UFC fight last night via unanimous decision but then was ruled a NC after because he used an inhaler between rounds 2 and 3. Crazy, first time I'd ever seen this.
- Chris Weidman has lost 5 of his last 6 fights (all KO/TKO finishes). Joe Lauzon came back and won tho!
- Enrolled in autopay for the citi card. It doesn't activate until next month, so I'll have to make a manual payment for this statement.
- get_flashed_messages() is a flask capability. You can basically flash a message inside any route, and then it will be displayed on the next request.
- Jinja.
- `include` will return already-rendered content from another file. You can't inject a block into it, like you can with `extends`.
- Blocks can't be conditional. Just make the content conditional in the other template.
- Supercontest.
- Moved the flashed_messages over from alerts (the flask-user default) to notify.js. Much cleaner, and consistent with the rest of the app. Migrated the js to the toplevel layout as well, rather than the flask_user template, so it flashes on every site in the app. This is much better because you might be exiting a user view and going to a contest view (which is the case during normal login), and you want the message to display right away.
- Restructured the contest views a tiny bit to extend the contest view header so that it could inject the title block (they were previously only `include`).
- Got rid of the contest routes passing "label" back. It's no longer necessary with the generic "View" title in the navbar and the specific route title in the contest_view_header.
- Pretty substantial change for season/week/league filtering in the TEMPLATE layer instead of the backend routes. Makes it a lot easier to manage. A log was able to be consolidated. Just conditionals in html now, mostly, for what gets shown to the user.
- Along with this came easy stuff like: don't show leagues on matchups page, don't show week on lb, etc.
- Renamed graph to progression. In title and such only, not in endpoint.
- Added a macro that returns card header title with h3 and mb-0.
- Could add some extends for the card/card-body/row/col, but they're all pretty different so this inheritance wouldn't save a ton (diff sizes for col breakpoints mostly). It's also less direct/explicit.
- Made it so the "View" nav dropdown is available at all times, even when you're looking at the basic secondary ones (rules, stats, etc). This just meant building url_for with NO arguments, if coming from those routes. All the url_defaults were already in place on the app side.
- Changed my int-casting into the proper divisibleby(1) (jinja built-in test), and moved it to a macro. Rounds to one decimal place if float. Returns a string in either case.
- Galantis concert at the Shrine.
Friday, October 18, 2019
- Went to Dark Harbor, the Queen Mary Halloween event in Long Beach.
- Supercontest.
- Configured the sbsc gmail account to be more consistent with my main account.
- flask-user.
- Fixed all the BS. Working now with all the new templates. I still have the full flask-user suite copied over and customized. Here is a near-complete list of the changes:
- Layout includes banner and navbar.
- Extends main_view block, which has container-fluid and p-3, then the contents are a card-header with the title and a card-body with the form, consistent with the rest of my stuff.
- The settings are locked. enable_remember_me, enable_username, retype_new_password, etc. All the conditionals are gone in the templates.
- Added proper template bases for banner_main_navbar, banner_contest_navbar, banner_contest_week_navbar.
- Laundry.
- The tabindex attribute on the element is (surprise) the order through which they'll be selected as the user hits the tab key (like filling out fields on a form, etc).
Thursday, October 17, 2019
- Old mansion with horror themes and spooky stuff, with 6 mini cocktails. Yup. https://feverup.com/m/76796. Bought tickets.
- Later requested to swap the house of spirits tickets from sat 26th to fri 25th to deconflict with Lawrence's bday and Briley/Sharon party, just in case. They honored it; moved to Thursday Oct 24th, 630-830pm.
- Called and made haircut appointment, and there was availability today. The online system was smooth.
- A whole cow is a few thousand bucks (~$5/lb of usable meat). A whole pig is a few hundred bucks (~$2/lb for usable meat).
- Bought tickets for dark harbor (queen mary long beach horror event every year).
- Jinja.
- Read through much of the documentation: https://jinja.palletsprojects.com/en/2.10.x/templates/.
- You can do an {% endset %} if you don't to confuse scope of a common variable.
- Macros are just functions that return html. If you have similar blocks of html anywhere, conditional on some sort of input (or even not), then you can make it a macro and just import/call it whenever needed. Not that import is different than include and extend; it's only used for macros (and variables, if need be), just like python.
- There are some useful built-in filters I wasn't aware of: dictsort, map, unique...
- {% trans %} is used for i18n (translation, obviously).
- The `extends` clause should be the first line in a child template. You can have multiple `extends` clauses in the full inheritance chain, but you have to be smart about the `include` / `extends` relationships. Remember, `include` will just pull html from somewhere else. `extends` will tell the blocks to fill the parent. The block definitions themselves should be in the file with `extends`, and the `include` sections within the blocks.
- Netflix has twice as many paid subscribers as Hulu, but only 10% of the viewers as regular old tv! Their q3 earnings were much better. Surged 10%.
- I'm gonna start doing some intermittent fasting, out of curiosity. The main benefit you hear people talking about: IM increases autophagy (cell recycling). I already have such a regimented diet, I figure adding a time dimension to this won't be hard. 16/8 is the goal, but if I have to use 12/12 as a transition period, that's fine.
- 3 main meals (I already do this, just shifting times).
- 1000 shake.
- 1200 smoothie.
- 1800 meats.
- Other.
- Veggie juice before gym.
- Coffee. Since you can't drink on an empty stomach, this keeps caffeine consumption in better complement with your natural cortisol cycles.
- Protein bar after gym.
- Python 3.8 is released. Good summary: https://docs.python.org/3.8/whatsnew/3.8.html. Main additions:
- Walrus operator, for stuff like check length WHILE assigning to variable.
- fstrings can do stuff like f'{user=}' now, where it will print the variable name, an equals sign, and the value for you.
- importlib.metadata can give you info about version, requirements, and data files for any package. More info: https://docs.python.org/3/library/importlib.metadata.html.
- Toilet was wobbly. Tightened everything. Plastic fasteners into porcelain.
- Splurged on a new electric razor.
- My old one is tiny, uses batteries, takes forever to finish, etc. It's small, I'll keep it around for precise stuff like arms.
- Got the Philips Norelco 8900. $200. It's the nicest one without a digital interface.
- Calculated all the utilities (gas/water/electric) + internet that briley still owes. Will be about +$1500 when I move out. Also will probably get some security deposit back, although keeping expectations lower.
- Citi Double Cash arrived! Activated the card, as well as the online management account. Added it to Google Pay, which chrome obviously has access to. Added to Mint. Changed the verizon autopay to this; it's the only recurring payment on the card (so far).
- Changed the verizon bill to submit payment on the 1st of the month, to keep everything in sync.
- Elastic, splunk, and nagios are popular log monitoring platforms.
- Installed gthumb so I could crop images natively in ubuntu.
- Sudulaev is so good. In under 5 seconds, he goes from being in a standing single leg to taking the other guy down.
- Supercontest.
- If you don't commit the lines before midnight, the app will 500 because it will try to commit scores (Thursday is a score day, so it tries). It can't commit scores when there are no lines yet, because the score table FKs to the line table. No programmatic action here, just make sure to commit lines before midnight on wednesdays. Added the note to the sentry error: https://sentry.io/organizations/bmahlstedt-org/issues/1279298266.
- Committed this week's lines and submitted my picks.
- Sentry error for InvalidPicks('A pick is being attempted on a game that has already started, and for a pick that the user did NOT already place. This is likely a malicious attempt, since the frontend should screen for this.'). https://sentry.io/organizations/bmahlstedt-org/issues/1270625608/?project=1773879. Changed it to properly send the error msg back to the frontend, and log it locally.
- Renamed the season blueprint to the better contest_blueprint.
- Reorganized ALL templates into subfolders. Completely separated them. Instead of inheritance everywhere along the whole change, they're now all distinct, and I define commonly used bases that include the appropriate sections.
- Removed basically all customization of flask_user templates, other than that they extend bases/banner_navbar.html.
- Finished the second season of succession. Solid show.
- Disabled adblockplus, ublock origin, and privacy badger for mtv.com so that I could successfully watch live tv in that domain.
Wednesday, October 16, 2019
- Jack Dorsey is CEO of Twitter and Square.
- Nationals swept the Cardinals for NCLS. Astros are up on the Yankees 2-1.
- What to do after promotion to senior management: https://sriramk.com/exec-101-first-thirty-days.
- HTML/CSS layouts and other random tags.
- Webkit appearance <a type="button> is deprecated, stop using it. For <button> elements, you still have to put the attribute type="button" so that it indicates it's a clickable button. For all browsers except IE, the default is "submit".
- Tables come with a default bottom margin.
- em = font size of the element. rem = root em, the font size of the root document. This is usually 16px default in most browsers. Specifying something as 2rem would be twice the default font size, or 32px usually.
- In bootstrap the default $spacer is 1 rem. So for stuff like m-0 m-1 m-2 m-3 m-4 m-5, it's all relative to the root font size. They almost double in size with each number.
- m-0 = 0 (0px)
- m-1 = 0.25 rem (4px)
- m-2 = 0.5 rem (8px)
- m-3 = 1 rem (16px)
- m-4 = 1.5 rem (24px)
- m-5 = 3 rem (48px)
- Card-header and card-body elements come with natural padding (as expected), so if you have a child element with additional padding/margin (heading, table, p), you probably want to remove it. Usually it's the bottom.
- hr has top and bottom margins.
- The "role" attribute on many tags is not required, but is there as a helpful piece of information. The most common case is when people use links <a> as buttons, so role="button" will tell screen readers and other accessibility tools what the user is actually supposed to do.
- When you specify `height: 30%`, it's relative to the parent element. To make it relative to the viewport height, you can use `height: 30vh`. The same applies for width.
- Cols naturally have gutters between items and rows. Remove with px-0.
- Supercontest.
- Although the project is private, I would like a setting that allows the badges to be public, so that build status and such can be seen by non-gitlab-loggin-in-users and non-admin. Oh well. https://gitlab.com/gitlab-org/gitlab/issues/15646.
- Tons of UI updates, mostly from the css above. Cleaned up a lot of the spacing. Made the buttons proper. Padding, margins. Nothing uses fixed-width anymore, every single element is responsive.
- Made some adjustments for whitespace that flask-user and zero-md and such injected (inconsistently).
- Completely rewrote the navs, from the many bars to the various dropdowns.
- Reconfigured with multiple navbar-collapses at different breakpoints.
- Scheduler only runs in prod now.
- Fixed the js to allow the unselection of picks all the way to zero. It would only show the button on matchups.length > 0 before. Also moved the pick button disabling and div hiding to the ajax beforeSend, rather than in the target function.
- The britney banner required a little more, since I was created the gif mosaic in html with bootstrap's img-fluid and other pieces. I also used the grid system within the jumbotron for the first time, which gave me a lot more control, and with more ease.
- Disabled shared and group runners for my gitlab project. Only using my machine now. Shared runners can be re-enabled with the click of a button from the frontend.
- Unlocked bmahlstedt-xps13 from just supercontest use, so that other projects (that I own) can run their pipelines on my machine as well.
Subscribe to:
Posts (Atom)






