<![CDATA[Dylan's Dev Blog]]>https://blog.dylanlu.com/https://blog.dylanlu.com/favicon.pngDylan's Dev Bloghttps://blog.dylanlu.com/Ghost 5.85Thu, 16 Jan 2025 08:16:11 GMT60<![CDATA[SBHacks 2025: We Won Something!]]>https://blog.dylanlu.com/sbhacks-2025/6788b3facbf46159506ddec1Thu, 16 Jan 2025 08:12:57 GMT

SBHacks11 happened during the first week of winter quarter. So far, my 24 units has actually been really fun; it's a lot of work but it's also interesting, and I have a lot of time to spend in the library. My team for SBHacks was a guy I met from Mountain View, my friend from high school, and one of his friends. We decided early on that we'd make something related to badminton and AI, since our friend from Mountain View was actually a top 20 ranked player nationally!

TL;DR

We won 1st place in the entertainment track and you can see the results here.

GitHub - lce4113/baddy-buddy
Contribute to lce4113/baddy-buddy development by creating an account on GitHub.
SBHacks 2025: We Won Something!

Before the Hackathon

Our planning phase was actually pretty tragic. We couldn't find any working models for badminton and we didn't have the compute necessary to train our own. We even considered switching the idea entirely to ping pong (but that would feel like cheating because I did that project last quarter).

Luckily, we kept with the project. I think the one big thing going for it was the name—Baddy Buddy.

After a few library sessions and some last minute scrambling over dinner and at the lounge, we were ready (although Ishan decided to stay up all night until 4AM!).

SBHacks 2025: We Won Something!
Brainstorming sesh

Hacking Begins

I honestly don't remember much of the first few hours, but nothing crazy happened anyway. Pretty standard arrangement for a hackathon.

SBHacks 2025: We Won Something!

We spent some time working with a model called "Widely Accepted Sports Baseline (WASB)" or something like that, but 4 hours in and we decided that it didn't fit our use case. That's when I stumbled upon the holy grail and mighty savior of our project:

GitHub - sunwuzhou03/SoloShuttlePose
Contribute to sunwuzhou03/SoloShuttlePose development by creating an account on GitHub.
SBHacks 2025: We Won Something!

It basically gives you pose, court, and player detection all in one (it packages all three models nicely in a easy-to-work-with format).

SBHacks 2025: We Won Something!
Sample Data

The only problem is that it take FOREVER to run inference on our MacBooks. So at this point, we just stuck with cached results for the sample videos so that we didn't need to recompute.

Flask Backend

We mostly left the SoloShuttlePose repo intact (except for some bug fixes thanks to Omar), but we added our own Flask server to handle web requests for uploading and fetching data. This wasn't to hard, but if I remember correctly we ran into a bunch of problems with importing code from different folder structures (like from a submodule, for example), so we just invoked the python scripts on a subprocess. Actually, this is one of the main reasons SoloShuttlePose saved us; it bundled all three models into one project so we didn't need to manage three venvs and have imports all over the place. This is something I want to learn for the future; how to cleanly mix projects together in python.

Side Quests

There were several mini games that we could compete in to win red tickets, which gave us a shot at the lottery for an electric scooter. I totally wanted that, so I participated in several of them, including a company talk, 1 AM push up contest, 3 AM yoga, and probably some more. We also tried doing a Smash Bros tournament but the wait was too long.

SBHacks 2025: We Won Something!
You can tell it's about 4 AM because the McDonald's DoorDash can at 3:30 AM

We... Did it?

After about 18 hours in, we finally had a working prototype! Now, it was time to polish the UI and create a full user demo from start to finish. We spent the rest of the time polishing this part up, as the demo is probably more important than the codebase itself. I also came up with a banger video idea and we filmed that. Unfortunately, the judges didn't even look at it because we had to do live demos. But hey, you can look at it... https://www.youtube.com/watch?v=J8pcAyOfyFE

SBHacks 2025: We Won Something!
Fire video presentation

And then, somehow it was morning again. My body physically felt horrible, but I was excited for the judging to start.

Live Demo

Our first judge was the Dean of Engineering. He loved badminton; not so much our app. We should've told him that Ishan was top 20 in the nation, cuz that would've sparked more conversation with him. He didn't even stick for our gen AI feature. Oh well, lesson learned—we gotta be more efficient.

Next we had Prof. Matni. Super chill guy. He liked the presentation, and we executed well. In class the next day, he even told me that "Baddy Buddy" was a hot topic among the judges. Perhaps we could've won one of the grand prizes if we had gotten a little luckier.

The last two were also better presentations, though the 3rd was for sure our best. The dude was so impressed with the vision model integrating with the gen AI model and asked so many questions, and we gave pretty good answers. Even the SBHack student admin who was with him was super impressed.

Overall, we gave good presentations that were an accurate representation of the work we did in the past 24 hours. Unlike some previous hackathons, we didn't sell.

Prize Time!

I fell asleep during the judging period, but woke up just in time for the award ceremony. I had that same fever dream feeling that I had back at GunnHacks where I felt like the work I did was completely garbage and there was no way I could win anything. My team looked at each other knowing that we would probably not get prizes for our project.

BUT WE WERE WRONG: "And the winner for our entertainment track is Baddy Buddy!"

I was so excited. Even though it wasn't a particularly great prize, just the fact that our expectations were exceeded gave us the rush of happiness. Our hard work was validated.

SBHacks 2025: We Won Something!
Yuh

After the Hackathon

Afterwards, I ate lunch at DLG, did laundry, and passed out on my bed. Then I woke up and got ramen with Mason and Surya. So yeah, pretty good weekend.

A few days later, we were featured in the SBHacks Instagram, and it's their most viewed reel of all time so far. Not sure if anyone knows who we are, but it's still cool to be a little "famous" in the coding community. I even had someone go up to me and be like "oh yeah, I think I saw you guys on Instagram." So that's fun.

https://www.instagram.com/reel/DE0S58vyD0W/

Conclusion

Anyway, after a tough loss at GunnHacks last year, it feels refreshing to win something. Looking forward to winning for real next time, and maybe at an even bigger hackathon...

]]>
<![CDATA[Christmas Break 24-25]]>https://blog.dylanlu.com/christmas-break-24-25/677d7e01defe0e66e8815444Wed, 08 Jan 2025 06:47:39 GMT

Christmas break this year was really fun. I came home early from UCSB on my birthday because I didn't have any finals, so I basically had an extra week and a half of break. The early days of break were mostly spent playing poker and pickleball with my friends. There was one night where we slept over at Cheney's house and I made $170 playing PLO! I was running so hot that day, I think I had the absolute nuts 3 hands in a row at one point. And oh yeah, we played from 10pm-6am that night, which is basically a whole school day. (Another cool poker fact, we got to play in the Stanford dorms one day because one of Colin's friend lives there).

Christmas Break 24-25
My $280 Wagyu and Lobster Birthday Dinner

I also visited Gunn for SEC and to see the basketball team. It was kinda awkward seeing Mr. Paley again because he was about to get on a call, and I didn't really say much when I got there. I had to go to leave for lunch so I didn't really get the chance to see how everything was going. I went out for lunch with Chris and Josh, and it was pretty interesting to see how everything was going for them, and I was especially curious what the culture was like at Cornell. It seems like they're both doing well; I need to get involved with my school a little more.

Singapore and Thailand

The highlight of the break was definitely seeing my little cousins in Singapore. It was so nice there—even the subways had bidets! The airport had an indoor forest with a giant waterfall in the middle, and we even tried out some of the Michelin star restaurants there too. On the first night arriving, we went to the street market that was made famous from the Crazy Rich Asians scene. I thought the food was good and unique, but not particularly special. The next day, we did a duck tour, which is like a boat and land vehicle that goes around Singapore; I got to see all the cool attractions like the Merlion and Apple's spherical Singapore store.

We also hung out in the mall quite a bit for food and shopping. My grandparents bought me some Birkenstocks, so that was really nice!

Once we went to Thailand, I was excited for the chance to relax by the pool/beach. The resort was pretty nice, it had a lazy river that looped around the entire place, and it wasn't too crowded. Nothing like Vidante though, that place was insane. But anyways, it was really nice to escape to this resort. We all got Thai massages where they walk on you. That night, I slept like a baby at 8:30pm.

The next day, we tried Muay Thai, which brought back memories of my Tae Kwon Do days. Kevin seems to have practiced a lot; my uncle wants me to take some classes here at UCSB this quarter.

Unfortunately, the trip was cut short by all the flying. I'd say we only had about 4-5 full days because we had to fly back and forth so much. I wish we had more time because I really liked it there.

We also got to see my uncle's work building. It was on like the 40th floor of some super nice building and we enjoyed eating lunch there with the breathtaking view. I hope to work in a place like that someday.

That's basically it. I remember we also had some really good crabs that were famous in Singapore. The flight back was a few hours shorter so that was also really nice. I timed Oppenheimer on the plane so that the bomb would go off on New Years.

Side Note About Ping Pong Project

Just before break I finished my ping pong project. Instead of keeping track of the score, I decided it would be cooler to recreate the scene in 3D. The process is mostly manual though, so it's not that practical. You can see a demo here:

I don't think I'll continue, but if I do, it's actually really easy to change this into a point tracker, since all you need to know is where the last bounce on the table is to determine who wins.

Next CCS Project

I think I want to create a diffusion model that can help you preview different clothing items on your own body so that online shopping is easier and leads to less returns. This is good for both the buyer and seller, so it's a win-win opportunity! There are companies developing this technology, so I'm not sure if it's best to try creating a packaged product or just a recreation of the model to research purposes. The idea is to have a lightweight extension that would work on any shopping website, thus making the experience much better.

Or I can create a smart glasses app to look at poker and tell you the best move to make.

Conclusion

Overall, I had a great break. Looking forward to what I'm going to create this quarter!

]]>
<![CDATA[Midquarter Slump]]>https://blog.dylanlu.com/midquarter-slump/67299336bd94f9a3688491faTue, 05 Nov 2024 03:56:21 GMT

