Monday, January 31, 2011

ColdFusion - Breaking output into columns using mod

Say you have a long list which you want to output, but you want to break it up into several columns. The way to do this is to use mod, which gives you the remainder from a division operation. The formula is very simple:
<ul><cfloop query="q_myquery">
<li>[output goes here]</li><cfif not q_myquery.currentrow mod ceiling(q_myquery.recordcount / [number of columns] )>
</ul>
<ul></cfif></cfloop>
</ul>
In this example, ul (unordered list) is used to create columns. You'll also need to set width and float in css, and can get rid of the bullets if they're not needed.

Make sure to put the statement after the main output, not before.

Thursday, January 13, 2011

No Pants - Big Hearts

This exchange was on the No Pants Subway Ride 2011 event's wall on Facebook.
As the exchange shows, having no pants is not the only thing the participants had in common. If seeing hundreds of people walk around without pants in the middle of winter didn't put a smile on your face, this surely will.

HEY this is a real shot in the dark but I found an iPod during the ridiculousness that was Union Square when it started to get dark. It belongs to an Anthony Rivera. Wish I could search through the entire event list but that's crazy talk. Hope I can find him! If you know him send him my way!
19 hours ago · ·

    • Anthony Rivera OMG thats mine. I LOVE YOU MAN
      18 hours ago ·

    • Tim Smith hahahahaha no waaaaaaaaaaaay I can't believe it. You don't have to give me the passcode if you don't want but can you describe the wallpaper or the kind of ipod JUST IN CASE you are another Anthony Rivera hahaha this is awesome
      18 hours ago ·

    • Anthony Rivera well the cover on it is like a mirror for one u can take it off... and fuck im not sure what the background was... i think i was the apple logo with a white splash behind it and a blue background i constantly change it.
      18 hours ago ·

    • Tim Smith yeah dude the mirror thing is good enough. So sick that this actually worked. I'm off to work right now, send me a message about where you are. I live in New Haven CT but frequent nyc all the time. Have a great day, happy I helped you out! Peace!
      18 hours ago ·

    • Richard Smith Good job Tim! If you want, drop it off at my place before you leave for S.C. and I will ship it to Mr Rivera at my expense, as I'm sure he wants it ASAP and you won't be back in CT for a week. I will need his address of course.
      16 hours ago ·

    • Tim Smith I'll find out Dad thanks.
      11 hours ago ·

Sunday, January 9, 2011

No Pants 2011

I came, I saw, I took off my pants.

Joined Improv for the annual No Pants Subway Ride. E train, car 9. At least I started on the E train. I didn't want to get off on the first stops in order not to get lost, except the opposite happened. Looks like everyone chickened out and only me and another guy took off our pants and got off. Didn't see anyone from the next car either. Then, instead of getting on the next E, accidentally got onto C and realized too late that we're on the wrong train. Ran pantsless across the street outside 72nd Street to get to the Downtown C. Met up with another straggler on the way back and when we finally got onto the final train, saw several other people who may have also got lost. Hopefully will appear on one of the photos or videos.

Decided to go home without pants and only put them on when I got off the subway. Ironically, unlike Manhattan, nobody in Brooklyn said a single word.

Even with the getting lost, was good fun. Looking forward to next year.

Mafia Wars - Adding building materials to Wishlist

After Zynga updated the Inventory page.  Adding items to wishlist stopped working, at least for me.  Clicking on the green "+" doesn't work in Chrome or FireFox.
Here's how to fix the problem in Chrome:

  1. Right-click on item picture and choose "Inspect element".
  2. Click on arrow next to detailed_wishlist div to open it.
  3. Click arrow next to wislistIcon div.
  4. Click on a element with WishlistController.addLoot event.
  5. In right column, double-click on the space between { } of element.style and enter position:absolute;left:1px; and hit enter.
  6. Click on the now working "+".

Sunday, January 2, 2011

Universal Pictures' new rental policy

Last night, we watched Scott Pilgrim vs the World.  I very much liked the movie, what I didn't like is the company who distributed the movie, Universal Pictures.

After watching the movie, I wanted to watch the specials, deleted scenes and bloopers.  While the menus and lists of clips are all there, if you try clicking anything, you will be met with a message that since you obtained this DVD semi-legally, i.e. rented it instead of honestly paying money for the movie, and are taking away food from the starving families of Universal Pictures' execs, you are not entitled to view the specials.  If, after watching the movie, you would like to actually see the specials, you will have to pay the full price of the DVD to view them.

Yes, all of you who are paying extra to Netflix to be able to view the DVD at home instead of streaming it are actually pirates and are stealing from the poor people at Universal.  So shame on you!

Why am I paying for Netflix?  Not everything is easy to find for download, especially HD.  Why am I paying for streaming +1 DVD? I like specials, specifically deleted scenes and bloopers.  Why should I rent Universal Pictures movies from Netflix instead of downloading?  I honestly don't know.

Good job Universal!  You new campaign to promote DVD sales and fight piracy is well thought out and extremely logical!