Search found 718 matches

by Sc4Freak
Fri Nov 23, 2007 11:07 pm UTC
Forum: Religious Wars
Topic: Tabs vs Spaces
Replies: 209
Views: 146860

Re: Tabs vs Spaces

I like a compromoise. My IDE (VS2005) inserts spaces when I press [tab], and also when backspacing whitespace it deletes spaces as if they were tabs. So I have all the convenience of tabs, and all the benefits of spaces.
by Sc4Freak
Tue Nov 20, 2007 1:16 pm UTC
Forum: Coding
Topic: Explain the language-side implementation of threading to me
Replies: 4
Views: 1207

Re: Explain the language-side implementation of threading to me

(this is primarily dealing with java, but looking over some other languages it seems this is the common way of implementing threads.) Threads are lines of control divergent from the rest of the program. Okay, cool, grand. In most languages they're implemented as objects, i.e. state and function enc...
by Sc4Freak
Sat Nov 17, 2007 1:31 am UTC
Forum: Coding
Topic: Teaching a beginner to program
Replies: 21
Views: 3622

Re: Teaching a beginner to program

A beginner, eh? Throw her off the deep and and plunge into advanced C++. :twisted:

(And no, of course I'm no serious. C++ as a beginner's language is like shooting youself in the foot)
by Sc4Freak
Thu Nov 15, 2007 5:50 am UTC
Forum: Coding
Topic: C Hacks
Replies: 17
Views: 4279

Re: C Hacks

Carmack didn't write the fast sqrt function. He used it in Quake 3, though, and was discovered in the function Q_rsqrt when Quake3 went open source (it's in q_math.c for anyone interested). http://www.beyond3d.com/content/articles/8/ http://www.beyond3d.com/content/articles/15/ From: John Carmack Se...
by Sc4Freak
Wed Nov 14, 2007 8:24 am UTC
Forum: Science
Topic: What has physics done for society lately?
Replies: 73
Views: 6548

Re: ammunition in the fight against those damn phil majors

New hard disk drives are using perpendicular recording, enabling far higher capacities. That's pretty recent.

http://en.wikipedia.org/wiki/Perpendicular_recording
by Sc4Freak
Tue Nov 13, 2007 11:58 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0342: "1337: Part 2"
Replies: 99
Views: 29741

Re: 1337: Part 2 Discussion

DeadCatX2 wrote:Fantastic! I loved every panel.

Can anyone name any O(n log log n) algorithms?

Also, wouldn't that function grow slower than O(n) for practical values of n?

For log10, maybe. But not log2, which is what "log" refers to in this context.
by Sc4Freak
Tue Nov 13, 2007 10:42 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0342: "1337: Part 2"
Replies: 99
Views: 29741

Re: 1337: Part 2 Discussion

Maybe in this specific problem, there were no useful heuristics that would not have taken a non-trivial amount of memory to calculate. Maybe, but the whiteboard appears to have some kind of mesh-like structure on it. Sure, it's not as ideal as a simple grid, but it shouldn't matter. Since we're tal...
by Sc4Freak
Tue Nov 13, 2007 5:50 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0342: "1337: Part 2"
Replies: 99
Views: 29741

Re: 1337: Part 2 Discussion

I've used both A* and Dijkstra's Algorithm in pathfinding - and I'm pretty sure Dijkstra's Algorithm requires more memory than A*. Dijkstra's algorithm is really the same as A* except the heuristic is always 0 - which means that when searching nodes it searches every node radially outwards until it ...
by Sc4Freak
Sat Nov 10, 2007 3:44 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9979
Views: 1981200

Re: Coding: Fleeting Thoughts

evilbeanfiend wrote:iirc the second before the unix epoch starts is used as an error value

Which would be a value of -1, I believe. Makes sense.
by Sc4Freak
Tue Nov 06, 2007 9:42 am UTC
Forum: Religious Wars
Topic: How do you pronounce it?
Replies: 264
Views: 140894

Re: How do you pronounce it?

I pronounce "char" as in "charcoal". It's how Bjarne Stroutrup pronounces it, anyway.

http://www.research.att.com/~bs/bs_faq2.html#char
by Sc4Freak
Tue Nov 06, 2007 3:58 am UTC
Forum: Science
Topic: Are physical constants rational?
Replies: 158
Views: 14084

Re: Are physical constants rational?

Is the speed of light constant? Some might not say so: http://www.wired.com/science/discoveries/magazine/15-11/st_alphageek This isn't to say that c changes under normal conditions, but the fact that it can be changed kind of blows my mind. If we could somehow do the opposite and speed it up, then ...
by Sc4Freak
Tue Nov 06, 2007 12:04 am UTC
Forum: Coding
Topic: What editor do you use?
Replies: 124
Views: 20944

Re: What editor do you use?

I use Visual Studio 2005. There's absolutely no match for this IDE, and it's free as well.

Unfortunately, it's Windows only.
by Sc4Freak
Mon Nov 05, 2007 8:05 am UTC
Forum: Science
Topic: Finally, A Font For Nerds
Replies: 2
Views: 1667

Re: Finally, A Font For Nerds

I was expecting something to do with Klingon.
by Sc4Freak
Thu Nov 01, 2007 11:18 pm UTC
Forum: Coding
Topic: Circular C Structures
Replies: 7
Views: 4931

Re: Circular C Structures

For future reference, this situation is called a "circular dependency".
by Sc4Freak
Fri Oct 12, 2007 7:55 am UTC
Forum: Coding
Topic: C++ Reading a .dat file
Replies: 15
Views: 10323

Re: C++ Reading a .dat file

To me, this is easier, though probably won't get accepted: #include <vector> #include <fstream> #include <iostream> #include <algorithm> #include <iterator> using namespace std; int main() { vector<float> NumberArray; ifstream Filestream("lab4_input.dat"); // Read from stream into vector ...
by Sc4Freak
Thu Oct 11, 2007 7:08 am UTC
Forum: General
Topic: Who the dickens are you?
Replies: 10922
Views: 2353589

Re: POST HERE FIRST - INTRO THREAD THE THIRD

I, uh, didn't see this thread when I first joined. I'm a lurker.

Hi everyone, I'm Sc4Freak and I'm an XKCD addict. *sob* :cry:
by Sc4Freak
Thu Oct 11, 2007 7:00 am UTC
Forum: Coding
Topic: C++ Reading a .dat file
Replies: 15
Views: 10323

Re: C++ Reading a .dat file

