David Croushore

A Man in Progress

How to Make a Reservation at the Red Porch in Nationals Park

As of this blog post, there will be exactly 2 places on the internet where you can find out how to make a reservation at the Red Porch Restaurant in Nationals Park.

For those who are unfamiliar, the Red Porch is a restaurant in center field at Nationals Park where you can sit outside with a pretty good view of the game, and have a waiter bring you your food and drinks, for free, rather than sitting in the nosebleeds and having to leave your seat to get concessions.  It’s common practice to buy the cheapest tickets available and then simply go to the Red Porch, or it’s sister, the Red Loft bar on the 2nd level.

Every time I go to the Red Porch, the hostess asks if I have a reservation, which I never do, but I have always been able to get seated at a table no later than the 3rd inning, and only had to wait that long once.  However, since tomorrow is Memorial Day and the Phillies are in town, the ballpark is likely to be packed, so I wanted to make a reservation ahead of time.  Since they always ask, I assumed the reservation number would be easy to find.  I was very wrong.

I finally did find the number.  Thanks to @cnichols14, who posted a picture on twitter over a year ago with the number attached.  Perhaps at that time the number was published more widely.  You can see the picture here, though there isn’t much to see. 

Thanks to that picture, I finally found the reservation number 202-640-7947.  Unfortunately, they are only open from 9-5 on Monday through Friday.  Interestingly, that means that they are almost never open during or within two hours of an actual game.  Sadly, since it’s Sunday, I couldn’t make my reservation today, but I do now know how.  Will they open at 9 on Memorial Day so that I can still make my reservation?  Probably not, but I will try.

Comments

Just Build the Damn Form on the Sheet

Since Excel userforms are such a pain in the ass, I just build the damn form on worksheet.  

The biggest issue that this causes, and the reason I wanted to use the userform in the first place, is that it’s difficult to specify the tab order, meaning when a user is filling out the form and hits the TAB key, the selection should jump to the next cell they would logically fill out. 

The solution requires a bit of creative design, but Excel’s functionality can be leveraged to make this possible. 

First, the cells to be filled out need to be laid out so that the order they would be filled out flows first from left to right across rows, then from the top down.  That means, for example, if there are 2 fields for first and last name, they should be set next to each other on the same row, rather than set vertically.  This imposes a constraint on the design, but with some creativity it can be overcome.

Next, select every cell on the worksheet and ensure that they are locked (in the format cells dialog box, on the protection tab, check the box to lock the cell when the worksheet is protected).  Once all the cells are locked, every cell that needs to be filled in can be selected and unlocked.  Now, when the sheet is protected (with a password of course), only the unprotected cells can be selected or filled in by the user.

Done.

Comments

Excel Userforms are a Pain in Ass

Excel is a spreadsheet program.  It can do some awesome stuff with spreadsheets.  But there are some other features that can be used to turn it into something beyond just a spreadsheet program.  One of those features is the ability to add userforms, which can prompt a user to enter information.

Unfortunately, unlike web forms or even Infopath, Excel userforms don’t work very well.  The UI is extremely sensitive to every small movement, it’s nearly impossible to select multiple controls without selecting all of them, and the method for using the data you collect is non-intuitive and clunky (most of VBA could be described as clunky). 

If anyone has experience working with userforms in Excel and can offer some suggestions to bring me off my ledge, I’d appreciate it. 

Comments

How to Find Out What Your SAS Macros Resolve To

OPTIONS SYMBOLGEN

That option will cause SAS to write messages to the log regarding what Macros resolve to when they are invoked.  Pretty handy for debugging SAS code that isn’t yours. 

Short and sweet today.

Comments

Using Arrays in PHP

PHP is similar to a lot of other languages I’ve seen in terms of creating and using arrays.  One interesting feature I saw today was the ability to nest arrays within arrays, rather than creating a 2D (or 3D or 4D…) array.  I’m not sure where this functionality might be advantageous, but I can certainly imagine that it might be. 

