Search found 119 matches

by Breakfast
Fri Mar 02, 2012 3:33 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 564942

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

Thanks for all of the suggestions Jplus. I'll get to trying those as soon as I can. I also doubt that Microsoft is using parallel processing techniques. However, if I can figure out a good way to implement it, it might help. .Net's built in function Parallel.Invoke() actually slowed the runtime down...
by Breakfast
Fri Mar 02, 2012 2:58 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 564942

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

On a cursory glance it appears C# .NET 4.0 does handle tail recursion although previous versions do not. I am using 4.0 I was planning to mention why I decided on 45 in my last post but forgot. 45 was picked from experimental test runs because it appeared to give the most optimal times (~8 - ~9 seco...
by Breakfast
Fri Mar 02, 2012 1:14 pm UTC
Forum: Coding
Topic: The "IT DOESN'T WORK!" thread
Replies: 1963
Views: 564942

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

Well, my code does work but I'm trying to make it more efficient. It's written in C# and here is my original code: private static List<int> QuickSort(List<int> listOfNumbers) { if (listOfNumbers.Count <= 1) { return listOfNumbers; } else { List<int> _partitionValue = new List<int>...
by Breakfast
Tue Feb 28, 2012 12:53 am UTC
Forum: Coding
Topic: Understanding Code Bases / Refactoring [Discussion,Research]
Replies: 8
Views: 3045