The excitement of starting college has kind of wore off. Not that I'm depressed or anything, just feel a little bored. Actually I'm like really bored.

Because I joined CCS (which was confirmed earlier last week, yay!), my schedule changed so that I only have 3 classes. And none of them are real bro. Math has all exams online, with no midterms or finals. CCS 1A and 1L are not graded, and everything is self-paced. I have so much free time and I don't know what to do with it. Even my ping pong app is starting to get boring. I don't feel motivated to apply to more internships or research. I have 6 total hours of class a week, and no school on Tuesday, Thursday, and Friday.

Lately, I've been playing video games to get over my boredom, but I feel icky afterward because I know that it's not the best way to spend my time. I just beat Sekiro yesterday; lowkey think that it was a little too easy but whatever.

But worst of all, I met this girl last week and I can't find the confidence to talk to her again. I told Mason my criteria for the perfect girl a few weeks ago, and she literally fits every description. Perhaps I like her for superficial reasons then, but I really can't tell. I saw her maybe about 4 times this week, still haven't talked to her again. I think this is the main reason for my slump. AHHH!!!!

Anyway, I just gotta be more confident and cheerful and all that. So yeah, good luck future me.

Looking Forward

I read that it's good to reflect on all the things I'm grateful for. I'm grateful that my parents were able to visit me last weekend; I had a lot of fun going out to eat and just talking about life back home. I think I've forgotten a lot about my old self.

I'm grateful for the friends I've made so far in college, and also for the mentors at church. I'm playing ping pong with Wesley on Friday, so looking forward to that.

I'm grateful to be in CCS, there are a lot of cool things I'm learning, and I'm excited for next quarter's classes. Speaking of next quarter, I'm doubling my workload; 6 classes and 24 units. A true CCS kid.

SOOOOOOO, I think I'll get better soon. These things happen from time to time.

Edit (two days later):

I just met Jay Freeman, the guy famous for jailbreaking iPhones (I used to love that stuff back in middle school). He gave a talk about some really complicated cryptocurrency and distributed systems stuff, and I feel so much imposter syndrome by being in that room. There were only 4 other people (this was for CCS kids), and I was the only one who wasn't asking lots of questions. But still, it feels cool getting "special" priviledge by getting invited to this talk.

]]>
<![CDATA[Detect Ping Pong Ball With Deep Learning]]>https://blog.dylanlu.com/detect-ping-pong-ball-with-deep-learning/67246ddfbd94f9a3688491b5Fri, 01 Nov 2024 06:19:25 GMT

Earlier I mentioned that the new direction of my project was to create a 3D reconstruction of a ping pong game using pose detection and ball tracking. My first step was to track the ball movement, and it looks like I did it (with decent accuracy)!

YOLO

You Only Look Once (YOLO) is a deep-learning architecture for object detection and tracking. The benefit of using this model over something like Fast R-CNN or other models is that it can run inference very fast (as the name implies, it only looks once).

I actually didn't realize that a whole auto referee system for ping pong was already created several years ago, as described in this paper: https://arxiv.org/pdf/2004.09927. Those guys, however, use a two-step system to detect the ball; I want to do it faster so that we can run the app on a smart phone.

YOLO is currently in V11. The python library makes it really easy to use as well, since I only need to specify my dataset directory and it will take care of the rest.

model = YOLO("yolo11n.pt")
results = model.train(
    data="../dataset/opentt.yaml", 
    project="..", 
    epochs=300, 
    patience=10, 
    batch=-1, 
    imgsz=640
)

The harder part was getting good data, but luckily the authors of the paper I mentioned above made their dataset open source. All I needed was a nice conversation with ChatGPT and we had could pull frames and annotations from the video!

Detect Ping Pong Ball With Deep Learning
There's like 10,000 of these images

You can look at the rest of the code, which I'm pretty proud of. This is actually my first deep learning project where I wrote my own code to train a model (even though I used YOLO).

GitHub - ccs-cs1l-f24/ping-pong-deep-learning
Contribute to ccs-cs1l-f24/ping-pong-deep-learning development by creating an account on GitHub.
Detect Ping Pong Ball With Deep Learning

Results

After 4.5 hours of training on my RTX 3070 Ti, I thought it was all a waste because the loss was really high and it automatically stopped at 46 epochs. Even worse, I tried testing with an image I took a while ago with James and it didn't work! But I figured out it was because the ball in that image was orange when I trained on only white balls.

Detect Ping Pong Ball With Deep Learning
No ball detected 😦

But the confusion matrix seems kind of promising. Looks like it can detect the ball about 80% of the time, which is not bad for my first model.

Detect Ping Pong Ball With Deep Learning
Detect Ping Pong Ball With Deep Learning
Running inference on test image

Conclusion

Yay, I made some good progress. My next step is to input a video and see whether it can consistently track the ball throughout each frame (and how fast). Then, I'll need to track the table and the people. So yeah I'd probably need to retrain my model for another 5 hours with more data 😭

]]>
<![CDATA[Ping Pong iOS App]]>https://blog.dylanlu.com/ping-pong-ios-app/67118912d672646268b957a8Mon, 21 Oct 2024 05:35:15 GMT

For my CCS Computing Lab class, I'm working on an app to automatically track and display ping pong scores on the phone (using computer vision). Right off the bat, however, there are a lot of problems to consider. First off, the ball can be hit at such high speeds that it would be impossible to capture precise movement data at 60fps. Also, you'd have to position the camera to perfectly capture the entire table, which may not necessarily be possible in all scenarios.

My First Prototype

To combat these issues, I decided to track points in a simpler—though less automated—fashion. When a player wins a point, they simply raise their non-dominant hand to indicate that they've won.

Though this approach is much more basic, I think it works better in practice, even if there's a way to track the ball accurately. Considering how many edge cases there are for deciding who wins a rally, it's probably better to let the human decide, rather than hope that the AI will guess correctly; using the hand-raise method ensures that the players always have control over the score, not letting there be any mistakes that they'd have to manually override.

To test my idea, I built a quick prototype using Python and my Macbook webcam. The demo code uses OpenCV and Google's MediaPipe to detect the players and determine whether they've raised their hand or not.

GitHub - ccs-cs1l-f24/ping-pong: Ping pong scoreboard using computer vision
Ping pong scoreboard using computer vision. Contribute to ccs-cs1l-f24/ping-pong development by creating an account on GitHub.
Ping Pong iOS App

After testing it at the downstairs ping pong table, it seems to work pretty well! Now time to build it for iOS.

Ping Pong iOS App
Raising my left hand to indicate I've won

Moving it to iOS

This step was a little harder since I have much less experience with Xcode and Swift, but I actually ended up learning a lot by forcing myself to build it here. When building previous Xcode projects, I had no idea what the MVVM (Model-View-ViewModel) or MVC (Model-ViewController) architectures were, so I got confused when I'd see so many different project formats. This time, however, I decided to learn one and stick with it. SwiftUI is a new framework that Apple recommends and uses the MVVM architecture, so I decided to go with that. It's actually pretty similar to React, where Views are like "dumb" components that render the props they're given, and ViewModels handle the backend logic. For MVC, ViewControllers are supposed to handle the logic and rendering at the same time, which can get messy.

Since SwiftUI is relatively newer and offers less control than UIKit (the previous framework), I spent most of my initial time trying to port Google's example iOS code for MediaPipe to work under SwiftUI. Luckily, the process wasn't that hard, as SwiftUI gives us a UIViewRepresentable class that allows you to run UIKit code in a SwiftUI app.

Once MediaPipe was set up, all I needed to do was write a callback function that processes the pose information, as seen below.