Additionally, there are a number of array functions that allow for analysis of arrays.  If an array contains only numeric values, for example, it’s easy to run statistics on the array.  There are also a number of functions for taking strings and creating arrays, or taking arrays and creating long strings. 

The code below demonstrates a number of array functions.  Again, simply copy this code into a text editor and save it as a .php file, then point your browser to it.

<html>
    <head>
        <title>
           Array Functions
        </title>
    </head>
    <body>
        <?php $array1 = array(14,38,55,116,2,4); ?>
       
        Count: <?php echo count($array1); ?> <br />
        Max Value: <?php echo max($array1); ?> <br />
        Min Value: <?php echo min($array1); ?> <br />
        <br />
        Sort: <?php sort($array1); print_r($array1); ?> <br />
        Reverse Sort: <?php rsort($array1); print_r($array1); ?> <br />
        <br />
        Implode: <?php echo $string1 = implode(” * “, $array1); ?> <br />
        Explode: <?php print_r(explode(” * “,$string1)); ?> <br />
        <br />
        In array: <?php echo in_array(15, $array1); // returns T/F ?> <br />
       
    </body>
</html>

Comments

Fun with Strings in PHP

Today I learned a number of string functions using PHP. 

Among the more interesting functions were strstr(), which finds a string within a string.  This find function is unique compared to other languages I’ve seen because it doesn’t just return the position of the string (the function strpos() does that), it returns the remainder of the string beginning with that substring.  I’m having trouble visualizing the use for that, but it is interesting.  strchr() does the same, but starts with a specified character. 

Here is a brief list of functions I experimented with today.  If you want to see how they work, simply copy this into a text editor, save the file with a .php extension, and open it with your browser.

<html>
    <head>
        <title>
           String Functions
        </title>
    </head>
    <body>
        <?php
            $firstString = “Do you have the time”;
            $secondString = ” to listen to me whine”;
        ?>
        <?php
            $thirdString = $firstString;
            $thirdString .= $secondString;
            echo $thirdString;       
       
        ?>
        <br />
        Lowercase: <?php echo strtolower($thirdString); ?> <br />
        Uppercase: <?php echo strtoupper($thirdString); ?> <br />
        Uppercase first-letter: <?php echo ucfirst($thirdString); ?> <br />
        Uppercase words: <?php echo ucwords($thirdString); ?> <br />
        <br />
        Length: <?php echo strlen($thirdString); ?> <br />
        Trim: <?php echo $fourthString = $firstString . trim($secondString); ?><br />
        Find: <?php echo strstr($thirdString, “time”); ?> <br />
        Replace by string: <?php echo str_replace(“time”, “patience”, $thirdString);?> <br />
        <br />
        Repeat: <?php echo str_repeat($thirdString,2); ?> <br />
        Make substring: <?php echo substr($thirdString,5,10); ?> <br />
        Find Position: <?php echo strpos($thirdString,”time”); ?> <br />
        Find Character: <?php echo strchr($thirdString, “h”); ?> <br />
    </body>
</html>

Comments

Hills and Valleys - The Columbia Triathlon

Today, I ran the Columbia Triathlon.  A friend of mine told me it was “really hilly”, and as it turns out, that was the biggest understatement of 2011.

On one of the downhills on the bike course, I broke the 40 mph barrier, which is a new personal record by about 4 mph.  On the run course, I passed someone on an uphill only to realize that they were walking, and I was running, and I was barely going faster than they were. 

I have never encountered hills like that on a bicycle.  I was alternating between going 30+ mph and 10 mph.  On some of the later hills, I learned what I was doing and got up to 12 mph. 

To add insult to injury, the race organizers put the finish line festival at the top of the hill above the finish line.  I think a number of the athletes probably never made it up that hill… which is sad.

Comments

Intro to PHP

<?php echo “Hello World!”; ?>

That’s how it starts.

The basic syntax for calling PHP.  Today I learned how to call PHP as well as how to declare and use variables: $Variable (case sensitive)

<?php

     $var1 = 3;

     $var2 = 2;

     echo $var1+var2;

?>

That code spits out the number 5 on a webpage (riveting, I know).

