I recently set up two photo galleries using two different mechanisms.

The first used ratings (iTunes style) to prioritize.  5 stars meant 5 times
the frequency of a 1 star photo.  That worked well.  I cached a list of Ids
(with 5 star photos being listed 5 times), in the app scope, picked an index
at random when I needed an image, and then used the ID at that index to
fetch the actual image data.  That way I didn't have to store the image data
5 times for 5 star photos.  This works well for screensaver or slideshow
type apps, where you just want a random photo, and you want one you like
more often than not.

The second organized the photos into directories (conceptually, at least).
To select a photo, first a directory was selected at random (no weighting),
and then an image was selected from that directory at random (again, with no
weighting).  You could certainly weight the categories differently, and even
the individual items, but that's a lot of nastiness, potentially.  This
works well if you want to control distribution across the categories, but
not necessarily individual images.

I think the latter is basically what you're describing at the end of your
message.

Cheers,
barneyb

> -----Original Message-----
> From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 18, 2004 2:08 PM
> To: CF-Talk
> Subject: ad weights
>
> Here's a fun task. I'm building pay per click ads for HoF (in
> place of banner
> ads and yes, the list ads are coming off). One thing is that
> I need to give each
> ad a weight in relation to another to show how often it
> should come up. I've
> thought of a few ideas and wanted to hear what others think.
> Basically, there's a table of ads that's dumped into an
> application array for
> caching. The question is, how to dump the ads in order to
> give 'high paying' ads
> more show than 'low paying' (or free) ads.
> This is one idea:
> When this table is dumped into an application array, a
> position in the array is
> given for each ad for each dollar (or part) it has.
>     .01 is 1 position.
>     $1 is 1 position.
>     $1.01 is 2 positions.
> This is rather simple and works well for small amounts of
> ads, but when you get
> a lot, it fails.
> ex: 99 ads at .01 and 1 ad at $5 will equal an array of 104
> items. The big
> paying ad has a greater chance of being seen in relation to
> any other ad, but is
> buried under all the low paying ads.
> Another idea is to have sub arrays for each price grouping.
> In this example, the
> chances of a $5 text ad coming up is far greater than a $1 ad
> and if a $5 comes
> up, then it'll be one of several $5 ads. This may work and
> I'm building it now.
> Critique?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to