extension ScoreDetectionService: PoseLandmarkerServiceLiveStreamDelegate {
    func poseLandmarkerService(_ poseLandmarkerService: PoseLandmarkerService, didFinishDetection result: ResultBundle?, error: Error?) {
        // This delegate is called by the PoseLandmarkerService delegate, which processes data then gives it to us
        guard let poseLandmarkerResult = result?.poseLandmarkerResults.first as? PoseLandmarkerResult else { return }
        
        for playerLandmarks in poseLandmarkerResult.landmarks {
            // Extract useful pose landmarks
            let noseLandmark = playerLandmarks[0]
            let leftWristLandmark = playerLandmarks[15]
            let leftShoulderLandmark = playerLandmarks[11]
            
            // Check which side of screen
            let isLeftSide = noseLandmark.x < 0.5
            
            // Check if raising hand
            let isRaisingHand = leftWristLandmark.y >= leftShoulderLandmark.y
            
            // Pass it to the corresponding player side hand detection service
            if isLeftSide {
                self.leftSidePlayer.update(isRaisingHand: isRaisingHand)
            }
            else {
                self.rightSidePlayer.update(isRaisingHand: isRaisingHand)
            }
        }
    }
}

This function will detect which side the player is on and whether or not they are raising their hand. We then update the player state to see if they've raised their hand long enough.

class PlayerHandDetectionService {
    var handRaised: Bool = false
    var handRaiseStartTime: Date = Date.distantFuture
    var handRaiseCounted = false
    
    var onPlayerWinsPoint: () -> Void
    
    init(onPlayerWinsPoint: @escaping () -> Void) {
        self.onPlayerWinsPoint = onPlayerWinsPoint
    }
    
    func update(isRaisingHand: Bool) {
        // TODO: If we've been raising our hand long enough, give a point
        
        // Get current time
        let currentTime = Date()
        
        // If raising hand, check if we passed the threshold
        if isRaisingHand {
            // Just started raising our hand
            if !self.handRaised {
                self.handRaised = true
                self.handRaiseStartTime = currentTime
                self.handRaiseCounted = false
            }
            // We've raised our hand long enough, give a point
            else if !self.handRaiseCounted && currentTime.timeIntervalSince(self.handRaiseStartTime) >= DefaultConstants.handRaiseDurationThreshold {
                self.onPlayerWinsPoint()
                self.handRaiseCounted = true
            }
        }
        // Else, reset hand check state
        else {
            self.handRaiseStartTime = Date.distantFuture
            self.handRaised = false
            self.handRaiseCounted = false
        }
    }
}

And the result works pretty well!

Ping Pong iOS App
To lazy to go downstairs but it works!

Next Steps

I actually ended up testing the app and it seems to work fine. The only problem is that no one wants to raise their hand, either because it's awkward or just annoying.

For my next steps, I have two ideas:

  1. The logical next step is to make the app automatically detect the points (despite the challenges I described earlier). Someone on YouTube kind of got this working, so it's definitely possible.
  2. Perhaps more interesting, I want to build an app that will "transcribe" the game into a full 3D reconstructed live scene, where the player can go back and analyze their form and see where they can improve. I'll do this by detecting where in space each item is at every frame, then rendering that into a 3D scene with something like Three.js or Unity. I was thinking of using low poly models to make everything look more cohesive.

For my second idea, I also want to try implementing a deep learning model that will test your form against professional players' forms that hit the ball in a similar situation; thus you can see how to improve. To go even further, an LLM could teach you specific steps/advice to achieve better form.

Overall, I think my next steps will be way harder and more ambitious, but hey, that sounds more fun anyway.

Ping Pong iOS App
Inspiration - https://www.youtube.com/watch?v=WS9ST9A6XEM

]]>
<![CDATA[The Paradox of Choice]]>https://blog.dylanlu.com/the-paradox-of-choice/66e783870faaf456ecc528dfTue, 08 Oct 2024 21:24:55 GMT

More choice is paradoxically worse for us, mostly because we will hesitate and feel less satisfied with the end result. Moreover, you're less likely to even make a choice when you have too many options.

Key Ideas

  • Maximizers vs Satisfiers: satisfying does not mean having low standards; it's like a DFS algorithm that stops once it finds something that matches its criteria
The alternative to maximizing is to be a satisficer. To satisfice is to settle for something that is good enough and not worry about the possibility that there might be something better.
  • With more options, you're more likely to regret not picking the other choice
  • Second-guessing choices undermine the value of what you picked
  • Constant decision-making drains mental energy; reducing choices helps conserve willpower.

Applications

  • Set up ground rules so that later decisions will be a no-brainer. For example, you can decide never to do more than 5 shots of alcohol 😭
  • Limit your choices to prevent decision paralysis
  • Automate decisions. For example, schedule out your meals for the week
  • Make final purchases (that satisfy your requirements). Don't try looking for things you can return

Quotes

Learning to choose is hard. Learning to choose well is harder. And learning to choose well in a world of unlimited possibilities is harder still, perhaps too hard.

Conclusion

This book shifts your perspective on decision-making, which you'll do a lot every day. I probably subconsciously use these lessons a lot, so I highly recommend it. My friend Mason also recommended the book How to Not Die Alone, which feels like a wrapper for this book but in the context of dating (not entirely sure though, since I'm only on the first chapter).

]]>
<![CDATA[Made to Stick]]>https://blog.dylanlu.com/made-to-stick/6542f13995dd5467248acc0eTue, 08 Oct 2024 21:04:41 GMT

We often hear boring stories, and then forget about them. This book is about how to make them stick, just like proverbs and urban legends.

Side Note: I read this book about 10 months ago, and I've been backlogged on my book summaries. I'm just going to share this draft that I wrote back then.

The Curse of Knowledge

We are cursed with knowledge, and therefore cannot remember what it is like to not know something. This makes it particularly difficult for experts to share with non-experts. Imagine I'm tapping a song on the table, do you think you'd know what it is? To me, the song is obvious, but that's only because I can hear it in my head.

SUCCESs Framework

Simple

  • Simple does not mean dumbed down: it's the Commander's Intent, the one most important thing. You can't have 5 most important things. Pick the "core" and go with it
  • "Don't bury the lead". Start with your most important thing first, then pyramid down

Unexpected

  • Gets their attention
  • Create gaps to keep interest in the plot
  • Fill gaps at the end for satisfaction

Concrete

  • Easier for non-experts to understand, since we are using tangible examples rather than abstract ideas
  • More memorable and it's easy to do

Credible

  • Anti-authorities, like a smoker, can send a powerful message to make you want to avoid something
  • Adding lots of provable details leads to internal credibility; they can just "try it for themselves"
  • Humanized stats are not plain numbers. Imagine a pebble is a nuke that can destroy a city, and I throw it in a metal tin. BOOM! Now I pour a bucket full of pebbles into the can, that's why we need to focus on nuclear safety.

Emotional

  • People are greedy. Tell them what's in it for them, not how impressively engineered your product is
  • One person > many. Sponsoring a single kid in Africa who loves playing soccer and likes piano is easier than donating to "kids in Africa"
  • Appeal to their identity, or their ideal identity. A Texan might throw trash on the floor, but when you associate that with the slogan "don't mess with Texas," they might change their mind.

Story

  • They inspire people to take action
  • They are often concrete, unexpected, and emotional

Other Advice

  • Look for sticky ideas, you don't need to be the one to create them (just like the fat subway guy story)
  • Anyone can come up with brilliant ideas, not just people like JFK. The examples in the book were predominantly normal people

Conclusion (10/8/24)

I actually tried applying some of these lessons to my college application, perhaps a little too forcefully. My Common App, for example, started out with me rapping at a hackathon—something that is generally unexpected. Maybe my applications were cooked from the start; cs and ce are both highly competitive fields, and I wasn't on par with applicants who won national competitions. Doesn't matter now; I'm enjoying UCSB so far.

]]>
<![CDATA[Starting College]]>https://blog.dylanlu.com/starting-college/66f8483bb6201e5a30fea19cMon, 07 Oct 2024 04:19:51 GMT

I've just finished my first two weeks of college, and I'm really enjoying it here. The transition was really easy since I did a 6-week summer program beforehand, so I already had friends coming into school. So far, classes are super chill and I've been attending as many club meetings as possible. I've also done many things that I never would have expected before (more on this later).

Anyway, let's start at the beginning.

Freshman Summer Start Program

Since this would be my first college experience, I was pretty nervous: there were so many new faces and I didn't have anyone I knew to hang out with. To make things worse, the building was really old (musty bathrooms, etc), so I had a bad feeling about how everything would turn out. I missed having my own private room and clean bathroom.

I really did not know what to do on that first night there, and I was kinda too scared to go out and say hi to people. So instead, I just played Sekiro on my M1 Macbook Pro. Probably not the best first impression when my roommate walked in for the first time. And not to glaze or anything, but he was a pretty intimidating guy: 6'2, built, and with a really deep voice (emphasis on the deep voice, I mean like holy shit, I was trying to match my voice so I didn't sound like a little kid). Of course in hindsight, he's a cool dude, and it's kinda funny how scared I was in that moment when I first met him. Overall, my roommate was considerate of my space and was very clean; we got along well I think.

Starting College
Very small room

New Friends, Classes, and Fun Activities