Re: Understanding Code Bases / Refactoring [Discussion,Resea

Thank you for the response and I'll look into Refactoring to Patterns . I'm not particularly looking for help when it comes refactoring, testing, or understand code but what I've come to notice is that more experienced developers have better abilities at accomplishing those tasks much faster than so...
by Breakfast
Sun Feb 26, 2012 11:56 pm UTC
Forum: Computer Science
Topic: beginning with computer science
Replies: 10
Views: 4099

Re: beginning with computer science

MIT OpenCourseWare is an excellent resource, especially for you because their introductory class is in python. http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-lectures/ You can find plenty of other classes, ...
by Breakfast
Sun Feb 26, 2012 11:22 pm UTC
Forum: Computer Science
Topic: Books on Information Theory
Replies: 9
Views: 5960

Re: Books on Information Theory

Computer Security: Art and Science by Matt Bishop might not be exactly what you want but it does cover a large range of topics. Here's a link to the table of contents: http://nob.cs.ucdavis.edu/book/book-aands/toc.html As a warning, a few of the chapters are a bit math intensive. However, they are s...
by Breakfast
Thu Feb 23, 2012 11:00 pm UTC
Forum: Coding
Topic: Understanding Code Bases / Refactoring [Discussion,Research]
Replies: 8
Views: 3045

Re: Understanding Code Bases / Refactoring [Discussion,Resea

I agree that any kind of formal documentation is typically a bad way to go about learning a code base. Requirements change too often and with a project of any substantial size it's probably been in development for years. This definitely makes the documentation lag behind current implementation. Howe...
by Breakfast
Thu Feb 23, 2012 5:25 pm UTC
Forum: Coding
Topic: Understanding Code Bases / Refactoring [Discussion,Research]
Replies: 8
Views: 3045

Understanding Code Bases / Refactoring [Discussion,Research]

So I'd like to know how individuals familiarize themselves with an existing code base of any size. Are there specific steps that you follow? What is your thought process behind choosing those steps and also the thought process that you use when carrying out those steps? How long did it take you to d...
by Breakfast
Fri Oct 07, 2011 3:32 pm UTC
Forum: Coding
Topic: Localization in Visual Studio 2010
Replies: 5
Views: 2406

Re: Localization in Visual Studio 2010

It is somewhat irrelevant because I've been moved to a different portion of the project and we have implemented localization completely now. However, this can still be a good place to discuss how it is done. I'll a high level of what we did now and hopefully go into more details later. Any comments ...
by Breakfast
Thu Sep 22, 2011 10:23 pm UTC
Forum: Coding
Topic: Localization in Visual Studio 2010
Replies: 5
Views: 2406

Re: Localization in Visual Studio 2010

Thanks for the input. We will be creating a .resx file (basically the template you were talking about) for each of the languages we have to translate our application into and all localization is applied only to displayed text. There is no currencies that we have to manage. So far I've manage to make...
by Breakfast
Thu Sep 22, 2011 8:11 pm UTC
Forum: Coding
Topic: Localization in Visual Studio 2010
Replies: 5
Views: 2406

Localization in Visual Studio 2010

So I'm working on a project for a client that will be released in sereval different countries and I have to provide localization logic. I can either do this in the asp web pages we are creating or in the c# code behind. I was wondering which was a better practice and hoping for some hints on how to ...
by Breakfast
Thu Apr 21, 2011 12:22 am UTC
Forum: Coding
Topic: Prank Code
Replies: 40
Views: 6601

Re: Prank Code

Ever since I picked up C# one of the things I've liked to do is program a double click event for every object that has a single click event that contains the code: this.Close();
by Breakfast
Sat Mar 13, 2010 4:27 pm UTC
Forum: Coding
Topic: Is C++ Getting Phased Out?
Replies: 67
Views: 8133

Re: Is C++ Getting Phased Out?

I've only been programming for 3 years (since I started college) but of what few languages I've used I've found it's the easiest for me to understand. I still have trouble wrapping my head around lisp, and java is too convoluted. It might be because my university started us out with c++, but it is m...
by Breakfast
Sat Mar 13, 2010 5:21 am UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Re: Help with dice probabilities

You guys caught me. This was for d&d 3.5 and my personal favorite is to roll 4d6 (drop the lowest) and apply the stats in order (first roll is STR, second is DEX...). You do this after picking a race and class. It makes for some truly interesting builds to play.

- Breakfast
by Breakfast
Sat Mar 13, 2010 4:24 am UTC
Forum: Computer Science
Topic: Is this a good CS curriculum?
Replies: 5
Views: 2307

Re: Is this a good CS curriculum?

My school's computer science degree requirements are (all of which are for undergraduate students): Math (MATH 131) Calculas 1 (MATH 247) Statistics (MATH 222 or 322) Discrete Math Natural Science This is usually filled with either a one year Physics sequence or a one year Geology sequence (I took G...
by Breakfast
Fri Mar 12, 2010 4:29 pm UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

I didn't mean that I didn't want to make my code look nice, merely that all of the examples that I have found are not clean and I don't know of any other way to implement it. The return values for the functions from the <semaphore.h> are correct but they are not carrying over between processes. Here...
by Breakfast
Fri Mar 12, 2010 3:43 pm UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

I forgot all about linking but was able to fix that (g++ test.cpp -lpthread -lrt). All of the example code that I've found uses these bare function calls and the program I'm writting does not have to be nice or clean in any way. pthread is a different model of concurrancy than using fork(). Fork is ...
by Breakfast
Fri Mar 12, 2010 1:02 am UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

*EDIT* - This is a test and not the actual program that I'm working on - Very sorry, I completely glanced over the platform thing. It's on UNIX and I think I'm on some kind of track now: This will not, cannot work. For starters, your Wait() implementation doesn't actually wait; it just returns imme...
by Breakfast
Fri Mar 12, 2010 12:16 am UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

1. I've decided to scrap my semaphore code assuming it will be easy to find a library (I know implementing the functions in the library would be easier). 2. The system has no problem including the <semaphore.h> file but when I compile I get undefined symbol errors for all the functions. 3. #include<...
by Breakfast
Thu Mar 11, 2010 11:05 pm UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

*EDIT* - This is a test and not the actual program that I'm working on - Very sorry, I completely glanced over the platform thing. It's on UNIX and I think I'm on some kind of track now: #include<iostream> using std::cout; using std::endl; struct Semaphore { int count; Semaphore(int pc) {count = pc;...
by Breakfast
Thu Mar 11, 2010 9:48 pm UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

Re: Using C++ Semaphores

I guess I'm looking to implement a basic semaphore then. Although, a third party library that I could look at would probably help. I can't wait for c++0x...
by Breakfast
Thu Mar 11, 2010 9:14 pm UTC
Forum: Coding
Topic: System V semaphores / POSIX thread (reference guide)
Replies: 13
Views: 2707

System V semaphores / POSIX thread (reference guide)

I've got a project due in a couple weeks that involves semaphores but I have no idea how to implement them in c++. The only other time I've used semaphores I was provided with a class that I don't have access to this time around. Can anyone help me with syntax and / or give a link to a tutorial that...
by Breakfast
Wed Dec 02, 2009 7:29 pm UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Re: Compiler Design

Sorry I haven't posted my compiler yet. His test programs have exposed a few flaws that I haven't had time to fix yet because of other classes. Should I post it flaws and all or what until I've managed to fix them? (I got an 86/100, which is sadly one of the better grades in the class lol)
by Breakfast
Sun Nov 29, 2009 2:45 pm UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Re: Compiler Design

Entropy, if you still have the book for the class could you post the language definition and give us a short rundown of how the compiler works / what it can handle?
by Breakfast
Sat Nov 28, 2009 1:28 am UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Re: Compiler Design

You've caught me! This is my junior year at BGSU and the professor is Lancaster. If you're still at BG I've probably seen you around. lol
by Breakfast
Fri Nov 27, 2009 10:52 pm UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Re: Compiler Design

Here you go, it's a modification of the little language that was proposed (?) by ACM back in the '70s.
The emitter uses java bytecode and the jvm's runtime stack.

ScannedImage.jpg
ScannedImage.jpg (141.93 KiB) Viewed 1933 times
by Breakfast
Fri Nov 27, 2009 8:53 pm UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Re: Compiler Design

Thank you, I'm now done with my compiler and I'll be free to show the code on 11/30/09 12:00 PM for any and all interested in compiler design.
by Breakfast
Fri Nov 27, 2009 8:24 pm UTC
Forum: Coding
Topic: Compiler Design
Replies: 14
Views: 1492

Compiler Design

I've been programming a compiler for a class this semester and I am now on the final stretch of checking for syntax errors. Two of the errors we have to check for in our language are: A procedure call does not reference a procedure name and A procedure name is referenced but not defined (un...
by Breakfast
Wed Aug 12, 2009 2:49 am UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Re: Help with dice probabilities

Thanks everyone!

After I did a few I got the hang of it and was even able to write a program to figure it out.

Malle, thanks for the list. My results were the same.
by Breakfast
Tue Aug 11, 2009 7:38 pm UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Re: Help with dice probabilities

*EDIT* Alright, 17 - (54 / 1296) (?) 16 - (94 / 1296) (?) I'm a programmer, but what I do honestly doesn't involve much math. I might be able to write a program but it would probably take more work than just solving the problems by hand. Yakk, I don't really understan...
by Breakfast
Sun Aug 09, 2009 11:15 pm UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Re: Help with dice probabilities

To the both of you, thank you very much. *EDIT* I want to make sure I'm on the right track. Example: With the above system, the only way to get a sum of 3 is to roll all 1's. So, since there is only one case, the probability is (1 / 1296). - Work I've done so far - 18 - (21 / 1296) 17 - ...
by Breakfast
Sun Aug 09, 2009 7:19 pm UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Re: Help with dice probabilities

This is my logic for the equation I came up with: To have a total of 18, at least three of the dice have to be 6's. -> (1 / 6) ^ 3 It does not matter what the final dice is. If the fourth dice is a 6, it is dropped because there are already three 6's. If it is less than 6, it is also dropped. So I s...
by Breakfast
Sun Aug 09, 2009 6:02 pm UTC
Forum: Mathematics
Topic: Help with dice probabilities
Replies: 18
Views: 2223

Help with dice probabilities

If three dice are rolled the probability that the sum of the dice equals 18 is (1 / 6) ^ 3 = (1 / 216 ) = 0.00462962963. If four dice are rolled and the lowest number is dropped, I come up with this equation to find the probability that the sum is equal to 18: the sum from i = 1 to 6 of (1 / 6&#...
by Breakfast
Thu Jun 25, 2009 2:54 pm UTC
Forum: Coding
Topic: Alpha-Beta MiniMax
Replies: 2
Views: 561

Alpha-Beta MiniMax

I can code a minimax algorithm using alpha-beta pruning but if I'm given a game tree and told to hand solve it with a-b I'm at a loss. I don't really understand how the algorithm is working. Can anyone help explain this too me?
by Breakfast
Tue Jun 16, 2009 10:08 pm UTC
Forum: Coding
Topic: Changing a const
Replies: 28
Views: 2014

Re: Changing a const

It compiles with warnings. lol
I've decided to do it another way that I've done before and hadn't thought of until now.
by Breakfast
Tue Jun 16, 2009 9:38 pm UTC
Forum: Coding
Topic: Changing a const
Replies: 28
Views: 2014

Re: Changing a const

The name of the array "map" quite literally refers to a 2D map that you can move an avatar around in. I think I'll go with a vector of vectors to solve the problem.
by Breakfast
Tue Jun 16, 2009 8:49 pm UTC
Forum: Coding
Topic: Changing a const
Replies: 28
Views: 2014

Re: Changing a const

If i add map[yCoor][xCoor] after #define xCoor 2 #define yCoor 2 does that accomplish what I want? If not should I try using a vector of vectors? I've done that before for a class project. Basically what I'm trying to do is have a map of size x, y and then load a new map of size a, b. So, even thoug...
by Breakfast
Tue Jun 16, 2009 8:17 pm UTC
Forum: Coding
Topic: Changing a const
Replies: 28
Views: 2014

Re: Changing a const

I got it to work with this: #include<iostream> using namespace std; #define xCoor 3 #define yCoor 3 int main() { int map[yCoor][xCoor]; for(int i = 0; i < yCoor; i++) for(int j = 0; j < xCoor; j++) map[i][j] = 0; for(int i = 0; i < yCoor; i++) { for(int j = 0; j < xCoor; j++) cout << map[i][j]; cout...
by Breakfast
Tue Jun 16, 2009 7:49 pm UTC
Forum: Coding
Topic: Changing a const
Replies: 28
Views: 2014

Changing a const

I've found no other way to declare a 2D array in c++ than this: #include<iostream> using namespace std; int main() { const int xCoor = 1, yCoor = 1; int map[yCoor][xCoor]; return 0; } My problem is that I want to be able to change the size of the array after it has been declared. I've tried using co...

Go to advanced search