elz: (ada-tubes)
[personal profile] elz posting in [community profile] intro_to_cs
First:

Open to: Registered Users, detailed results viewable to: All, participants: 25


Tickyboxes!

View Answers

Finished lecture 2
24 (96.0%)

Finished problem set 1
15 (60.0%)



Also, it occurs to me that it might be handy to have a place to post/discuss solutions to the problem sets, to see what we can learn from each other in the absence of TAs. If you actually go to MIT and the problem sets are still the same, don't read these. ;)

Fire away!

Date: 2009-11-12 06:47 am (UTC)
exor674: Computer Science is my girlfriend (Default)
From: [personal profile] exor674
from math import *

def primes_upto_n(n):
    primes = [2]
    choice = 1
    while len(primes) < n:
        choice += 2
        rt = sqrt(choice)
        isPrime = True
        # since we need all primes from 2 to n, this optimization works
        # we can prime-factor all non-prime numbers.
        for i in range(0, len(primes)):
            poss = primes[i]
            if (choice % poss) == 0:
                isPrime = False
                break
            if (poss >= rt):
                break
        if isPrime:
            primes.append(choice)
    return primes

primes = primes_upto_n(1000)
nthPrime = primes[-1]
sums = reduce(lambda sum,prime: sum+log(prime),primes)
print "Sum: ", sums
print "Nth Prime: ", nthPrime
print "sums / Nth Prime: ", sums/nthPrime


Yeah, this includes some weird-crazy optimizations >_<

kUsOwOPPqqovUv

Date: 2012-05-03 09:49 am (UTC)
From: (Anonymous)
Developing such a lens would make a lot of sense, since actually the comnpay that's stealing sales from Canon in this type of lens is SIGMA with their 30mm f/1.4 EX DC HSM (not Nikon, since their 35mm f/1.8 can't mount on a Canon anyways.)Sure, Canon has the affordable EF 28mm f/2.8 and EF 35mm f/2.0, but both of these are older designs and really only cover the extreme ends of the normal prime range equivalents on cropped bodies (28mm on APS-C = 46mm on FF, 35mm APS-C = 56mm FF). Of course, it's because both these lenses were originally meant for use on 35mm film cameras, and thus are not necessarily geared towards the cropped APS-C sensors of the Digital Rebels, XXD and 7D bodies.A proprietary Canon EF-S 30mm (49mm equivalent FF) or EF-S 32mm (51mm equivalent) comes closest therefore to the ideal 50mm classic normal focal range, and with an at least f/1.8 max aperture (preferably f/1.4 to compete with Sigma), and USM to boot for around the $200-$350 range, it would be a great buy. IMO, such a lens would almost certainly have to be EF-S in order to keep the cost down and not cut into sales of the cheaper 28mm and 35mm meant for FF bodies, unless Canon phases out those two lenses altogether and restrict FF users to the more expensive 28mm f/1.8 USM and 35mm f/1.4L USM.

Profile

Introduction to Computer Science

July 2010

S M T W T F S
    123
45678910
11121314151617
18192021222324
2526272829 3031

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 12th, 2025 01:41 pm
Powered by Dreamwidth Studios