64,152 Solved Topics
Remove Filter ![]() | |
[CODE] #ifndef VECTORBINARYTREE_H #define VECTORBINARYTREE_H template<typename Object> class ArrayVector{ private: int capacity; int sz; Object* a; protected: void overflow() { capacity*=2; Object* b=new Object[capacity]; for(int i=0;i<sz;i++) b[i]=a[i]; delete []a; a=b; } public: ArrayVector(int initCap=16){ capacity = initCap; sz=0; a = new Object[capacity]; } int size() const {return sz;} bool isEmpty() … | |
hey guys, just one question- how do i get netbeans to import a whole folder (containing numerous java files)? the only option i currently get is to import eclipse projects. | |
My profesor added this line of code to a bubble sort saying that it made it more efficient by tracking the last swap. I don't understand how this would work [CODE] void bubble_sort(int a[], int n){ while (0<n-1) { int last =0; for (int i=0; i<n-1; i++) { if (a[i]>a[i+1]) … | |
Wget is a very useful tool, however, I dont know how to use it in python. Below is my try but with no luck. Would you tell me the right way ? Thank you very much !! I made a wwget.py [CODE] #!/usr/bin/python import urllib2, urllib img=wget("http://blog.freetimegears.com.tw/patrick/archives/Maple-tree.jpg") [/CODE] Running in … | |
Hi all, I have virtually no knowledge of C, but I have a problem with one of my scripts. It runs fine on a 64-bit Linux machine, yet it gives me a seg fault when run on 32-bit linux. gdb tells me that the seg fault occurs on line 314. … | |
My file below checks if the user is ! logged in, and redirects to login page, or does nothing if user is logged in. [CODE]<?php if(isset($_COOKIE['SID'])) { $sid= $_COOKIE['SID']; $uid = $_COOKIE['User']; $lastip = $_COOKIE['Cname']; $_POST['SID']=$sid; $check = mysql_query("SELECT * FROM users WHERE SID = '".$_POST['SID']."'")or die(mysql_error()); while($info = mysql_fetch_array( … | |
Hello. I've got a problem that I haven't been able to solve after a long time searching. It's a simple problem. I have two forms. 1) Form1 2) Form2 I need to get from Form1 to Form2 and vice versa. I can get from Form1 to Form2 easily, but I … | |
Greetings Good People of DaniWeb, I have been on a search for a solution for my problem for weeks and weeks now. My search has brought me into this wonderful community in which I hope to find help. I will be doing my part in the community by providing help … | |
An exercise that Stroustrup wants the reader to do is understand the output of the following program. [code] #include "../../std_lib_facilities.h" struct X { int val; void out(const string& s, int nv) { cerr << this << "->" << s << ":" << val << "(" << nv << ")\n"; } … | |
I want to validate the textbox like , the textbox can not accept string value..i can accept only the number value.............................. At first i had validated the textbox in VB.Net like : =========================================================================================Private Sub txt1_KeyPress(KeyAscii As Integer) If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 8 Then … | |
Hello, first post =D Seemingly simple question, but I can't seem to find the solution. [CODE] (above were other SQL statements I had been fooling with) SQL = "SHOW TABLES;" Try conn.Open() da = New MySqlDataAdapter(SQL, conn) Dim cb As MySqlCommandBuilder = New MySqlCommandBuilder(da) da.Fill(ds, "products") dgvMain.DataSource = ds dgvMain.DataMember … | |
My rand() isn't very random. As a matter of fact, it's not random at all! I am running Ubuntu 10.04 on both home comp and laptop. When I execute the code: [CODE]#include <iostream> #include <cstdlib> using namespace std; int main() { int x; x = rand(); cout << x; return … | |
Again I come crawling for help... I made a program that makes coordiant points and lines with these coordinates. A new class is going to inherit from the class with the lines, and calculate the distance between a line segment and a point. I found the correct mathematical formula. With … | |
Hey every one... im trying to read file path from .txt I can read it but there is one big hole in which i stepped.. So if you could help me out?? lets see the code looks like this: [CODE]Imports System.IO Public Class Form1 Function INIparse(ByVal TextStringToProcess As String, Optional … | |
Hi, I have been struggling with Valgrind's error in this function: [CODE]void parse_date(char *date_out) { char *date_in = __DATE__; int month = 0, day = 0; char *str_month = (char*) malloc(sizeof(char) * 4); char *str_day = (char*) malloc(sizeof(char) * 3); /* check mallocs */ if ((str_day == NULL) || (str_month … | |
Two Sessions Questions I am developing a members site, and trying to make it template and DB driven, so it can be transportable between domains. Each page that is called makes use of include statements to bring in the constant information that is found on every page Sample page call … | |
Hi, I created a program that makes a multiplication table, I dont know where the .txt file is located after executing the program Im using turbo C++ :-/ [CODE]#include<iostream.h> #include<stdio.h> void main(){ int multiplicand; int multiplier; int toprow; int column; int repeater; FILE* Starter=fopen("[COLOR="Red"]multiplication.txt[/COLOR]","w"); cout<<"Insert the number of repetitions: "; … | |
Hello everybody, I am looking for a good C++ midi API. I have written a program in C++ that needs to be able to export MIDI. So far I had written my own export function, but I feel that the complexities of low level midi coding will become to great … | |
I have finish coding some of my Payroll Program modules. But im having a problem on the log-in. I would like the log-in to determine the type of the user logging in, a User or Admin (Level Access of course). If it is a User, all command buttons in every … | |
Hi, I have a table `Categories` with fields (category_id, category, parent_category_id) I want to write in a single query to replace the parent_category_id with the corresponding category_name. [CODE] // OBJECTIVE: To return all category names and parent category names // if category is root (no parent), parent category name is … | |
Need some help here. Why after I insert the node, it loop back to insert node again, and it not back to the menu. [CODE] #include "stdafx.h" #include <iostream> #include <string> #include <iomanip> #include <sstream> using namespace std; struct place { string cityName; place *left, *right; }; string myStr; void … | |
Hey everyone, I have a quick (and hopefully simple question). I'm writing a simple program that will ask the user for two different inputs(IP address and message), save those as strings, then run a command in command prompt adding those strings on the end as arguments. I'm using it to … | |
Hey guys, I'm getting a few errors I can't seem to figure out solutions for: (SalesEmployee Line 21) error C2248: 'SalariedEmployee::salary' : cannot access private member declared in class 'SalariedEmployee' (SalesEmployee Line 17) error C2664: 'SalariedEmployee:: SalariedEmployee(const SalariedEmployee &)' : cannot convert parameter 1 from 'std::string' to 'const SalariedEmployee &' … | |
Another total Nuby collection. I have an xml file from which I wish to eliminate all elements that have any attributes at all. All I really need to do is eliminate the contents of the attribute. How do I do this? My plan is to start with <xsl:template match="Contains an … | |
I am self taught in php only. now im starting to learn javascript as well. I have noticed so far that I can dynamically creat my pages, forms, validation etc... with js just like i can with php. (at least that seems true so far from what i am learning). … | |
Write a Java program to continue creating your own userdefined methods and introduce some do while loops. Write two valuereturning methods called farToCel() and celToFar(). These two methods will convert temperatures from Fahrenheit to Celsius and Celsius to Fahrenheit respectively. They will each take a single int parameter and return … | |
Am I able to read or write to a file with this code or what is stumping me. The following is what I am suppose to do. Calculate each employee’s pay, and write it out to a sequential file. Be sure to include file I/O error handling logic. Include only … | |
Now, heading might be a bit misleading. If that is the case forgive me as I cannot think of best heading! i have database of books, that is e-books. Each table have page number and contents (to simulate true book). The problem is, I have to search for a word … | |
![]() | hi! i tried to run the following program in BORLAND C++ version 5.02.. [code] #include<stdio.h> #include<graphics.h> #include<string.h> #include<math.h> #include<conio.h> int const monthcount=12,dataoffset=18; struct indata { float realarray[ 12]; float array[ 12]; }; char getlabel[3]; indata data; int monthplace[ 12]; float interval,chartbottom,radius; struct wcp { float x; float y; } coord[monthcount]; … |
Hi I am fairly new to python. I want to do a seating reservation program containing 32 seats so the users can reserve seats and unreserve seats. I know I need a class that sort of contains the seats, but I dont know how to make it.... I have made … | |
Would someone please try & modify this query in a way that it shows the count for how many users have registered for the current day ? So like right now it should display a count of 2 and then come midnight it would show 0 and then incrementally go … | |
I have a problem about loading/saving ArrayList from/to file. I've searched some thread about this but it's not ok, because the demo used ArrayList<String> but i used ArrayList<Student> with Class Student [ICODE]public class Student { private String id; private String name; private int year; private String genre; private String course; … | |
i have this code to simulated a walk going either forwards or backwards amd i need to modify it so that it can go either up, down, left or right. only problem is im stuck can you offer any advice? thanks [code] import random filename="walk1.txt" def randWalk(n): steps = 0 … | |
I'm sending out AJAX request for a XML file to plot a chart. The problem is everytime the response comes back, the chart refresh itself, even if the XML is exactly the same. I would like to use Javascript to check the content of the reponse XML with the cached … | |
hi guys, I have another noob question, I was wondering if anyone can help me with it. the home work assignment I have is "[B]In this assignment we are going to write a phone directory program. The user is asked to input a name and the program looks up the … | |
Hello, all professionals, I used subprocess.Popen to launch a process, right now I am planning to shut it down after a given time. Can I use subprocess.kill() to fulfill that? (I do not know how to do that cuz every time I will receive a error message.) [CODE] import subprocess … | |
My attempt to write a recursive method to produce the results of the number of combination where x=13 and y=52 and Combination (y, x) =..... When I use small numbers (e.g.: 2,4) I tend to get a result only when I blank out the 3rd if statement. The formula used … | |
Well i was wordering how can i do one file for whole site or with includes. Example i see some sites have index.php?page=register etc or index.php?page=portofolio How can i do that without if else because i have problems with it. | |
[code=c++] #include <iostream> using namespace std; int getNumChild() { int numChildren = 0; cout <<"How many children do you have? "; cin >> numChildren; return numChildren; } int calCredit(int numChildren, double income) { int totCredit = 0; totCredit = numChildren * 1000; if (income < 70,000) { if (totCredit > … | |
i am retrieving a $_GET variable date: $month= date(m, $date), is there a way to retrieve this and make it convert to its equivalent $month= date(F, $date)?? i need the variable info but i need to get the full textural representation of the month not just the number. And im … | |
I tried to generate permutations by using itertools module but its not working. [CODE=python] >>>print(permutations([1,2,3],3)) <itertools.permutations object at 0xa917c5c> [/CODE] Why is it so? and how do I make it work properly? | |
When trying to pass a template parameter to another template, I am getting an 'invalid template parameter' error. I even tried to force it with 'typename' with no success. Can anyone see what's wrong with this? [code] #include <itkImage.h> #include <itkImageFileWriter.h> #include <itkRescaleIntensityImageFilter.h> template <class T> void WriteImage(typename T::Pointer image, … | |
hi so i need to write a rock paper scissors game. when played in the command prompt it should look something like this user input is in [B]bold[/B] press q at any time to quit please choose rock(r), paper(p) or scissors(s): [B]r[/B] computer chose paper. you lose! your score: 0 … | |
I am having a problem of getting a variable passed from one page to another. On the first page there is a drop down menu populated by sql. [CODE] $result = mysql_query ("select Name from dba.wx_faq_backup where Name like '%dev%' group by Name") or die (mysql_error()); //$result = mysql_query ("select … | |
Hi! I've downloaded the MySQL Server 5.1 and developed a small database using the MySQL Command Line Client. However, now I must update a structure of some tables, include some foreign keys, etc. In my opinion, it is not very comfortable to use the MySQL Command Line Client and the … | |
Advice sought? Hi, I'm trying to create a program that when run ten times (closing inbetween) then throws up a message. My thoughts on this is to get my application to create a dat file storing 0 (Zero) in it, then have my application read the dat file for input … | |
Team - I am in the beginning of a new project. I need to be able to present a list of records on an .aspx page. (This isn't a problem.) and when the "details" link is clicked it woudl show the full record etc. (again, not a problem) Problem? I … | |
Hi im working on views that can help me navigate through records in a table. i have managed to execute an sql string to select the table i.e "select * from Users" i however want to build a "Previous" and "Next" command on the view but im mixed up on … | |
Hey guys.. I have a foreach loop (with multiple variables inside of it) and I need to collect the variables, as well as other content, and store it into a single string so I can output it into an email. Has anyone done something similar to this before? Here's some … | |
Hello, I need to find repeated sequences within a vector. I have been thinking about using search, as is described [URL="http://www.cplusplus.com/reference/algorithm/search/"]here[/URL]. But this uses an array to search, I don't need to use extra memory, as I am seaching for sequences [B]within[/B] the same vector. Any suggestions on how to … |
The End.