Search found 235 matches

by notallama
Sun Dec 20, 2009 3:01 pm UTC
Forum: Coding
Topic: Scheme IDE
Replies: 7
Views: 2442

Re: Scheme IDE

edwin isn't exactly emacs. it's basically emacs, but uses scheme instead of elisp.
by notallama
Wed Oct 28, 2009 2:49 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts


i have been meaning to take a look at that for a while now.
i have far too many projects i'll never finish on the go already, though.
by notallama
Mon Oct 19, 2009 6:46 pm UTC
Forum: Coding
Topic: What to do with Lisp?
Replies: 25
Views: 3979

Re: What to do with Lisp?

emacs+SLIME is the devil. I don't know why people always suggest it. emacs is the devil. well, it does everything i want it to. buttons to eval the thing i'm working on and get docstrings. and it knows how to indent, and it matches brackets of all sorts, and it tells you the arguments of functions ...
by notallama
Mon Oct 19, 2009 3:58 pm UTC
Forum: Coding
Topic: What to do with Lisp?
Replies: 25
Views: 3979

Re: What to do with Lisp?

emacs + SLIME is by far the best ide i have used for any language.
it was made for common lisp, but it can be set up to work with other lisps as well. (i use it for clojure)

so whichever lisp you settle on, you should probably get that set up.
by notallama
Mon Oct 19, 2009 3:32 pm UTC
Forum: Religious Wars
Topic: Am I the only one on here that can't stand Python?
Replies: 184
Views: 35884

Re: Am I the only one on here that can't stand Python?

