Geeks With Blogs
My Blog geek yapping September 2009 Entries
The slippery slope of "var"
The var keyword has been a rather controversial addition to the C# language. Many developers initially fear it, getting lost in demos that use it. Eventually, they come to understand it as something "lazy" programmers would use and often dismiss it. I've gone through these stages. I even remember my blood boiling when I saw resharper, out of the box, suggest to use it! I never really understood it as anything more than implicit typing. Recently, I decided that I should learn new concepts with new ......

Posted On Thursday, September 24, 2009 3:21 AM

Weighted Average in python
	def WeightedAverage(items, value, weight):
		numerator = sum(value(i) * weight(i) for i in items)
		divisor =  sum(weight(i) for i in items)
		return (numerator / divisor) if divisor != 0 else None

Posted On Sunday, September 6, 2009 2:17 PM

Copyright © Wes McClure | Powered by: