iD NEWS & BLOG
Preparing for Camp
Summer is just around the bend and it’s time to start thinking about camp. What will you bring? How will you prepare? These are common questions from both first-time and seasoned campers. Let’s explore some of the answers below.
How to prepare:
I suggest starting to pack early, even a week in advance. This will allow you time to go out and buy anything you realize you still need before you have to leave. Please make sure your registration is in order and that your camp account is paid and up-to-date. You may want to bring with you the confirmation of your registration and your map/driving directions.
What to bring:
If you’re an Overnight Camper, please refer to the iD Tech Camps’ checklist. But in general, just bring your daily essentials. We advise you not to bring anything you wouldn’t want to lose. Medications and other essentials should be clearly marked and all health conditions should be reviewed at check-in. For the benefit of your child, please make sure to disclose all medical issues with the registration materials. This way the Director and staff are informed in advanced and can make your child’s experience that more enjoyable.
And remember…
We’re here to help! Should you have ANY questions prior to, during, or after camp, our Client Services Representatives are available to assist you by phone or email. While at camp, your child is encouraged to bring any questions or concerns to the camp staff since all staff are extensively trained and ready to help.
However, the most important thing to bring to camp is your eagerness to learn and have a fun week. You’ll find that attending iD Tech Camps will be one of the most exciting and long lasting things you’ll do this summer. And you’ll make many friends who share similar interests. Now you can even stay in contact by visiting The iD Basement – Enjoy it!
Posted in iD Tech Camps | No Comments »
Trip to iD Tech Headquarters: Part 3
Welcome back guys! I had intended to post the conclusion to this prank last week but I was busy at our annual staff training at Lake Forest College in Chicago (more on that soon!)
For those just tuning in, this is the final installment covering the annual prank on Pete. In my last blog I documented how we covered Pete entire house with little green army men, now, it’s after hours and my team of merry pranksters has infiltrated the iD Tech Headquarters and we about to cover the office just the same. We decided to Make Pete’s desk the epicenter of the green army men but start with a line of them from the elevator, that would meet up with a similar line of them coming from his desk and include a tableaux in the middle.
Ken, from IT, spearheaded the battalion starting at the elevator, arranging his soldiers in a tight single-file formation:
Jami, SoCal Regional Manager, lead her troups into battle starting from Pete’s desk. Jami implemented more guerilla style tactics, marching her soldiers in a staggered, tessellated pattern:
They meet in the middle:
It’s an ambush!?
And finally, the view from Pete’s war-torn desk!
Despite all these solders, we are all about peace a love at iD! We just have a funny way of showing it with these goofy pranks – Pete is always a great sport!
Tags: headquarters, parnks, pete
Posted in iD Tech Bloggers | No Comments »
Making a Poll in PHP from Scratch: Part 1
There are plenty of ready-made Internet polls out there, particularly if you are using a framework for your site such as Wordpress, vBulletin, or Joomla/Drupal. But occasionally it is worthwhile to create your own from scratch, whether for learning or to simply fulfill specific features you need in your application. In this series of posts, that is exactly what we will create – a homemade PHP/MySQL voting page. You should be then able to modify this code for your specific needs.
First, let’s talk about the inherent flaws in Internet voting. In the most basic form, an Internet poll is just a choice a person makes on a page that is stored in the database. Without any checks, a person could just refresh the page and vote over and over again. Or, worse, they could employ a script of their own that does this automatically. You could potentially register millions of votes this way, given enough time. So what checks and balances do we have? There are three main options.
User Login
A user login system is the most secure of your options, especially if the accounts are linked to a unique email address. If you are using a system like Wordpress or Drupal, then it is trivial to store the userid of the voter in the database as well. Do you want to use this option with your poll? If the user is already logging in for other reasons, then this is probably fine. Making a user register just to vote in a poll brings the convenience factor way down, most likely deterring most people. Plus, is it really worth it? If a user has the time and inclination, they can simply register over and over again, especially if they have their own domain or email server from which to pull infinite accounts. You could employ some IP-checking with your account checks to make sure they are unique, but then it just becomes an arms race. This option is too burdernsome for us to use in this project.
Cookies
We could use cookies set on a person’s machine to determine whether they’ve voted or not, but all it takes is a browser switch, cleared cache, or a privacy mode and suddenly our checking goes right out the window. This option is almost too simple for the user to overcome.
IP Address
The last major option is an IP address check. There are several flaws with this method, like the others, but we can overcome a few of them more easily. First, IP addresses are not a one-address-to-one-person mapping. The system can go either way, in fact. You can have multiple IPs for a single person, if they have multiple systems, a cellphone, so on. You can also have multiple people for an IP, in the case of a corporate network. You could have 10,000 people registering as a single IP. But these are problems we can find workarounds for. We’ll use IP checking in conjuction with a few tricks as our authentication method.
Database Structure: Your Favorite Fruit
For this poll, I’m creating two different database tables, mypoll and mypolltally. The first table will contain all of the choices in our poll and the second the individual votes. This means that we can only have a single poll at a time, but this is a trivial matter in the future to extend (we would simply add another column to mypoll, pollid, containing a unique identifier. Then we would just need a column in mypolltally to store the pollid of each vote).
mypoll mypolltally -------------------------- -------------------------------------------- | id | choice | | id | isvotefor | ipaddress | value | -------------------------- -------------------------------------------- | 0 | banana | | 0 | 3 | 255.255.255.255 | 1 | | 1 | apple | | 1 | 4 | 254.255.255.255 | 1 | | 2 | orange | | 2 | 1 | 251.255.255.255 | 1 | | 3 | strawberry | | 3 | 2 | 252.255.255.255 | 1 | | 4 | blueberry | | 4 | 2 | 253.255.255.255 | 1 | -------------------------- --------------------------------------------
The Fields
mypoll:
- id: A unique identifier for records in the table. When we register a vote in mypolltally, we’ll need to know which option we are voting for. We’ll use this value to do so.
- choice: The text for each option. Our poll question is “What is your favorite fruit?”, so here we lay out the choices such as
- banana, apple, and orange.
mypolltally:
- id: A unique identifier for each vote in the system.
- isvotefor: This field points identifies which option in mypoll that this vote is selecting.
- ipaddress:The IP address of the voter.
- value:We can extend our features a little by having this field. Instead of simply registering a “Yes” for a particular option, we can register a range. We can then allow people to indicate how much they like the option. Perhaps a 1 value is a little, a 5 value is a lot, and anything negative means they do not like it. For now, a value of 1 will just mean yes but later we’ll extend it for enhanced voting.
That’s enough of the theory for now. In the next part of the series we’ll launch into the actual PHP code and finish up with the basic functionality. In Part 3 we’ll extend our code to allow for more features.
Tags: internet poll, internet polls, internet voting, mysql, PHP, php mysql, php poll, poll, voting
Posted in iD Tech Bloggers | No Comments »
Trip to iD Tech Headquarters: Part 2
Welcome to the exciting continuation of “Trip to iD Tech Headquarters”. If you are just tuning in let me bring you up to speed. We are the annual iD Tech Paella party, hosted by none other than CEO Big Pete himself. Every year at this event my department, the regional managers, play a big prank on Pete. So what was the prank this year?
Our weapon of choice: little green army men, approximately 1,000 of them
Our mission: secretly fill every nook-and-cranny of Pete’s house with them
While Pete was distracted cooking Paella and dancing the “eclectic slide” my cohorts and I rotated in and out of Pete’s house, with pockets full of little green army men. Here are some photo’s from our embedded reporters:
However it doesn’t stop there! Under the cover of darkness, at around midnight, a special “Delta Force” of soldiers was mobilized and invaded the iD Tech Headquarters! Though the assault on Pete’s house was fun, we out did ourselves in the office!!! Tune in next week for the exciting conclusion of operation “Make Pete Crazy with 1,000 little Green Army Men” and see Pete’s reaction!
Posted in Uncategorized | 1 Comment »
Randomizing your Flickr to vBulletin Feed
Last time I discussed pulling your Flickr feed into a vBulletin installation (or really, any php-based CMS/website). That solution pulled the lastest photos up to some amount and displayed them. But what if you want to randomize them and not always display the pictures in the same order? We’ll be pulling a large amount of photos from Flickr and I don’t always want only the last ones to show up in the same order. Instead, I’d like to pull the last, say, 200 photos and randomly display 10 of them. Here’s the code modification from last week’s post:
require_once("includes/phpFlickr.php");
// Create new phpFlickr object
$f = new phpFlickr("yourapikey");
$f->enableCache("db","mysql://user:password@server/database");
$limit = 200;
$count = 10;
// Find the NSID of the username inputted via the form
$person = $f->people_findByUsername('iDTechCamp');
// Get the friendly URL of the user's photos
$photos_url = $f->urls_getUserPhotos($person['id']);
// Get the user's first X($limit) public photos
$photos = $f->people_getPublicPhotos($person['id'], NULL, NULL, $limit);
$flickrbox = "<table class='flickrbox'><tr>";
$nonrepeatarray = array();
for ($i = 0; $i < $count; $i++) {
$rand = rand(0,199);
while(in_array($rand,$nonrepeatarray)) $rand = rand(0,199);
array_push($nonrepeatarray, $rand);
$photo = (array)$photos['photos']['photo'][$rand];
$flickrbox .= "<td><a class='flickrimg' href=$photos_url$photo[id]>";
$flickrbox .= "<img border='0' alt='$photo[title]' "
."src=" . $f->buildPhotoURL($photo, "Square") . ">";
$flickrbox .= "</a></td>";
}
$flickrbox .= "</tr></table>";
You can see I’ve highlighted the altered sections in red. First, we up the $limit to 200. Then we introduce a new variable, $count. This variable will contain the number of photos we’d like displayed of the 200 we’re pulling. Next we change our foreach loop into a regular for loop. We will then randomly generate a number between 0 and 199 (remembering that arrays begin at 0, not 1). We run a while loop to check if that number is already in an array we’ve been keeping called $nonrepeatarray. If it is there, we draw another number. If it isn’t, we exit that loop, add it to the array, and keep moving with the portion of the loop dedicated to building the image display.
Although this may not be the most efficient method, it is simple. Plus, we have caching enabled through the phpFlickr API, so that will help. Other ways of doing the exact same thing include generating an array containing the values 0-199, shuffling the array, and then popping off one element each time. You are guaranteed not to have repeats.
For other methods of generating random, non-repeating numbers, with sample code, see here: http://www.phpbuilder.com/board/showthread.php?t=10329337.
Tags: Flickr, Flickr API, non-repeating random numbers, PHP, phpFlickr, random numbers, vBulletin
Posted in iD Tech Bloggers | 2 Comments »




















