## Search found 765 matches

Sun Jun 07, 2009 12:53 am UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 776763

### Re: Coding: Hacks and Snippets

Mine's not nearly as cool, but still amusing... *Fibonacci generating code* That's a cool way to generate the Fibonacci numbers. So, here's my implementation in Haskell! nthFib :: Int -> Int nthFib n = fibGen ['A'] n where fibGen xs 1 = length xs fibGen xs n = fibGen (convert xs) (n - 1) convert = ...
Sat Jun 06, 2009 11:26 pm UTC
Forum: Mathematics
Topic: I am looking for a tree diagram with various math concepts
Replies: 1
Views: 373

### Re: I am looking for a tree diagram with various math concepts

Not a tree diagram, but the Mathematical Atlas may be suit your needs.
Fri Jun 05, 2009 3:35 am UTC
Forum: Mathematics
Topic: Hitting Walls in Proofs
Replies: 15
Views: 1487

### Re: Hitting Walls in Proofs

When I get stuck on a problem, I usually end up getting up and doing something else for a bit to keep myself from trying the same approach(es) again and again. Even while doing something else though, I'll generally keep thinking about it in the back of my mind, and often times I'll figure it out or ...
Sun May 31, 2009 6:10 am UTC
Forum: Coding
Topic: Folder Watcher in C "EXC_BAD_ACCESS"
Replies: 11
Views: 1208

### Re: Folder Watcher in C "EXC_BAD_ACCESS"

In C, strings have a fixed size. char *cmd = "ls -l "; When you write that, you're saying cmd has enough room for 6 characters plus the null terminator. When you try to append something to it, you don't have enough room, so you're getting the weird memory error. Try something like char cmd...
Sat May 30, 2009 8:07 pm UTC
Forum: Music
Topic: What are you listening to?
Replies: 9560
Views: 1096031

### Re: What are you listening to?

This album is beyond amazing.
Sat May 30, 2009 4:26 am UTC
Forum: Mathematics
Topic: Trouble with Improper Integrals
Replies: 3
Views: 890

### Re: Trouble with Improper Integrals

I have to echo the suggestion of switching to polar/cylindrical coordinates. Once you do, the improper integral 'disappears' and it's pretty straight forward to evaluate.
Thu May 28, 2009 9:01 pm UTC
Forum: Religious Wars
Topic: The single best computer food
Replies: 205
Views: 39359

### Re: Favourite hacking food

Tue May 26, 2009 5:19 am UTC
Forum: School
Topic: Is the Pragmatist wrong?
Replies: 10
Views: 1575

### Re: Is the Pragmatist wrong?

I'm a firm believer that if you get a degree in something you like, you'll find work in it irregardless of how 'unpractical' it may be. If you like it enough, you'll be willing to explore it more, you'll likely come across more opportunities, and you'll be willing to put in the effort needed to make...
Mon May 18, 2009 5:04 pm UTC
Forum: Mathematics
Topic: math hw proof help
Replies: 6
Views: 701

### Re: math hw proof help

\cos{(\alpha + \beta)} = \cos{\alpha}\cos{\beta} + \sin{\alpha}\sin{\beta} \cos{(\alpha - \beta)} = \cos{\alpha}\cos{\beta} - \sin{\alpha}\sin{\beta} The sign switches: \cos{(\alpha + \beta)} = \cos{\alpha}\cos{\beta} - \sin{\alpha}\sin{\beta} \cos{(\alpha - \beta)} ...
Sun May 17, 2009 4:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

fazzone wrote:What languages are you used to when

Code: Select all

    someArray = someOtherArray;

does a deep copy of the array?
Well I was just sort of told "Java has no pointers" so I assumed that everything including arrays would be copied by value. But now I know better: arrays and objects are always references.
Sat May 16, 2009 10:18 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

System.arraycopy()? Yeah I found that, but it was still a 'what a silly error...' moment. @rat4000 Your program breaks since you're reversing the individual steps rather than the entire list at the end Computing by hand you can see that 3 -> [1,1,2] 4 -> mreverse (head [1,1,2] + head [1,2]) : [1,1,...
Sat May 16, 2009 10:09 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

So I'm working with Java for a class for the first time... I just spent the past hour thinking my sorting algorithms were all working correctly when I noticed that someArray = someOtherArray; doesn't copy the contents, but rather a reference to the original array. So in fact, only the first sorting ...
Sat May 16, 2009 4:00 am UTC
Forum: Mathematics
Topic: ITT: Why Math Is Awesome.
Replies: 51
Views: 5799

### ITT: Why Math Is Awesome.

Inspired by this thread, and in particular, this post: I think that one of the funnest things about maths is that we have no bounds, we don't just start with what we know and build on it(although it's certainly important), we start with what things could be and see where they take us. It's precisely...
Wed May 13, 2009 4:35 pm UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

1
Sat May 09, 2009 5:34 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

I love writing obfuscate code... I love anything that is confusing, so writing obfuscate code is fantastic. Elegant code is nice, but so is needlessly confusing/complex code.
Fri May 08, 2009 11:05 pm UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

0
Fri May 08, 2009 5:32 pm UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

Cheese wrote:1
Fixed.

0
Fri May 08, 2009 2:35 am UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

0
Thu May 07, 2009 3:46 pm UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

1
Thu May 07, 2009 12:52 am UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

0
Wed May 06, 2009 10:36 pm UTC
Forum: Forum Games
Topic: Random bitstream! (000zerozero000000zero)
Replies: 1947
Views: 213293

### Re: Random bitstream! (000zerozero000000zero)

0
Wed May 06, 2009 4:21 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

