Miner Phil

The place where I unearth useful bits


Archive for January, 2013

Groovy in Netbeans

Wednesday, January 30th, 2013

Not too long ago, I started using a framework called GRAILS, which meant learning Groovy. To my delight, Groovy is a groovy language!

I’ll save my explanation for a later post. For now, I leave you with this article describing how to use Groovy in a classic Java program using Netbeans. Enjoy!

http://netbeans.org/kb/docs/java/groovy-quickstart.html

Python Enumerate

Monday, January 7th, 2013

I find myself programming in a variety of languages these days. Today, I found a nugget of information pertaining to retrieving the index of a for-each-loop’s iteration.

 Python |  copy code |? 
1
data = ( 'a', 'b', 'c' )
2
for i, f in enumerate( data ):
3
    print "%d => %s" % ( i, f )

From:
http://zerokspot.com/weblog/2007/03/12/for-loop-with-index-in-python/