Forum: Legacy and Other Languages 16 Days Ago |
| Replies: 3 Views: 586 Take the sum and multiply by the step size. It's that easy.
Or see Simpson's method.
Edit: Gah, of course you have to have fractional endpoints. So treat the first and last segments specially. |
Forum: Legacy and Other Languages 17 Days Ago |
| Replies: 1 Views: 405 You need to tell us the error message and what line it's on, and you need to use CODE tags for us to want to look more closely. |
Forum: Legacy and Other Languages Sep 28th, 2009 |
| Replies: 3 Views: 808 Maybe it's base-64 encoded. Try assuming that and decoding it. |
Forum: Legacy and Other Languages Sep 25th, 2009 |
| Replies: 3 Views: 758 You can't be helped with such a vague request; ask friends and coworkers, or just fiddle around. |
Forum: Legacy and Other Languages Sep 15th, 2009 |
| Replies: 1 Views: 759 You haven't shared your own. |
Forum: Legacy and Other Languages Sep 10th, 2009 |
| Replies: 2 Views: 730 |
Forum: Legacy and Other Languages Mar 17th, 2009 |
| Replies: 7 Views: 754 First, make your life easier by making a function
(define (name x)
(cond ((pair? x) 'pair)
((symbol? x) 'symbol)
(else (error "i don't know how to handle this case"))))
... |
Forum: Legacy and Other Languages Mar 7th, 2009 |
| Replies: 7 Views: 1,659 The ironic thing is that your first pasting _was_ indented, if you look at when you quote it.
And I do want to help, I just identified for you the main thing you need to do to implement split... |
Forum: Legacy and Other Languages Mar 7th, 2009 |
| Replies: 7 Views: 1,659 Well, if you want to implement a split function, the first step would be for your code to handle all the possible cases. |
Forum: Legacy and Other Languages Mar 7th, 2009 |
| Replies: 7 Views: 1,659 What the ****. Do you realize how bad the indentation is?
Aghh. |
Forum: Legacy and Other Languages Mar 7th, 2009 |
| Replies: 7 Views: 1,659 |
Forum: Legacy and Other Languages Mar 7th, 2009 |
| Replies: 5 Views: 862 Both these links suck horribly. On the former, you can't find anything, and it holds no promise of having anything any good for C#, and the latter is just a site that links to other sites'... |
Forum: Legacy and Other Languages Mar 6th, 2009 |
| Replies: 5 Views: 862 If you're asking which is better, C# is inarguably better. There might be JVM languages like Scala or Clojure that are better than C#, though. |
Forum: Legacy and Other Languages Mar 4th, 2009 |
| Replies: 5 Views: 1,315 All you need to do to fix your problem is look at your code and imagine what a prolog interpreter would do when interpreting it. |
Forum: Legacy and Other Languages Mar 4th, 2009 |
| Replies: 1 Views: 486 |
Forum: Legacy and Other Languages Mar 3rd, 2009 |
| Replies: 5 Views: 1,315 Well you have more problems than just that. |
Forum: Legacy and Other Languages Mar 2nd, 2009 |
| Replies: 5 Views: 1,315 Your second predicate is going to match and override whatever you do in your third predicate. You need to handle nested lists before you handle non-nested lists. |
Forum: Legacy and Other Languages Mar 1st, 2009 |
| Replies: 0 Views: 699 Read this; enjoy.
http://ociweb.com/jnb/jnbMar2009.html |
Forum: Legacy and Other Languages Feb 26th, 2009 |
| Replies: 2 Views: 1,110 For what OS? My automatic answer is SBCL. |
Forum: Legacy and Other Languages Feb 20th, 2009 |
| Replies: 7 Views: 2,086 What is the ctr? What are you talking about.
You should regard this as a problem of approaching the list from one of three cases: the previous element having been a list, having been an atom, or... |
Forum: Legacy and Other Languages Feb 3rd, 2009 |
| Replies: 4 Views: 768 No, it says you have non-exhaustive patterns!
In particular, you defined the function binadd for non-empty lists with:
binadd (x:xs) (y:ys) n = ...
But you didn't define the function for... |
Forum: Legacy and Other Languages Feb 2nd, 2009 |
| Replies: 4 Views: 768 d2b2 evaluates to something of type [Int], right? Which means the expression (d2b2(n / 2):1) is trying to pass an [Int] as the left-hand argument of the (:) function. Since the (:) function is of... |
Forum: Legacy and Other Languages Jan 22nd, 2009 |
| Replies: 1 Views: 707 You know what time complexity means or can look it up, right? Why don't you use some reasoning to figure out why time complexity is useful? |
Forum: Legacy and Other Languages Dec 30th, 2008 |
| Replies: 3 Views: 1,075 Just write some code that does the algorithm you want, there's no "effective" solution.
I'm sure there's some matrix slicing functions you could use; Matlab does those faster than its interpreted... |
Forum: Legacy and Other Languages Dec 23rd, 2008 |
| Replies: 2 Views: 1,263 Sort them by the kind of terms they have, and then group the similar terms together.
Alternately, don't use letters at all in your representation of polynomials -- but this only works if you limit... |
Forum: Legacy and Other Languages Dec 20th, 2008 |
| Replies: 2 Views: 806 If you want to know what the algorithm is, read the whole paper. |
Forum: Legacy and Other Languages Dec 19th, 2008 |
| Replies: 2 Views: 798 This is a complete waste of your time. |
Forum: Legacy and Other Languages Dec 16th, 2008 |
| Replies: 1 Views: 683 I'm pretty sure you want something that works like the following:
(transform '(+ - + - / + - + - + + + / + + + - - - / + + + - - - - +))
It would make no sense to make transform into a macro. |
Forum: Legacy and Other Languages Dec 1st, 2008 |
| Replies: 3 Views: 1,001 Dynamic typing vs. crappy static typing vs. good static typing; concurrency. |
Forum: Legacy and Other Languages Nov 15th, 2008 |
| Replies: 2 Views: 956 awk '{ system("kill " $2) }' |
Forum: Legacy and Other Languages Nov 12th, 2008 |
| Replies: 1 Views: 930 Why don't you read Wikipedia? It has clear answers.
What does this even mean? |
Forum: Legacy and Other Languages Dec 21st, 2007 |
| Replies: 2 Views: 1,226 Yeah, it can be used for more than just textual input and textual output. You can do lame graphics without it being a big deal. But you are generally limited by the fact that the language and... |
Forum: Legacy and Other Languages Nov 26th, 2007 |
| Replies: 15 Views: 3,009 Well, yeah. I agree with calling functions (when used functionally in Scheme) functions. And calling procedures (when used procedurally, with side effects) procedures.
Of course, Scheme isn't... |
Forum: Legacy and Other Languages Nov 24th, 2007 |
| Replies: 15 Views: 3,009 There are no functions in Scheme, only procedures. That is, the word used in the R5RS specification (and probably R6RS, but I haven't read that) is "procedure". That's why there is a procedure... |
Forum: Legacy and Other Languages Sep 15th, 2007 |
| Replies: 66 Views: 15,149 It's not apt-get or aptitude that are good, it's the underlying package management system that they use.
And as far as the overlying interface is concerned, I recommend using Synaptic, unless it's... |
Forum: Legacy and Other Languages Sep 1st, 2007 |
| Replies: 3 Views: 1,498 Looks pretty straightforward. Just because an absurd compendium of redundant types and brackets is what you're used to looking at doesn't mean Smalltalk has a flawed syntax. |
Forum: Legacy and Other Languages Aug 31st, 2007 |
| Replies: 3 Views: 1,498 Looks like Smalltalk's syntax is nicer looking and more elegant. |
Forum: Legacy and Other Languages Aug 31st, 2007 |
| Replies: 4 Views: 1,712 What does fork = fork (f,g) x = (f x,g x) mean? Did you mean to type just fork (f,g) x = (f x,g x) for that line? I'll assume you did.
We have fork (f,g) x = (f x, g x). So we see that f and g... |
Forum: Legacy and Other Languages Aug 30th, 2007 |
| Replies: 4 Views: 1,712 Awesome. Haskell is the best programming language.
I'm not sure how complicated the expressions you're getting are, but there is only one way in which expressions get combined in Haskell: by... |
Forum: Legacy and Other Languages Jun 23rd, 2007 |
| Replies: 1 Views: 1,246 Do you want to change the internal machinations of the ode45 solver, or do you just want to look at the results of the ode45 solver at particularly-intervaled timesteps? If the former, the answer... |