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!

Monday, December 13, 2010

Vaad HaTznius - Washing

From Harry's Black Hole email.

The following statement has just been released by the Vaad Ha Tznius:

The Vaad Ha Tznius has just issued the following guidelines regarding laundry. It has come to our attention that many families, including those who pride themselves on following all aspects of halacha, are regularly not conforming to proper Tznius guidelines. Unbelievably, many, many families are washing men's and women's clothing together at the same time in the same washing machine. This is an unprecedented breach of Tznius!!! How could anyone think that one is allowed to wash men's and women's undergarments at the same time in the same washing load?!!! What has our nation come to when people have fallen to such a low level? For shame!!! This practice must stop!!! Given this we are issuing the following guidelines regarding the doing of laundry.

1. Ideally each observant home should have two washing machines and two dryers - one washing machine and one dryer should be used exclusively for men's clothing and the other washing machine and dryer should be used exclusively for women's clothing.

2. In the event that a family cannot afford to have two washing machines and two dryers, the following rules should be adhered to. ... See More
a. Under no circumstances should men's clothes be in the same machine as women's clothing. They should, of course, also be dried separately.
b. After doing a load of men's clothing, one should run the washing machine through a complete cycle without any clothes in it. Then one may wash women's clothing in this machine. The same procedure should, of course, be followed after washing a load of women's clothing, namely, run a complete cycle without any clothes in the machine. Then one may wash men's clothing in the machine.
c. After drying a load of men's clothing the dryer should be allowed to cool off completely. After this, one may use the dryer for drying women's clothes. The same applies after drying a load of women's clothing before using the dryer for men's clothing. It is not enough to let the dryer cool below Yad So Ledas Bo. The dryer must be completely cooled off.

Our forefathers lived in a land that was between two rivers - the Tigris and the Euphrates. The reason is obvious to anyone who thinks into it a bit. One river was used to wash women's clothing and the other to wash men's clothing. Surely we can continue this tradition by observing the rules stated above. We are confident that everyone who takes Yahadus seriously will abide by the guidelines stated above.
With Torah greetings,
The Vaad Ha Tznius

Thursday, December 9, 2010

Частушки

Рыбка плавает в томате,
Ей в томате хорошо,
Только я, едрена матерь,
Места в жизни не нашел.
Fish in thick tomato sauce
Swims in happy comatose,
Only me, pathetic wimp,
Have no fucking place to swim.

По реке плывет топор из села Чугуева,
Ну и пусть себе плывет железяка ...
Down the river drifts an axe from the town of Byron,
Let it float by itself- fucking piece of iron!!!

Я лежала с Коленькой совершенно голенькой,
Потому что для красы я сняла с себя трусы.
I was sleeping with my honey absolutely naked;
I have taken off my panties just to make a statement.

С неба звездочка упала
Прямо милому в штаны,
Пусть горит там, что попало,
Лишь бы не было войны.
Starlet's fallen from the heavens right into my boyfriend's briefs,
I don't mind his roasted penis if it helps us live in peace.