Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

python - Is this parallel calculation using the new concurrent.futures lib OK? -


i submitted following, runs ok me, have single core machine , take documentations comment spread on more cores if had them; automatically.

from concurrent import futures import math  numbers = [     112272537195293,     112582718962171,     112272537095293,     115280098190773,     115797840077099,     1099726829285419]  def lowest_factor(n):     if n % 2 == 0:         return 2     sqrt_n = int(math.floor(math.sqrt(n)))     in range(3, sqrt_n + 1, 2):         if n % == 0:             return     return n  def main():     print( 'for these numbers:\n  ' + '\n  '.join(str(p) p in numbers) )     futures.processpoolexecutor() executor:         low_factor, number = min( (l, f) l, f in zip(executor.map(lowest_factor, numbers), numbers) )         print('    mnimal prime factor %d of %i' % (low_factor, number))  if __name__ == '__main__':     main() 

it looks ok me running in python 3.2b1 (r32b1:87064, dec 5 2010, 19:08:18), welcome criticism others. p.s. did above this: http://rosettacode.org/wiki/parallel_calculations

i bought multi-core laptop xmas. example worked fine.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -