Search found 650 matches

by Ephphatha
Wed Jun 29, 2011 7:35 am UTC
Forum: Mathematics
Topic: How do you explain 1/infinity != 0?
Replies: 17
Views: 7136

Re: How do you explain 1/infinity != 0?

Thanks for all that, ConMans explanation especially. I guess this means I'm the asshole :P.
by Ephphatha
Tue Jun 28, 2011 12:20 pm UTC
Forum: Mathematics
Topic: How do you explain 1/infinity != 0?
Replies: 17
Views: 7136

How do you explain 1/infinity != 0?

Bit of background, another forum I frequent has got into arguing about roulette betting systems and an expected payout based on the martingale system in particular. One of the claims was that the probability of having an endless losing streak is 0. I know that is false, as if you have a probability ...
by Ephphatha
Wed Apr 06, 2011 1:14 pm UTC
Forum: Coding
Topic: for loop scope
Replies: 3
Views: 959

Re: for loop scope

Code: Select all

boost::mutex _mutex;
{
boost::mutex::scoped_lock temp_lock(_mutex);
for (int i = 0; i < 100; ++i) {
  //code here
}
}


That will do what you want.
by Ephphatha
Sun Mar 27, 2011 12:11 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

Eclipse is ok until you try to do anything more advanced that basic text editing, then it crashes. What do you mean by "more advanced that basic text editing" ? Is there an IDE that will let me specify a command line argument to pass to the program when running it from the IDE? That'd be ...
by Ephphatha
Sun Mar 27, 2011 9:54 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

While we're on the topic of Java, does anyone have a suggestion for a cross-platform Java IDE that doesn't suck? Eclipse is ok until you try to do anything more advanced that basic text editing, then it crashes. Netbeans is nice, looking past the code-completion and immediate error highlighting, but...
by Ephphatha
Tue Mar 22, 2011 9:44 am UTC
Forum: Mathematics
Topic: LaTeX and other markup!
Replies: 73
Views: 34411

Re: LaTeX and other markup!

I just noticed this today: With $, $s^2_i=\frac{1}{n_i-1}\left(\displaystyle\sum^{n_i}_{j=1}x^2_{ij}-\frac{\left(\displaystyle\sum^{n_i}_{j=1}x_{ij}\right)^2}{n_i}\right)$ With \[, \[ s^2_i=\frac{1}{n_i-1}\left(\displaystyle\sum^{n_i}_{j=1}x^2_{ij}-\frac{\left(\displaystyle\sum^{n_i}_{j=1}x_{ij}\rig...
by Ephphatha
Tue Mar 22, 2011 8:46 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 515778

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

How do I vertically align equations in a latex document when I want them displayed in a table? The below gives me similar output to what I want, but there is an excessive amount of whitespace before the last two equals signs. \begin{tabular}{ccrll} $n_b=8$ & $\bar{x}_b=103.75$ & $s^2_b$&...
by Ephphatha
Thu Feb 10, 2011 8:29 am UTC
Forum: Coding
Topic: What should be defined before starting a new job?
Replies: 6
Views: 1306

Re: What should be defined before starting a new job?

What I'm trying to find at the moment is a project aim for my honours thesis. The reason I'm apprehensive is because he has contacted me and said "I want you to do some research in power aware computing, do this project which is about image analysis." Good advice about responding to change...
by Ephphatha
Tue Feb 08, 2011 2:05 am UTC
Forum: Coding
Topic: What should be defined before starting a new job?
Replies: 6
Views: 1306

Re: What should be defined before starting a new job?

Yeah, a research project. The brief I've been given is that I'm going to be tasked with writing a mobile phone app that will take and analyse a picture of atoken lying flat on a surface, and I will need to use that to work out the distance and angle the phone is away from the token. The aim is to pe...
by Ephphatha
Mon Feb 07, 2011 5:13 am UTC
Forum: Coding
Topic: What should be defined before starting a new job?
Replies: 6
Views: 1306

What should be defined before starting a new job?

I'm moving into my honours year this year and I was planning on doing a thesis about power aware computing. I had not thought to much about a focus and a project though, which is why when one of my lecturers offered to give me a project to work on I was receptive. I have done work for this lecturer ...
by Ephphatha
Sun Oct 03, 2010 3:29 am UTC
Forum: Coding
Topic: Writing to Files and Such
Replies: 5
Views: 1266

Re: Writing to Files and Such

How would I read the information from a file that I've written to? I mean, the specific information. For instance, if an employee named Timmy Bonnette makes $25 per hour, how would I find that information to match with the 45 hours that he has worked this week? You would first need to decide on an ...
by Ephphatha
Fri Oct 01, 2010 11:52 am UTC
Forum: Coding
Topic: Graphics in C++ on a Mac?
Replies: 18
Views: 4385

Re: Graphics in C++ on a Mac?

Have a look at SDL and/or SFML when you get sick of glut. They're much nicer libraries to use.
by Ephphatha
Mon Aug 30, 2010 9:06 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

An open letter to OpenGL: Dear OpenGL and surrounding community, Screw you, too. Best wishes, maafy6 So this past week, I've been working on a bug in some code that uses OpenGL. I've never done anything in OpenGL. The documentation and tutorials that are available for OpenGL, and especially shaders...
by Ephphatha
Fri Aug 20, 2010 7:54 am UTC
Forum: Coding
Topic: Game Engine Architecture Design
Replies: 11
Views: 8859

Re: Game Engine Architecture Design

Thanks for the comments everyone. I must admit I'm much more interesting in building tools for game development than actually making games, so I really want to learn how people have done it and see if there's anything I may be able to add. heh, I think I've found more game engines out there then ga...
by Ephphatha
Fri Aug 20, 2010 3:12 am UTC
Forum: Coding
Topic: Strings, C++ and my program's odd output (SOLVED)
Replies: 5
Views: 1447

Re: Strings, C++ and my program's odd output (SOLVED)

Yeah, cin.get() (which is called by, or calls, operator>>) reads up to, but not including the first whitespace character. You're writing very C style code there as well, you can hold off declaring variables until you actually need them, and you can declare variables in conditional statements. Instea...
by Ephphatha
Fri Aug 20, 2010 3:04 am UTC
Forum: Coding
Topic: Game Engine Architecture Design
Replies: 11
Views: 8859

Re: Game Engine Architecture Design

Oh, I know that designing an engine for the sake of designing an engine is a terrible idea. I'm going to be making a simple platformer and only really implementing the functionality I need. Adding functionality isn't my goal, just defining a structure. Iteration is your friend, then. Write the simp...
by Ephphatha
Mon Aug 16, 2010 2:46 pm UTC
Forum: Coding
Topic: Game Engine Architecture Design
Replies: 11
Views: 8859

Re: Game Engine Architecture Design

Oh, I know that designing an engine for the sake of designing an engine is a terrible idea. I'm going to be making a simple platformer and only really implementing the functionality I need. Adding functionality isn't my goal, just defining a structure.
by Ephphatha
Mon Aug 16, 2010 7:57 am UTC
Forum: Coding
Topic: Game Engine Architecture Design
Replies: 11
Views: 8859

Re: Game Engine Architecture Design

Thanks, and thanks to the mod who moved this thread (I'm never sure where I should post questions like this). I'm interested in building a "learning" engine, so the emphasis is on something relatively general that gives people an idea of what is needed to build an engine without getting bo...
by Ephphatha
Thu Aug 12, 2010 3:13 am UTC
Forum: Coding
Topic: Game Engine Architecture Design
Replies: 11
Views: 8859

Game Engine Architecture Design

First off, I tend to write a brain spew so if there's anything I've written that you think is wrong, or could be done better, please tell me. I'm doing a project this semester at uni and I've chosen to implement a component based architecture (and do a simple game to show it is usable/give me a goal...
by Ephphatha
Thu Aug 12, 2010 2:03 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 15538

Re: [Unnecessarily-] Compact coding tricks

cogman wrote:void swapint(int& a, int& b) { a ^= b; b ^= a; a ^= b; }

That doesn't work for all inputs. Hell, for ints there's no reason not to use a temp variable, it's (usually) only 4 bytes.
by Ephphatha
Sun Aug 01, 2010 1:56 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 15538

Re: [Unnecessarily-] Compact coding tricks

I used to use the return values from assignment (in C and C++) all the time. I would say "if (x = f(y))" on purpose, for instance. It seemed normal to me, and I was surprised when I found out most people don't like it. Yeah, I do it all the time, too, but in deference to people (& com...
by Ephphatha
Fri Jul 30, 2010 5:27 pm UTC
Forum: Coding
Topic: HTML5 + Javascript and collision detection
Replies: 11
Views: 8857

Re: HTML5 + Javascript and collision detection

Yeah, I made an edit while you were posting. It didn't look right, so I decided to use your collision function and see what I should be getting with that input (what I think I should be getting isn't always right...). So I've probably made a transcription error somewhere.
by Ephphatha
Fri Jul 30, 2010 4:59 pm UTC
Forum: Coding
Topic: HTML5 + Javascript and collision detection
Replies: 11
Views: 8857

Re: HTML5 + Javascript and collision detection

Better late than never :P (Had to look up game architecture last night. Didn't have much free time). I don't know if there are any obvious errors here, I did a quick test with one ball at the origin with velocity (1, 0), and a second ball at position (3, 0.7) with no velocity. When they collided the...
by Ephphatha
Wed Jul 28, 2010 9:21 am UTC
Forum: Coding
Topic: [Unnecessarily-] Compact coding tricks
Replies: 112
Views: 15538

Re: [Unnecessarily-] Compact coding tricks

A school assignment mandates I write a snippet to print a string backwards. for (int c = str.length(); c>0; console.format ("%c", str.charAt (--c)));console.format ("\n");  I like C++ for this. for(std::string::iterator it = str.rbegin(); it != str.rend(); std::cout << *it, ++it); std::cout << std:...
by Ephphatha
Wed Jul 28, 2010 5:39 am UTC
Forum: Coding
Topic: HTML5 + Javascript and collision detection
Replies: 11
Views: 8857

Re: HTML5 + Javascript and collision detection

That makes more sense than what I wrote. I was operating under some fairly big assumptions and 2 am clarity of mind :).

I'll try implement that in a C++ program that actually runs so Nubsy can see how it works. Nubsy, pay attention to what edanite said.
by Ephphatha
Tue Jul 27, 2010 3:07 pm UTC
Forum: Coding
Topic: HTML5 + Javascript and collision detection
Replies: 11
Views: 8857

Re: HTML5 + Javascript and collision detection

Alrighty, lets assume you have your positions stored as a 2D vector (that is, some data structure with x and y members). The simplest, and therefore first, collisions to worry about are sphere-sphere (which means ball-ball and ball-pocket collisions). Now, ball-ball collisions are simple. You calcul...
by Ephphatha
Thu Jul 22, 2010 12:41 pm UTC
Forum: Coding
Topic: Coding Habits
Replies: 24
Views: 2844

Re: Coding Habits

I mean code completion like Intellisense in VS. I'm fairly certain this isn't what TheChewanater was talking about, though, because it's pretty hard to be less productive with a good code-completion tool. Well, in the case of VS, not being able to navigate up or down using the arrow keys after you'...
by Ephphatha
Thu Jul 22, 2010 8:50 am UTC
Forum: Coding
Topic: Coding Habits
Replies: 24
Views: 2844

Re: Coding Habits

I say remove code completion and formatting completely, it only adds confusion, not ease. Maybe auto-indent, but IMHO anything more makes it more difficult to use since you have to know exactly that that IDE behaves. I don't think you actually mean "code completion" here, an example of wh...
by Ephphatha
Thu Jul 22, 2010 8:37 am UTC
Forum: Coding
Topic: Problem with OpenGL in Visual C++ 2008 Express Edition
Replies: 13
Views: 2958

Re: Problem with OpenGL in Visual C++ 2008 Express Edition

I'm going to agree with Sc4F here. If you get familiar with a language by doing console based stuff you'll be in a much better position to move on than by just jumping in the deep end (for example, you will learn what various error messages and warnings mean very quickly :)) When it comes to setting...
by Ephphatha
Wed Jul 21, 2010 5:31 am UTC
Forum: Coding
Topic: What code/software license should I use?
Replies: 5
Views: 1492

Re: What code/software license should I use?

In any case, if I haven't convinced you that you should drop the "You may not resell verbatim" condition, you should just ignore the rest of my post. If I have, then I'd say the choice should be pretty simple: ⋅  If you just want people to be able to do whatever with the code wi...
by Ephphatha
Tue Jul 20, 2010 10:45 am UTC
Forum: Coding
Topic: What code/software license should I use?
Replies: 5
Views: 1492

What code/software license should I use?

So I want to make a portfolio and chuck up things like my old uni assignments, little games I've written, and anything I write that I feel might be useful for someone else. I don't want to charge anything for anything, and I don't want anyone else to charge anything for the source or compiled binari...
by Ephphatha
Thu Jul 15, 2010 4:03 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

I feel like I've accomplished something today. I've got a set of cameras written which extend on each others functionality to do different things. A base camera offering Dolly and Pan operations (with helpers to Pitch/Yaw/Roll, Surge/Sway/Heave, MoveTo/LookAt a point), An abstract DynamicCamera clas...
by Ephphatha
Wed Jul 14, 2010 3:03 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 515778

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

Edit: All solved. Due to programmer stupidity for the most part. Cross posting this from the Fleeting Thoughts thread, since I can't seem to grasp the concepts. Or, I can't seem to get the output I'm expecting. --------- Can someone edumacate me on the intricacies of emulating a camera in OpenGL? Ev...
by Ephphatha
Tue Jul 13, 2010 4:56 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

I was going to post this in the IT DOESN'T WORK thread, but it works. I just want to understand why. Skip to the last paragraph if you want to ignore the boring bits. Yes, I know using this-> is unnecessary, but I find it's a helpful reminder of what variables are member functions and is cleaner tha...
by Ephphatha
Tue Jul 13, 2010 4:08 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

On a somewhat unrelated topic, since I have little experience organizing larger projects, I'm looking for some well-structured source code to peek at. So if anyone has some open-source projects they're fond of, I'd be interested in checking them out. (that goes for Haskell and C) Chrome and Firefox...
by Ephphatha
Tue Jul 13, 2010 11:11 am UTC
Forum: Coding
Topic: Chewy Render Manager
Replies: 23
Views: 2534

Re: (Can someone make a Win32 / Mac build of) CRM (?)

Giving it a shot, I'll see how it goes in a few hours.

Edit: Fuck gtkmm. I've been trying to find every file it includes and there are some that just don't come with the installer. Sorry, but I'm gonna have to drop it.
by Ephphatha
Tue Jul 13, 2010 10:55 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

Also: dynamically-allocated 2D arrays are just asking for severe pain... as a general rule, any time you see "a pointer to a pointer to X" you should really think hard about whether it's necessary. You'd have much less hassle with a 1D array with width*height elements. Most common image f...
by Ephphatha
Mon Jun 21, 2010 9:28 am UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1958
Views: 515778

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

Ok, The last error appeared to be a result of programmer incompetence. However, I'm not out of the woods yet. I'm getting a std::bad_alloc exception which I honestly can't see a reason for. It gets thrown when it attempts to copy the first line of the input file to a data buffer. At this point the p...
by Ephphatha
Sat Jun 19, 2010 10:52 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

Alright, thanks for the help :). I'll work on it and see how the rest of the group handles it, and see what ends up working best.
by Ephphatha
Sat Jun 19, 2010 5:32 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9870
Views: 1779513

Re: Coding: Fleeting Thoughts

Yep, you most certainly don't need any singletons. Consider the properties of a singleton: it's a global object for which only a single instance is allowed. That is, you need to do additional work to ensure that only one instance is ever created. Even if you're 100% sure you don't need more than on...

Go to advanced search