98 Archived Topics

Remove Filter
Member Avatar for phorce

Hello, In my class I have a method that basically does this: - Reads in characters from text file (as a string) - Converts the characters into an integer - Stores the values into the integer Here is the code: [code] bool Loader::Read(string theFile) { strRepositry = theFile; string theData …

Member Avatar for phorce
0
122
Member Avatar for phorce

Hello I'm working on a project, and I have the following classes: [LIST] [*]Loader - This loads the contents of the text file [*]Matrix - This processes the data that has been loaded [/LIST] Now I'm using association, Loader -> Matrix In my matrix class I have a method that …

Member Avatar for histrungalot
0
164
Member Avatar for phorce

Hello :) (Too many questions about this)! Basically, I'm trying to display the contents of a matrix without using "cout" in my class. (It's a bad method) I've tried to return an array, but, that failed miserably.. So I've got a method in my class: [code] double Matrix::read(int theRow, int …

Member Avatar for ravenous
0
118
Member Avatar for phorce

Hello, basically I want to return an array from a function (So I don't output things in the class - just main) But I seem to get the error: "invalid types 'int[int]' for array subscript" Here is the code: [code] #include <iostream> using namespace std; int matrix() { int matrix[10] …

Member Avatar for phorce
0
205
Member Avatar for phorce

Hello.. I'm doing a project that involves searching/matching 2 matrix's. The basic idea: Matrix 1: 0 1 0 1 0 1 0 1 0 1 1 1 1 0 1 Which will then be interpreted in memory as: 0 1 0 1 0 1 0 1 0 1 1 1 …

Member Avatar for mrnutty
0
107
Member Avatar for phorce

Hello, I'm just wondering really.. I have a 2D matrix but I've defined it as a 1D matrix. So for example: [code] double *matrix = new double[N*M]; [/code] My question is, I'm going to be manipulating data very shortly and want to read this data in from a text file.. …

Member Avatar for WaltP
0
236
Member Avatar for phorce

Hello hope that you can help. Basically, I'm making a site that uses a header file and then for each page, include the header and set the title.. It's easy using procedural PHP but I want to do it using OO. Here is the problem: Page.php (class) <?php class Page …

Member Avatar for ctaylo21
0
106
Member Avatar for phorce

Hello could someone explain what I'm doing wrong to get the error: Segmentation fault: 11 when trying to fill in a 2D array from two for loops? Here is the code: Matrix.h [code] #ifndef _Matrix_h #define _Matrix_h using namespace std; class Matrix { public: Matrix(); // Constructor Matrix(int M, int …

Member Avatar for phorce
0
1K
Member Avatar for phorce

Hello, I'm trying to create a matrix that dynamically defines the rows and columns.. Now, everything is fine, apart from when I include a function to output the 2D array.. The error: Matrix.cpp:20: error: invalid types ‘double[int]’ for array subscript ... The code is: Matrix.cpp [code] #include <iostream> #include "Matrix.h" …

Member Avatar for phorce
0
130
Member Avatar for phorce

Hello, I'm creating a Matrix, that the user can manually define the rows and columns.. (This will be defined in a class) But, I'm having trouble resizing the vector to what is set in main.. Here is the code: Matrix.h [code] #ifndef _Matrix_h #define _Matrix_h #include <vector> using namespace std; …

Member Avatar for VernonDozier
0
2K
Member Avatar for phorce

Hello, I'm working with files in a C++ project AND the text file that I need to open is in the same directory, however when just trying to open it like this: [code] string inputFile = "myText.txt"; [/code] It will not open, even though it's in the same directory, so …

Member Avatar for Narue
0
12K
Member Avatar for phorce

Hello, now it looks like this is homework help, but no - it's not! I'm trying to communicate between a C# program and a webpage, I'm generating the data into C# and wanted to export it to the webpage using JSON.. However, I can't seem to find out if it's …

Member Avatar for gusano79
0
128
Member Avatar for phorce

Hello, having a slight problem here.. I have a string, that I need to do character analysis on - Basically finding out how many times "B" is in the text and then ordering this from (lowest to highest). Now I can get the results, but, I don't know how to …

Member Avatar for phorce
0
129
Member Avatar for phorce

Hey, I'm building my own platform mainly for a project, but, for my own personal use as well.. I'm also changing the style of programming that I do it in, and, setting up some rules.. I just wondered if there are any disadvantages to the way that I am setting …

Member Avatar for phorce
0
200
Member Avatar for phorce

Hello, I'm a mac user and starting a new module in Prolog and wondering if there are any applications that can compile and run Prolog for mac? Sounds silly, but can use terminal? Thanks :)

Member Avatar for phorce
0
397
Member Avatar for phorce

Hello, basically I have two tables: People Orders Now I want to grant the first person in "Peoples" with all privileges, now I've tried to do this: [code] GRANT ALL ON Orders TO {testUser |PUBLIC |role_name} [WITH GRANT OPTION]; [/code] Doesn't work (because they are technically not a user, therefore, …

Member Avatar for mlesniak
0
137
Member Avatar for phorce

Hello I need some advice (I'm not expecting code - Just want to know if it's possible / references) Basically, I want to create a class that I can check if the email has been submitted AND also, if it's formatted right (e.g. does it contain a @ but also …

Member Avatar for pritaeas
0
85
Member Avatar for phorce

Hello, I'm doing a project where I need to see which number matches to a list of letters in the alphabet. Currently I have the output as: [code] A= 5 A= 8 B= 9 B= 2 C= 0 C= 3 D= 6 D= 4 E= 1 E= 13 F= 0 …

Member Avatar for Munnazz
0
127
Member Avatar for phorce

Hello, I have a map that contains the alphabet (key) and a double (value) and I would like to sort the list so that the highest value is at the top but it still keeps it's key.. E.g. [code] #include <iostream> #include <map> int main() { map<char, double> alphabet; alphabet['a'] …

Member Avatar for vijayan121
0
135
Member Avatar for phorce

Hello, I'm writing a program that compares two percentages and I need them to be rounded up or down depending on their number.. I have used this: [code] percentage[i] = Math.Round ((analysis[i] * 100) / char_count); [/code] Bit it throws an error that it's too ambiguous.. Now the "analysis" is …

Member Avatar for thines01
0
97
Member Avatar for phorce

Hello, I have two arrays that contain different numbers that I need to compare with another array.. e.g. Array 1: 10 20 40 70 Array 2: 5 3 10 18 2 Basically, I want to write a program that calculates the highest value each array and then swops the values.. …

Member Avatar for Narue
0
170
Member Avatar for phorce

Hello, I'm trying to read in words from a text file that look like: The World Fell Over etc.. But it doesn't seem to be working.. I've written some code however it will only show the first word OR loads of question marks.. [code] string dictionary() { string words[500]; ifstream …

Member Avatar for thines01
0
135
Member Avatar for phorce

Hello wonder if you could help me please.. Basically I'm trying to implement a script where it searches through a file and sees the most popular word.. I've got it doing it like this: [CODE] Squence: 0 0 Squence: 1 0 Squence: 2 0 Squence: 3 0 Squence: 4 0 …

Member Avatar for raptr_dflo
0
139
Member Avatar for phorce

Hello, I need to search a char array, for a particular word... E.g. [code] char * search; char arr[10] = {'b', 'c', 'a', 't', 'h', 'e', 'p', 'h'}; string words[1] = {"the"}; search = strstr (alphabet, words); [/code] But it doesn't work... Any ideas what the problem could be? Thanks …

Member Avatar for thines01
0
80
Member Avatar for phorce

Hello, I'm working on a project where certain characters can have multiple values.. E.g. Letter 'A' can be replaced with 'B', 'C', 'D' Letter 'S' can be replaced with 'X', 'Y' And then it would output it like this: A can be replaced with B - Yes/No A can be …

Member Avatar for NathanOliver
0
92
Member Avatar for phorce

Hello, I'm doing some work on Frequency Analysis and decrypting text.. Basically, this is how I think it works... You take the alphabet (as a char) [code] alphabet[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; [/code] Then you read in the string you want to analyse [code] crypt[26] = {'c', 'a', 'b', 'e', 'f', 'f', …

Member Avatar for mrnutty
0
100
Member Avatar for phorce

Hello (Dunno if this is the right forum) But basically, I've been given some text to decrypt. I've got to do it using frequency analysis. Here's what I've done: 1. Got a frequency analysis of the text: Showing how many times a letter appears. 2. Got a frequency analysis of …

Member Avatar for frogboy77
0
155
Member Avatar for phorce

Hello, I have an array and need to sort it so that the highest numbers show first etc.. I have written this: [code] for(int i=0; (i < 26); i++) { while(counter[i] < counter[i + 1]) { int temp = counter[i]; counter[i + 1] = temp; counter[i] = counter[i + 1]; …

Member Avatar for phorce
0
100
Member Avatar for phorce

Hey.. Is it possible to make PHP type arrays? Like keys? For example, I have an array of numbers, and an array of letters.. A = 10 B = 20 C = 30 And then I sort the numbers so that the highest number is at the top etc.. But, …

0
73
Member Avatar for phorce

Hello I'm trying to display the memory location(s) of an array of pointers. It works, but it prints the memory locations out as: e.g. [code] (0x7fff672e19a0) [/code] I know that is the memory location, but in other examples, I've seen it being displayed as [code] 4041 [/code] Here is the …

Member Avatar for L7Sqr
0
125
Member Avatar for phorce

Hello, I am working on a script that reads each individual character from a txt file and then outputs it depending on whether it's in the alphabet or not.. The problem is, it won't output spaces or anything apart from the string.. e.g. The text file reads: [code] Hello, my …

Member Avatar for Red Goose
0
108
Member Avatar for phorce

Hello, I'm developing an application that reads a text file, and then replaces what's in the text file with an array (alphabet) It all works ok until I try and change the position of the inputted character and it returns: [b]Segmentation fault: 11[/b] It's really confusing! Here is my code: …

Member Avatar for sundip
0
99
Member Avatar for phorce

Hello, I'm trying to calculate the center of a DIV element. But it doesn't seem to be working, I don't quite get what to do with the calculations.. Here's my code: [code] <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <style type="text/css"> body { background-color: #cccccc; } .rectangle { width: 400px; height: 100px; border-style:solid; …

Member Avatar for MartinRinehart
0
93
Member Avatar for phorce

Hello, Does anyone have any experience with phpwebsocket by google? I'm having a problem connecting to my server... Here is the two files: (server.php) [code] #!/php -q <?php /* >php -q server.php */ error_reporting(E_ALL); set_time_limit(0); ob_implicit_flush(); $master = WebSocket("[server_IP]",12345); $sockets = array($master); $users = array(); $debug = false; while(true){ $changed …

Member Avatar for cwarn23
0
170
Member Avatar for phorce

Hello, I am working on a chat application in jQuery and I have used the function setInterval(), however, it doesn't seem to refresh the div element.. Or load it for that matter.. Here is the code: [code] <!DOCTYPE html> <html> <head> <style> #shoutbox { width: 400px; height: 400px; border-style:solid; border-width:5px; …

Member Avatar for stbuchok
0
275
Member Avatar for phorce

Hello, I am working on an algorithm that checks to see if a value is in an array, however, it doesn't seem to want to work .. It will display that the first number is there but nothing else.. Any ideas? Heres the code: [code] #include <iostream> using namespace std; …

Member Avatar for gerard4143
0
334
Member Avatar for phorce

Hello, I have wrote a OO program and I have been able to compile ok when using Dev cpp however, I have moved to mac and now compiling through the terminal. For classes I use a main.cpp (the main script), Numbers.h (The header file for the class) and Numbers.cpp (all …

Member Avatar for phorce
0
154
Member Avatar for phorce

Hello, I'm going to be laying ethernet around my house, now, I'm just wondering which is the fastest? I've been looking at this "CAT5e RJ45 Ethernet Network LAN " type of Ethernet cabling, would this be fast? Thanks.

Member Avatar for smferoz
0
184
Member Avatar for phorce

Could anyone recommend any commands to connect to port 443 using terminal? It's a printer website, that enables you to print... Any ideas? Thanks you :)

Member Avatar for rch1231
0
132
Member Avatar for phorce

Hello, (Using Mac as a server) I have set up a web server (at home) and it's working perfectly fine. However, I'm using ssh to access the files from a different computer and would like to rename and change the location of the "WebServer" server file, basically put it on …

Member Avatar for cocolio
0
109
Member Avatar for phorce

Hello, I want to build a system that allows me to print a document (from a input field) and it prints at my home. Basically, if I'm out I have an input box that if I upload a file to it, it will print for when I get home. Same …

Member Avatar for cereal
0
109
Member Avatar for phorce

Hello When I normally write classes and then use them, I'd use this: [code] $site = new Site(); $site->load('header'); [/code] But I've seen people do this: [code] $site = new Site(); $site->load->header(); [/code] How do they do it? Confused

Member Avatar for kaisarkhan87
0
93
Member Avatar for phorce

Hello, I want to create a DDoS prevention script, but I don't know which is the best way to go about it. What I was thinking is that, when a user attempts to connect to the website, it records their IP and then if there is loads of traffic, it …

Member Avatar for happytogether
0
100
Member Avatar for phorce

Hello, I'm trying to create a script that counts the number of people in an array by using a variable called "counter" I am using functions to display the information, however it won't display.. [code] <?php function main() { $people = list_people(); echo 'There are currently: ' . $counter . …

Member Avatar for phorce
0
120
Member Avatar for phorce

Hello, I have a computer upstairs that I want to store everything off and then just be able to ssh into it. I have port forwarded 20 to the IP address of the computer (on the router), and connect to it when I'm on my own router it works, however, …

Member Avatar for jingda
0
115
Member Avatar for phorce

Hello, I am trying to remotely connect to my mac that is at home. It appears when I am on my network, I can ssh into it without any problems whatsoever. If I try and ssh outside of my network it displays an error saying "Connection failed" Is there a …

Member Avatar for Netcode
0
75
Member Avatar for phorce

Hello, I am working on a system that logs someone in, from their IP address and not their username and password. The thing is, I need to access the remote IP address rather than the router's IP address. For example [code] <?php echo $_SERVER['REMOTE_ADDR']; ?> [/code] Will only display their …

Member Avatar for edwinhermann
0
153
Member Avatar for phorce

Okay, I have a posting system, so when a user posts something it displays.. Now I want the background of these to be like this: - White - Grey - White - Grey Now, I've done it before, but only using tables.. So I'd have like: <?php $bg = ($bg=='#eeeeee' …

Member Avatar for karthik_ppts
0
123

The End.