The first few days were just for socializing and meeting new people. I think I made most of my friends by randomly sitting with them in the dining hall, or just complaining about the showers while passing by in the bathroom. To this day, I still hang out with those same people I met.

Starting College
The FSSP squad

By the time classes started, I had a system for brushing my teeth and showering (which seems simple enough until you realize that the showers had no benches to put your stuff on). I ended up adopting the "towel strat," where you would walk to the showers with only a towel on. It was awkward at first, but then again, what have I been training in the gym my whole life for!

The classes were pretty easy—Writing 2 was self-graded and my Greek Myth TA gave everyone A's on their paper—but I still spent a lot of time in the library. There's something kind of satisfying just grinding out homework while overlooking the ocean. I was studious for the first week or so, but then I started getting into Game of Thrones, and that took up most of my time instead.

Apart from class and the library, I'd usually spend my time playing ping pong in the lounge (I was known as the best player in the building) or going to the gym. I actually got noticeably stronger in recent months, and I've gotten some compliments about that from my friends.

Also, of course, I started surfing! My friend who was originally from Santa Cruz took us all out and taught us how to surf. I didn't stand that day, but I guess it led the path to many other fun surfing days. We went probably every week, especially since the beach was a 5-minute walk from our dorm and because we had unlimited access to boards and wetsuits.

Starting College
First surf at Campus Point Beach

Party School?

Once I found my place with my group of friends, we started going out every so often (they went out way more than me; I was trying to be a little more locked in). In Isla Vista, there are parties literally every day of the week. I remember going to one random frat house on a Thursday night (and keep in mind, this is the summer school) yet it was still packed with people.

Anyway, like I said in the introduction, I did something that I never thought I'd do (perhaps regrettably). Actually, I think it was a bad idea. 5 shots was a little too many. I'm not going to say it here but you (AKA future me) definitely know. Fuey and James were surprised as well.

Starting College
Red eyes is my roommate, and uh...
Starting College
5 shots and Louis' tank top!

Beach

We hit the beach a lot. Here are some cool photos.

One Week Back Home

Despite all the fun I had at FSSP, I actually looked forward to going back home. I missed my family and my friends, and I missed having good food. The first meal I ate when I got back was O2 Valley: BBQ pork over rice, popcorn chicken, and boba. The classic combo!

I spent as much time as I could with my parents, but they also had to go to work. My day-to-day life was basically the same as before FSSP.

Berkeley

I also had the chance to visit James and Cheney at Berkeley. Hayden and I took an Uber there (the train didn't work) and I slept over for two nights. We had a lot of fun trying new food, exploring the campus, and best of all, playing 7 hours of poker. I lost money, but oh well.

Starting College

Shopping

When I got back on Monday, I met up with Josh, Max, and Mihlaan and went to Valley Fair mall. I bought a really nice black hoodie (which is my favorite one now), a pair of loose jeans, and some Uniqlo oversized shirts. My friends say that baggy is the way to go; my parents don't like it, I'm not sure what I think. We also got miso soup to end the trip. The next day, they all left for college.

Starting College

UCSB - For real this time

Wow, I actually can't believe that I've started college. I've been thinking about it for almost all my life. It's totally different than what I'd imagined (and perhaps, where I'd imagined), but I'm actually really happy with my stage in life right now.

First, let me show you my room.

I lowkey might be taking up most of the room, but my roommates are super chill (thank god). I've spent a few hours gaming in the first week, but I've stopped for the most part.

Last Good Meal With Parents

The night they dropped me off, my parents treated me to a nice meal. I got lobster and clam chowder. We also took a walk by the pier at night and stumbled upon the place where I had ice cream for the first time ever. Perhaps it was meant to be.

Zero Week and Clubs

I met a lot of new people during zero week, and there were plenty of engineering events that I attended. Overall, this week was purely for making new friends and exploring what the university has to offer (a once-in-a-lifetime moment, just as Mr. Hahn predicted!). I should've talked to more girls, but whatever; maybe after I get a perm and complete my ABB transformation I'll do that.

There were plenty of clubs that I was interested in: ACM, IEEE, Gaucho Racing, Game Dev Club, and UCSB Rocket Club. I only ended up joining ACM and IEEE though, since time is rough. I also checked out other events like the boba social from the Asian Engineering Club.

Church is Really Good?

Church has surprisingly been the highlight of many of my days. I first got started at A2F during the summer and met some of the mentors there—all of them are amazing and really cool people. In particular, Joseph is a CS major from UCSB working remotely as a software engineer. We play basketball together and more recently, I've been going with Surya to his house for Courses 101: delicious food and exploring hard questions about Christianity. His mom also taught Physics at Gunn; what a small world! There's another mentor named Dylan. He's a CE major who also works in the area, and he's really good at surfing. He brought his boards (he has six) the day after I moved in and took me surfing at Campus Point, which I thought was really nice of him. Derek is a software engineer from Berkeley who is also really cool. Eric is a 4th year CCS Physics major who is good at basketball and is probably going to grad school for CS (he said his research lab is looking for undergrads...). Cyril went to my high school! He did CS and is working in Santa Barbara; he knows Fuey's sister and Ethan Kitch's older brother. And finally, we have the pastor, John. Man, this guy is insane. He graduated EECS from Berkeley and went into software engineering, decided he didn't like it, took the LSAT and scored 99th percentile, decided that wasn't right either, scored 99th percentile on MCAT, then realized his true calling was to be a pastor. Wow. This guy is my inspiration for life.

Funnily enough, church has actually been the best networking "club." But of course, I've gotten much more than that from it. I'm still trying to explore my own faith, and I find myself in the same shoes as many of the mentors who used to be just like me. As the year goes on, I hope to learn more about God and figure out who I'm supposed to be.

Today, Surya (a non-Christian, but has been going for 2 weeks) and I took Mason to church. I was surprised to say that he really enjoyed it and even encouraged Beto to come. He doesn't believe in the God aspect of church, but he really relates to lessons about morality and purpose that we discussed this morning. Actually, off-topic, I think at church I saw Rori, someone from my middle school who I haven't seen in years. I wonder who else from Palo Alto goes here.

A New Major?

Finally, let's talk about about something that is HUGE for my college career. Last week, I got an email saying that I got into the College of Creative Studies! Now, though the name sounds a little lame, this is a really great opportunity. If you didn't read my blog post ("Last Week of School") where I stressed out about applying for it, CCS is basically a "graduate" school for undergraduates. Basically, the idea is to accelerate lower div CS classes to push you straight into upper div as soon as possible. By Spring, I'll be taking upper div CS courses.

Not only is the program accelerated, but there are other perks. Best of all, perhaps, is that being in CCS greatly increases chances of getting research, because the professors know that we're the real deal. The class size is also really small, so you can make a close connection with your peers and with your professors (this year is only 5 people in CCS Computing, though generally there are about 15 per year). Some of my classmates are quite strange, but I think it'll be fine. My friend Ezra from Gunn is also one of the 5 in this program.

My offer into this major is actually contingent on my performance in the first class. Professor Richert Wang told me that if I'm not done with the CS 24 labs by the end of week 5, I could be in some trouble. It's been 4 days since he told me that; I finished all of it. Looking forward to finishing CS 32 this week!

For my CCS Lab, I'm working on an AI ping-pong scoreboard app that can automatically track points. My first approach is to detect when a player raises their hands to indicate that they've won the rally. Soon, I could look into actual automation, but I think the hand-raise approach works better in practice.

Starting College

I've also started applying to research and internships, now that I have the CCS badge under my name. Wish me luck!

Future

Idk man. I've been writing this post for over an hour now. I hope there are good things to come. I want to make new friends, eventually talk to girls, and continue to grow as the best version of myself.

]]>
<![CDATA[The Summer Before College]]>I had some stuff about my Portugal trip written a few weeks ago that I never got around to finishing. So I guess I'll try summarizing my entire summer in this one blog post.

Senior Grad Trip - Portugal

My friends and I just got back from our

]]>
https://blog.dylanlu.com/portugal-and-summer-plans/667493e055d34f46005d4731Wed, 17 Jul 2024 22:52:10 GMT

I had some stuff about my Portugal trip written a few weeks ago that I never got around to finishing. So I guess I'll try summarizing my entire summer in this one blog post.

Senior Grad Trip - Portugal

My friends and I just got back from our senior trip in Portugal a few weeks ago. I loved it. The food was really good, the mountains and beaches were really pretty, and people were very friendly. The only downside is that the last two Airbnb's smelled really bad (especially in the bathroom), and there were lots of drug dealers out on the streets at night time (although it was interesting to see people try selling cocaine to us).

Lisbon

We spent the first five days in Lisbon, where we explored the city, tried all sorts of new food, and looked at some castles. The Airbnb was really nice, though it was located more on the outside of the city, where all the business buildings were. We were really tired the first night, so we just walked to the nearest restaurant, which served burgers that looked and tasted like cat food. Not fun.

