Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
c3RhdHVz

David James xpe

💭
c3RhdHVz
View GitHub Profile
@xpe
xpe / hormonal_obesity.txt
Created Jun 14, 2020
Insulin & Insulin Resistance : Feedback Loops
View hormonal_obesity.txt
ASCII Diagram version of
https://thefastingmethod.com/wp-content/uploads/HOT-Fatty-Liver2.1.jpg
┌────────┐
┌───────────┐ │ high │ ┌───────────┐
│ glucose │────┬────▶│insulin │────┬────▶│ obesity │
└───────────┘ │ └────────┘ │ └───────────┘
│ │
│ ▼
┌────────────┐ ┌─────────────┐
@xpe
xpe / comment_327243.md
Created Oct 29, 2019
Let's retire Lines of Code and just count characters instead!
View comment_327243.md
@xpe
xpe / question.md
Created Oct 27, 2019
Machine Leaning Theory: Double Descent Curve
View question.md

Neural networks are capable of interpolating (fitting the training set perfectly) and driving test error lower.

Can the AdaBoost algorithm also do this?

Why or why not?

@xpe
xpe / numeronym.py
Last active Oct 7, 2019
Use this when your phrases need numeronyms!
View numeronym.py
def abbreviate(phrase):
def shorten(w, t=7):
if len(w) <= t:
return w
else:
return "{}{}{}".format(w[0], len(w)-2, w[-1])
return " ".join([shorten(w) for w in phrase.split(" ")])
abbreviate("The Heilmeier Catechism demands a thoughtful approach to risk taking")
# 'The H7r C7m demands a t8l a6h to risk taking'
@xpe
xpe / policy_gradient_loss.py
Last active Dec 23, 2018
Policy Gradient Loss function for PyTorch
View policy_gradient_loss.py
import torch
import torch.nn as nn
import torch.optim as optim
from torch._jit_internal import weak_module, weak_script_method
@weak_module
class PolicyGradientLoss(nn.Module):
"""
Multiplies an unreduced CrossEntropyLoss by a `q` vector.
"""
View why-wired-gigabit.md

Various arguments for wiring your home with Cat 6 (gigabit) ethernet or better.

Bottom-line advantages of Cat 6 over 802.11ac WiFi:

  • Better capacity. While 802.11ac, under optimal conditions, can approach 500 Mbps, having a wired connection that guarantees 1000 Mbps can be useful.
  • Better reliability.
  • Better security.
  • Better latency.

All of this said, it isn't either-or -- you can use your wired connections for connecting computers to NAS or when you need maximum speed for uploading.

@xpe
xpe / rust_wrapper_type_pros_and_cons.md
Last active Jul 11, 2018
Pros and Cons of Wrapper Types in Rust
View rust_wrapper_type_pros_and_cons.md

Pros and Cons of Wrapper Types in Rust

I've written a mathematically-oriented and computatioally-intensive application in Rust. While the mathematical theory is not necessarily difficult, keeping the various quantities clear required some care.

For this reason, I'm refactoring it to clear it up. I've created some custom structs to wrap various mathematical types.

For example, I created a type to write PDFs (probability density functions)

@xpe
xpe / default-terminal-in-ubuntu-gnome.md
Last active Mar 19, 2018
Changing the default terminal in Gnome (Ubuntu 17.10)
View default-terminal-in-ubuntu-gnome.md

I'm running Ubuntu 17.10.

After I installed Terminator, it became the default terminal in Gnome.

I would like to switch back to the default terminal.

First, I checked:

gsettings get org.gnome.desktop.default-applications.terminal exec
You can’t perform that action at this time.