More coding adventures


It’s another day and another chance to make progress with data processing. Since it’s been a busy few weeks since hospital-PI has returned to the lab, I haven’t had a ton of time to work on the dataset that we collected, the first of hopefully many. However, the initial analysis is done, so it’s time to move forward and start thinking about what comes next. That is, how can we refine what we’ve done? There’s a lot of steps I can take, but I think today we’ll sum it up and narrow it down to the steps I’m most excited about.
(more…)Race to the deadline


What is it about self-imposed deadlines that feel more important than the ones you hardly have control over? Maybe it’s because I’m competitive or maybe it’s just that I hate failing at something that I set for myself, but whatever the reason tomorrow is my latest deadline and I’m so close to finishing I can taste it. So today I’m hoping to finish my coding work so I can process some more of the “big idea” dataset I collected several weeks ago.
(more…)Attack of the code


Here’s the thing, all code is bad code. Some code is just better than others. For every person who writes a program, there’s someone else who would do it a totally different and, to them, less complicated or confusing way. However, as long as the code you write works, it shouldn’t really matter how badly it’s written, right? To me the difference between bad code and worse code is comments. The frustrating thing about taking apart someone else’s code is that there are rarely enough comments to figure out what the hell is going on.
(more…)It came from the fifth dimension!


Programming, you either love it or you hate it. Okay, let’s be honest, you either hate it or you tolerate it. There’s just so much to keep track of and as you start tacking on more and more, it can quickly become overwhelming. What’s worse is when you don’t have a whole lot of time to make sense of it all, you just push ahead as quickly as you can. Something has to give, it’s just a matter of what.
(more…)The second lecture!


Who writes a blog and forgot he’s teaching a class tomorrow? This guy! No really, it totally slipped my mind and I only recently sent out the reminder to the lab letting them know it was going on. It’s a bit shocking, but it’s okay because I’m mostly ready for this class, I just need to put a few slides together if I want to be extra fancy about it, but I’ve planned it out in advance.
(more…)On trying something new


As a grad student the work/life balance tends to blur. I actually do most of my work on the weekends and tend to try to take time during the week for myself. This works best for me because weekends are typically when no one needs me to physically be somewhere, so I can get into the correct headspace to do some work. This weekend was a busy one, and my Co-PI had some ideas about one of the papers I’m working on that required my full attention. He also wants me to do something I’ve never done before, so let’s talk about trying something new!
(more…)Intro to MATLAB – Part 5


Well we’re doing it. We’re adding to the MATLAB course I taught. Today we’re going to dive into functions, more importantly why you may want to write your own function, when you probably don’t need to, and how to tell the difference. This of course was inspired by the stuff I had to do the other day and when I realized I should just stuff everything into a function, life became a lot less complicated. Don’t worry, functions are your friends!
(more…)The value of planning your code


It’s no secret I need to write code, a lot of code. A mind numbingly large amount of code. Researching in a brain-machine interface lab is more about programming than it is about scifi brain hacking or anything the latest techno-thriller movies would have you believe. Anyone can do it, but it takes a certain amount of practice and a whole heck of a lot of time. Over time your skills develop and things get to be easier, but it’s not a linear progression (is anything really?) so things can be frustrating. These days planning saves me tons of time and effort, so today I want to pass that bit of knowledge on to you.
(more…)Programming overreach


This is what happens when I try to get fancy with the work I’m doing. I end up attempting to do things that aren’t done easily or if they are done easily, I figure out the hardest way possible for me to get them done. A week or so ago (here) I was excited because I came up with a super cool way to do something and I thought that the hardest part was behind me. Oh how wrong I was… but I’m close to figuring this out, I just need to do a lot of work to dig out of this hole I threw myself into. This is why you should never do anything fancy!
(more…)Sometimes you’re too close to the problem


I’ve had a breakthrough! I’ve been working for months on a problem and I probably could’ve come up with the solution sooner if I hadn’t been trying to force it. Maybe I’m weird, but I find the easiest way to come up with a solution to a problem is to just walk away from it. I don’t always do it, but I always end up regretting that I didn’t just step away from the thing long enough to get the full picture.
(more…)Intro to MATLAB – Part 4


We made it! This is the last post (for now anyway) in my four part Intro to MATLAB series. I reserve the right to go back and write more on the topic, but at the moment this is the end. If you’re just finding this and want to read the other posts in the series, I’ve made a super helpful Intro to MATLAB category where they are listed. Today we’re going to take a dive into editing code, finding ways to make your life easier, and just some bits of magic I’ve learned over the years that makes my life so much easier now. Let’s goooooo!
(more…)Intro to MATLAB – Part 3


To debug or not to debug. Just kidding you’re always going to need to debug. My class has officially ended, so this weekend we’re posting the last two parts to the four part Intro to MATLAB series. This lecture I taught my class how to use the debugger in MATLAB to solve any sort of problem they may run into and how to make sense of any issues they had. Unfortunately this means there is no code associated with this class, but we can still go into detail. The best part about being able to debug is that it makes you look like a coding god, so it’s a skill worth learning.
(more…)Intro to MATLAB – Part 2


I’m teaching an intro to MATLAB class and if it’s one thing I hate it’s hording knowledge so I’m sharing it here for all of you to enjoy! If you missed the first part, fear not you can find it here. I’ve also created a special category (the Intro to MATLAB category) where you can find these posts and a whole lot of other things I’ve taught, like my 10 week solid modeling for beginners classes and my incredibly detailed and surprisingly popular, know your spinal cord series (my personal favorite). Okay enough plugging my classes, let’s talk MATLAB.
(more…)Intro to MATLAB – Part 1


Per my usual routine, I’m teaching a class and instead of hording the knowledge I’m putting it here for all of you to use! I’m even going to attach the example code I wrote, which has enough comments to fill a small book, to help everyone just starting out. As I explained to my students, this is an intro to MATLAB course so my focus is on showing how things are done in MATLAB and less on how to problem solve using MATLAB. Although the last two lectures have not been created yet so they may focus on problem solving, who knows.
(more…)