Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
75% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #1K
~25.6K People Reached
Favorite Tags

49 Posted Topics

Member Avatar for ItecKid

How to check if a vector is NULL? [code=c++] vector <int> test; [/code] How to check if this is NULL? [code] if (test == NULL) [/code] returns compiler errors.

Member Avatar for Lucaci Andrew
0
5K
Member Avatar for ItecKid

Hello, I am attempting to write the merge sort algorithm which will generate a vector of 20 random integers and then sort them. The problem is, it does not output the sorted list, it merely outputs a series of zero's and one's. My code is as follows, any help is …

Member Avatar for Calbert21
0
520
Member Avatar for Hoff123

Hi, Your declaration of member functions is wrong in the test.cpp Should be like [ICODE]void Cool_Class::cool_function()[/ICODE] Also, it has been a while since I do OOP in C++ but I think you also need to declare a constructor, so the object knows how to exist...

Member Avatar for ItecKid
0
224
Member Avatar for ItecKid

Hello all, I am trying to understand the concept of pipe-ing input/output through a C program. I wrote this simple code: [CODE] #include <stdio.h> #include <stdlib.h> void in_read (int *foo) { read (0, foo, 1); } void in_write (int foo) { write (1, &foo, 1); } int main (int argc, …

Member Avatar for histrungalot
0
188
Member Avatar for ItecKid

