Search found 197 matches

by fazzone
Tue Nov 30, 2010 1:29 am UTC
Forum: Coding
Topic: IDEA: Building the Subvernet
Replies: 6
Views: 1056

Re: IDEA: Building the Subvernet

I believe Freenet is like this, and has existed for a while
by fazzone
Thu Oct 14, 2010 1:13 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Berengal wrote:Why oh why couldn't they just have included first-class functions in the first place?


Agree. Or at the very least make anonymous classes more like pseudo-closures, i.e. no final variable nonsense.
by fazzone
Wed Sep 22, 2010 6:38 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

It's common for people to use the same words in a reply, especially stuff like names. Or, when adding new words to learn, take into account other words I used in the same input box/recently to figure out how words are connected. The default soft-keyboard IME on my Motorola Droid does names from my ...
by fazzone
Sat Sep 11, 2010 12:26 am UTC
Forum: Coding
Topic: What does one do in Computer Science 1?
Replies: 16
Views: 2893

Re: What does one do in Computer Science 1?

Programming. As in, not computer science. It is extremely unlikely that you would be doing anything considered computer science, i.e. data structures / algorithms. Then again, I've heard of schools having classes taught in Scheme, where I suppose you would learn a lot more computer-sciency stuff. Bu...
by fazzone
Sat Apr 24, 2010 2:44 am UTC
Forum: Coding
Topic: PHP Ackermann's Implementation
Replies: 10
Views: 2991

Re: PHP Ackermann's Implementation

Well, I'm pretty sure PHP's integers aren't bignums by default. Though I am also pretty sure that PHP provides a arbitrary precision library of some kind. Basically, the integer types that you are using aren't big enough to compute something as mindbogglingly large as the result of an Ackermann func...
by fazzone
Fri Apr 23, 2010 12:10 am UTC
Forum: Coding
Topic: C character array error
Replies: 2
Views: 704

Re: C character array error

Well, as it happens, GNU gcc has some nonstandard I/O functions. Among them is getline. Their page about is http://www.gnu.org/s/libc/manual/html_node/Line-Input.html . So their version of getline is called the same thing, but takes different types of arguments, so the compiler isn't sure which you ...
by fazzone
Mon Apr 05, 2010 4:02 am UTC
Forum: Coding
Topic: Need advice on a distributed app architecture
Replies: 2
Views: 657

Re: Need advice on a distributed app architecture

it's towards the latter end of the scale, you might be better off going with a simpler client-server architecture based off standard networking, as opposed to MPI. This. Very much this. If your computers are indeed old, their networking hardware is maybe 10/100 or perhaps even slower. Most serious ...
by fazzone
Thu Mar 18, 2010 10:54 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Also, I'd probably use "break" rather than "continue outer" for the other one, but that's just me. Would that work? I could be wrong, but wouldn't using a break mean that the initial for loop does not start again? In other words, wouldn't using a break jump past the inner loop's...
by fazzone
Sat Mar 13, 2010 8:15 pm UTC
Forum: Coding
Topic: Beautiful regexes
Replies: 32
Views: 5727

Re: Beautiful regexes

The inefficiency...it burns!

or

Code: Select all

even 0 = True
even n = not(even(n - 1))
by fazzone
Sat Mar 13, 2010 8:08 pm UTC
Forum: Coding
Topic: Mother...
Replies: 9
Views: 1289

Re: Mother...

void ring() { for(int a=0;a<1000;a++) { object b=new object(width/2,height/2); object.add(b); b.yv=sign(Math.sqrt(1-Math.pow(b.xv=sign(random.nextDouble()),2))); } } So "object" is an instantiable type that either inherits from or contains an ArrayList<object> of all its instances? What? ...
by fazzone
Tue Mar 02, 2010 3:15 am UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 782227

Re: Coding: Hacks and Snippets

Or you could use http://en.wikipedia.org/wiki/Fast_inverse_square_root (Probably less efficient, but entertaining anyway)
by fazzone
Fri Feb 26, 2010 4:29 pm UTC
Forum: Coding
Topic: dynamically size multidimensional arrays in C/C++
Replies: 23
Views: 5279

Re: dynamically size multidimensional arrays in C/C++

As far as I know, there is no more elegant solution. The alternative is to use a one-dimensional array, and manually do the pointer arithmetic.

Edit: If you want the new int[n][n] syntax, use Java.
by fazzone
Sun Feb 21, 2010 7:09 pm UTC
Forum: Coding
Topic: What can be done to speed this up?
Replies: 9
Views: 1321

Re: What can be done to speed this up?

Well to be rigorous and be much more sure of correct results, you would have to use a serious random number generator (such as the Mersenne Twister) instead of the Linear Congruential Method (LCM) based approach that your libc probably uses (I know it's what glibc uses).
by fazzone
Sun Feb 21, 2010 5:34 pm UTC
Forum: Coding
Topic: What can be done to speed this up?
Replies: 9
Views: 1321

Re: What can be done to speed this up?

I'm not much of an optimization expert myself either. If you really really need the speed, I'd unroll some of your smaller loops. Past that, there's not much I can see except to hand code it in assembly (which wouldn't be impossibly hard). You could also probably use unsigned char instead of short i...
by fazzone
Sat Feb 20, 2010 8:09 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Then Java is legalese.
by fazzone
Wed Feb 03, 2010 11:40 pm UTC
Forum: Coding
Topic: Prime Number Finder in VB.net
Replies: 5
Views: 1806

Re: Check for whole number in VB.net

As it happens, finding really large primes is interesting in cryptography, so there are people who stand to make a substantial amount of money by finding really large primes. I think you can sell primes that are more than 10000 digits to the NSA or something. Anyway, as I recall, the largest known p...
by fazzone
Fri Jan 22, 2010 1:22 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Wow, I was getting times of about 5 to 6 seconds. What kind of algorithm did you implement?
by fazzone
Sat Jan 16, 2010 11:44 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

qbg wrote:Sudoku is too easy. After throwing some of hardest ones list on wikipedia, the longest my unoptimized, rather simple solution in Clojure took 960 milliseconds to solve.

Which one exactly did you do? I wonder how my simple backtracking solver in C would stand up.
by fazzone
Mon Dec 14, 2009 11:27 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Oops, wasn't thinking. Maybe

Code: Select all

void someClass::someMethod(const someClass * const that) {
    return computation(this->var, that->var);
}

8)
by fazzone
Sun Dec 13, 2009 11:09 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