We spent our first real day trying out different foods in the city. The bifanas and the pastel de natas were really good, so we made sure to get more when we visited other places. We also tried margaritas for the first time!

We'd usually get back around 10-11 pm, just in time for some late-night poker. In the first few games, I profited about $110, though that number slowly dwindled down to somewhere around $60 by the end of the trip. I don't think the alcohol helped...

The Summer Before College
I made $100 that day...

Oh and we also saw a soccer game, although it was just a friendly match and Ronaldo didn't play (he played literally two days after, what the heck man!). That was pretty fun, but everyone around us was smoking so I guess not that fun.

On the last night before we left Lisbon, we also hit the casino. We came in with about $25 each and lost it all in a matter of 20 seconds—three hands of blackjack. It took us longer to walk from the entrance to the table than to actually play the game. I guess that's why no one looked happy there (although we saw one woman cash out $10,000).

Sintra

This was probably the most beautiful place I've ever seen. We started by seeing the castle and a famous well. It was cool, but it wasn't anything spectacular in my opinion. What really stood out was the hike we did right after. Since it was starting to rain a little, all the other tourists left, meaning the mountain was all to ourselves. And on top of that, there was mist everywhere around us (it looked so cool).

I also bought a souvenir shirt here. Turns out, when I went to buy my parents a gift on the last night of the trip, I accidentally bought the exact same shirt without realizing. I don't know how that happened.

Lagos/Luz

Even though Lisbon and Sintra were really pretty, I think the highlight of the trip was Lagos. It's a small beach town with lots of really good food. My personal favorite was the restaurant where I got sushi as an appetizer and steak for my main course. The entire atmosphere of the place was kinda cool too, with menu items like "Vegan bitch" and other interesting names.

But the food wasn't the best part, it was the beach! We did a boat tour, went on Kayaks, and chilled by the ocean, sipping our Piña Coladas. We even started a Jetski rental an hour before our bus back to Lisbon.

Overall Thoughts

Even though I really wanted to go to Japan, I think this trip exceeded my expectations. We made some really awesome memories here and I think everyone would want to come back if we had the chance.

The Rest of My Summer

After getting home and settling in, I spent some time preparing for college. I met with Al a few times at the Mitchell Park Library to talk about UCSB and photonics stuff. The first meeting was mostly about his "Start UC" program that he wants to start with me, but I told him that I wanted to wait until I settled into college before taking on this big project. In our second meeting, he was super eager to teach me about photonics, a topic which I told him I was interested in (because of its applications in Artificial Intelligence). I learned about phonons, photons, conduction bands, indirect/direct gaps, P-N junction, and so much more in that one hour. To be honest, I don't understand everything, but it still is super interesting.

Elden Ring DLC: Shadow of the Erdtree

I've been waiting for months and I finally got the chance to play. I had so much fun, but I might've spent a little too much time stuck in my room. I beat the DLC in about 40 hours, which was over the course of 12-ish days. There's so much lore to uncover it's actually unbelievable. And the final boss was incredibly satisfying to beat.

The Summer Before College
It's beautiful

Getting a "Job"

My mom wanted me to get a job this summer so that I could "learn the value of money" and all that fun stuff. So I signed up to be a DoorDasher, got in my car, and waited... and waited... and kept waiting for two hours and still got no orders. What a total waste of time! I tried three more days before giving up on it completely.

Instead, my parents were willing to hire me instead. I did some basic housework like gardening, installing a new sprinkler control panel, and other cleaning tasks. I made $15 an hour, so not the best, but also not horrible either.

My mom started talking to church friends about my search for work, and that led to more side job opportunities. I started by cleaning Mrs. Angela's shed and made $60 for 2.5 hours. I think it looks really clean!

The Summer Before College
It used to be completely filled with spiderwebs

Then, I started a little basketball clinic for June and Johann's kids. I think they really enjoyed it. We did basic dribbling drills, shooting, and some fun games like dribble knockout. Kevin and Evelyn joined for a few sessions two and had fun.

I made about $90 for 5 hours, but it was also nice talking to June and Johann about college/career/life stuff afterward. They recommended I take some stats classes and learn the technologies that engineers actually use in industry, rather than just the theory. I think I'm going to take that into account when I pick courses in two days. On the final day, the kids and the parents wrote me thank you notes, with June and Johann strongly suggesting that I join a Christian group in college.

Kevin and Evelyn

My little cousins are back! It was super fun hanging out with them this past week and a half. Kevin is getting alarmingly tall (99.7th percentile), but I still have some time before he surpasses me. The week went by really quickly, but we spent time playing late-night board games, Smash Bros, JCC basketball, and watching Brooklyn 99. We also went to the Hillsdale Mall to shop (Kevin bought a Harry Potter game), and we went again later that week to do an escape room. I think everyone had a really great time.

But today will be the last time we'll see them for a few months. They're moving out to Singapore for a year, but they should move back to Palo Alto after that. Evelyn will be going to Gunn! That's crazy!

Looking Forward

My UCSB orientation is tomorrow so I'll be exploring what they have to offer and picking my dorms and courses. I really hope I get good roommates since it'll be random. Hopefully a double as well.

I still don't really know what electives to take since all the interesting courses aren't offered every quarter and they have so many prerequisites.

Anyway, I guess this is my last real day of summer. By the time we get back home, I'm going straight to UCSB for summer school.

]]>
<![CDATA[Last Week of School]]>https://blog.dylanlu.com/last-week-of-school/6647027977651a456c881c4cTue, 28 May 2024 07:11:52 GMT

So I thought I'd give a quick update on things since I haven't posted in like a month.

I've been really enjoying the last few weeks of school. There's basically no work to do and my grades are locked in already, so there's really nothing that's hard. I finally stopped making that stupid sandwhich that I always each for lunch (everyday Sophomore year) and now I go out to each during 2nd period photo or skipping a few classes.

In terms of coding projects, there's not much activity there to be honest. I'm still learning more about AI, and it'll be a while before I can make some real projects (I'd rather make something technically complex than another boring app). For my Calc final, I made a script to record chords and decompose it into the individual notes using Fourrier Transform. This concept is pretty cool and has a lot of applications; I saw it at Atmosic but I was never really sure what it did (or what frequency domain meant). My CS Capstone final is likely a quick script to turn a song into an image, and have a script to play a song from an image.

College Stuff

I finally had all my recommendation letters and videos sent to UCSB CCS Computing, which is the "graduate" CS school for undergrads. It gives you a much more personalized experience and focuses on performing research alongside regular coursework. It's pretty competitive; people have given up Stanford and Berkeley to get into this, even though I never heard of this before.

Fuey recenlty got off the waitlist for UCSB and I've been trying my best to convince him to come. I don't understand the thought-process of going with UIUC—to me, it just seems like a worse school at a worse location, but I guess it has the specific major that he wants to do.

Last Week of School
It's like a beach resort...

Prom and Ditch Day

Prom was pretty fun. I went with my usual group of friends and we took some pictures at Bol Park. After-party was fun too.

Ditch day was awesome. We went to Poplar Beach and walked like 15 minutes down the coast into an isolated part of the beach (where no one else would find us). There were probably a little under a hundred seniors there sleeping over in tents. Some people started a bonfire and there were games like volleyball and spikeball.

I think everyone was probably drunk or high, but that made it really easy to socialize and just talk to people I don't normally talk to. Hayden threw up in the tent, which made me really paranoid the whole night. Luckily, the tent didn't smell and nothing else happened.

I think in the middle of the night, some Paly kids were on top of the cliff throwing eggs at all of us. A few hit the tent and a few got on my jacket, but I don't think anyone was in the right headspace to care at all.

Some of us were in the "bijillionth dimension," while others were only in the 5th dimension lol. It was pretty funny listening to people talk.

A few days later, a news article appears online: "Gunn High School trashes Poplar Beach". Uh oh.

Basically, it was resolved with a really nice "sorry" letter and some volunteer effort by our Seniors to clean up all the trash and more.

Senior Assassin

I can't believe I was betrayed. For the last 10 or so people in Senior Assassin, we used Life360 to track each other's locations. I saw that Fuey was right outside of Ella's house (to get Mihlaan, who was there too), and so I asked if I could wait with him. We waited and did some driving, and he tells me that there's a faster way: Shree can get us into the house since he's good friends with them. Turns out, Fuey knew that Shree had me, but still it was the only way he could get in. So I guessed he sacrificed me so that he could get his target. Wow.

A week or so later, we're hanging out at the Y, and we decide to go for his other target, Julia. We wait outside her house for a while, but then we see her parked outside of Safeway. Easy kill, we think. When we got there, the windows were open, and Julia looks at us as if she was waiting for us to come. Then, out of nowhere, McKayla pops out of the back seat and shoots Fuey as he approaches. We totally got outplayed there. I guess we were too obviously waiting outside her house, so she decided to lure us out and kill Fuey.

Anyways, Fuey complained that McKayla didn't have her location on, so the kill got reversed. He survived this round, and eventually, ended up winning the entire thing. He made $400.

Upcoming Stuff

Wow, my last day of school was last week. I literally can't believe it; I really enjoyed PAUSD. The graduation ceremony is in a few days, and after that, my friends and I are headed straight to Portugal. No plans for the trip yet, but we have all of our housing and transportation booked. Other than that, I signed up to be a DoorDash driver (my parents wanted me to get a job and this seems the easiest), but I also just sent an application to In-N-Out since they pay way more.

I'm really excited for college. Hopefully I get a double with a great roommate and I can bring my gaming PC. I also want to do some morning runs by the beach, as well as lots of gym days. I think it'll be really fun.

Also, I'm looking forward to all the grad parties. At the one with our close family friends, I got a few really good books. I've already read "Atomic Habits" and "How To Win Friends and Influence People," but I'm looking forward to reading "I Will Teach You To Be Rich" over the summer. Stay posted for some book summaries!

]]>
<![CDATA[The Hard Thing About Hard Things]]>https://blog.dylanlu.com/the-hard-thing-about-hard-things/6542dd3495dd5467248acbe4Tue, 30 Apr 2024 03:57:18 GMT

This is one of my favorite and most relatable books. Not only does he have similar feelings about his high school and company (as a football player and being stressed out all the time), but he also begins each chapter with a rap! This guy is so cool. I wrote about him and his book in my Stanford essays.

To be honest, I read this book 6 months ago and have book slacking off on my book summaries. Also, during my Stanford interview, Yinan asked me specific questions about the book (cuz I told him it inspired me), but I couldn't answer them lol.

Anyway, based on my notes and what I remember, this is what's important.

  • Firing is hard emotionally, but if someone doesn't fit your culture or is not doing what is required/expected, fire them immediately
  • Firing should not be a surprise, but you should take care of them. Leave a good impression for future employees and create good working conditions
  • In layoffs, the CEO should clearly state that it's the company's fault.
  • CEO is a lonely job: no one else has all the information; you can't share the burden by taking the "accepted" answer from other employees because the company will die; no one is born a CEO and must experience failure to succeed later on
  • Take care of your people first, then your shareholders
  • When deciding equity, everyone should be just a little unsatisfied; that's how you know you've done it right
  • Be honest. People see through fake positivity, and it actually makes you look stupid. If you're in trouble, say so
  • Bad news spreads automatically, so there's no point in trying to cover it up. Surprises destroy employee's trust in leadership and hurts morale
  • Take care of HR, because taking care of employees is the only way to create a great company; more important than the product or profit themselves
  • Spend time investing in employee training. It may take a while at first, but in the long run, it's worth it (saving a little time multiplied by 365 days a year)
  • One-on-one meetings are very important, and they should not be forced. Managers should do 85% listening and less talking. If there's a problem, employees need a way to communicate that privately and safely
  • Nobody cares. It doesn't matter if you fail with a great reason; spend all your energy finding the one impossible solution (also in sports psychology speech by Mr. Creighton)
]]>
<![CDATA[Fall In Love With the Problem, Not the Solution]]>https://blog.dylanlu.com/fall-in-love-with-the-problem-not-the-solution/64cb29716272e0524c0f4c1eTue, 30 Apr 2024 03:57:00 GMT

I've given up on writing full-blown summaries. I read this book like a year ago and these notes have just been sitting here.

  • If you're not willing to give up a sport or a hobby, you're not dedicated enough to run a startup. Your investors will not be dedicated enough either
  • Starting with the problem will give you a clear message to tell people and they'll understand it better, rather than "our system does..."
  • If the problem is something daily, you're onto something (we like the "toothbrush model" – twice a day
  • Fail fast. If you aren't willing to fail, you already did
  • The main thing is the main thing; focus all of your energy on your current phase (fundraising, R&D, etc)
  • Find investors that will stick with you through tough times and will support you. Prepare to dance the "hundred noes"
  • Fire fast. "Knowing what you know today, would you hire this person? If not, fire them the next day"
  • Elite teammates will know when someone is out of place. They will leave if you don't fire the bad ones
  • It is okay to fire a cofounder, and sometimes necessary. Don't expect to still be friends though
  • Users don't like change. The early majority need to be convinced to join, and will churn unless they get immediate value
  • You are a one-man sample; don't expect your assumptions to hold true with everyone
  • People who find value will share it with others. Don't expect a user to read anything you provide them
  • If you cannot figure out PMF, you will die
  • Figure out your business model: B2C (prefer don't make them pay upfront, either sell advertising data or go with subscription), B2B, or B2B SaaS (the best, which allows you to get steady annual income)
  • Set the price on the value you create, not on what it costs you to make. If that isn't profitable, change your business model
  • Word of mouth works best for high-frequency apps because people have more opportunities to tell someone else
]]>
<![CDATA[College Decisions]]>https://blog.dylanlu.com/college-decisions/66176ef6d65e55689084b7beThu, 11 Apr 2024 05:47:30 GMT

I'm gonna be completely honest, I'm pretty sad. I see my friends and classmates get into their dream schools like Stanford, Berkeley, MIT, and all that, while I'm here scrolling through Reddit for comments like "it's okay, college rank doesn't actually matter."

I can't say that my results were the worst-case scenario—unlike my friend who got rejected from all 25 CS schools he applied to (except ASU), I have a few solid choices to choose from. But still, it just feels unsatisfying. I've always dreamt of getting into Stanford, opening the decision letter with my parents, and then running across my street screaming "Oh my God!!!"

I guess that'll never happen.

What's Next?

Right now, I think my top two options are UT Austin and UCSB. My dilemma is this: UT's engineering program looks really fun, the buildings are super cool looking, and it has a decent reputation. But at the same time, it's Texas... 90% Texans to be exact. I have no clue whether I'd fit in, and the area just seems to foreign to what I'm used to.

UCSB, on the other hand, seems like a dream school, but it doesn't really have the reputation to make me go "Wow I'm so excited." I know that rankings aren't everything, but it does hurt a little bit thinking about how just 4 months ago, my family totally dismissed that as an option because it's a "party school."

I'm visiting this Saturday and I've emailed an old classmate who does engineering there, so I have some things to look forward to at UCSB, but this decision is just killing me!

Put simply, if I want a more comfortable experience at a smaller engineering program, go to UCSB. If I care about prestige and don't mind being across the country at a big school, go to UT Austin.

Some side things to consider are also that UCSB will let me switch to CS if I want, and I have the option of doing a 5-year master's degree. UT Austin locks me into Cockrell, so no CS classes (other than those provided in the certificate program). Also, no football at UCSB, and the startup scene is probably less vibrant.

In the meantime

But in the meantime, there are still 6 weeks of senior year to enjoy. I definitely did not start a business like planned, but that's lowkey still on the table if I get an idea and put in the effort.

My last adult league basketball game is tomorrow as well, but it was really fun while it lasted. I've made great memories at our post-game dinners and poker sleepovers.

I'm also really interested in AI all of a sudden. I started reading a few books and watching some Stanford AI courses; I'm thinking of starting a small project pretty soon as well. If things go well with my dad's networking, an OpenAI internship would actually be so fire.

Conclusion

I'm gonna be completely honest, I'm really jealous of a lot of people at my school, especially the people who can just apply to Stanford for the hell of it and get in (of course, they've already committed to MIT). I've always thought I was like that, but I guess this is a good shift in perspective. I'll need to work my ass off if I want to get my dream job or pursue grad school; no more letting my pride be an excuse for laziness.

]]>
<![CDATA[Gunn Elimination Recap]]>https://blog.dylanlu.com/gunn-elimination-blog-3/65b89028d0e6474374318b26Thu, 29 Feb 2024 07:09:24 GMT

I've totally been slacking off on my blogging, but let's try to do this before I forget everything.

Elimination ended eight days ago, but it feels much longer than that. I think it's because the kills really started to die down at the end since it's really hard to kill a tryhard. This is the final standings, with Liam Wong winning the game.

Gunn Elimination Recap
Final Standings

Managing the Game

There were a few road bumps here and there, but the game went pretty smoothy overall. Someone even said, and I quote, that it was an "honor to meet the CEO of Elimination." That felt really good.

Forgetting to click save

Somehow, I forgot to click save when I disabled Supabase signups, so over 50 new users signed up on the first day. That was problematic because I was getting reports of people not having targets, and it checked out on the database. This had me panicking, and so I manually set their targets (this is while simultaneously handing out plushies at lunch, and holding my own plushie to be safe).

Luckily, a friend texted about wanting to sign up but not be in the game. That's when I was really surprised because she shouldn't have been able to sign up in the first place, and I realized that it was because I didn't click save (but because of this, I was able to smuggle James into the game without anyone noticing).

Lots of freaking emails

Let's say 2% of the population are little bitches and complain about getting killed without reading the rules (and these Gunn people really love to write elaborate, long essays to defend their stupidity). For the first few days, that's like 14 emails a day, which is totally unmanageable. I sent a message on the first day saying that I would no longer be "reviving" players and that they should read all rules before giving their codes. It got a lot better.

