No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
19 Posted Topics
hey guys. OK so, I've been wondering this for a while now. my code is always so unnecessarily cluttered because I don't know how to do this, lol. say I have a set of private class variables: [code=java] private ArrayList row0 = new ArrayList<String>(); private ArrayList row1 = new ArrayList<String>(); … | |
So we have to implement Bresenhams line drawing algorithm as well as Cohen-Sutherland line clipping algorithm. For some reason my whole program (9 classes, but only will include Line.java here) runs fine, but the output .xpm file contains a picture that is not what it's supposed to look like from … | |
So one of the problems I have been having with my programs is the length of time it takes to print out a pixel map into the XPM file. I tested it with like : 500 rows and 2 columns -- 1 second 500 rows and 10 columns -- a … | |
So I have a lot of code so I guess I'll just post the couple classes that seem to be giving me problems and where the problem is occuring. [CODE=java]// line class to store lines from .ps file class line { // for outcodes private int RIGHT = 2; private … | |
So I have a JComboBox, which contains recipe names. I want, when the recipe name is changed, for the label that is an icon of the rating (1 to 5) stars, based on my recipe object, to change as well. My code seems like it should work perfect but it … | |
ok so i want to read a .txt file line by line. I have the code for that BUT i want to keep track of what line im on, i might be completely braindead from working on this whole project forever but heres the line by line code i am … | |
So I have my text files saving perfectly from my program in the exact way I want them to. Here is a copy of the text file that my program saves that I am now trying to load back in, parse, and set up internally as another object: [CODE]scott-survey m/c … | |
So I have this function that is supposed to output an object (save an object) to a .txt file. It doesn't output anything when the program comes to the point where it runs this function. I am 99% sure this is where the program hangs. [code=java] public void saveSurvey(String txtFile) … | |
[code=python] #!/usr/bin/python import os.path n = 10 allPositions = [] state = [] blackPairCap = 0 whitePairCap = 0 blackInaRow = 0 whiteInaRow = 0 row0 = [] row1 = [] row2 = [] row3 = [] row4 = [] row5 = [] row6 = [] row7 = [] row8 … | |
It keeps giving me this elif syntax error in line 103 and I have NO idea where it's coming from. UGH!!! [code=python] #!/usr/bin/python import os.path #nxn board, in this case n = 10 n = 10 #will hold the positions similar to n-queens allPositions = [] #current state of board … | |
It keeps giving me this exception when it [I]seems[/I] like I am adding a choice to my choices vector, and I don't know why. Here is that snippet of code. If you need more I can provide it. Thanks ahead of time. [CODE=java]import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Vector; … | |
So here is my program: [code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/22/09 import pdb #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making … | |
How come this just hangs, after debugging I found it never returns True for precondition even though it should on the very first go around....ugh!!! [code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/8/09 import pdb #n is going to be … | |
[code]backTrack ( stateList ) ====================== state = first element of stateList if state is a member of the rest of stateList, return 'FAILED-l if deadEnd?(state) return 'FAILED-2 if goal(state), return NULL if length(stateList) > depthBound, return 'FAILED-3 ruleSet = applicableRules(state) if ruleSet == NULL, return 'FAILED-4 for each rule r … | |
[code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/7/09 #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making an allDirections list. allDirections = [[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[-1,1],[1,-1],[1,1]] #declare … | |
[code=python]#!/usr/local/bin/python #Scott Landau #CS 380 #Assignment 1 Programming Portion in Python #Created - 4/6/09 #Last Edited - 4/7/09 #n is going to be equal to 4 for this queens problem. n = 4 #Assigning the empty list to initialState. initialState = [] #Making an allDirections list. allDirections = [[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[-1,1],[1,-1],[1,1]] #declare … | |
[CODE=C++]#include <iostream> #include <fstream> #include <vector> #include <string> #include <sstream> #include <stdio.h> #include <time.h> using namespace std; bool StringToInt(const string &s, int &i); int main() { // opening up and setting up the input file stream so we can read it // to perform the "account info" and the "history" … | |
I want to convert two C++ programs into MIPS assembly. Both programs compute if a given integer is prime or not. They both contain the same main() pretty much, but one uses an iterative function while one uses a recursive function. I am not too good with MIPS so I … | |
i am completely stumped at how to create this program. can anyone help out? here are the guidelines. Introduction Perhaps in no other sport does statistics play as major a role as in the game of Baseball. In fact, certain numbers, such as 56 (length of Joe DiMaggio's hitting streak), … |
The End.