Map can be used for memoization. The simple way is to make a function that takes a map, a function and an argument, then looks the argument up in the map and if it isn't there it runs the function, inserts the result in the map and returns the result and the new map. There's at least one library th...
Wed May 06, 2009 4:14 pm UTC
Forum: Music
Topic: Discover new bands game.
Replies: 56
Views: 4980

### Re: Discover new bands game.

Aborym - Generator

Incredible industrial black metal.
Wed May 06, 2009 3:39 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

Thanks for the Haskell help, that makes sense. Now I just need to find a way to get rid of my call to maximumBy, which I'm now guessing is the source of my stack overflow.

I don't really understand how map memoizes though...
Tue May 05, 2009 9:12 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

2 Haskell questions: 1) What exactly is a 'stack overflow'? I'm doing PE 14 now (the Collatz conjecture), and I get a stack overflow if I try to find the maximum chain for 1,000,000, but not for 100,000. 2) Do let expressions memoize? That is, if I have something like let foo x = [...] in [...] will...
Tue May 05, 2009 8:40 pm UTC
Forum: Mathematics
Topic: Summation help
Replies: 6
Views: 734

### Re: Summation help

Ended wrote:A bit of a side note, but if you're familiar with binary you might recognise the series in d) as

01111b = 10000b - 00001b

where there are n+2 digits in each of the numbers.
That's a neat way of looking at the problem... I like it.
Sun May 03, 2009 4:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

Wouldn't

Code: Select all

int **foo(){    // ...}

work?
Fri May 01, 2009 7:11 pm UTC
Forum: Mathematics
Topic: Help with a Math Problem
Replies: 11
Views: 1522

### Re: Help with a Math Problem

Fri May 01, 2009 4:48 pm UTC
Forum: Gaming
Topic: Portal!
Replies: 385
Views: 59503

### Re: Portal!

I just beat Portal. What a blast. I didn't find any of it all that hard until the final chamber. A bunch of the rooms were rather tricky. Also, The eyeball floating the middle of the room was annoying. When I finally managed to get it out of the sky, I only had 13 seconds left. When the room explode...
Fri May 01, 2009 2:33 pm UTC
Forum: Mathematics
Topic: Math Books
Replies: 378
Views: 247548

### Re: Math Books

Also there are lots of topics in algebra you could go into after your first course, that your next two (or three, or four...) will avoid. So, if you really enjoyed the algebra you took, you might enjoy something like representation theory. Maybe you feel you've OD'ed on groups though. Representatio...
Fri May 01, 2009 1:59 pm UTC
Forum: Coding
Topic: Poll: Wich grammatic genre do you favor?
Replies: 29
Views: 2464

### Re: Poll: Wich grammatic genre do you favor?

zombiefeynman wrote:Berengal - you have convinced me that I really need to learn Haskell.
Haha, I think I said that exact thing a few months back. It's totally worth it.
Thu Apr 30, 2009 5:59 pm UTC
Forum: Mathematics
Topic: Math Books
Replies: 378
Views: 247548

### Re: Math Books

I guess all first two year curricula aren't created equal. I have taken: Calc I-III - Mostly non-rigorously, though I do know some basics of analysis as well. Linear Algebra - Stuff up to canonical forms, inner product spaces, spectral theory... Algebra - One semester of group and ring theory. Proba...
Thu Apr 30, 2009 4:38 pm UTC
Forum: Coding
Topic: Poll: Wich grammatic genre do you favor?
Replies: 29
Views: 2464

### Re: Poll: Wich grammatic genre do you favor?

I voted for curly and LISP style. Curly is my favourite, and definitely the easiest to read, but the LISP style makes sense once you get used to it. And as with zombiefeynman, I don't like being forced to indent my code a certain way. Admittedly, 99% of the time, that's how I would indent it anyway,...
Thu Apr 30, 2009 4:21 pm UTC
Forum: Mathematics
Topic: [homework] Vector Calculus
Replies: 2
Views: 466

### Re: [homework] Vector Calculus

I'm going to assume F(r) is the potential function... I don't know why it's in terms of r though. Integrate x+y with respect to x , and you'll get some f(x,y) + C_1(y) Integrate x-y with respect to y , and you'll get some g(x,y) + C_2(x) Now we get that the po...
Thu Apr 30, 2009 4:00 pm UTC
Forum: Mathematics
Topic: Math Books
Replies: 378
Views: 247548

### Re: Math Books

To keep my math mind sharp over the summer, I want to teach myself as much about some field of math as possible, preferably not something I'll be taking courses in next year. So, I've narrowed my choices down to either graph theory or number theory. What's a good text book for either? Something for ...
Tue Apr 28, 2009 4:52 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 516131

### Re: The "IT DOESN'T WORK!" thread

Also you have them named backwards
int argc, char *argv[]

argc = argument count, an integer
argv = argument vector, an array.
Mon Apr 27, 2009 4:08 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

That worked, thanks.
Mon Apr 27, 2009 3:55 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

\$ ghci GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :l time.hs [1 of 1] Compiling Main ( time.hs, interpreted ) Ok, modules loaded: Main. *Main> :l pe021.hs [1 of 1] Compiling Main ( pe021.hs, interpreted ) Ok, modules loaded: Main...
Mon Apr 27, 2009 3:34 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

I got the time module with apt-get. Nice and easy.

Everything about Haskell has been a blast, so I assume monads are no different. But... how do you use it?

Code: Select all

> :l pe021.hs> :l time.hs> time (pe021 10000)

Doesn't work. I don't know what I'm doing here.
Mon Apr 27, 2009 2:54 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1782005

### Re: Coding: Fleeting Thoughts

Thanks! That's using a monad? I should really get around to learning more Haskell... I started over Christmas break, got sufficiently far, but then school rolled around and I haven't had time to continue. EDIT: Urgh, I'm getting module Data.Time not found. lolwut? That's kinda odd... EDIT 2: Apparen...