| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> a few lets wouldn't hurt. <1> yeah, you have that stray 'doInput list' at the top level there <2> Cale: no main calls doInput <1> then you need to indent the doInput <3> What's input for Theta? <4> As it's part of the definition of 'main'. <0> @type sum <5> forall a. (Num a) => [a] -> a <3> Cale, what's the input for theta? <1> Aleks: I don't understand the context of your question
<1> Manyfold: also, what's list? <1> Manyfold: perhaps you want to p*** it the empty list? <3> sin(theta) = 2/3 and pi<=(thetat)<=pi/2, find cot(theta) <3> that's just (theta) not thetat <3> understand now? <6> Aleks: have you tried drawing a right triangle to solve that problem? <7> back <8> int-e annotated #21967 with "(for Manyfold) this could work" at http://paste.lisp.org/display/21967#1 <9> Manyfol1: yay <7> Cale: it's excercise 3.10 in the tutorial you pointed me recently <1> Manyfol1: yeah, I recognise it <1> int-e: that still has indentation and typing problems <3> <6> ...no... it would help though :x <0> Cale: I guess the if then else has problems. what typo did I miss? <1> int-e: not typos, but various types don't match <0> oh yes. getLine is bad :) <7> num is really a string? <8> int-e annotated #21967 with "(for Manyfold) with style changes; this one actually works." at http://paste.lisp.org/display/21967#2 <7> so num = read numString peerhaps? <0> you have to use let for declaring pure values within do blocks <0> you can either use readLn (as I did) which is basically a getLine followed by a read. <10> sum = foldr (+) 0 <10> product = foldr (*) 1 <0> there are really many ways to do it: a) x <- getLine; let y = read x b) x <- liftM read (getLine) c) x <- getLine >>= return . read d) x <- return . read =<< getLine (some people prefer this to c) ) <0> e) instead of let y = read x you could use y <- return (read x) <10> x <- read `fmap` getLine <0> then there's readLn and I think that covers the most reasonable versions. <8> Cale annotated #21967 with "a solution to the problem" at http://paste.lisp.org/display/21967#3 <1> readLn <1> @type readLn <5> forall a. (Read a) => IO a <1> oh, it was mentioned <11> Hrm <11> x^(ab) - x^a <- can this be reduced anymore? <1> it can be factored <10> x^a(x^b - 1) <11> right eight <0> xerox: not quite <11> x^a*x^b - x^a
<10> No! <11> no <11> nono <11> x^(ab) = x^a^b <10> Right :) <0> x^a (x^(ab-a) - 1) = x^a (x-1) (x^(ab-a-1) + ... + x + 1) <0> CoffeeBuzz: I'd read that as x^(a^b) though, not (x^a)^b <11> int-e, yeah, i ***umed you knew whay i meant ;) <0> CoffeeBuzz: better add these parentheses. <12> CoffeeBuzz: ^ is right ***ociative so a^b^c = a^(b^c). <3> Thanks for all the help, cya! <11> % Solve[x^a + 1 == 0] <5> CoffeeBuzz: {{a -> (I*Pi)/Log[x]}} <11> how do you tell it to solve for x? <11> % Solve[x^a + 1 == 0, x] <5> CoffeeBuzz: {{x -> (-1)^a^(-1)}} <11> nevermind <11> % Solve[ (e^(a*k^2*s^2) / (k^2*s^2) == 0, s] <5> CoffeeBuzz: $Failed <11> pfft <11> oh <11> % Solve[ e^(a*k^2*s^2) / (k^2*s^2) == e^a, s] <5> CoffeeBuzz: {{s -> ((-I)*Sqrt[ProductLog[-((a*Log[e])/e^a)]])/(Sqrt[a]*k*Sqrt[Log[e]])}, {s -> (I*Sqrt[ProductLog[-((a*Log[e])/e^a)]])/(Sqrt[a]*k*Sqrt[Log[e]])}} <13> CoffeeBuzz, e^(blah)/blah is never 0 <11> yeah just realized that ;) <11> ok, time to type in this monster <11> % Solve[ e^(a*k^2*s^2) / (k^2*s^2) - e^(a*r^2 + s^2) / (r^2 + s^2) == e^(a*r^2 + a*s^2*t^2) / (r^2 + s^2*t^2) - e^(a*r^2 + a*y^2) / (r^2 + y^2), y] <5> CoffeeBuzz: {{y -> -(Sqrt[-(a*r^2*Log[e]) - ProductLog[(a*Log[e])/(e^(a*k^2*s^2)/(k^2*s^2) - e^(a*r^2 + s^2)/(r^2 + s^2) - e^(a*r^2 + a*s^2*t^2)/(r^2 + s^2*t^2))]]/(Sqrt[a]*Sqrt[Log[e]]))}, {y -> <5> Sqrt[-(a*r^2*Log[e]) - ProductLog[(a*Log[e])/(e^(a*k^2*s^2)/(k^2*s^2) - e^(a*r^2 + s^2)/(r^2 + s^2) - e^(a*r^2 + a*s^2*t^2)/(r^2 + s^2*t^2))]]/(Sqrt[a]*Sqrt[Log[e]])}} <11> % Solve[ e^(a*k^2*s^2) / (k^2*s^2) - e^(a*r^2 + s^2) / (r^2 + s^2) == e^(a*r^2 + a*s^2*(k^2 - 1)) / (r^2 + s^2*(k^2 - 1)) - e^(a*r^2 + a*y^2) / (r^2 + y^2), y] <5> CoffeeBuzz: {{y -> -(Sqrt[-(a*r^2*Log[e]) - ProductLog[(a*Log[e])/(e^(a*k^2*s^2)/(k^2*s^2) - e^(a*r^2 + s^2)/(r^2 + s^2) - e^(a*r^2 + a*(-1 + k^2)*s^2)/(r^2 - s^2 + k^2*s^2))]]/(Sqrt[a]*Sqrt[Log[e]]) <5> )}, {y -> Sqrt[-(a*r^2*Log[e]) - ProductLog[(a*Log[e])/(e^(a*k^2*s^2)/(k^2*s^2) - e^(a*r^2 + s^2)/(r^2 + s^2) - e^(a*r^2 + a*(-1 + k^2)*s^2)/(r^2 - s^2 + k^2*s^2))]]/(Sqrt[a]*Sqrt[Log[e]])}} <13> what the hell <11> does it use e = exponential ?? or is there some f'n to do that <11> exp? <11> E? <14> Use E <11> % Solve[ E^(a*k^2*s^2) / (k^2*s^2) - E^(a*r^2 + s^2) / (r^2 + s^2) == E^(a*r^2 + a*s^2*(k^2 - 1)) / (r^2 + s^2*(k^2 - 1)) - E^(a*r^2 + a*y^2) / (r^2 + y^2), y] <5> CoffeeBuzz: {{y -> -(Sqrt[-(a*r^2) - ProductLog[a/(E^(a*k^2*s^2)/(k^2*s^2) - E^(a*r^2 + s^2)/(r^2 + s^2) - E^(a*r^2 + a*(-1 + k^2)*s^2)/(r^2 - s^2 + k^2*s^2))]]/Sqrt[a])}, {y -> Sqrt[-(a*r^2) - <5> ProductLog[a/(E^(a*k^2*s^2)/(k^2*s^2) - E^(a*r^2 + s^2)/(r^2 + s^2) - E^(a*r^2 + a*(-1 + k^2)*s^2)/(r^2 - s^2 + k^2*s^2))]]/Sqrt[a]}} <11> thats not as pretty as i hoped it would be <13> if you're trying to solve horrible equations then you probably need to rethink the problem <11> well... i'm building a difference of gaussian image pyramid using incremental gaussian blurring (std dev = s)... but I pre-smooth with gaussian stddev = r. <11> say I is my image, G(s) is Gu***ian blur kernel, stddev s. let L(s) = G(s)*I (* = convolution). Then I multiply s by some constant factor k, and subtract the two so D(s) = L(ks) - L(s) <11> next level... D(ks) = L(k^2s) - L(ks) ... etc <11> but ... i figured instead of using huge kernels as k gets raised to higher powers, you can do it incrementally. L(k^(p+1)s) = L(k^ps)*G(u) ... where u ends up = k^p*s*sqrt(k^2 - 1) ..
Return to
#math or Go to some related
logs:
vim behind assertion #css #javascript #math phpfunction onclick echo perl recursive macro grub Hyperthreading disable #debian debian fluxbox startup ubuntu ifconfig vmnet
|
|