Server:Server Status

Minecraft Skins

The wife and I are playing some minecraft, look how adorable we are:

Mrs. Pinkin (I can only embed one of us at a time to view :( )

Surfrock66

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

My Retinas

I went to the optometrist and they took pictures of my retinas, check them out:

Left RetinaLeft EyeRight EYeRight Eye

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Excel Formula: Double (And More) Conditional Sums

Let's say you have an excel spreadsheet for guys that sell billboard space with 3 columns: Seller, Billboard Location, and number of days. Let's say you wanted to find out how many days John sold a certain billboard for. Excel doesn't have an elegant way built in for double-conditional sums. There's a plugin you can install, but the formula is UGLY, and really doesn't work past 2 variables. If you wanted to do a triple-conditional sum, you're basically out of luck.

The solution I've come up with uses 3 features:

  1. SUMIF: SUMIF is a conditional sum formula based on a single variable. It takes 3 arguments: The range of cells to check against, the value you're searching for, and the corresponding range of cells to add if the first cell meets the conditions. Read about it here.
  2. CONCATENATE: This function just combines text into one big text. If A2="Joe" and B2="South St." then CONCATENATE(A2,B2)="JoeSouth St."
  3. Filter Uniques: Excel can take a list of items and separate it out into JUST the unique entries; this will be critical to pare down the unnecessary data. Select your range, go to the Data menu, then advanced filter, then choose your range (just the Unique ID column) and check the box for "Unique Records Only." This feature doesn't work on formulas; what you must to is select your whole column with the formula in it, copy it, then instead of pasting it in the same place chose "paste special" and select values...this just leaves the formula's result in place.

First, we need to take all of our indexes and concatenate them, so that we have a unique field for each possible combination. This works for any number of indexes. In this case, like I showed above, we're concatenating the name and location. Then, you can run the SUMIF command with the unique column we created being the range to check. Let me create an example below:

RepBoardDays
Sold
Unique IDSUM
JoeOne5=CONCATENATE(A2,B2)=SUMIF(D:D,D2,C:C)
JoeOne10=CONCATENATE(A3,B3)=SUMIF(D:D,D3,C:C)
JoeOne12=CONCATENATE(A4,B4)=SUMIF(D:D,D4,C:C)
JoeThree6=CONCATENATE(A5,B5)=SUMIF(D:D,D5,C:C)
ChrisTwo8=CONCATENATE(A6,B6)=SUMIF(D:D,D6,C:C)
ChrisOne9=CONCATENATE(A7,B7)=SUMIF(D:D,D7,C:C)
DaveOne4=CONCATENATE(A8,B8)=SUMIF(D:D,D8,C:C)
DaveTwo2=CONCATENATE(A9,B9)=SUMIF(D:D,D9,C:C)
DaveTwo7=CONCATENATE(A10,B10)=SUMIF(D:D,D10,C:C)

This produces a table like this:

RepBoardDays
Sold
Unique IDSUM
JoeOne5JoeOne27
JoeOne10JoeOne27
JoeOne12JoeOne27
JoeThree6JoeThree6
ChrisTwo8ChrisTwo8
ChrisOne9ChrisOne9
DaveOne4DaveOne4
DaveTwo2DaveTwo9
DaveTwo7DaveTwo9

which you can then use the "Filter Uniques" function on the Unique ID column to pare down to this:

RepBoardDays
Sold
Unique IDSUM
JoeOne5JoeOne27
JoeThree6JoeThree6
ChrisTwo8ChrisTwo8
ChrisOne9ChrisOne9
DaveOne4DaveOne4
DaveTwo2DaveTwo9

So, finally, once we remove the unnecessary columns and re-title the result column:

RepBoardDays Sold Per User, Per Board
JoeOne27
JoeThree6
ChrisTwo8
ChrisOne9
DaveOne4
DaveTwo9
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fun With Sodium Polyacrylate

I made a video about this stuff that I've been playing with, it's so geeky it's awesome:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Dynamic Menus in WordPress as a CMS

I've been developing a site where I'm using wordpress as a CMS more than a blog, for many reasons. I'm very familiar with it, I like the automated SEO, I think it's simple to use, etc. But one big challenge is the menu navigation and how to set it up. I want this to be automated and I don't want to have to edit the menu every time there's a new page.

To clarify the terms, there's a menu with "solutions" then "products" with 3 sub categories "indoor" "outdoor" and "media players." Plus there's a "guides" area and a "blog" area.

The menu system is handled by the category management. If a page is made that goes into the menu, you simply tag it with the category where it should go. You can click the main header of the menu to go to a page with all the posts in the category. Then you hover over the header of the menu, and I want a dropdown menu with a list of posts in there. I want to limit this to a certain number of posts, then have a button for "more" at the bottom. You can see an example here.

Let's take a look at the code at the start of my menu. This basically encapsulates the markup for the menu, and for the first dropdown. I have this in a separate "nav_menu.php" file but it could go in your header as well.

   <div id="nav_menu">
   <ul id="main-nav">
    <li id="solutions-nav" class="singlelevel"><a href="./?cat=9&amp;feature=solutions">Solutions For...</a>
     <div class="subnav">
      <ul>
        <?php query_posts('cat=9&posts_per_page=10&orderby=title&order=ASC'); ?>
       <?php while (have_posts()) : the_post(); ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
       <?php endwhile; ?>
       <li><a href="./?cat=9">More...</a></li>
      </ul>
     </div>
    </li>

So, take a look at the php code there. First of all, important to note, this disrupts the wordpress loop so we'll need to fix it a little bit later. First, it does a post query limiting the list to one category (you can search by "category_name" but I'm a fan of the Id's) and then setting a limit to how many to pull; I chose 5 by default. Then, there's a while loop that pulls some data from each post and formats it into a listed menu entry. After the while loop closes, I throw out the "more" button which queries the whole category for posts.

If you do just that, every time you try to list posts you'll pull a list of every post you've got and it will supremely annoy you. You need to reset your post query to be able to limit it to the page at hand. At the bottom of my theme's "header.php" file, right before the posts would get displayed by "index.php," I added the following php line:

<php query_posts('cat='.@$_GET['cat'].'&p='.@$_GET['p']); ?>

This will pull the post list based on the categories selected or the specific post listed; all of my links and navigation are handled through those 2 "GET" variables so it will limit the posts queried to anything selected. Make sure to put the @ before $_GET to suppress any errors the get command gets, for example, if there's nothing passed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -