Tuesday, December 05, 2006
Groundbreaking
There are a few events each year that seem to exemplify the spirit of what St Olaf is, and I think last Friday's groundbreaking ceremony for St Olaf's new Science Center was certainly one. From the Christ-filled words of the speakers, to the Fram Fram song, to the view of the distant windmill spinning over the science center, the crowd of hundreds of students, adults, alumni, parents, Americans, Norwegians, and more, standing faithfully in the cold to show their support, and the seven symbolic shovels manned by leaders of our community: this is St Olaf.
Thursday, November 23, 2006
Happy Thanksgiving!
There's so much to be said, I'm at a loss of where to start. It's really a day that can fit the opening of A Tale of Two Cities well:
It is the best of times: life is really good for most of us, and I'll admit I feel this especially so right now - God has seen me through from my absolute worst low of lows just two months ago and brought me to being "pretty darn good" now. It's also my first Thanksgiving "living on my own" (and trying to deal with the clutter of boxes that contains my life right now).
And yet it is the worst of times: we are a nation at war, and many families are celebrating Thanksgiving while a loved one fights for our nation half a world away. Many other families are celebrating Thanksgiving for the first time without a beloved relative. This will be my family's first Thanksgiving without my two Grandmothers. For the family of one of my friends, this will be their first Thanksgiving without his mother, and for another friend, their first without her uncle.
The Macy's Thanksgiving Day parade just ended with Santa going by on his float (preceded immediately, I'll add, by Christian singer Natalie Grant!), and in my family, that means the official start of the Christmas season. More specifically, it means we are now "allowed" to play Christmas music. The required first song of the season: Mannheim Steamroller's "Deck the Halls". My parents, I'm sure, had the real CD at the ready at their house, and I had my iTunes cued up and standing by, plugged into the speakers on my desk ready to blast out the notes and thus complete the morning.
The one unfortunate part of the opening of the Christmas music season is that KTIS will start playing lots of songs that I like less well. I'm not a fan of most traditional Christmas music, favoring instead some of the more contemporary rock-ish renditions. This is not to say all of the 'old' Christmas songs are bad, I'm just jaded and tired of hearing the same ones over and over year after year, which is why it will be exciting to start branching out to newer recordings by Steven Curtis Chapman, MercyMe, Avalon, Big Daddy Weave, Barlow Girl, the Trans-Siberian Orchestra, et al.
But I digress.
For today, like most other days, I take a moment to pause and remember to live a life of "Thanksliving", rather than one day of "Thanksgiving". Here are just a few of the things I am thankful for each morning when I wake up:
My Mom and Dad and the rest of my loving family
My wonderful friends
My education
My car
My guitar
My nation
My Awesome God
It is the best of times: life is really good for most of us, and I'll admit I feel this especially so right now - God has seen me through from my absolute worst low of lows just two months ago and brought me to being "pretty darn good" now. It's also my first Thanksgiving "living on my own" (and trying to deal with the clutter of boxes that contains my life right now).
And yet it is the worst of times: we are a nation at war, and many families are celebrating Thanksgiving while a loved one fights for our nation half a world away. Many other families are celebrating Thanksgiving for the first time without a beloved relative. This will be my family's first Thanksgiving without my two Grandmothers. For the family of one of my friends, this will be their first Thanksgiving without his mother, and for another friend, their first without her uncle.
The Macy's Thanksgiving Day parade just ended with Santa going by on his float (preceded immediately, I'll add, by Christian singer Natalie Grant!), and in my family, that means the official start of the Christmas season. More specifically, it means we are now "allowed" to play Christmas music. The required first song of the season: Mannheim Steamroller's "Deck the Halls". My parents, I'm sure, had the real CD at the ready at their house, and I had my iTunes cued up and standing by, plugged into the speakers on my desk ready to blast out the notes and thus complete the morning.
The one unfortunate part of the opening of the Christmas music season is that KTIS will start playing lots of songs that I like less well. I'm not a fan of most traditional Christmas music, favoring instead some of the more contemporary rock-ish renditions. This is not to say all of the 'old' Christmas songs are bad, I'm just jaded and tired of hearing the same ones over and over year after year, which is why it will be exciting to start branching out to newer recordings by Steven Curtis Chapman, MercyMe, Avalon, Big Daddy Weave, Barlow Girl, the Trans-Siberian Orchestra, et al.
But I digress.
For today, like most other days, I take a moment to pause and remember to live a life of "Thanksliving", rather than one day of "Thanksgiving". Here are just a few of the things I am thankful for each morning when I wake up:
My Mom and Dad and the rest of my loving family
My wonderful friends
My education
My car
My guitar
My nation
My Awesome God
Tuesday, November 07, 2006
I Voted
Homework done, my studying began late last night, or rather, early this morning, for what ranks among the most important tests I have taken this semester: my vote. Okay, before today, I was passingly familiar with the candidates and issues, but not well enough to consider myself well-informed enough to vote. Huge thanks to my roommate Ben for walking through the important races' candidates and issues with me.
There are so many amazing things about the test I took this morning. For one, it's not graded! I can put whatever answer fits me and know that I'll still get 100%, and if I don't know the answers to some of the questions, I can leave them blank and not be penalized. All tests should be this way.
I woke up early this morning, prayed for friends in need and the election day on the whole, and soon made my way over to Buntrock to get my second-ever little red circle sticker. After re-registering so that I can vote in Northfield instead of having to drive home, I received my ballot and started filling in ovals. Governor, senate, house, and amendments, those were the most important ones, and honestly, I skipped the rest. To me, it doesn't really matter who the new Northfield sheriff is - I don't know anything about the candidates, so it just seems right that I leave that decision to better informed voters. Don't misinterpret what I'm saying here: I do not take voting lightly at all–it's one of the most important rights and duties that we have in this country–, but for me it's only critical that I am able to cast my vote for the races that really matter to me, in other words, the big, non-local races.
The machine scanned my ballot and told me I was voter number 124. Not terrible for 9:30 in the morning. Most importantly, though, I'd made my voice heard, and I got my wonderful sticker to wear proudly all day long. And now, with the polls closed, I pray May God Bless America, no matter what the outcomes are from today's vote.
There are so many amazing things about the test I took this morning. For one, it's not graded! I can put whatever answer fits me and know that I'll still get 100%, and if I don't know the answers to some of the questions, I can leave them blank and not be penalized. All tests should be this way.
I woke up early this morning, prayed for friends in need and the election day on the whole, and soon made my way over to Buntrock to get my second-ever little red circle sticker. After re-registering so that I can vote in Northfield instead of having to drive home, I received my ballot and started filling in ovals. Governor, senate, house, and amendments, those were the most important ones, and honestly, I skipped the rest. To me, it doesn't really matter who the new Northfield sheriff is - I don't know anything about the candidates, so it just seems right that I leave that decision to better informed voters. Don't misinterpret what I'm saying here: I do not take voting lightly at all–it's one of the most important rights and duties that we have in this country–, but for me it's only critical that I am able to cast my vote for the races that really matter to me, in other words, the big, non-local races.
The machine scanned my ballot and told me I was voter number 124. Not terrible for 9:30 in the morning. Most importantly, though, I'd made my voice heard, and I got my wonderful sticker to wear proudly all day long. And now, with the polls closed, I pray May God Bless America, no matter what the outcomes are from today's vote.
Friday, November 03, 2006
Good Pain?
It's seemingly an oxymoron, I know, to say there is such a thing as a "good pain", but the slight tingly pain I feel in my fingers is exactly that. Why? Because it comes as a result of learning how to play my beautiful new guitar. It's a very satisfying, moreso than truly painful, feeling, knowing that my fingers worked hard to press down in these newfound contortions that musicians call chords.
I bought my shiny new toy about two weeks ago, and I did a very little bit of independent learning by way of the Internet, but nothing much. And then, yesterday, I had my first real lesson! I owe a huge thank you to Adam for being willing to tutor me, or, more accurately, put up with me :) Mini-lessons included just getting acquainted with the instrument, then tuning (being a non-music major, this gave me challenges), and finally some basic chords, enough to very slowly strum out Amazing Grace. Okay, so I wasn't good at it, but I'll get there eventually. I am bound and determined to make this pretty instrument make equally pretty noises someday.
I bought my shiny new toy about two weeks ago, and I did a very little bit of independent learning by way of the Internet, but nothing much. And then, yesterday, I had my first real lesson! I owe a huge thank you to Adam for being willing to tutor me, or, more accurately, put up with me :) Mini-lessons included just getting acquainted with the instrument, then tuning (being a non-music major, this gave me challenges), and finally some basic chords, enough to very slowly strum out Amazing Grace. Okay, so I wasn't good at it, but I'll get there eventually. I am bound and determined to make this pretty instrument make equally pretty noises someday.
My First Scripture Reading in Chapel
Last Friday morning was slightly traumatic and yet, in another, more important sense, fulfilling. Last Friday was the first day I've ever read a scripture passage in Chapel. Remembering only my short chapel presentation a year ago as one of five speakers, I came fully expecting to have shaky legs with a moderately shaky voice to match, and of course, since the reading was rather lengthy, I knew my mouth would dry out quickly. Discreetly gulping down as much water as I could, I sat waiting quietly at the front of the make-shift Urness Chapel.
I had no real reason to be nervous, of course. I'd printed out my own 'large print edition' of the reading (which was now waiting patiently for me within the Bible on the podium), and I'd rehearsed several times - mostly silent lip synching, but once out loud, too. And I'd already done a sound check with the microphone, so I knew what to expect when I started reading out loud again.
Now, I really do like speaking in front of people, but this was a brand new crowd of mostly unfamiliar faces to me. In all honesty, the previous Wednesday had been the first day this year I'd gone to chapel, and I only went because my former psychology prof was speaking. Why had I now been asked to accept this privilege of reading in front of everyone? I knew I couldn't screw up; I did not want to make a fool of myself, not here, not in front of these people. Today I needed to make a good impression, today I needed to try my best to offer some semblance of actually appearing intelligent.
All told, the reading went just fine. My over-the-top nervousness ahead of time disappeared once I was at the microphone - at that point the previously almost overwhelmingly worrisome task became almost routine; "you've read out loud before, and you're a good sight reader, and for goodness sake, you've practised this text, to boot!" is what I told myself. My mouth did run quite dry (I'm sure it didn't help that I had not fully re-hydrated from giving blood several days before), but somehow I made it through, and in the aftermath actually received several compliments from friends saying I'd done just fine. In short, all my worries had been for naught. Thank you, God.
I had no real reason to be nervous, of course. I'd printed out my own 'large print edition' of the reading (which was now waiting patiently for me within the Bible on the podium), and I'd rehearsed several times - mostly silent lip synching, but once out loud, too. And I'd already done a sound check with the microphone, so I knew what to expect when I started reading out loud again.
Now, I really do like speaking in front of people, but this was a brand new crowd of mostly unfamiliar faces to me. In all honesty, the previous Wednesday had been the first day this year I'd gone to chapel, and I only went because my former psychology prof was speaking. Why had I now been asked to accept this privilege of reading in front of everyone? I knew I couldn't screw up; I did not want to make a fool of myself, not here, not in front of these people. Today I needed to make a good impression, today I needed to try my best to offer some semblance of actually appearing intelligent.
All told, the reading went just fine. My over-the-top nervousness ahead of time disappeared once I was at the microphone - at that point the previously almost overwhelmingly worrisome task became almost routine; "you've read out loud before, and you're a good sight reader, and for goodness sake, you've practised this text, to boot!" is what I told myself. My mouth did run quite dry (I'm sure it didn't help that I had not fully re-hydrated from giving blood several days before), but somehow I made it through, and in the aftermath actually received several compliments from friends saying I'd done just fine. In short, all my worries had been for naught. Thank you, God.
Tuesday, October 10, 2006
Thank You, Grandma Ruth
Not too many weeks ago I wrote about my car breaking down on the freeway. Very exciting. And very ironic, too, because earlier that day my parents and I had been talking about how they wanted this car to last through the winter, and then we'd buy a new one next spring. So of course the motor chose that day to die.
Our choices: pay $4000 to replace the engine in a 13 year old car, or start looking for a new car. To my glee, we opted for the latter, which meant the Monday after my ordeal on the entry ramp my parents and I got to go car shopping!
Mom came down to Olaf to pick me up (since I had no transportation of my own), and we met Dad at the dealer. After a small amount of looking around, we came back to the first car we'd spotted a few days previous when the tow truck dropped off my old one: a really nice condition three year old car with all the great features: leather interior, moonroof, CD player (none of our vehicles have ever had one before), power seat, etc. It was just a really really nice car. And it was used, with a number of miles on it, so the price was actually affordable. The best, and also scariest, part is that they let me take it on a test drive. That was... fun, I guess, but nerve wracking at the same time.
We bought it. I had to leave to go help with an event at Minnehaha, and it was a good thing I left when I did instead of waiting, since it took Mom and Dad another several hours of waiting and writing before the paper work was all done.
Now, I didn't get to drive the new car right away - the dealer has a three-day return window, so Dad drove it for the next several days, including a longer journey into Wisconsin with Mom and Grandpa for a funeral, before I was allowed to wrestle the keys out of his hand and start calling the vehicle 'my own' on Thursday night of that week. (Dad is still fond of asking me how "his car" is doing, since he did, after all, pay for it, and I just get to drive it).
Why is the title of this blog entry "Thank You, Grandma Ruth"? Because, in a very practical sense, it was the inheritance money that bought the car (cash, no loans involved). So, sincerely, Thank You, Grandma Ruth, for buying us a very nice car for me to call my own.
Our choices: pay $4000 to replace the engine in a 13 year old car, or start looking for a new car. To my glee, we opted for the latter, which meant the Monday after my ordeal on the entry ramp my parents and I got to go car shopping!
Mom came down to Olaf to pick me up (since I had no transportation of my own), and we met Dad at the dealer. After a small amount of looking around, we came back to the first car we'd spotted a few days previous when the tow truck dropped off my old one: a really nice condition three year old car with all the great features: leather interior, moonroof, CD player (none of our vehicles have ever had one before), power seat, etc. It was just a really really nice car. And it was used, with a number of miles on it, so the price was actually affordable. The best, and also scariest, part is that they let me take it on a test drive. That was... fun, I guess, but nerve wracking at the same time.
We bought it. I had to leave to go help with an event at Minnehaha, and it was a good thing I left when I did instead of waiting, since it took Mom and Dad another several hours of waiting and writing before the paper work was all done.
Now, I didn't get to drive the new car right away - the dealer has a three-day return window, so Dad drove it for the next several days, including a longer journey into Wisconsin with Mom and Grandpa for a funeral, before I was allowed to wrestle the keys out of his hand and start calling the vehicle 'my own' on Thursday night of that week. (Dad is still fond of asking me how "his car" is doing, since he did, after all, pay for it, and I just get to drive it).
Why is the title of this blog entry "Thank You, Grandma Ruth"? Because, in a very practical sense, it was the inheritance money that bought the car (cash, no loans involved). So, sincerely, Thank You, Grandma Ruth, for buying us a very nice car for me to call my own.
Friday, October 06, 2006
I Think I Finally Get It
Not to say that I've solved all of life's mystery's, but, in short, I think I finally got it. I heard this song [Matthew West's "More"] playing on KLOVE on my way back to St Olaf this evening:
"I love you more than the sun
And the stars that I taught how to shine
You are mine, and you shine for me too
I love you yesterday and today
And tomorrow, I'll say it again and again
And I see you
And I made you
I love you more than you can imagine"
I was singing along with it, and then I realised what I was saying, how that's truly how God feels toward us, how much God loves us, how much God wants to take care of us.
It's been a really, really bad week, but this was just what I needed to hear. It finally sank in: God loves me. No matter how much I've screwed up, no matter how much God knows I'm going to continue to screw up, God still loves me. It was an amazing moment of clarity. Thank you, God.
"I love you more than the sun
And the stars that I taught how to shine
You are mine, and you shine for me too
I love you yesterday and today
And tomorrow, I'll say it again and again
And I see you
And I made you
I love you more than you can imagine"
I was singing along with it, and then I realised what I was saying, how that's truly how God feels toward us, how much God loves us, how much God wants to take care of us.
It's been a really, really bad week, but this was just what I needed to hear. It finally sank in: God loves me. No matter how much I've screwed up, no matter how much God knows I'm going to continue to screw up, God still loves me. It was an amazing moment of clarity. Thank you, God.
Sunday, September 17, 2006
Broken and Beautiful
Mark Schultz has a great new song called "Broken and Beautiful", which has been making its rounds on Christian radio in these few weeks before the CD release. Why do I think it's so great? Because it echoes the reality of so many different people from so many different walks of life:
"There's a business man
There's a widowed wife
A smiling face with a shattered life
A teenage girl with a choice to make
It's crowded here in church today"
When I step into church, I know all too well the worries and stresses that I'm facing in my own life, but I often forget that everyone is coming weighed down with their own burdens, too. Everyone has struggles, everyone has pain, and everyone comes in need of healing. Which is why the next part of the first verse is so applicable:
"And the preacher says as the sermon ends
Please close your eyes
Bow your heads
Is there anyone in need of prayer?
Oh Jesus wants to meet you here"
To me that's just really powerful, to be reminded that no matter what we're going through, God still loves us and wants to help. Hearing those words above really touches me, because I know how important it has always been to me to have that prayer time in church. But then, sadly, Mark's song becomes less good, and by that I mean he completely misses the point, ruining everything he had just built up:
"'Cuz we all fall short, and we all have sinned
But where you left, God's grace begins"
That first line is beyond appalling in its simplicity, ignorance, and condemnation, all of which are too commonplace in the Christian Church today. Mark just finished talking about four people who have come to church in need of prayer and love and support [at least two of whom are not themselves guilty of nor responsible for their situation, the first and fourth, I think, are being deliberately left to individual interpretation], but now the blame has been placed back onto these distraught souls, anyway. It's appalling to me because this game of blaming the victim is, sadly, the most common refrain I hear coming from the ultra vocal, ultra conservative Christian right, and I'm dismayed to see this attitude has now creeped its way into my favorite music genre. These people Mark describes to us came to church seeking renewal and relief, not pulpit-imposed guilt for crimes not their own.
This isn't to say that the church should be all feel-good, all lovey-dovey, without any talk of culpability and responsibility for one's actions, but when sin is invalidly assigned as the root cause of suffering when it is clearly not (as was the case for the lives talked about in Mark's first verse), I am forlorned. It's really just that one line that's a kick in the pants. The rest of the song works. The rest of the song, in my opinion, paints a beautiful portrait of what can happen when we come to God, hearts opened, begging for healing and restoration, and the end result truly is beautiful.
"There's a business man
There's a widowed wife
A smiling face with a shattered life
A teenage girl with a choice to make
It's crowded here in church today"
When I step into church, I know all too well the worries and stresses that I'm facing in my own life, but I often forget that everyone is coming weighed down with their own burdens, too. Everyone has struggles, everyone has pain, and everyone comes in need of healing. Which is why the next part of the first verse is so applicable:
"And the preacher says as the sermon ends
Please close your eyes
Bow your heads
Is there anyone in need of prayer?
Oh Jesus wants to meet you here"
To me that's just really powerful, to be reminded that no matter what we're going through, God still loves us and wants to help. Hearing those words above really touches me, because I know how important it has always been to me to have that prayer time in church. But then, sadly, Mark's song becomes less good, and by that I mean he completely misses the point, ruining everything he had just built up:
"'Cuz we all fall short, and we all have sinned
But where you left, God's grace begins"
That first line is beyond appalling in its simplicity, ignorance, and condemnation, all of which are too commonplace in the Christian Church today. Mark just finished talking about four people who have come to church in need of prayer and love and support [at least two of whom are not themselves guilty of nor responsible for their situation, the first and fourth, I think, are being deliberately left to individual interpretation], but now the blame has been placed back onto these distraught souls, anyway. It's appalling to me because this game of blaming the victim is, sadly, the most common refrain I hear coming from the ultra vocal, ultra conservative Christian right, and I'm dismayed to see this attitude has now creeped its way into my favorite music genre. These people Mark describes to us came to church seeking renewal and relief, not pulpit-imposed guilt for crimes not their own.
This isn't to say that the church should be all feel-good, all lovey-dovey, without any talk of culpability and responsibility for one's actions, but when sin is invalidly assigned as the root cause of suffering when it is clearly not (as was the case for the lives talked about in Mark's first verse), I am forlorned. It's really just that one line that's a kick in the pants. The rest of the song works. The rest of the song, in my opinion, paints a beautiful portrait of what can happen when we come to God, hearts opened, begging for healing and restoration, and the end result truly is beautiful.
An Exciting Afternoon!
This afternoon, as I was driving back to campus from Minneapolis, I was preparing to exit from Highway 77 (Cedar) onto 35E, when all of a sudden I felt a very noticeable jerk and noticed my speedometer begin to drop. At the very outset I assumed it was the cruise control inelegantly readjusting me down a mile or two, but then the engine started to make a lot of noise: a very loud and unnatural clicking noise, along with the painful sounds of going much faster on the inside. "Hmm", I thought. "That's probably not a good sound. I'm already committed to take this entrance ramp onto 35E, but I'll take the first exit once I'm on that freeway." I turned off the cruise control. "Hmm", I thought again. "I'm pressing the gas pedal, I should be speeding up to about 70mph, but I'm slowing down. That's odd." Meanwhile, the engine is still making the loud clicking noise. I was down to about 50 on my speed and I realised I probably wasn't going to make it to the next exit. I put on my hazards to warn the car behind me and started to slow down. The real excitement came when I started to pull onto the shoulder, though, because that's when the SMOKE started coming out from under the hood! Yikes! I finally stop about 200 yards back from the merge to 35E, park, turn off, and get out as quickly as I can, convinced the car is going to catch on fire, an assumption not helped by the fact that more and more smoke kept coming out of the hood in greater and greater quantities. I had two thoughts, and two thoughts only: my computer is in the trunk, and that's more or less my life, so I really hope the car doesn't become engulfed in flames; and, more importantly: I have too much to live for to be caught in an explosion, so I must get away quickly. I prayed along the way, too.
Now, good for me, I had my mobile with, so I called my parent's house where I thought my dad was. No answer. I call again. No answer. I call my mom's cell, planning my first words to be something like "Get in the car now and I'll explain on the way". No answer. Distraught, and in a huge panic, I call the AAA emergency number and give them the details. They send a tow-truck on its way to rescue me, and I eventually get a hold of mom and dad, both of whom come on their way. (My real first words to my mom were "The important thing to know is that I'm okay").
While I waited (half an hour), two other cars stopped on their way to offer help. Knowing both my parents and the tow truck are now on the way, and seeing that the car was no longer smoking, I graciously sent the good samaritans on their way, my faith in humanity's potential for goodness restored.
The tow-truck arrived first and starts making preparations to load the car onto the flatbed. Dad arrives a few minutes after, we load all of the video equipment I was carrying in my trunk into the van, and wait for the truck driver to finish loading my car. I call mom to let her know how it's going and that we'll meet her at the car dealer (Freeway Dodge, where we were having the car towed to).
And then we're on our way. We all met up again at Dodge, glance around at some of the used car stickers in case we find ourselves needing to buy a replacement instead of repairing, and then mom brought me back to school, several hours and a good deal much more excitement later than I had originally planned.
Things could have been a lot worse. If I'd driven any farther, I'm fairly certain the car would have actually caught on fire. I could have not had a cell phone to call for help. We could have not had AAA coverage. And I could have been much less composed than I was. Now, admittedly, on the inside, I was very very nervous, but I still managed to evaluate, process and react to the situation in a very orderly and outwardly calm manner. I pulled off the road so I wouldn't block traffic, I attempted to call my parentals, I successfully called AAA and coherently gave them the information they needed, and even before that phone call I had very consciously thought through the situation: do I need to call 911? Do I call AAA? Do I just call my parents? Who else can I call if they can't come rescue me? In short, in the end, I feel that I did quite well, which gives me a realistic confidence that I'll be able to remain clear-headed if I'm ever in a worse situation in the future.
Now, good for me, I had my mobile with, so I called my parent's house where I thought my dad was. No answer. I call again. No answer. I call my mom's cell, planning my first words to be something like "Get in the car now and I'll explain on the way". No answer. Distraught, and in a huge panic, I call the AAA emergency number and give them the details. They send a tow-truck on its way to rescue me, and I eventually get a hold of mom and dad, both of whom come on their way. (My real first words to my mom were "The important thing to know is that I'm okay").
While I waited (half an hour), two other cars stopped on their way to offer help. Knowing both my parents and the tow truck are now on the way, and seeing that the car was no longer smoking, I graciously sent the good samaritans on their way, my faith in humanity's potential for goodness restored.
The tow-truck arrived first and starts making preparations to load the car onto the flatbed. Dad arrives a few minutes after, we load all of the video equipment I was carrying in my trunk into the van, and wait for the truck driver to finish loading my car. I call mom to let her know how it's going and that we'll meet her at the car dealer (Freeway Dodge, where we were having the car towed to).
And then we're on our way. We all met up again at Dodge, glance around at some of the used car stickers in case we find ourselves needing to buy a replacement instead of repairing, and then mom brought me back to school, several hours and a good deal much more excitement later than I had originally planned.
Things could have been a lot worse. If I'd driven any farther, I'm fairly certain the car would have actually caught on fire. I could have not had a cell phone to call for help. We could have not had AAA coverage. And I could have been much less composed than I was. Now, admittedly, on the inside, I was very very nervous, but I still managed to evaluate, process and react to the situation in a very orderly and outwardly calm manner. I pulled off the road so I wouldn't block traffic, I attempted to call my parentals, I successfully called AAA and coherently gave them the information they needed, and even before that phone call I had very consciously thought through the situation: do I need to call 911? Do I call AAA? Do I just call my parents? Who else can I call if they can't come rescue me? In short, in the end, I feel that I did quite well, which gives me a realistic confidence that I'll be able to remain clear-headed if I'm ever in a worse situation in the future.
Friday, September 15, 2006
PHP Email Validation using Regular Expressions
This is a very geeky post, but I spent a good three hours making this code work perfectly, and I'm kind of proud of it, so there.
The idea is this: I needed a function that would validate the email address entered by a user on a new Tech Request System that I'm writing for Minnehaha, but I also wanted the user to be able to enter comma separated email addresses in the form and have those parsed correctly. Google didn't seem to have a ready-made function available for me to use, so I knew I had to take on the challenge and write my own. It was fun, too, so I can't really complain. The code may not be the most efficient it could be, but it works, and for a small scale application like this that's really the only requirement.
The following PHP function, validateEmail($email), checks the input ($email) to see if it contains valid email addresses. This is done first by parsing the input string into an array, each location in which will contain an individual email address to be parsed (this is assuming the original input was a comma separated list of emails; if only one email address was entered, this array will only have value associated with it). I then create a variable to return (cleverly named $return) and initialise it to be the returned value from calling validateSingleEmail on the first item in the aforementioned array. If there are more items in the array, the for loop goes through and checks them by calling validateSingleEmail on each. If the item is a valid email, that text is returned and appended (with a comma and space) to the $return variable. If the item is a blank email (pure whitespace, that is), validateSingleEmail returns an empty string and nothing is appended to $return (this is useful to catch any trailing commas and spaces in the original input so that they don't cause an error). Otherwise, if the item is an invalid email address (not matching the format abc@def.ghi), a validateSingleEmail returns false, thus causing validateEmail to also return false, which, in my application, causes an error message to appear on the user's screen when they press submit.
If all goes well, though, the function returns $return, and also sets the POST variable $_POST["Email"] to be this return value (that way everything is entered into the database correctly when the rest of the data is sent).
That's it. Very exciting for the non-computer people, I know. Actually, I'm sure it's not all that terribly exciting for the computer types, either, but maybe it will be useful to someone else someday.
function validateEmail($email) {
$emails = preg_split("/,/", $email);
if($return = validateSingleEmail($emails[0])) {
$count = count($emails);
for($i = 1; $i < $count; $i++) {
$addition = validateSingleEmail($emails[$i]);
if($addition !== false) {
$return .= ($addition == '' ? '' : (', ' . $addition));
} else {
return false;
}
}
$_POST["Email"] = $return;
return true;
} else {
return false;
}
}
function validateSingleEmail($email) {
if(!preg_match('/[^ ]+\@[^@ ]+\.[^@ ]+/', $email, $matches)) {
if(preg_match('/[\S]+/', $email, $matches)) {
return false;
} else {
return '';
}
} else {
return $matches[0];
}
}
The idea is this: I needed a function that would validate the email address entered by a user on a new Tech Request System that I'm writing for Minnehaha, but I also wanted the user to be able to enter comma separated email addresses in the form and have those parsed correctly. Google didn't seem to have a ready-made function available for me to use, so I knew I had to take on the challenge and write my own. It was fun, too, so I can't really complain. The code may not be the most efficient it could be, but it works, and for a small scale application like this that's really the only requirement.
The following PHP function, validateEmail($email), checks the input ($email) to see if it contains valid email addresses. This is done first by parsing the input string into an array, each location in which will contain an individual email address to be parsed (this is assuming the original input was a comma separated list of emails; if only one email address was entered, this array will only have value associated with it). I then create a variable to return (cleverly named $return) and initialise it to be the returned value from calling validateSingleEmail on the first item in the aforementioned array. If there are more items in the array, the for loop goes through and checks them by calling validateSingleEmail on each. If the item is a valid email, that text is returned and appended (with a comma and space) to the $return variable. If the item is a blank email (pure whitespace, that is), validateSingleEmail returns an empty string and nothing is appended to $return (this is useful to catch any trailing commas and spaces in the original input so that they don't cause an error). Otherwise, if the item is an invalid email address (not matching the format abc@def.ghi), a validateSingleEmail returns false, thus causing validateEmail to also return false, which, in my application, causes an error message to appear on the user's screen when they press submit.
If all goes well, though, the function returns $return, and also sets the POST variable $_POST["Email"] to be this return value (that way everything is entered into the database correctly when the rest of the data is sent).
That's it. Very exciting for the non-computer people, I know. Actually, I'm sure it's not all that terribly exciting for the computer types, either, but maybe it will be useful to someone else someday.
function validateEmail($email) {
$emails = preg_split("/,/", $email);
if($return = validateSingleEmail($emails[0])) {
$count = count($emails);
for($i = 1; $i < $count; $i++) {
$addition = validateSingleEmail($emails[$i]);
if($addition !== false) {
$return .= ($addition == '' ? '' : (', ' . $addition));
} else {
return false;
}
}
$_POST["Email"] = $return;
return true;
} else {
return false;
}
}
function validateSingleEmail($email) {
if(!preg_match('/[^ ]+\@[^@ ]+\.[^@ ]+/', $email, $matches)) {
if(preg_match('/[\S]+/', $email, $matches)) {
return false;
} else {
return '';
}
} else {
return $matches[0];
}
}
Subscribe to:
Posts (Atom)