this is worse. if a { ... if b { ... if c { .. if d { .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) .... (lots o code) } } } ..continue from here. } without the braces (or wit...
by notallama
Sat Oct 17, 2009 9:19 pm UTC
Forum: Mathematics
Topic: Need help developing an algorithm!
Replies: 7
Views: 1025

Re: Need help developing an algorithm!

maybe:
[math]\frac{100}{1+e^{a(x-1)}}[/math]
where a is a constant of your choice.

plugging 1 in gets you 50, and and higher numbers approach 100.
and you can round/floor/ceil it if you need an integer.
by notallama
Thu Oct 15, 2009 7:30 pm UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 784012

Re: Coding: Hacks and Snippets

i had something like this in one of my assignments for my 3d animation class: float to_float(int a) { return *((float*)(&a)); } it was so that i could write floats as hex numbers to avoid rounding errors. also, probably my favourite c hack: int n = something; while(n --> 0) { //do stuff }
by notallama
Thu Oct 15, 2009 2:37 pm UTC
Forum: Coding
Topic: what the balls? (haskell prime number generator bug)
Replies: 6
Views: 1173

Re: what the balls? (haskell prime number generator bug)

that was the problem. changing it to Integer fixes it.

when it makes counters, it squares the value. so that was enough to roll it over. (and then it gets inserted way before it should)
by notallama
Thu Oct 15, 2009 7:49 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

binary search trees are basically good for teaching you how a binary search tree works. generally, you'll want a self balancing one. maybe a red black tree or a skip list or something. but anyways, you can use it as a priority queue. or you can extend the idea a bit and get an kd-tree, which is usef...
by notallama
Thu Oct 15, 2009 6:57 am UTC
Forum: Coding
Topic: what the balls? (haskell prime number generator bug)
Replies: 6
Views: 1173

what the balls? (haskell prime number generator bug)

so i tried to write a prime number generator in haskell, but it doesn't quite work right. i zipped (,) over my list of "primes" and one i found on the interwebs (10000 primes), and filtered the ones that were equal to see where the problem was. this is the first one that it got wrong: (486...
by notallama
Sat Oct 10, 2009 2:51 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

ooh, fancy.
now to see if i can hack something together for a more functional way to handle graphics. or does that exist too?

also, why the hell did i put those "-> a"s in there?
this is what happens when i spend too much time fighting with c++, i guess. brain gets mushier.
by notallama
Sat Oct 10, 2009 12:17 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

what i want is io done as lists. stdin as a list of char. stdout by returning a (lazy) list of char at the top level. basically, the entire program would have a type. main :: [Char] -> a -> [Char] or main :: [keyboard/mouse state (at regular intervals)] -> a -> [Bitmap] or something. when i get arou...
by notallama
Fri Oct 09, 2009 5:45 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

i usually just use A, B, C, etc. for placeholders.

what do you mean by garbage? like an unused element in a destructuring bind/pattern matching?
if so, i'll generally use _ there.
by notallama
Fri Oct 09, 2009 2:14 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

which lisp are you using?

scheme or clojure will probably be better at kicking you out of your c++ habits than common lisp.
by notallama
Wed Oct 07, 2009 3:10 am UTC
Forum: Mathematics
Topic: Continued Fractions and Irrational Numbers.
Replies: 8
Views: 1614

Re: Continued Fractions and Irrational Numbers.

nope.

rationals are countable.
if irrationals were countable, then you'd be able to map the naturals onto the reals. (even numbers to rationals, odd numbers to irrationals)
by notallama
Wed Oct 07, 2009 1:13 am UTC
Forum: Science
Topic: An interesting question: Perfect Mirror Ball
Replies: 56
Views: 12946

Re: An interesting question

it would gain mass, too.
by notallama
Mon Oct 05, 2009 11:27 pm UTC
Forum: Science
Topic: Homebrew estimates of the speed of light
Replies: 8
Views: 1411

Re: Homebrew estimates of the speed of light

there's the ol' spinning mirror trick. get a laser pointer, a spinning mirror, and a concave mirror. the concave mirror should have a long focal length. and the spinning mirror should spin as fast as possible, and you have to know how fast it's spinning. you put the spinning mirror at the curved mir...
by notallama
Mon Oct 05, 2009 12:30 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

from what i have heard, plt scheme is the one to get if you intend to do anything practical.

i use mit scheme, but i have not really written a program more than a page long in it.
by notallama
Sun Oct 04, 2009 8:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

the steps are interchangable. i just do whichever one i think of first.
by notallama
Sun Oct 04, 2009 5:23 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

i just wrapped my head around that. i have used corecursion before, but didn't notice. like, i have defined fibbonacci numbers like this before: (def fib (lazy-cat [0 1] (map + fib (rest fib))) but i was thinking of it as regular old recursion. basically, i was looking at the elements as being defin...
by notallama
Sun Oct 04, 2009 3:41 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

my process for writing a recursive function goes like this: step 1. solve base cases step 2. assume i have solutions to smaller problems and use them to solve current problem and then it works. no need to visualize the whole program flow. so i guess i just visualize it as a base case and a few calls...
by notallama
Sat Oct 03, 2009 6:58 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

i have done this sort of thing in a programming competition: A ? A1 ? a1 : A2 ? a2 : A3 ? a3 : default : B ? B1 ? b1 : B2 ? b2 : ... in real code, i'd probably write helper functions or something, though. i find it easy enough to read, but long functions are kinda gross.
by notallama
Sat Oct 03, 2009 12:44 am UTC
Forum: Mathematics
Topic: Countably Infinite
Replies: 14
Views: 2640

Re: Countably Infinite

countably infinite means that there is a bijection between the set and the natural numbers. or sortof the way you're looking at it: there is a well-ordering of the set such that any two elements are a finite number of steps apart. that ordering is not always the natural ordering, such as in the case...
by notallama
Sat Oct 03, 2009 12:32 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9990
Views: 2003207

Re: Coding: Fleeting Thoughts

people keep telling me that the ternary operator in c/c++/java/etc. is evil. i don't get why, though. i mean sure, it's a little ugly, but compared to the rest of the language, i find it rather nice. i have been using it much like cond in lisps. it seems much nicer to me than the equivalent if/else ...
by notallama
Sat Oct 03, 2009 12:03 am UTC
Forum: Mathematics
Topic: which asshat came up with infix?
Replies: 23
Views: 3358

Re: which asshat came up with infix?

i find the f(a,b) syntax even worse :V it should just be fab or f a b. also, if you treat natural numbers or reals or whatever as unary functions, you can drop the * symbol. so that first thing becomes: (+ab)(+ac)(+a(bc)) with the first set of parens being optional. @mike: the first way to make it e...
by notallama
Fri Oct 02, 2009 5:25 am UTC
Forum: Mathematics
Topic: which asshat came up with infix?
Replies: 23
Views: 3358

Re: which asshat came up with infix?

no, but it's mainly the weird spacing of the xs.
parens work for prefix and postfix too.
also indentation for clarity.

so:
**+ab+ac+a*bc
or
**(+ab)(+ac)(+a*bc)

or

Code: Select all

**+ab
  +ac
  +a*bc


i find those all easy to parse.
by notallama
Fri Oct 02, 2009 1:40 am UTC
Forum: Mathematics
Topic: which asshat came up with infix?
Replies: 23
Views: 3358

which asshat came up with infix?

i find myself getting all riled up about operators between my operands every month or two. it's like getting sand in your underwear.

anyways, are there any benefits to infix notation to make up for the precedence issues? or do people just stick with it out of habit?
by notallama
Thu Sep 17, 2009 6:37 pm UTC
Forum: Science
Topic: You might be a physics major if...
Replies: 540
Views: 63098

Re: You might be a physics major if...

i have used heat death as a pro-abortion argument. little entropy spewing bastards.

i'm a cs major, though.
by notallama
Wed Sep 16, 2009 12:10 pm UTC
Forum: Coding
Topic: Programming Science Projects
Replies: 9
Views: 1226

Re: Programming Science Projects

you could also compare speed and space usage of two algorithms on the same problem.
by notallama
Mon Sep 07, 2009 10:19 pm UTC
Forum: Coding
Topic: C and C++ compiler for windows
Replies: 15
Views: 1605

Re: C and C++ compiler for windows

there's mingw.

it's a gcc port to windows. (as in, it compiles into something that runs on windows)
i have not tried it, though, due to windows being such a pain in the ass to work on.
by notallama
Wed Aug 26, 2009 5:07 pm UTC
Forum: Coding
Topic: You know you're a hardcore programmer when...
Replies: 23
Views: 3544

Re: You know you're a hardcore programmer when...

compilers would be a good class to learn optimization in, yes? if you can write an optimizing compiler, you have learned how to optimize, i would expect. also, i think the best thing you can do for pre optimizing your code without prematurely optimizing it is to declare everything as const/immutable...
by notallama
Wed Aug 26, 2009 7:36 am UTC
Forum: Coding
Topic: Fake Programming Language
Replies: 210
Views: 31284

Re: Fake Programming Language

my take on a lisp/c++ mix #this is a comment (namespace mandelbrot (defstruct complex """this is a struct. it is defined by its constructor(s)""" #docstring <:template [type.T]> #template arguments. (metadata) [T.real, T.imaginary] #constructor arguments {:real real, :i...
by notallama
Wed Aug 19, 2009 11:23 pm UTC
Forum: Coding
Topic: You know you're a hardcore programmer when...
Replies: 23
Views: 3544

Re: You know you're a hardcore programmer when...

it's such a small amount, though.
like, it's only going to use one kill counter per player, right?

i dunno. it seems like shaving as a weight loss strategy.
by notallama
Wed Aug 19, 2009 10:15 pm UTC
Forum: Computer Science
Topic: The Most Awsome Books in CS
Replies: 19
Views: 2879

Re: The Most Awsome Books in CS

the little schemer teaches you just enough scheme to understand the book.
if you want to learn a practical amount, then you'll have to learn it elsewhere, but if you only want enough to read/understand the book, it's not required.
by notallama
Wed Aug 19, 2009 10:11 pm UTC
Forum: Coding
Topic: You know you're a hardcore programmer when...
Replies: 23
Views: 3544

Re: You know you're a hardcore programmer when...

i don't get why it shows up in so many places.

like, could they really only spare a byte for the kill count?
by notallama
Tue Aug 18, 2009 7:34 pm UTC
Forum: Computer Science
Topic: The Most Awsome Books in CS
Replies: 19
Views: 2879

Re: The Most Awsome Books in CS

you're just entering second year.
why are you already defining yourself as a [insert language here] programmer?
by notallama
Tue Aug 18, 2009 5:55 pm UTC
Forum: Coding
Topic: Adding a string to a file by cmd
Replies: 2
Views: 570

Re: Adding a string to a file by cmd

in bash, it's:
echo $stuff >> file

">" overwrites
">>" appends

maybe it's the same?
by notallama
Mon Aug 17, 2009 10:21 pm UTC
Forum: Coding
Topic: Yet Another "Which Language?" Post
Replies: 10
Views: 1388

Re: Yet Another "Which Language?" Post

clojure: standalone? not quite. runs on the jvm, and requires a .jar file condense code? yeah, by a lot libraries? tons. has its own and it can use java libraries easy to set up? download jar and it works. slightly more effort to configure for emacs free? yep. it's a lisp, so it has said jesus-macro...
by notallama
Wed Aug 12, 2009 4:42 am UTC
Forum: Coding
Topic: What language would you recommend for a complete newbie?
Replies: 25
Views: 2221

Re: What language would you recommend for a complete newbie?

if your goal is to pick up c++ and use it as a primary language, then learning c first isn't going to do a lot of good. if your goal is to learn more about computers/languages, learning c first is a pretty good idea. the basic idea is that c is easier to learn, and it teaches you low level stuff rig...
by notallama
Tue Aug 11, 2009 3:25 pm UTC
Forum: Computer Science
Topic: Useful implementations of The Thompson NFA regex
Replies: 6
Views: 5687

Re: Useful implementations of The Thompson NFA regex

i read the article.

it's a lazily computed dfa, basically.
it says that awk is using pretty much the same method.

Go to advanced search