March 12, 2010

Pages


Search Site


Subscribe

...to receive future posts via email.

Topics



Archives

Entries Tagged as 'Misc'

Pollyanna Setup Script

November 16 2009 by Adam

Pollyanna — or Secret Santa, as I understand it's often referred to outside of PA — is a great way to do a gift exchange in a large group while keeping costs down for those involved. Everyone is randomly assigned another member of the group to buy a gift for, and nobody knows who anyone else has been assigned. My wife and I do this with our friends, and to complicate things, most of us are married or at least dating, so we stipulate that you can't accept a drawing of your significant other. So when the hat gets passed to me, if I draw my wife's name, I just put it back and draw again. If we get stuck in a stalemate, we just start over.

We usually do our drawing during our Thanksgiving get-together, but this year we forgot. A quick Google search only showed one site that let you setup a Pollyanna, and it's got several requirements that don't meet my needs (#1 being that I don't want to make my friends sign up for a site just to do Pollyanna drawings); so I decided to write a quick ColdFusion script to do a random drawing that meets our extra rules and then automatically email everyone their gift recipient.

This is fairly basic, but it got the job done for us. If I were going to do anything else with it, I might add list support to the "noPick" option to allow listing multiple participants that can't be picked for the current person.

First, let's create a list of people who are participating, and their email addresses. In addition, put in each person's significant other in a field we'll call "noPick", so that we can stop them from picking that person.

Now, I know I'm going to want to randomly select from a list, so let's pull in listGetRandom from CFLib.

/** * Returns a random selection from a comma delimited list. * Modified by Raymond Camden * * @param List The list to grab a random element from. (Required) * @param Delimiter The list delimiter. Defaults to a comma. (Optional) * @return Returns a random element from the list. * @author Brad Breaux (bbreaux@blipz.com) * @version 2, March 12, 2004 * http://cflib.org/udf/ListGetRandom */ function ListGetRandom(instring) { var delim = ","; var rnum = 0; var r = ''; if(ArrayLen(Arguments) GTE 2) delim = Arguments[2]; if(listlen(instring) gt 0) { rnum = randrange(1,listlen(instring,delim)); r = listgetat(instring,rnum,delim); } return r; }

Now, I know from first-hand experience that this can sometimes result in two or three complete restarts due to deadlock. When you're dealing with true randomness, there's no telling how many restarts you might need, so I know I want to write a recursive function so that it can restart itself as many times as needed if we detect a deadlock; and I want it to accept my original structure of people as input.

Inside that function, let's immediately create 2 lists of all of the participants: 1 to loop over for the person drawing from the hat, and 1 to represent the names in the hat. We'll also need a structure to hold all of the successful drawings, a variable to hold the current pick from the hat, and a variable to act as our loop index.

Loop over all of our entrants – once each – and let them pick a name randomly from the pool of remaining names in the hat.

This is where we start to apply our constraints. Deadlock is when there's only one name left in the hat, and it's either the person themself, or their significant other. Check for deadlock, and if it's found, recurse.

There's actually one more deadlock scenario that I didn't run into in my testing or pick up on until I started writing this all out. Do you see it? (Answer is in the next paragraph, so don't jump ahead if you want to figure it out.)

It's when there are 2 names left in the hat and they are myself and my significant other. So, to account for that, let's rewrite the above code as follows. We'll loop over the remaining names in the hat, and the first time we find a name that doesn't violate the rules, we break out of the loop. If we make it all the way through the loop, we're in a deadlock, and need to restart.

Since we're adding two new variables for the deadlock check, don't forget to go back and var scope them.

So now we know we're not in a deadlock, the only remaining rule is that as long as I've picked myself or my significant other, I need to put that name back and draw another one. Once I've drawn a suitable name, escape this loop.

Remove the selection from the pool of remaining people, save the selection so that it can be used later to send an email, and pass the hat.

That's the meat and potatoes of the selection. All that's left is to send the emails, and I'm sure you can figure out how to do that.

Posted in ColdFusion | Misc | 1 comments

How to update your FeedBurner feed name without losing subscribers

March 06 2009 by Adam

This blog, before I bought the domain FusionGrokker.com, lived at http://tuttletree.com/NerdFusion/ — a subfolder of my family blog. While there and operating under the title "NerdFusion," I setup FeedBurner using the same title, NerdFusion. When I bought this domain and moved my blog here, I knew I would rather have my FeedBurner URL reflect my new blog title; but I also knew from past experience that changing the FB url causes problems. Doing so abandons any and all subscribers, and after you realize that, you can't get the old url back, because it's "in use" (by whom, exactly?!) So I just left well enough alone, and until today I have been continuing to point my RSS links to the old FeedBurner link.

In my mind, this is retarded because the whole point of using FeedBurner in the first place is so that you can change your blog domain or blogging platform without losing subscribers in the process. If they have the same problem — albeit, not exactly the same, but close enough — then what benefit are they really providing? Ideally, they would allow you to create an alias that points back to the original feedburner url, as long as it was unique and available. Heaven forbid the easy, correct method be available though, right? This started as an informational post and has derailed into a rant.

*Cough* Back to business.

So FeedBurner has some, erm, "problems." I would really recommend that you not change your FB url.

Instead, create a new one and have your subscription links point to it. Let your old readers continue to use the old FB url. It won't hurt anything, I promise. The only down-side I've found to this, so far, is that your stats are now split between the two. I'm not much of a stats whore any more though, so it doesn't bother me that much — which is to say, at all. Half the time I can't remember my FeedBurner password, let alone feel like checking my RSS stats.

Now, my RSS link is what it should be: http://feeds2.feedburner.com/FusionGrokker/

I hope this helps prevent people from making the mistake of changing their FeedBurner URL only to find they have kicked their subscribers to the curb.

Posted in Misc | 4 comments

Who's in your Tweetdeck "misc" column?

March 04 2009 by Adam

I'm not married to Tweetdeck. I find myself going back and forth between it and Twhirl. Both have features I wish the other did, and I haven't been able to strike up the right balance. I wish Tweetdeck felt as polished as Twhirl. I wish Twhirl showed groups like Tweetdeck. And so on.

Anyway, the other day it occurred to me that most people that use Tweetdeck probably have a Misc column — I do. I thought it might be fun to put up a list of people you follow that don't fit into some major category that gets its own group. For example, I have groups for CF Community, and IRL (In Real Life — aka Meatspace), so you won't see any ColdFusion people or family memebrs in my list.

So here, in no particular order, is my Misc group.

  • @BarCampPhilly — Missed the first one, hoping to go next time.
  • @DarthVader — Do I really need to explain?
  • @DrHorrible — Eagerly awaiting chapter 4.
  • @FakeSarahPalin — Comic Relief
  • @FeliciaDay — See: Dr. Horrible.
  • @GreebleMonkey — A blogger whose path crossed mine.
  • @HigherEdCampPHL — Hoping to attend, expecting big things.
  • @ICHC — Comic Relief
  • @Jarrod_dixxon — Yes, I am a Stack Overflow fanboy.
  • @Jeresig — … and a jQuery fanboy.
  • @JimBreuer — For comic relief, if he would ever post…
  • @LeoLaporte — For awesome links.
  • @MarsPhoenix — I guess maybe I'm a space nerd at heart? Who knows. Just darn interesting!
  • @NerdMeritBadges — Yeah. Nerdy. That's me.
  • @Newegg — My favorite hardware retailer.
  • @Nothingface1 — One of my favorite bands.
  • @NotSam — A member of the Opie & Anthony radio gold team.
  • @OpieRadio — The O&A title character I would never have expected to embrace twitter…
  • @ParentHacks — I'm something like 5,000 posts behind on the PH blog, but I feel obligated to catch up one day…
  • @PennJillette — I love Penn & Teller. (Especially their Showtime show) Nuff said?
  • @PhillyLounges — Followed me randomly one day, looked half interesting. Decided not to block.
  • @RockBandDLC — Ahhhh, Rock Band. My favorite video game. How I love thee.
  • @SarcasticMomLC — Another blogger whose path crossed mine.
  • @SomeECards — Early notification of new cards so I can be the first to send them to my friends, winning all the coolness points.
  • @Spolsky — Who hasn't been following Joel for years?
  • @SuperDalgas — Another Stack Overflow team member.
  • @ThatKevinSmith — Yeah, I just like fat guys from NJ?
  • @TheToadies — Another favorite band.
  • @WilW — I had a crush on his TV mom.
  • @Wiseacre — Spectacular photographer; true to his name.
  • @xpdev — Free private SVN hosting.

Ok, so I lied. That was alphabetical order. I showed you mine, now you show me yours.

Posted in Misc | 1 comments

Graduation

February 16 2009 by Adam

It was with a great deal of fondness and appreciation that I submitted my resignation from Perficient last week.

I started with a small consulting firm by the name of E-Tech Solutions and based in West Chester, PA in December of 2005 — the 12th, to be exact; that's how fondly I remember it! — and since then my life has been in a state of constant change and growth (in more dimensions than one!). To be perfectly honest, I thought I was a damn good ColdFusion developer when I applied there — and it turns out I had a lot to learn.

I had no idea there were ColdFusion conferences, certifications, publications and mailing lists, and an enormous community of bloggers, twitterers, podcasters, and open source developers. That's a lot of media to try and absorb and keep straight, so it's no surprise that about the time I learned about these things is when I became an RSS fiend. I still whip out my iPhone to check up on bloglines at the oddest times…

When I wasn't working on client websites, I attended CFUnited in both 2007 and 2008, learned Model-Glue and ColdSpring in my free time, wrote a few open source projects myself, and got certified for ColdFusion 7. I've had my eyes opened to the beauty and importance of frameworks and design patterns.

… And there's so much more that if I wrote about it all you would drown in a sea of hyperlinks.

And I owe it all to one person: Chuck McElwee.

Chances are you don't know him. He had one article published in the CFDJ back in 2002, and used to chirp in on CF-Talk occasionally, but otherwise isn't really that involved in the ColdFusion community. He was my boss at E-Tech and he showed me that there was so much more to ColdFusion than me and the documentation vs. the world. (Although, for what it's worth, the documentation is so good that I would bet on us. ;)

When E-Tech was purchased by Perficient in early 2007, and with the economy starting its downward spiral, Chuck and I were fortunate enough to keep our jobs and continue working together. A large portion of E-Tech's business was ColdFusion consulting — and to a lesser extent, hosting our clients. While CF made up roughly half of our business (by my own estimate) the other half was Java, .Net, Sharepoint, and other Microsoft solutions. It was these other competencies that Perficient was most interested in, and so ColdFusion became the proverbial red-headed step child.

ColdFusion consulting gigs continued coming in for a while — and still do, to some extent — and I've had plenty to do and lots of opportunities to hone my C# skills, but as I'm sure many consulting firms are dealing with right now, billable hours are a little bit scarce no matter what technology you're talking about.

Consulting has taught me how to work at break-neck speed and how to help a client find a cost effective compromise between the solution they want and what they want to pay for it. But most of all, consulting has taught me that consulting is not a business I want to be in if I can help it.

I will always look back and remember E-Tech and Perficient as the true foundation of my career in web development. I only wish I could bring some of the excellent people I had the opportunity to work with along the way with me.

So where am I going? What does the future hold for me?

I have accepted a position at the University of Pennsylvania's Wharton School of Business.

I'm excited about the opportunity to work in an environment where extra time spent learning something new is considered a valuable effort; where opportunities exist for me to learn Flex, AIR, and other related technologies; and to work with some great minds (Sorry if there are others I didn't link… I just don't know about your blogs yet!) in what I'm told by many is a great program.

I am not taking Terrance Ryan's vacant position, but he did mention to me who he's pulling for as his replacement. ;)

I see so many opportunities and things I want to take advantage of in my future, and this job feels like the right way to start. Here's to the next step.

Posted in ColdFusion | Misc | 4 comments

Skype Hates the Elderly

December 26 2008 by Adam

A couple of days ago I got a call from my dad. He was at my grandfather's house, working on the laptop he and my mom gave him for Christmas. One of the primary reasons for giving him the laptop was that it had a webcam, and they were setting him up on Skype to be able to video-chat with our enormous and widespread family. But now there was a problem. He wasn't seeing any video — mine or his — on his end, even though I could see him when we would call each other. Days before this, we had tested everything and it was working perfectly.

So what changed between the passed test and the failed test?

  1. New location, ISP (Grandpa's house)
  2. Installed Microsoft Office
  3. Turned on Windows "Large Fonts"

My grandfather, like so many older people, doesn't have the greatest eye-sight, even with his glasses; and the Large Fonts feature of Windows really helps him use the computer.

As it turns out, this was the culprit. Changing back to "Normal" fixed the video problem. And through some clever tuning in the dialog found by clicking the "Advanced" button in that screenshot, you can make the fonts larger without using "Large Fonts," if necessary. I know Skype hasn't done this intentionally, and I've sent them a bug report via their suggestion form.

In the meantime, I hope this helps someone else out there trying to fix their grandparents' video problems.

Posted in Misc | 1 comments