My personal favorite naming convention, in curly-brace OO languages (I'm looking at you, C++ and Java), is to call all same-type parameters to instance methods "that". Like so: void someClass::someMethod(const someClass& that) { return computation(this.var, that.var); }
by fazzone
Sun Dec 13, 2009 11:06 pm UTC
Forum: Coding
Topic: Radians vs degrees (in java)
Replies: 7
Views: 5746

Re: Radians vs degrees (in java)

Do everything in radians, Java does. If you must convert between the two, use Math.toDegrees and Math.toRadians. The way I often write graphics code like this is declare my static constants like this: private static final double someAngle=Math.toRadians(someDegrees); And that's the only time I ever ...
by fazzone
Tue Dec 08, 2009 8:23 pm UTC
Forum: Coding
Topic: Independent Study Topic?
Replies: 21
Views: 3230

Re: Assembly or OpenGL? (another "which one" thread)

It is my belief (having learned assembly) that learning assembly makes learning everything easier, because there is no "magic". There's no "call this library function". Most people today seem to believe that they can get away with not understanding their systems all the way down,...
by fazzone
Thu Dec 03, 2009 8:10 pm UTC
Forum: Coding
Topic: Java file I/O help
Replies: 4
Views: 563

Re: Java file I/O help

How are you running it? If you are running from inside an IDE, the IDE will usually set the executable's path to be the root of the project folder, so you won't be able to find files placed in the same directory as the actual .jar or .class file(s).
by fazzone
Sun Nov 29, 2009 10:00 pm UTC
Forum: Coding
Topic: Awesome Acheivements
Replies: 116
Views: 12637

Re: Awesome Acheivements

Consider?
by fazzone
Sat Nov 28, 2009 3:38 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9968
Views: 1950659

Re: Coding: Fleeting Thoughts

Pico.
by fazzone
Thu Nov 26, 2009 5:12 am UTC
Forum: Coding
Topic: Accessing files on a USB drive in C
Replies: 9
Views: 1061

Re: Accessing files on a USB drive in C

Um...mount it and use it like anything else?
by fazzone
Mon Nov 23, 2009 2:51 am UTC
Forum: Coding
Topic: Awesome Acheivements
Replies: 116
Views: 12637

Re: Awesome Acheivements

I just wrote a Java program to download a random wallpaper from www.socwall.com. Then I used it, in conjunction with wget and gconftool-2, in a bash script to change my wallpaper to a random new one every X seconds.
by fazzone
Sat Nov 21, 2009 5:33 am UTC
Forum: Coding
Topic: Coding: Hacks and Snippets
Replies: 434
Views: 782227

Re: Coding: Hacks and Snippets

Extremely clever. Extremely clever in a terrible, terrible way.
by fazzone
Fri Nov 20, 2009 10:11 pm UTC
Forum: Coding
Topic: Please help me construct a graph...
Replies: 6
Views: 958

Re: Please help me construct a graph...

is http://www.fooplot.com of any help?
by fazzone
Wed Nov 18, 2009 11:23 am UTC
Forum: Mathematics
Topic: Reflection from functions
Replies: 2
Views: 772

Re: Reflection from functions

Ah, very cool. Thanks.
by fazzone
Tue Nov 17, 2009 2:02 am UTC
Forum: Mathematics
Topic: Reflection from functions
Replies: 2
Views: 772

Reflection from functions

So I wrote a program a while back that does reflections along mirrors defined by arbitrary functions and I noticed an interesting property of mirrors defined by functions that were power greater than 2. For a cubic mirror, you get something that looks kind of like this: http://imgur.com/kD7BQ.png No...
by fazzone
Mon Nov 16, 2009 11:28 am UTC
Forum: Coding
Topic: Which language?
Replies: 36
Views: 4381

Re: Which language?

Earlz wrote: lol
wait...what?
lol lol lol
:!:
by fazzone
Thu Nov 12, 2009 12:58 am UTC
Forum: Coding
Topic: Googles new programming language: Go
Replies: 33
Views: 2701

Re: Googles new programming language: Go

Or, this could be political. Now that Oracle technically owns Java, this could be Google's shot across Oracle's bow; saying "If you try to privatize Java or mess with it, we'll convince everyone to leave and jump on board Go instead". Maybe not, because this language is fairly significantl...
by fazzone
Mon Nov 02, 2009 3:24 pm UTC
Forum: Coding
Topic: Having a very newbie problem.
Replies: 5
Views: 1101

Re: Having a very newbie problem.

Well, you could always just look in float.h, but http://www.cplusplus.com/reference/clibrary/cstdio/printf/ is an excellent reference for printf.
by fazzone
Sun Nov 01, 2009 6:01 pm UTC
Forum: Coding
Topic: Applying for Internships
Replies: 3
Views: 788

Applying for Internships

So for my (high) school's "math, technology and science academy", I have to do a summer internship. I think it would just be the coolest thing ever to get to see what a real software development house looks like and how it operates, so I want to send out some emails to nearby companies inq...
by fazzone
Thu Oct 29, 2009 1:12 am UTC
Forum: Coding
Topic: Black hat or White hat?
Replies: 30
Views: 3649

Re: Black hat or White hat?

So is 8 posts the new record for a completely non-math-related thread to degenerate into math jokes? :D
by fazzone
Tue Oct 27, 2009 8:55 pm UTC
Forum: Coding
Topic: Help a beginner: Problem in C
Replies: 10
Views: 1128

Re: Help a beginner: Problem in C

1) Every OTHER question (as in, one in two) doesn't accept an answer. 2) the percentages at the end are all zero :( 1) Because scanf is weird (The intricacies of scanf are just about the easiest thing to get tripped up with in C, IMO), you should change all your scanf("%c" ... to scanf(&q...
by fazzone
Fri Oct 23, 2009 2:08 am UTC
Forum: Coding
Topic: Should I learn Assembly?
Replies: 102
Views: 11529

Re: Should I learn Assembly?

But...although it may certainly be a learning experience (I found it so) to write assembler on the bare metal, though it's not necessary to do so to be able understand assembly.
by fazzone
Sun Oct 11, 2009 1:42 am UTC
Forum: Coding
Topic: TI-nspire
Replies: 2
Views: 864

Re: TI-nspire

Like, TI-BASIC (programming on the device) or C or Assembly (programming done on a computer, then transferred to a device)?

Go to advanced search