Still, I was getting like 5 emails a day, which is fine but just annoying when I have to make a judgment on each edge case while trying my best to make sure they aren't lying. I gave up on responding to emails about a week.

I hate freshman

Not only did these freshmen have the nerve to find Matchomatics data on my GitHub and call it "hacking," but they also decided to brute-force elimination codes. I really did not think this would be an issue, and I really did not want to implement rate-limiting or some penalty (I'm a very trusting and lazy person I guess). But I guess that kinda backfired.

The freshman who did it actually succeeded after about 6 hours, which not only led to a bunch of frantic emails but also totally increased my server costs. Look at the number of API requests below.

Gunn Elimination Recap
I'm famous guys!

I thought I was running some million-dollar corporation for a second.

I ended up being nice about it, since he emailed me an apology letter explaining how he did it and why. I told him that he could implement rate-limiting for next year's Elimination.

The interviews

Apparently, I'm not a great interviewer. I had very little to say, and when Oracle released their news article I was very scarcely quoted (and I was saying some stupid stuff too). I guess I'll work on that for the future.

Some kid even interviewed me for her English project, but that's like totally a waste of my time bro.

Some Final Elimination Stories

Last year, I'd say my craziest story is when a very dedicated Senior tried to eliminate me. He followed me outside of CS Capstone and tagged me right when I left the N-building stairs; but when I looked up, I still had the roof over me. I then sprinted across to the little theater, weaved through the overhangs to try making it to basketball practice, and asked Sangeet to get my stuff from my car. Luckily, the roof connected all the way to Titan Gym, so I was good for now.

When practice ended, my car was the only one in the parking lot, except for the a suspiciously parked truck next to me. Some guy came out and was like, "yo can you jump my car, I think it died," and I was a little suspicious (but more trusting because my car also died last week too). Suddenly, the guy popped out, I dropped all my stuff, and I bolted back to Bow Gym where there was an overhang. I guess we were in a little stalemate, with him trying to follow me every step I took, and his friends lurking around my car. But somehow, I outmaneuvered him at the last second and sprinted to the car, he might've tagged me in the car, but it didn't matter since the car has a roof too.

He was persistent though, and he got his friends to stand in front and behind my car, preventing me from driving off. We were there for almost 30 minutes, and he was like "yeah I have nothing better to do so we can do this all day." Some of his friends drove over too.

Eventually, I just got tired, and I told him I was letting go of my brakes. And I did. And he moved, but shocked at the idea that I would run him over to escape. When I cleared them, he tried sprinting along side my car, but I accelerated and I was gone.

Someone's little brother

Bro, I'm not gonna write much since I'm getting tired, but if you know I have my plushie in my hand, and you try looking at my from an angle where you can't see it, of course that doesn't count. That's what Nathan's little brother tried doing and it pissed me off. The worse part is that he's a freshman and he felt so entitled, saying shit like "oh you had your fun coding the site, so the other players should be able to have their fun and you're preventing that by not following the rules." Like bro I wrote the rules, and you're literally stupid.

Anyway, later that night I stayed to shoot an hour after practice. When I went out, he popped out behind my car and tagged me, but I was prepared and was holding my plushie. Yay.

A betrayal of sorts

I reshuffled targets at Cheney's house, after our big Paly game win, and my new target was Ethan Zhou. I feel kinda bad, cuz he was trying to help me with the site (even though it was too late), and spent all night making this.

Gunn Elimination Recap
Ethan Zhou's homepage

It looks pretty cool, but it would be too hard to integrate that style for the entire site, and make it work for mobile.

But anyways, I was stupid enough to tell Steve and Chloe that I had him, so they instantly warned him. Steve was too scared to lead me to Ethan during lunch, so we wandered campus for the entire lunch. I didn't find him, until after math, I saw him at the little theater. The theater is it's own island, so there's no wall connecting to the N-building (which is where he had English). Surely, this meant victory.

But he was persistent and just waited there, thinking that he could outlast me.

Gunn Elimination Recap
Waiting patiently to get my kill

After 15 minutes, and after his friend brought out the assignment for him, he dropped his plushie to grab a pencil. I immediately capitalized on the opportunity and got the kill.

A trip to GRT

I definitely shouldn't have made eye contact with Vivian, and definitely should not have been so obvious when trying to tag her. She immediately sat down, so she was safe, and I had to come back later that night to get her during GRT.

After practice, James and I got some Zareens, then went back to Gunn. It's like 9:30 PM at this point, so GRT should be getting out. But someone saw me and snitched, so now the entire GRT is teaming up to try to get Vivian to safety while I'm just waiting for the opportunity to tag her.

I sit while they take their meeting, and it's been like 30 minutes. Some dude spills lychee jelly on my head, then offers me $60 to leave. Of course, I said no because first of all, he's definitely not giving me $60, and secondly, I don't want his money.

Gunn Elimination Recap
GRT Meeting

When it's over, she slides all they way to the back parking lot into her mom's car, and at the last moment when she needs to stand up, five GRT kids shove me. I'm a little embarrassed that these scrawny kids could do that, but I guess I'm as tough as I think I am.

She escaped... or did she? I ran into James' car and we pursued her in a 5-minute car chase, at which point James said that this was going too far and we went home.

I have some funny videos if you (AKA future me) want to look at your camera roll for Feb 9, 2024.

JORTs?

Thanks Fuey.

Gunn Elimination Recap
JORTS

My death

After all the craziness in the last few weeks, the way I died was incredibly anti-climactic. I was talking with some friends outside the brunch line, and... someone tagged me from behind. That's it. That's how it all ended...

Conclusion

Elimination was very fun, and I learned a lot from building the site. In terms of reach, this is a great step in the right direction; I had more users than ever before, and people actually found my site intuitive.

And maybe, just maybe, there might be another chance to win—in our unofficial, water-gun-using Senior Assassin later this semester.

]]>
<![CDATA[Gunn Elimination Blog #2]]>https://blog.dylanlu.com/gunn-elimination-blog-2/65b201ded0e6474374318a93Sat, 27 Jan 2024 21:16:27 GMT

Gunn Elimination starts in 2 days and we have about 650 signups (250 more than last year)! Lately, I've been doing more logistical stuff, like handing out plushies and organizing the rules, but I've also added some new features.

But let's look at the site first.

Final UI Design

Not too different from what I had previously, but I think it looks a little better. Since the game didn't start, a lot of the fields are left blank, so maybe I'll update it later.

Gunn Elimination Blog #2
/app
Gunn Elimination Blog #2
/app/leaderboard
Gunn Elimination Blog #2
/app/rules
Gunn Elimination Blog #2
/app/profile/95030486

Supabase Pro

I didn't want to take any risks since 650 people is a lot to deal with, so I paid for Supabase Pro, which comes with daily backups. Also, it's lowkey a scam since I had to pay an extra $10 to make it look like this.

Gunn Elimination Blog #2
No more "yihigqyfdifpodmnguxr.supabase.co"

But also like it broke for some other people so I may end up not going with the custom domain (so I basically wasted $35!).

Game Messages

I made a new table to make messages since it's important to keep everyone updated. Pretty simple.

Gunn Elimination Blog #2

Calendar and Kill Cutoff

We mostly used last year's rules, but we made the game longer and added some fun rules, like wearing JORTS.

This year, to avoid random people who don't play the game but just hide all week, we decided to implement a kill cutoff. Basically, if you don't have more than 1 kill by the end of the week, you're automatically eliminated. I might do a last-minute removal of this rule if not enough people will be left, but I think it's a cool rule this year.

Gunn Elimination Blog #2
Elimination Calendar 2024

Kill Cutoff Code

Not gonna lie, the code is terrible because I was lazy and used a little ChatGPT. It basically loads all players into a JS array, then filters out people with enough kills to stay alive. Then, we go one by one and delete the remaining people. It literally takes so long to load (like 20 seconds), so I'm worried that something might crash during the game. But hopefully not!

import { error, json } from '@sveltejs/kit';

export const POST = async ({ url, locals: { supabaseAdmin, getSession, getRole }, request }) => {
	const role = await getRole();
	if (role !== 'Admin') {
		throw error(403, { message: 'Unauthorized' });
	}

	const { kill_requirement } = await request.json();

	if (!kill_requirement) throw error(422, 'Invalid kill_requirement');

	// Fetch all players
	const { data: playersData, error: playersError } = await supabaseAdmin
		.from('players')
		.select('*');

	if (!playersData || playersError) throw error(500, 'Error with players table');

	// Filter players with less than one kill
	const playersToUpdate = playersData.filter((player) => player.kill_arr.length < kill_requirement);

	// Update these players
	for (const player of playersToUpdate) {
		const { error: updateError } = await supabaseAdmin
			.from('players')
			.update({ alive: false })
			.eq('id', player.id); // Assuming each player has a unique 'id' field

		if (updateError) {
			throw updateError;
		}
	}

	return json({ message: 'Successfully cutoff players' });
};

/api/game/admin/playercutoff

And while I was testing it out, I had a mini heart attack. I thought I deleted my entire players table (with 500 people at the time). Turns out, I just had a filter when viewing the table.

Gunn Elimination Blog #2
Mini heart attack

More Code Updates

I have a lot of small improvements that I added as well.

Retain Kill Code If Not Logged In

When scanning a QR code, it will open a browser and attempt the kill. But it won't work if you're not logged in. This was bad because then you'd have to log in and then scan the code again.

Basically, if we're not logged in, then we'll redirect to /login?killcode=[kill_code_here]. On the login page, we'll check if there's a code and save it to localstorage.

onMount(() => {
    if (killcode) {
        localStorage.setItem('loginkillcode', killcode);
    }

    loaded = true;
});

Then when we go to the app homepage, we'll check for a killcode in localStorage and try it.

onMount(async () => {
    const loginkillcode = localStorage.getItem('loginkillcode');
    if (loginkillcode) {
        inputKillCode = loginkillcode;
        localStorage.removeItem('loginkillcode');
        await submitCode();
    }
});

Fixing BIG Security Vulnerability

Try finding the issue with this.

import { json, error } from '@sveltejs/kit';

export const POST = async ({ url, locals: { supabaseAdmin, getSession, getRole }, request }) => {

	const { student_id } = await request.json();

	// killedPlayer = the player we're force killing
	// originalPlayer = the player who had this guy as the target

	const { data: killedPlayer } = await supabaseAdmin
		.from('players')
		.select('id')
		.eq('student_id', student_id)
		.single();

	if (!killedPlayer) throw error(500, 'Error fetching player with that student id');

	// Delete the player's entry in the targets table
	const { data: killedPlayerTarget } = await supabaseAdmin
		.from('targets')
		.select('target')
		.eq('id', killedPlayer.id)
		.single();
	if (!killedPlayerTarget) throw error(500, 'Error deleting target');

	// Delete the player's entry in the targets table
	const { error: deleteError } = await supabaseAdmin
		.from('targets')
		.delete()
		.eq('id', killedPlayer.id);
	if (deleteError) throw error(500, 'Error deleting target');

	// Player's target is not alive anymore
	const { error: updateTargetAliveError } = await supabaseAdmin
		.from('players')
		.update({ alive: false })
		.eq('id', killedPlayer.id);
	if (updateTargetAliveError) throw error(500, 'Error updating target alive status');

	// Get the player who had this player
	const { data: originalPlayerTargetData, error: getPlayerError } = await supabaseAdmin
		.from('targets')
		.select('id')
		.eq('target', killedPlayer.id)
		.single();
	if (!originalPlayerTargetData) throw error(500, 'Error fetching the original player target data');

	const { data: originalPlayer } = await supabaseAdmin
		.from('players')
		.select('*')
		.eq('id', originalPlayerTargetData.id)
		.single();
	if (!originalPlayer) throw error(500, 'Error fetching original player');

	const { error: updateError } = await supabaseAdmin
		.from('players')
		.update({ kill_arr: [...originalPlayer.kill_arr, killedPlayer.id] })
		.eq('id', originalPlayer.id);
	if (updateError) throw error(500, 'Error updating player data');

	// Record kill in kill_feed table
	const { error: killFeedError } = await supabaseAdmin
		.from('kill_feed')
		.insert({ player_id: originalPlayer.id, target_id: killedPlayer.id });
	if (killFeedError) throw error(500, 'Error inserting into kill feed');

	// Update player's target to the target's target
	const { error: setNewTargetError } = await supabaseAdmin
		.from('targets')
		.update({ target: killedPlayerTarget.target })
		.eq('id', originalPlayer.id);
	if (setNewTargetError) throw error(500, 'Error setting new target');

	// Redirect to app or return success
	return json({ mesage: 'Successfully force killed player' });
};

/api/game/admin/forcekillplayer

If you're me, then you probably found it. But if you're not, then you have no idea what I'm talking about lol.

If I didn't include this below, then anyone can force-kill players, so long as they know how to do a POST request.

const role = await getRole();
if (role !== 'Admin') {
    throw error(403, { message: 'Unauthorized' });
}

Checking for permission

Obviously that's really bad, so good thing I found it!

Backup Database as CSV

I wrote this before I decided to pay for Supabase Pro, but I think it was a cool thing to learn regardless.

Basically, I had lot's of help from Google and ChatGPT to figure out how to download my table as a CSV file.

import { error } from '@sveltejs/kit';
import JSZip from 'jszip';
import { format } from 'date-fns'; // TODO: make this work with dayjs cuz I don't need two date packages

export const GET = async ({ locals: { supabaseAdmin, getRole } }) => {
	const role = await getRole();
	if (role !== 'Admin') {
		throw error(403, { message: 'Unauthorized' });
	}

	const tables = ['players', 'kill_feed', 'targets'];
	const zip = new JSZip();
	const folderName = format(new Date(), 'yyyy-MM-dd');
	const folder = zip.folder(folderName);

	if (!folder) throw error(500, 'Error creating folder');

	for (const table of tables) {
		const { data, error: tableError } = await supabaseAdmin.from(table).select('*').csv();
		if (tableError) throw error(500, `Error fetching ${table}`);
		folder.file(`${table}.csv`, data);
	}

	const zipBlob = await zip.generateAsync({ type: 'blob' });

	return new Response(zipBlob, {
		status: 200,
		headers: {
			'Content-Disposition': `attachment; filename="${folderName}.zip"`,
			'Content-Type': 'application/zip'
		}
	});
};

/api/game/admin/backuptable

We can then do a get request and download the blobs, or whatever that means.

const exportTables = async () => {
    // Download zip (based on ChatGPT)
    try {
        const response = await fetch($page.url.origin + '/api/game/admin/backuptable');
        if (!response.ok) {
            throw new Error('Network response was not ok');
        }

        const blob = await response.blob();
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = 'tables.zip';
        document.body.appendChild(a);
        a.click();
        window.URL.revokeObjectURL(url);
        document.body.removeChild(a);
    } catch (error) {
        console.error('Error:', error);
    }
};

Function to Download Zip Files

Get Today's Challenge

Do display the current challenge, I just hard coded a function to return the right string given the date. I used ChatGPT to turn my table into a switch statement, cuz that's a lot of manual labor.

// Lol thanks ChatGPT
export function getTodaysChallenge() {
	const currentDate = new Date();
	const day = currentDate.getDate();
	let rule = '';

	switch (day) {
		case 28:
			rule = 'Targets Assigned 10 PM (Sign ups close)';
			break;
		case 29:
			rule = 'GAME STARTS. 12 AM: To stay safe, players must hold the animal with their right hand';
			break;
		case 30:
			rule = 'To stay safe, players must be holding the animal with both hands';
			break;
		case 31:
			rule = 'Targets Change at 10 PM: To stay safe, players must be holding animal BELOW waist';
			break;
		case 1:
			rule = 'To stay safe, players must be holding animal ABOVE their shoulder';
			break;
		case 2:
			rule = 'To stay safe, players must be under a roof or overhang';
			break;
		case 3:
			rule =
				'Targets Change at 10 PM: Players with less than one kill are automatically eliminated';
			break;
		case 4:
		case 11:
		case 16:
		case 19:
			rule = 'On weekends, players must abide by all rules and must carry a plushie to be safe';
			break;
		case 5:
			rule = 'To stay safe, players must be touching a wall';
			break;
		case 6:
			rule = 'To stay safe, players must be wearing a HAT.';
			break;
		case 7:
			rule = 'Targets Change at 10 PM: To stay safe, players must be wearing JORTS (jean shorts).';
			break;
		case 8:
			rule = 'To stay safe, players must be wearing a wig';
			break;
		case 9:
			rule = 'To stay safe, players must be SITTING OR LAYING DOWN ON THE GROUND.';
			break;
		case 10:
			rule =
				'Targets Change at 10 PM: Players with less than two kills are automatically eliminated';
			break;
		case 12:
			rule = 'To eliminate others, players must have at least one shoe off.';
			break;
		case 13:
			rule = 'To eliminate others, players must be carrying a football in one hand.';
			break;
		case 14:
			rule =
				'Targets Change at 10 PM:. To eliminate others, players must give their target a flower immediately after eliminating them.';
			break;
		case 15:
			rule = 'To eliminate others, players must be wearing a tie around their neck.';
			break;
		case 20:
			rule = 'NO ONE IS SAFE. (can be tagged anytime even w/animal)';
			break;
		default:
			rule = 'On weekends, players must abide by all rules and must carry a plushie to be safe';
			break;
	}
	return rule;
}

Conclusion

That's it for now. I might do another post if something big happens. My friend asked to help improve the UI like yesterday, but I told him it was too late and I didn't want to give him the secret keys since something could accidentally go wrong. I'm hoping the game goes well, and that I can at least make top 10.

Also, we are considering doing an unofficial senior assassin, with water guns and no safety zones. That will be way more fun and crazy in my opinion.

]]>