Hello all, First off, I am not here to debate the merit of storing PDF as a blob in MySQL. I know this is not optimal solution, but this is the requirement that I have to work with. The upload appears to be successful, (Field in the database is filled …

Member Avatar for cereal
0
2K
Member Avatar for ItecKid

Hello, everyone, Next semester, I will be taking a course in Java programming language, and was wondering if anyone knew of a good IDE that runs in the Red Hat/Fedora environment. (Preferably something installed through YUM.) I tried a Google search on this, yet the only thing I seem to …

Member Avatar for Computerphile
0
389
Member Avatar for ItecKid

I have this code. pthread_create does not through an error message, however it does not execute it's argument function. See comments in code for better description [code=c] void * moveFiles (void * arg); int main (int argc, char **argv) { pthread_t * tid; int rc = 0; /*variables count and …

Member Avatar for ItecKid
0
2K
Member Avatar for ItecKid

Hello, I am trying to read through a UNIX directory in C and write all the filenames to an array. However, the array is not being populated with any value. Here is a snippet of relevant code: [code=c] char **files = {NULL}; struct stat fileinfo; int count = 0; int …

Member Avatar for nezachem
0
109
Member Avatar for ItecKid

*EDIT-I know strtok doesn't actually 'return' a segfault-I realize after submitting topic that is poor wording. Hello, I am having a problem with the C function strtok, as follows: [code=c] void function_name (char * cmd) /* Gathered from another function using readline. Assume 'ls -l' in this example */ { …

Member Avatar for abhimanipal
0
804
Member Avatar for ItecKid

Hello, I am trying to structure query to execute MySQL fulltext search. I have creates simple table as follows: CREATE TABLE IF NOT EXISTS `entries` ( `id` int(3) NOT NULL auto_increment, `doc` text collate utf8_unicode_ci, PRIMARY KEY (`id`), FULLTEXT KEY `doc` (`doc`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; And …

Member Avatar for mwasif
0
97
Member Avatar for ItecKid

Hello, I have two different tables I need to extract data from. They are linked by a number, that is to say the value of the field 'number' in table 1 is the same value as the value of the field 'num' in table 2. I can select data from …

Member Avatar for urtrivedi
0
137
Member Avatar for MadSkyrim

Ah, well, if you are simply trying to print the results, it is very simple: [code=perl] if ($_ =~ /(foo)bar(baz)/) { print "$1 $2\n"; #Prints 'foo baz' from the pattern 'foobarbaz' } [/code] See? You can put groups of parentheses around certain parts of the regular expression to 'capture' them …

Member Avatar for MadSkyrim
0
173
Member Avatar for ItecKid

Hello, I am attempting to use JavaScript to 'highlight' text by changing it's background color: [code] <div id="foo" onMouseOver="highlight(this);"></div> [/code] In JavaScript: [code] function highlight (word) { document.getElementById (word.id).bgColor="blue"; } [/code] This produces no effect. I also have an onClick event in the same div, can I not have onClick …

Member Avatar for ItecKid
0
3K
Member Avatar for ItecKid

Hello, I have written a 'predictive text' widget using JavaScript/AJAX. When user enters a string of letters into form, the list of possible matches is displayed under the form. This works well and good, now I am trying to make it so that when the user clicks on a certain …

Member Avatar for Taywin
0
756
Member Avatar for ItecKid

Hello, I am new to PHP language, but not to programming or Regular expressions. I am using [code]preg_match_all ($pattern, $file, $matches)[/code] in my code, where $pattern contains two groups of capturing parentheses. I understand that each element of $matches[1] is an element captured by the first group of parentheses, and …

Member Avatar for cwarn23
0
78
Member Avatar for lastlight

[QUOTE=lastlight;1171848]Howdy all, If I comment out "use functions" and"&run_frunner" (a call to the functions package) it will display in a browser[/QUOTE] Based on that analysis, I would guess that there is an error in the run_frunner subroutine in your functions module-it could also have to do with how you called …

Member Avatar for ItecKid
0
159
Member Avatar for ItecKid

Hello, all, I am writing an x86 function that is called, with arguments, from a C program. Which registers does x86 store these arguments in?

Member Avatar for Salem
0
62
Member Avatar for ItecKid

Hello, Question regarding the connect function (in Socket), how to specify a specific port? The function only accepts two arguments, the socket and the ip. I have multiple devices on the same ip but different ports that I need to connect to, how to do this in Perl? Thanks.

Member Avatar for Abinila
-1
110
Member Avatar for SpyrosMet

You need to pass the array as an argument to the function...when you call the function from main, give it the array as an argument.

Member Avatar for SpyrosMet
0
132
Member Avatar for pcpp

I think your problem with the user name is that you are using getline. Try just using [icode]cin >> name;[/icode], like you're doing with the password. As for reading the password in as *'s, as far as I know (though I could be wrong) there is no clean way to …

Member Avatar for VernonDozier
0
106
Member Avatar for Nikhar

Yes, it does. Vectors are part of the STL and should be accepted by any recent C++ compiler.

Member Avatar for Nikhar
0
65
Member Avatar for chrisname

Your question intrigued me, so I copied your code and got the same error. Your problem is with this [icode]if ($htmlFile == 'no file found')[/icode]. Instead of the == operator, use the eq operator. Your actual problem, however, is that this will only work for the first HTML file in …

Member Avatar for chrisname
0
144
Member Avatar for mubdea
Member Avatar for jonsca
-2
239
Member Avatar for Stefano Mtangoo

Have you looked at NetBeans? I'm pretty sure it compiles with gcc/g++, and includes an IDE.

Member Avatar for ItecKid
0
102
Member Avatar for ItecKid

Hello, I am trying to send e-mail using Perl and Net::SMTP::SSL. However, I receive errors when running this script (example from documentation): [code=perl] #!/usr/bin/perl -w use Net::SMTP::SSL; sub send_mail { my $to = $_[0]; my $subject = $_[1]; my $body = $_[2]; my $from = 'me@gmail.com'; my $password = 'MySuperSecretPassword'; …

Member Avatar for simfex
0
667
Member Avatar for Vindhyaauri

Reading from a file in array context will get you all the lines in the file: [code=perl] @array = <$fh> #where $fh is your file handle [/code] If the atoms are in order (1, 2, 3) etc, and you need to get specific values from them, use split: [code] my …

Member Avatar for d5e5
-1
439
Member Avatar for Happy Family
Member Avatar for Narue
-1
84
Member Avatar for anna2

This is...really not that hard...The first function is basically one line manipulating the variable with the calculation you were given. The second function is the exact same thing but in a loop from lower bound to higher bound.

Member Avatar for ItecKid
0
103
Member Avatar for ItecKid

Hello all, I am trying to write a clustering algorithm where, given location of certain points (I.e, latitude and longitude) I need to choose 50 of these to be cluster centers such that the diameter of each cluster is minimized. To that end, I believe that the program should choose …

Member Avatar for ItecKid
0
113
Member Avatar for zobadof

On the whole namespace thing, yes, don't use namespaces, but you can do things like [icode]using std::cout;[/icode] at the top of your program so you don't need to put the [icode]std::[/icode] in front of every print statement. As for the OP, you asked no question, but your code is riddled …

Member Avatar for Nick Evan
-1
163
Member Avatar for C++ Beginner

Sales is passed to the function as an integer, but in the line [icode]cout << sales[count];[/icode] you are treating it like an array. Add a [] to sales on line 36-this will ensure the function will treat sales as an array.

Member Avatar for valtikz
0
445
Member Avatar for restrictment

If the name is being read in as a string, you can append to it using the + operator: [code=c++] std::string name; std::cin >> name; /*say, Robert */ name += ".txt." std::cout << name << std::endl; /* should print Robert.txt */ [/code] EDIT: And then you can open the file …

Member Avatar for Narue
0
106
Member Avatar for orwell84

On Ubuntu, you should be able to [code] sudo apt-get install cpan [/code] And then [code] cpan ModuleName [/code] And this should configure everything automatically.

Member Avatar for ItecKid
-1
142
Member Avatar for ItecKid

Hello, I am writing a C++ program to find the largest such number such that the square root of that number is less than or equal to a fixed number, set by me, like this: [code=c++] #include <stdio.h> #include <math.h> int main (void) { long fixed, param, result; result = …

Member Avatar for ItecKid
0
125
Member Avatar for dolly37

I ran a quick test and had the same problem you did; it would only get the odd numbered lines. I do not have much experience with Tk, but I think second argument to insert must be scaler. Thus, this will get all your lines: [code=perl] #! /usr/bin/perl use Tk; …

Member Avatar for crb3
0
127
Member Avatar for Akis2000

Syntax errors notwithstanding, what problems are you having? What happens when you compile and run the code?

Member Avatar for Akis2000
0
344
Member Avatar for santhanalakshmi

What exactly are you asking? Perl arrays are not like C++ arrays, they can grow and shrink in size dynamically. [code] my @array; [/code] This declares an empty array, whose size is zero. To add things to array, most common operations push and unshift. [code] push (@ARRAY, $VALUE); [/code] puts …

Member Avatar for santhanalakshmi
0
170
Member Avatar for ItecKid

Ok, so I have to write two (OO) Perl modules. One the them, in one of it's subroutines, needs to call the constructor of the other module. According to my professor, this should be doable without the classes having working knowledge of each other. For example, if I have: [code=Perl] …

0
63
Member Avatar for Hilariousity

Been a while since I've used that syntax, but I think it is supposed to be: [code=cpp] bool Data::operator [/code]

Member Avatar for Hilariousity
0
2K
Member Avatar for ItecKid

Hello, If I have code like such: [code=c++] map <string, map <string, int> > foo; map <string, map <string, int> >::iterator bar; [/code] How to access the value of the nested map? Normally I access a map's value like such: [code=c++] bar->second; [/code] To that end, I tried doing this …

Member Avatar for ItecKid
0
2K
Member Avatar for ItecKid

Ok, I'm not sure if the above title made sense, here is what I am trying to do: Suppose I am writing a module that looks something like this: [code=Perl] package Whatever; use strict; use warnings; #constructor--will take one argument when called sub new { my $class = shift; my …

Member Avatar for KevinADC
0
88
Member Avatar for neoseeker191

You need to use == instead of = in your if statements. '=' sets the thing on the left equal to the thing on the right, == means 'is equal to.'

Member Avatar for soroushc
0
137
Member Avatar for ItecKid

Hello, I am having some trouble reading data from a .txt file. I know that the file contains strings separated by white space. The problem is, I don't know how many strings there are, so I would like to go through the file one string at a time, and then …

Member Avatar for ItecKid
0
151
Member Avatar for ItecKid

Hello, How to call a function which takes dynamic array argument? That is to say, if I have: [code=C++] void fctn (int *a[], int n) { *a = &n; //do stuff with a. } [/code] How to call this in main? Must I have another array declared in main to …

Member Avatar for thelamb
0
107
Member Avatar for ItecKid

Hello, I am trying to write the merge sort algorithm. My code is as follows: [code=c++] #include <iostream> #include <cstdlib> using namespace std; void m_sort(int list[], int temp[], int left, int right); void merge(int list[], int temp[], int left, int mid, int right); void mergeSort(int list[], int size) { int …

Member Avatar for ItecKid
0
134
Member Avatar for ninja_gs
Member Avatar for ItecKid

Hello, I am having trouble understanding the output of the following program: [code=C++] #include <iostream> using namespace std; int main () { int a[5][6]; int b, d; for (b=0; b<=5; b++) { for (d = 4; d >= 0; d--) { if ((b+d)% 4 == 0 ) { a[d][b] = …

Member Avatar for ItecKid
0
135
Member Avatar for ItecKid

So basically, my assignment was to write quick sort and merge sort using both vectors and arrays, and time how long it takes to sort the the arrays and vectors of various sizes. However, the code is producing inconsistent results. Sometimes it seg faults, other times it produces unfriendly messages …

Member Avatar for ArkM
0
641
Member Avatar for ItecKid

Hello, I am trying to write the quick sort algorithm to take in an array of 20 random integers and sort them. However, it is producing weird output for the sorted list. My code is as follows, can anyone give me a little help here? [code=C++] #include <iostream> #include <vector> …

Member Avatar for Freaky_Chris
0
109

The End.