The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Dohh - category searches

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Dohh - category searches Posted: Mar 22, 2004 12:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Dohh - category searches
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I just made an update to the category search function. I implemented a cache that sped things up, but there was no proper date sorting. Why was that? Well, this is one of those times when my implementation "leaked". Here's what I did:

  • Each posting has a category
  • I created a cache dictionary, where the keys are the categories, and the values are a collection of files that have (one or more) postings of that category in them (there's one file per day in this implementation)
  • The collection was a Set, to prevent the same file from showing up twice in a particular category list

Using a Set, and then not dealing with that was the problem. When posts are placed on the screen, I just iterate over all the posts asked for and render them. That's fine when they are already in reverse chronological order - but a Set is unordered. I hadn't considered that, which is why - until five minutes ago - category searches were bringing back posts in a random order. It's fixed now :)

Read: Dohh - category searches

Topic: Seaside HoTo at StS 2004 Previous Topic   Next Topic Topic: Re: Crimson Room

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use