It depends on whether the .dat file is in text or binary format. (I'll assume its in text format). Anyway, dealing with raw memory allocation is a bad idea in practice. In a real application, you'd use something like std::vector. As for your problem, operator new returns a pointer to the allocated b...
by Sc4Freak
Mon Sep 24, 2007 12:53 am UTC
Forum: Coding
Topic: C89 vs C99.
Replies: 30
Views: 11125

I meant as a beginner learning C or C++.
by Sc4Freak
Sun Sep 23, 2007 12:14 pm UTC
Forum: Coding
Topic: C89 vs C99.
Replies: 30
Views: 11125

They created the C headers for C++ for a reason, you know. There are times when using the C system is needed. Lets say you are using libxml2 with C++. That is a C-based library, so all of the "strings" used and passed through its functions are C-style. If you don't know C-style strings, a...
by Sc4Freak
Sat Sep 22, 2007 6:44 am UTC
Forum: Coding
Topic: C89 vs C99.
Replies: 30
Views: 11125

Also totally invalid in C89 though, which is what the 2nd edition of the K&R book covers. (Supposedly; I don't have a copy to verify that's indeed what it uses, but I doubt it is.) The second editon is C89 The second edition of The C Programming Language describes C as defined by the ANSI stand...
by Sc4Freak
Wed Sep 19, 2007 11:45 am UTC
Forum: Science
Topic: Minimum population question
Replies: 50
Views: 18038

Are we assuming all the other things that go along with a destroyed Earth, like loss of technology and such? Well, it's no fun if you can just clone your way back to genetic diversity. Um... how would cloning create diversity? Well if you do it in a semi natural way and using two people, you could ...
by Sc4Freak
Wed Sep 19, 2007 11:43 am UTC
Forum: Science
Topic: Do You Doubt that the Universe is Unspeakably Strange?
Replies: 21
Views: 3351

I don't think detonating bombs qualifies as disarmament, even if you do have less bombs than you started with.
by Sc4Freak
Tue Sep 18, 2007 10:36 pm UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 142734

Any half decent compiler would automatically define the DEBUG and _DEBUG macros for debug builds, anyway.
by Sc4Freak
Tue Sep 18, 2007 10:21 pm UTC
Forum: Serious Business
Topic: Use of weapons by private security forces
Replies: 38
Views: 4072

I'm reasonably sure that tazers, capsicum spray (+all derivatives) and definitely guns are all illegal here in Australia. Heck, even Airsoft and BB guns are also completely banned.

So it's not a problem.
by Sc4Freak
Tue Sep 18, 2007 10:18 pm UTC
Forum: Serious Business
Topic: If you fled the US, where would you go?
Replies: 209
Views: 23348

I live in Australia, and I very much enjoy living here.

But if I had to leave, there are only 2 places I'd go: Europe (excluding the UK) or Canada.
by Sc4Freak
Tue Sep 18, 2007 11:30 am UTC
Forum: Science
Topic: positron battery?
Replies: 19
Views: 4815

Well, I doubt antimatter-matter reactions could possibly be used in such a small device as a battery. As I understand it, antimatter-matter reactions release a large amount of their energy in the form of gamma rays and neutrinos - both of which would be difficult to utilise as a power source for som...
by Sc4Freak
Sun Sep 16, 2007 12:09 am UTC
Forum: Mathematics
Topic: The 6 Ns puzzle
Replies: 40
Views: 5666

Pi is exactly 3!
by Sc4Freak
Thu Sep 06, 2007 4:43 am UTC
Forum: Coding
Topic: c++, what does std:: do?
Replies: 37
Views: 8212

Another issue is that declaring it in global scope in a header file means the directive will propagate to every translation unit the header file is #include'd in, which means that all users of your header will be subjected to the directive. You may not mind that you can't use a variable named "...
by Sc4Freak
Wed Sep 05, 2007 2:04 pm UTC
Forum: Coding
Topic: Calculator program
Replies: 5
Views: 2199

Tip #1: Abandon TI-BASIC I did quite a large amount of programming on my TI-89T using TI-BASIC. It's utter crap, built for usability and not speed. I once ran a simple benchmark, and all operations in TI-BASIC (no matter how simple) were many orders of magnitude slower than they should have been for...
by Sc4Freak
Wed Sep 05, 2007 1:57 pm UTC
Forum: Coding
Topic: c++, what does std:: do?
Replies: 37
Views: 8212

No, in practice it should be avoided. I've come across times where I've had a name clash with something from the SC++L. There is a LOT of stuff in the std:: namespace, and declaring using namespace std; in a header file is just asking for trouble. What if you want a variable named map? Or count? Or ...
by Sc4Freak
Mon Sep 03, 2007 12:08 am UTC
Forum: Coding
Topic: C++ question
Replies: 44
Views: 6542

No, that's Beep() from the .NET framework. I linked to the one in WinAPI.
by Sc4Freak
Fri Aug 31, 2007 7:43 am UTC
Forum: Coding
Topic: C++ question
Replies: 44
Views: 6542

Only way you can change it (under windows) is probably using some DOS insterrupt or something(thus making your app 16bit) but, for the ambitious, you can make your own OS, and then, once you have all the essential stuff(GDT and IDT) then you can just output something to a special port, and attach a...
by Sc4Freak
Wed Aug 29, 2007 11:13 am UTC
Forum: Coding
Topic: A funny compile for my C++ class
Replies: 11
Views: 3422

In practice, you should probably avoid using char to store non-characters. The 3 bytes saved isn't worth potential errors like the one you encountered.
by Sc4Freak
Sat Aug 25, 2007 8:30 am UTC
Forum: Coding
Topic: What does this code do? -- a game
Replies: 52
Views: 9366

Code: Select all

((!!a) ^ (!!b))


I'll never understand why C doesn't have a logical XOR operator.
by Sc4Freak
Thu Jul 12, 2007 5:02 am UTC
Forum: Mathematics
Topic: How many digits of Pi do you know?
Replies: 445
Views: 106488

3.141592653589793238462643383279

So 30 places, apparently. Completely useless, but fun to memorise anyway.
by Sc4Freak
Thu Jul 12, 2007 4:58 am UTC
Forum: Coding
Topic: IDE Suggestions?
Replies: 33
Views: 6149

If you're on Windows, I'd say Visual Studio 2005 Express Edition. It's simply a superior IDE. I'm particularly fond of its debugging features, and it's free.
by Sc4Freak
Thu Jul 12, 2007 4:55 am UTC
Forum: Science
Topic: It works, AND its awsome... BITCHES
Replies: 65
Views: 12651

Gotta love Google. :lol:
by Sc4Freak
Thu Jul 12, 2007 4:51 am UTC
Forum: Science
Topic: Stupid chemistry measurement.. please
Replies: 20
Views: 3570

Re: Stupid chemistry measurement.. please

Read your chemistry textbook.

Was that really necessary? I think not.
-Hodge

Go to advanced search