// LinkedHashMap remembers the order in which the items are added to the list,
// which preserves the sorting coming from the db
Map<String, List<TopSellerDO>> topSellersByCategoryMap = new LinkedHashMap<String, List<TopSellerDO>>();
Tuesday, November 30, 2010
LinkedHashMap
If you have a HashMap in a particular order and want to make sure it gets maintained, use LinkedHashMap.
Tuesday, November 2, 2010
JSTL code to iterate over a Map
Helpful snippet of JSTL code to iterate over a
Map<String, List<SomeDO>>
<c:set var="topSellersByCategoryMap" value="${results.topSellersByCategoryMap}"/>
<c:forEach var="entry" items="${topSellersByCategoryMap}">
Name: ${entry.key}
Value: ${entry.value}
<c:forEach var="listitem" items="${entry.value}">
Item: ${listitem.merchant.domain}
</c:forEach>
</c:forEach>
<c:forEach var="entry" items="${topSellersByCategoryMap}">
Name: ${entry.key}
Value: ${entry.value}
<c:forEach var="listitem" items="${entry.value}">
Item: ${listitem.merchant.domain}
</c:forEach>
</c:forEach>
Thursday, July 22, 2010
Yeats poem
This was quoted in an email from Congressman Alan Grayson and I forgot how much I love it. Putting it here to hold onto for another day.
TURNING and turning in the widening gyre
The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world,
The blood-dimmed tide is loosed, and everywhere
The ceremony of innocence is drowned;
The best lack all conviction, while the worst
Are full of passionate intensity.
William Butler Yeats, "The Second Coming"
TURNING and turning in the widening gyre
The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world,
The blood-dimmed tide is loosed, and everywhere
The ceremony of innocence is drowned;
The best lack all conviction, while the worst
Are full of passionate intensity.
William Butler Yeats, "The Second Coming"
Wednesday, September 30, 2009
Eight stages on the wheel of spiritual development
In Nature and the Human Soul: Cultivating Wholeness and Community in a Fragmented World, Bill Plotkin describes eight stages on the wheel of spiritual development: Innocent, Explorer, Thespian, Wanderer, Soul Apprentice, Artisan, Master and Sage.
I was an Innocent until around 12-14.
I was an Explorer while I was drinking and finding my way.
I was a Thespian when I began "Acting as If."
I was a Wanderer when I began looking for HP.
I was a Soul Apprentice through my last years living in NYC.
I am now in the Artisan stage. Let's hope it lasts a long time. I'm really not ready to be a Master or a Sage yet.
I was an Innocent until around 12-14.
I was an Explorer while I was drinking and finding my way.
I was a Thespian when I began "Acting as If."
I was a Wanderer when I began looking for HP.
I was a Soul Apprentice through my last years living in NYC.
I am now in the Artisan stage. Let's hope it lasts a long time. I'm really not ready to be a Master or a Sage yet.
Friday, April 3, 2009
Wednesday, January 2, 2008
reenable select,contextmenu
There's a website I use a lot that has disabled right-click and text selecting, which is inconvenient as it lists addresses it would be extremely handy to be able to copy into another window for maps.google.com. So I created a scriptlet in a bookmark to re-enable this functionality.
Name: reenable select,contextmenu
Location: javascript:void(document.onmousedown=null);void(document.oncontextmenu=null)
Name: reenable select,contextmenu
Location: javascript:void(document.onmousedown=null);void(document.oncontextmenu=null)
Wednesday, October 10, 2007
Subscribe to:
Posts (Atom)