Chris Padilla/Blog
My passion project! Posts spanning music, art, software, books, and more. Equal parts journal, sketchbook, mixtape, dev diary, and commonplace book.
- It's a compiled language. SO there are some errors that are caught at compile time, like undeclared variables.
- Intelisense is strong here. Typing values right out the gate makes that all the easier.
- Self documentation is pretty wicked in Visual Studio. Opening up the Assembly Browser gives you access to ALL the properties and methods for objects and classes that are used in your project.
- Enums! From the TypeScript docs: "Enums are one of the few features TypeScript has which is not a type-level extension of JavaScript."
- Interfaces and Generic Types also are a borrowed C# concept!
- If you need a method that can access the data directly on an instance? Store the method with the instance.
- If need something that converts data from an instance, or is largely utilitarian in function, a static method could be a good option.
- All things are acquirable, including blogs and podcasts
- There are genres of games I grew up playing that have fallen from the limelight into niche-status. Platformers comes to mind.
- Though, Point and Click Adventure Games have hit me really hard lately. LucasArts closed in 2021. Humongous Entertainment, maybe a juvenile example, but one from my childhood, had a short 15 year run before closing due to both hand drawing animation becoming to expensive and their target age range of young kids growing up quicker, wanting to move on to games marketed for older kids.
- On the topic of 2D Animation: Austin Kleon wrote in response to the Oral History of Lilo & Stitch. Kleon writes about how you know it's good when you have to ask "how did this even get made??" and Lilo & Stitch was one of those for Disney. The Florida studio that developed it, though, was closed only a year after, and marked the major shift for Disney away from 2D animation.
- Austin, Texas.
- Man, even the climbing gym I go to was just acquired!
- You may need to
pip install mysqlclient
so that the ORM can pick up your mysql config. - You may also need to download mysql through homebrew.
- Lastly, I think it's helpful to have the MySQL workbench GUI.
- Tolkein's Fellowship of the Ring is going to take me a while, y'all. 🐉 So far so good, though. It's very cozy — lots of words dedicated to eating supper.
- Form & Essence: A Guide to Practicing Truth I took an arts admin class with Matt back at UT. Matt is such an amazing embodiment of the servant leader, and this book feels like I'm getting to take the best bits of his class all over again.
- I have a few words written through the Books tag on my blog. My favorite this month: Software is Measurably Valuable Creation
- My friend Thomas Kurtz gave a beautiful recital in Austin! No sound online yet, but all of his recordings are gorgeous.
- The Black Box by aivi & surasshu. An old favorite. I love the mix of classical and chiptune by the composers of Stephen Universe.
- Lumi by Snail's House. Kawaii Future Bass at it's finest.
- Brasilian Skies by Masayoshi Takanaka. The king of City Pop never disappoints. I admit that Star Wars Samba is a favorite track.
- New Ted Lasso is pretty good! The Apple product placement is strong this season. 📱
- We're trying out a few others - Shrinking and The Big Door Prize. So far so good!
TypeScript is Secretly Just C#
TypeScript is MOSTLY just a way of bringing C# methodology to building applications in JavaScript.
Call me Captain Obvious! They are both Microsoft products.
But I've been learning C# and the similarities have been interesting!
Here are the things that are really nice about working in C# so far:
The only exception might be that C# is a classic object oriented programming language where JavaScript and TypeScript mostly fake that part, being much more dynamic. Arguably, though, some of the tooling already gets you pretty close — component based frameworks, for example.
The "TypeScript is just JavaScript" sentiment has strangely made TypeScript difficult to learn for me. Similar to Node vs ES6 — the fact that they're so similar makes it difficult to remember that your brain needs to work in a different paradigm. It helps when I'm learning about Types in a language that is strongly typed from the get-go.
So I'll say this much: learning C# has been a really fun way to also learn TypeScript.
Static Methods
In class driven languages like, say, C# — a way of storing utility methods is through a Static Method.
Say you're working in JavaScript. A great ol' example of this is the Object.keys()
method.
Objects
is the constructor. keys
the static method.
(technically not a class since JavaScript only mimics classes. More details on that in You Don't Know JS by Kyle Simpson and contributors.)
In JavaScript, you can access the method on the constructor through dot notation. But when creating an object, that object doesn't have a keys method.
const pizzaData = new Object();
Object.keys(pizzaData) // √
pizzaData.keys // X
The benefits?
Largely memory and data size. Not every object needs to recreate the method for each instance. We really only need one source of truth for a utility method like this.
Not all that different from abstracting a handler in React components. Does each input component need to have its own onChange
method instantiated with the component? Or can the same method be passed down from a parent prop.
So a pattern for working with static methods could be:
Transience
I'm thinking lots on the transient nature of things.
Especially in art, software, and entertainment, but y'know, everything is changing all the time.
My recent pieces of evidence:
Maybe it has to do with my age. Large slices in the pie chart of my life have been pretty consistent and sturdy. Same group of friends k-12. Same colleagues in college. Even in teaching music, working with the same folks. It helps that my medium — teaching classical music — was a backwards looking genre. There were discoveries to be made, but they weren't the "ground moving underneath you" kind of discoveries.
Maybe it's the technological era. 300 MB on a CD ROM was a lot back in the day. Software was shipped on floppy disks 25 years ago. Now GitHub can help me write my unit tests.
Lots of feelings to be felt here:
It's cool! New stuff all the time!
Or...
It's a bummer! They don't make it like they used to!
I'm somewhere in the middle. Mostly, I'm becoming more aware of how important creative work is as a response to shifting sands.
In grad school, I read Making Your Life As An Artist by Andrew Simonet. Lots of great practical advice, though the opening of the book has a beautiful explanation of why all art making is important:
With food, there have long ben seed savers and farmers who reject the standardization of our diet. They grow things that don't fit with industrial agriculture. They preserve the seends for plants we may need someday.
This is what artists do culturally. We provide the wide spectrum nutrition that the soul needs and the Entertainment Industry ignores. We save cultural seeds, the DNA of ideas and ways of seeing that we may need tomorrow.
Or in 20 years.
Or 2,000 years.
Sometimes it looks like blogging.
Sometimes it's playing the sax.
The nice thing is it's not just high art that's worth preserving, so is the folk music.
All the same, when making something that comes from a place of authentic curiosity and fascination, it's a way of casting a vote for the staying power of that idea.
You bring your own intersections of the different moving cultural pieces, and we get a double wammy - preserving meaningful culture and creating something new in the process.
Late Easter Sketches
Barre Chord Improv
Been LOVING this new instrument!
Creative Legacy
Doing creative work gets pitched as this "Exertion of the ego" or "One bold director's vision." Iwata himself said "Creativity, after all, is an expression of the ego."
Allow me to be over 30 and bust out the phrase "But, the older I get...":
The older I get, the more I feel inspired by being tied to a lineage. The more it feels ennobling to be a part of a larger legacy of craft, expression, and plane ol' messing around.
It happens anytime I go to an art museum... like this weekend! We're all moved by an artists' ability to draw expressive strokes on a page, paint a bowl, or carve figurines.
Take that in any creative dimension you want. I have a few more:
Every time I sit down to code, I feel my spirit jumping down into the trenches with many folks I admire. Those spirits that developed video games in the 80s and 90s in Japan, or those developers who programmed the websites I visited as a kid. Or my favorite: my dad — who was always tinkering with custom built PC's while I was growing up.
As a musician, well, there are multiple!! I sat with Bach and Yo-yo Ma while learning the first cello suite on bari sax. (An offensive idea to some, I'm sure, but wildly fun for me!) When I play piano, a range of jazz musicians, classical pianists, and composers sit at the bench next to me.
Lately, my favorite is thinking of Walt Stanchfield, who would "spend an inordinate amount of time at the piano" only to go on and sketch tirelessly. A very personal fit for me, who also is spending his days sketching and banging at the keyboard.
On a grander scale, all of that connects us with generations spanning humanity of people who added flare to simple items and decorated their time with song.
Here's W. A. Matheau's essay on originality:
...You realize that what is "original" essentially rearranges the familiar: the same ancient notes and gestures done over again in meaningful new ways. You realize that only the fingerprints are yours, and that this was true for Beethoven and his fingerprints, and Bird and his. You see how everyone is on the same pilgrimage, and how there is no racing on such a road as this. You desire on thing only: To be a conscientious traveler.
Phew! What a relief! No need to be original. Just authentic. Instead, we're all unique intersections of influences.
While that leads to different sensitivities and different eyes for beauty, we're all united in one way or another to our lineages. And we are continuing the conversation for generations by contributing in the first place.
My voice may not be entirely unique. Instead, I think it's more noble to be the vessel through which so many traditions and eyes for beauty in the world continue on. In that way, we all live on.
New Album — Forest 🌳
An adventure into the wooded grove 🌲🍃
Playing with a few sounds from Ocarina of Time and Chrono Trigger!
Purchase on 🤘 Bandcamp and Listen on 🙉 Spotify or any of your favorite streaming services!
How C# Compiles
I'm taking time to dig into a more enterprise level language. For me, it's a good opportunity to learn from technology that was built to scale so that my work in other languages can be informed by that long term scalability.
Here are some concepts that are important to know before diving into the language:
Compiling
Major C family languages C and C++ are also compiled, but they compile directly to machine code. So there's a limit to what machines the programs can be run on — compiling to windows means no linux support.
C# is compiled, but instead of compiling to machine code, it's brought down to IL code (Intermediate Language.) This actually borrows from Java, famous for the tagline "write once, run anywhere!"
The IL code can then be run on any machine with a the Common Language Runtime (CLR) installed. The CLR will take the IL code and compile it to machine code from there. For C#, the CLR is part of the .NET framework, so any apps developed through .NET have this same flexibility of running on multiple platforms.
JavaScript in the browser is actually an interpreted language. The code is given to browser that take the instructions and executes at runtime.1 Node would be a closer comparison since its compiled. It's passed through the V8 engine which compiles Node code to machine code.
Practice or Play
I hear variations on this quote every now and then. Here's Scott Adam's version of it:
"Practice involves putting your consciousness in suspended animation. Practicing is not living."1
A jarring idea for someone who spends time doing what looks like "practice" on first glance. It goes for all domains — software, music, art, writing, or otherwise.
I thought about my time in school and think about how, largely, your time is spent "practicing" for adulthood. Why did that feel different? Why was there nothing but abundance and joy during that time?
One of my favorite essays from Julia Cameron's "The Artist's Way" has an answer:
“It must take so much discipline to be an artist,” we are often told by well-meaning people who are not artists but wish they were. What a temptation. What a seduction. They’re inviting us to preen before an admiring audience, to act out the image that is so heroic and Spartan—and false...
True, our artist may rise at dawn to greet the typewriter or easel in the morning stillness. But this event has more to do with a child’s love of secret adventure than with ironclad discipline. What other people may view as discipline is actually a play date that we make with our artist child: “I’ll meet you at 6:00 A.M. and we’ll goof around with that script, painting, sculpture …”
Largely when we're kids, we're playing. Kids aren't overly concerned about their futures or the results of where their work will get them. It's just for the joy of exploration and taking on an interesting challenge!
Matt also has a great antidote to this in Form & Essence — it's the difference between doing and being. Are you aiming to get tasks done? Reach a certain destination? Or are you simply being a musician, being an engineer, being an artist.
The difference between practicing and living is the posture. Are you overly worried about results and reaching a continually elusive future, or are you playing?
Julia Cameron again:
Remember that art is process. The process is supposed to be fun. For our purposes, “the journey is always the only arrival” may be interpreted to mean that our creative work is actually our creativity itself at play in the field of time. At the heart of this play is the mystery of joy.
Barley and Board
Faber - Ceremony for Peace
The Faber books have a knack for really stately pieces 👑
Sorry for the fake out at the end. 🙂 Best experienced in a loop!
Connecting SQL with Python
A great deal of data flexibility is made available through MongoDB's aggregations.
When it comes to SQL, that same ability to query and combine data is a first-class process by nature of the language itself.
Combine that with a scripting language like python, and the possibilities continue to open up!
Here are the basics to getting started with passing SQL queries in from Python.
Setting Up
A bit of installing needs to be done first:
To setup mysql on the command line after install, you'll want to login with this command:
$ mysql -u root -p
Leaving the password flag blank by default on first login, though this can be changed later.
SQLAlchemy & MySQL Workbench
SQLAlchemy will be the ORM of choice for this post. There are other great options, though I personally chose this because it has first class support in the Pandas method DataFrame.to_sql()
.
The nice thing about using an ORM is you have access to methods that simplify queries down to a single call.
#Equivalent to 'SELECT * FROM schools'
query = db.select([schools])
Sometimes, though, you have to open up the hood and write more intricate queries yourself.
Writing the Script
Ok! The fun part begins!
In an environment variable, set your connection url:
mysql+mysqldb://root:PASSWORD@localhost/DBNAME
Above I've already created a DB, so I'm skipping that step here. You can programmatically do this through Python and the steps looking similar to create_db_connection
below.
We'll pass that url into our create_db_connection
method:
from sqlalchemy import create_engine
from sqlalchemy.sql import text
from sqlalchemy.orm import Session
def create_db_connection(url):
connection = None
try:
connection = create_engine(url)
print("MySQL Database Connection Successful 👍")
except Error as err:
print(f"Error: '{err}'")
return connection
While we're at it, let's write our method for executing a query and reading a result:
def execute_query(connection, query):
try:
with connection.connect() as session:
session.execute(query)
print('Query Successful')
except Error as err:
print(f"Error: '{err}")
def read_query(connection, query):
result = None
try:
with connection.connect() as session:
result = session.execute(query)
return result
except Error as err:
print(f"Error: '{err}'")
If you'd like to pass in values dynamically, you can use the text module. Here's an example form this article:
from sqlalchemy.sql import text
with engine.connect() as con:
data = ( { "id": 1, "title": "The Hobbit", "primary_author": "Tolkien" },
{ "id": 2, "title": "The Silmarillion", "primary_author": "Tolkien" },
)
statement = text("""INSERT INTO book(id, title, primary_author) VALUES(:id, :title, :primary_author)""")
for line in data:
con.execute(statement, **line)
For us, though, a raw string works just as well:
pop_client = """
INSERT INTO client VALUES
(101, 'Starbucks', '123 Cool St., Dallas TX', 'Fast Food'),
(102, 'Cava', '27 Yum Dr., Austin TX', 'Lunch'),
(103, 'Flavor Town', '20 W Good Food Lane, Houston TX', 'Dine In'),
"""
One reason to use MySQL workbench here is that it's WAY easier to debug through their console than to do it within our Python program. So, as you're writing queries, I would recommend giving them a whirl in the GUI first.
After confirming the above insert works in the GUI, you can clear it by truncating the table:
TRUNCATE TABLE client
From here, it's as easy as calling our methods:
connection = create_db_connection(url)
q1 = text("""
SELECT *
FROM client;
""")
execute_query(connection, pop_client)
results_first = read_query(connection, q1)
for row in results_first:
print(row)
Reading and writing, done! From here, the only limits are your SQL savvy and your python chops.
AI as a Synthesis Tool
True artists create in the genre of their time. Sooooo I'm going to write about AI!
Some of the AI demos are pretty impressive!
What I've seen though, mostly, feels like playing those old point-and-click adventure games. You have to keep trying different solutions to a puzzle just to make the game happy. Similar is true with having AI generate content for you.
It's a tool, but it's not quite the "steal your job" kind of automation that's been expected. At least, from a knowledge-work perspective.
Josh Comeau makes a great point at this juncture about tasks v jobs:
My personal belief is that for the most part, working professionals will find ways to integrate this technology into their workflows, increasing their productivity and value. Certain tasks might be delegated to an AI, but not many jobs.
I appreciate that GitHub's AI product is named "Copilot." It seems more fitting and true to the nature of most AI tools. It's not going to do the job for you, but it's a means of getting an idea started or synthesizing information.
Dave and Chris speak to this point on ShopTalk Show (also, my source for Josh's article!) AI seems to be good at synthesizing and expanding on certain points. Generating reports, namely, or summarizing notes.
But, in that sense, blog articles that are only a Google search away can accomplish a similar task.
So maybe that's it. AI is largely a synthesis tool that is only one step removed from the Google "I'm feeling lucky" button of old.
But it still takes a human being to understand context, style, form, and to solve the innumerable problems that take more than a few Google searches.
Does that takeaway from how impressivene or usefull AI is as a tool? I don't think so. AI still unloads the initial effort of sifting through content.
If anything, the fact that AI is not quite a quantum leap in productivity is a testament to how AMAZING our current resources are.
The Haps - April 2023
The sun is coming back out and I am loving it! ☀️
Blogging & Dev
Fun month of blogging! I'm wrapping it up on researching JavaScript testing and am switching over to SQL.
Tailwind redesign is still kicking at work! We got docker up and running, too! 🐳
Meetups are great! I had a blast again at React Dallas! If you're in the area, come on out! It's such a great group of folks. ⚛
You can catch up with my tech projects through the Tech tag on my blog.
Music
I released Whiteout this month! Snuck it in right as it started warming up outside.
On a trip up to UNT, I got to wander around my old stomping grounds at the College of Music. It was so rejuvenating to be up there. I lovingly wax nostalgic on the place as "my own Disney World for Music."
I did a few piano recordings while I was there, too! The Bach Prelude in C is my favorite, such a dreamy piece...
You can see what I've shared so far through the Music tag on my blog. I'm also sharing recordings on Instagram.
Drawing
I finished my second AND third sketch books this month! 📒 Dried out my first fine liner! 🖊 I'm crossing right through those artistic rights of passage.
I'm just about wrapping up Drawabox with lots of studies on animals. I'm currently on the hunt for resources for studying the human figure next.
You can see what I've made so far through the Art tag on my blog. I'm also sharing drawings on Instagram.
Words and Sounds
📚
🎧
📺
Life
Really grateful for some sunshine and warmth! The end of winter is always pretty tough, and this one felt extra long here in Dallas.
It's mostly been heads down for Miranda and I. My favorite nights this month have been the couple where we've put on some music and drawn together.
The best vibe was when we drew camels and snails while listening to Arooj Aftab! 🐌 🐫
👋
Animal Construction
My favorite studies on animal construction! Lots of sturdy looking body with noodley legs! 🍜
All part of the Drawabox module on animals.