Soon, I’ll move on to PHP code that does something a little more meaningful.


Comments

The Difference Between INDEX() and INDEXC() in SAS

Today, I was teaching the Intermediate SAS course that I developed over the last 9 months and an interesting question came up.  What is the difference between the INDEX() and INDEXC() functions.  Well it turns out to be pretty useful.

In SAS, the INDEX() function will scan a string and return the location of a substring.  So for example INDEX(“Alabama”,”bam”) would return 4, since “bam” starts at the 4th letter of the word “Alabama.”

INDEXC(“Alabama”,”bam”) returns 3… Huh?

The INDEXC() function takes the list of characters in the string after the comma and searches for the first instance of any of them, thus when it encounters the lower case “a,” at the third character, it returns that index.  (If these were all uppercase, it would return a 1).

This is useful if you need to find any instances of special characters.  For example, searching a variable field called “phone_number” for parentheses or dashes could be done with INDEXC(phone_number,”()-“).

Comments

A Man in Progress

I’ve been searching for a long time for a “brand” for this blog.  What began as a 30 day challenge blog focused on improved well-being flamed out because the goal was too nebulous.  My recent attempts to reignite the blog have been without direction.

What I’ve needed is a unifying idea: a concept that inspires me.  Unfortunately, as it is, I’ve been looking for that idea for a long time, and it has not come, nor will it ever. 

As it turns out, I lack the kind of ideals that unify a persona. The things I value shift and change with time and circumstance.  Under the guise of logic I cling to ideas at intervals neither short nor long, but there is no higher purpose behind my thoughts or actions. 

It occurred to me that perhaps my search for some named and tangible identity was fruitless, because, like the wind, I only exist in motion.  Stability and security are my death.

February 7th, 2007 was a snowy Wednesday, coincidentally my sister’s 18th birthday.  That morning, I received an email that I’ve taken care to keep, for reasons I have not understood.  I have copied excerpts below:

Gentlemen,

I can’t imagine the day when I awake with the thought that mediocrity should be my agenda for the day.  I can’t fathom the possibility of  waking up without belief in myself.  Have I woken up in doubt, have I felt mediocre, have I struggled? No doubt, I am a man and men  struggle.  It is hard damn work rising above the morass of mediocrity and the pull of doubt and depression, after all we live in a society that celebrates instant success and dubious achievements based in self-aggrandizement. This society rewards followers and those of shallow thought with all the trappings previous generations showered upon real heroes.  Why?  Simply because we no longer value hard work, accountability, social order, long-term goals, sustained effort, humility, respect and belief in each other.  We are an instant gratification “what have you done for me lately” society.  It is not as if I have done anything great in my time on this planet, but I strive to never short change the day and more importantly I give those around me everything I have to give- most of which is my time, effort, love and respect.  I am not a rich man, but I am rich in experience, friends, the spirit of life, work ethic and determination.  I will share all of these with anyone who simply asks and is willing to work alongside me in positive endeavors.  I will fight for what I believe in and for those I love and respect.

 I want this to be a place where people don’t fear possibilities and shed fears about what they can accomplish.  A place where men embrace failure as part of the process of success, but never dwell on that failure as they move forward to that successful outcome. These are the things that I value.  I simply love spending time with a group of people who are not willing to accept the status quo of a diseased society where mediocrity and disrespect are glorified.  I love spending time with people like:

At this point, the author wrote about many individuals, including me:

Dave Croushore- a man in progress- few men are willing to make real
change in their life- Dave embraces it and the results are obvious.

“A Man in Progress”

It was not the kind of praise given to others, and seems almost a backhanded compliment intended to convey that I was not a fully formed person.  But that is not the case.  In fact, that simple phrase, “a man in progress,” is the most accurate description of my life and values that I have ever encountered.

For me, there is no end goal.  Progress is the goal. 

I cannot comprehend the feeling that others must have when the return to the same ideas and tasks repeatedly.  Why look towards the past when there is a future (a near future) to create?

This is my grand ideal: to embrace constant change in pursuit of nothing.  To remain in progress for progress’ sake.

Comments