Today for a contract, I worked on a redirect that checked to see if user had a profile or was authenticated. Simple enough, but you may not know how to do it in Django!
Here’s how:
def profile_required(): def decorator(view): @wraps(view) def _wrapped_view(request, *args, **kwargs): if not request.user.is_authenticated: return HttpResponseRedirect(reverse("login")) if not request.user.profile or not request.user.profile.organization: return HttpResponseRedirect(reverse("no-organization")) return view(request, *args, **kwargs) return _wrapped_view return decorator All via a standard decorator!
I’m going to start a new series, called today-i-did. and what it is is a collection of the things I did and learned that day. I want to spread any knowledge, and let loose while writing and building that writing muscle.
An eventful day it was today, having to implement some new features for an MCP server, while also balancing side-hustle work and CTO burdens. It all started with some Nest.
This is a busy week for me, not taking into account anything from my personal life. Work has just exploded over the last year with all these different projects that I am leading or have a major hand in in some way. It’s a great problem to have, but it’s still a problem, and leaves not a lot of mental energy left for any kind of exploration and learning on my own time.
In a sense, writing is nice because of the act of creation. Creating something again. Creating something from nothing. It feels like we can’t create anymore and the act of creation is for nought. I agree with something that I just read on George Hotz' blog. Technology isn’t about creation anymore, it’s about status and dollars. I find myself getting caught up in it.
Some of these tools though have removed my ability to think.
Maybe AI tools are the greatest thing to hit programming since sliced bread, and maybe they do drastically change the game. Here’s one unintended consequence though: burnout. Not being able to ever take a break from the hard problems, and instead constantly being focused on solving them. You are stuck working as a programmer on problem after problem without any cognitive respite despite working your butt off. It is great for automating the nitty gritty.
Why did I decide to go to grad school? I don’t know. It’s a decision that feels like it’s been forever in the making. I have had an interest in hardware since my undergraduate days. I’ve read online plenty lately that most developers think all there is to this field is web development. Most developers that I know locally this is definitely the case. SaaS culture and other startuppy concerns dominate the day and the programming that I first heard about was a niche pursuit and discipline.
Talking with friends about startup ideas In our community Tridev, we often find ourselves wishing we had certain software, or wistfully thinking about products that we could build. I wanted something that could tweet for me! I wanted a bot that could tweet about updates to my ongoing work that I was doing in code. Why? Because everyone talks about building a brand and how important that is. Complaining with other developers in my area helped me to realize just how much of a pain building a brand actually is.
Linear Regression Attempting to fit a function (a straight line) to a dataset to observe a linear relationship. Then used to predict further values given the line that we’ve fit.
Validation Machine Learning engineers will use train-test splits, which means that they will split up the data into a train and a test set. Statisticians will use metrics, prediction intervals and correlations.kjA
Unsupervised learning Regression is supervised (requires examples to calculate the line), but unsupervised learning is all about anomaly detection and clustering.
Eigendecomposition Break up a matrix into it’s basic components. A lot like factoring a number. Used in machine learning and principal component analysis.
Two values, the eigenvalues and the eigenvector. This only works on square matrices.A
Eigenvalue equation Because this only works on square matrices, if we have a square matrix A, then it has the following equation for the eigenvalues.
A * v = lambda * v v is the eigenvector, and lambda is the eigenvalues.
Yes, it’s true that I spend my days as an AI researcher at my current full-time job, but I’ve found myself behind in terms of hard AI skills. These skills I used to have from my college days, but since then I’ve grown rusty on a lot of the math. Lots of workers out there are looking to improve their AI skills in this AI-driven age, and you count me among them.