41 Solved Topics
Remove Filter I don't know why I'm having such a problem with this, basically, I want to have a Queue that is constantly running during the program called "Worker" this then works, however, every 10 seconds or so.. Another method called "Process" comes in and processes the data. Let's assume the following, … | |
I have two threads, and, I want one thread to run for 10 seconds, and then have this thread stop, whilst another thread executes and then the first thread starts up again; this process is repeated. So e.g. from threading import Thread import sys import time class Worker(Thread): Listened = … | |
I believe there is a function which returns the max value for a double, however, I do not need this. I'm converting the following function: public void StaticCompress(short[] samples, float param) { for (int i = 0; i < samples.Length; i++) { int sign = (samples[i] < 0) ? -1 … | |
I might be a bit tired, but why does the following not work? class Signal { public: Signal() { } protected: std::vector<double> data; }; class Something : public Signal { public: Something() { data.resize(100); } }; class Parser : public Signal { public: Parser() { std::cout << this->data.size(); } }; … ![]() | |
I basically have two classes: `Signal` and `Parser` they both have differences, however, they each share the data that `Signal` has. I want to incorperate Method Chaining into the class, so my classes (at the moment look like the following): class Signal { Signal() { } Signal& Parse() { return … | |
Earlier today I could not sign in and it told me my username + password combonation wasn't right. But, I had not changed it? It worked after I re-set my password. Nothing changed on my account, so I don't think I've been "Hacked" Any ideas? P.S. now I'm getting a … | |
I'm working on a project that generates roughly between 13x512 values in which I compare at run-time. So the program outflow will be sort of as follows: - Program executes - Extracts (1) 12x512 - Extracts (2) 12x512 - Compares (1) to (2) - Extract (3) - Compares (3) to … | |
Sorry if this is hard to understand what I'm trying to do here, but, I do not know how to approach this. I am using method overloading in my constructors of a class, and I have multiple "Window" functions which are all classes that can be used and I need … | |
Hello, I am having a few problems when trying to execute the a Makefile that will *hopefully* create a static library that I can use for future use. Here is my code below: #----------------------------------------------------------------------------- # Usage of make file #----------------------------------------------------------------------------- # Clean operation: # make -f MakeClient clean # # … | |
I have not visited PHP/MYSQLI for some time now, and, need some guidance on the following problem: I'm trying to retrive all the data from the given week and just in that week. My table looks like the following: id int(11) type varchar(255) week datetime And as a test data … | |
Hello, I don't want to look like I am following other forums, but, wouldn't it be a good idea for users (with a certain amount of rep) to have basic moderation tools, or, atleast the ability to edit posts by users and: 1) The person who posted can accept this … | |
Hey, I have a function in C that I am trying to convert over to C++. I have done everything, apart from this line: memcpy(mel[i],&temp[melstart[i]],mellength[i]*sizeof(double)); I need a way of copying the elements in temp[melstart[i]] over to a vector of doubles.. Here is the C code: void Setup_Mel(int fft_size, int … | |
Hello, So basically, I am trying to create a system based on the Singleton Pattern and I'm confused. If I have an Animal class, as well as a Cat class which is derived from Animal and then using a Singleton class will create a single object of which-ever class has … | |
Hello, I'm trying to read the header information of a .wav file and I'm kind of stuck. Basically, the header information is located at different offsets in the file. So for example: (0-4) = ChunkID (4-8) = ChunkSize (8-12) = Format .. .. .. .. .. .. From this: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ … | |
Hello, wondering if someone can help me. I'm working with a .wav file, and, I need to collect the header information. The header contains (roughly, 20 bits/bytes) before the actual data. And, each of this data is contained at different locations in the file. I need to read a particular … | |
Hello, wondering if someone can help me quickly.. Basically, I have created a array to store all the data in a text file. The pointer of the array is sent to a function, which then populates it. Here is the code: void Data(char* theData) { ifstream txtFile(inputFile.c_str()); if(!txtFile.is_open()) { cerr … | |
Hello, I'm trying to develop an algorithm/program that calculates the distance between two points. These values are stored inside a 1D array, which, acts as a 2D array (I think you know what I mean!) The values are: 150 50 15 20 The calculation should therefore be: d = √(150 … | |
Hello, I'm building an application in PHP and when outputting HTML tags, it shows the tags.. So for example: <?php echo "<b>Hello world</b>"; ?> I would expect Hello world to be in bold.. But no, I get: <b>Hello world</b> as the output Any ideas please? | |
Hello, I'm currently working on a project that basically reads some text and then performs basic Lexical Analysis on the text. I'm having a slight problem with overloading methods. So for example, I have a method that can read in the words from a txt file and another method which … | |
Hello, I have this matrix: 0 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 and I need to print out the block with the coords: (2,1) so in this case: 1 0 1 0 I have tried this: for(int i=minRow; (i < 2); … | |
Hello, I have been reading an article on comparing data, and have been given this code: for(i = 0; i < matrix1W; i++) { for(j = 0; j < matrix2H; j++) { diffSum += abs(matrix2->pData[(row+j)*backW+(col+i)] - marix1->pData[j*matrix2+i]); } } Now it works when using arrays, but, I'm using vectors, is … | |
Hello, Wondering if you can help me.. I have a variable, that each time needs to multiply by 2 (I know, it sounds simple.. I'm probably being an idiot) but it works like this: LOOP 1 offsetX = 0; offsetY = 0; LOOP 2 offsetX = 2; offsetY = 0 … | |
Hello, I'm currently studying and sometime soon will have to do a final year project (which runs through the year).. Now I've been looking at stuff om image recognition and although it interests me I want to do some kind of signals or signalling. My idea is to capture the … | |
Hello I need some help, I'm trying to output something to a text file (.htm) which will then display the data that is being generated in the C# program.. Now the problem is, whenever I try to replace something, it doesn't work. Just replaces it with "System.Char[]" Here is the … | |
Hello, I have two paragraphs on my page and I need to draw a line between them. Now, I currently store the positions of the two paragraphs inside a database and I have access to them, I just don't know what to do from here. Some people have suggested I … | |
Hello, I have a major problem with a Correlation algorithm I'm trying to implement.. Basically, when I have two small matices: Matrix 1: 0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 1 1 1 0 0 0 0 1 1 1 … | |
Hello, I have 2 massive matrix's and I need to compare one matrix with another.. Now, I have come up with a solution that takes a 5x5 block of the matrix1 and compares it with a 5x5 block of matrix2, this happens until the end of both matrix's.. I'm confused … | |
Hello, I need some help please.. I need to write a recursive predicate in Prolog that subtracts two numbers until number 2 is higher than the result. I have completed the logic in C++: [code] #include <iostream> using namespace std; int mod3(int a, int b) { int intResult = a-b; … | |
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 … | |
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 … | |
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" … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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]; … | |
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, … | |
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; … | |
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 . … |
The End.