199,114 Archived Topics
Remove Filter ![]() | |
I am trying to take a user's input and assign it to a certain part of a structure. This code is in my book so I assume it's correct: [code] scanf("%d", &part_number); inventory[num_parts].number = part_number; [/code] I need to do the same thing but with a string instead of a … | |
HI I have a while loop and it's a foreach in it.The while loop showes a query result but if there was a foreach in the while loop ,it's run just one time but if it isn't in it ,the while run untill fetching all the result but I want … | |
My EOT font doesn't work in PHP. It only work in HTML. Can anyone help me? Thanks. | |
Whenever I am getting a line from a file by using the string getline() function, I seem to be getting an extra character. I am curious to know what exactly that character is. It recently caused me a bit of trouble trying to debug. Let's say the file is like … | |
Dear colleagues I am currently working on designing a scheduler using Borland C. I am struck with the concept of interrupts. I am trying clock tick interrupt for task switching. In all materials they say you will continue to your regular job until the interrupt occurs. I don't think it … | |
Hello. I have text fields with data that is not being inserted into my table 'Election'. The Election table has these fields: ID (primary key and auto-increment), title, open_datetime, close_datetime, department, adminID, active (default is 'N') I checked to make sure all the field names are the same. Everything works … | |
When I try to run my program( which is a test entity system for anyone who's wondering ), I get a Stack Overflow error, and I cannot find the source of this error. Here is my code: baseentity.h: [code=c++]#ifndef BASEENTITY_H #define BASEENTITY_H #include <vector> #define DECLARE_CLASS( className ) public: virtual … | |
Hi again! I've been working on this program and I am thankful for all the help and tips I've gotten from this forum. However, at the moment I can't seem to get this selection sort to work on my array. I've tried it 3 different ways(will post code below) and … | |
i have the following code [CODE]<?php $id = $_SESSION["user_session"]; $get = mysql_query("SELECT * FROM table WHERE id='$id'"); $total_found = mysql_num_rows($get); if($total_found==0){ my code goes here }else{ while($g = mysql_fetch_array($get)){ $id_2 = $g["id"]; $query = mysql_query("SELECT * FROM table WHERE id != '$id' AND id!='$id_2'"); while($z = mysql_fetch_array($query)){ mycode goes here … | |
So, I have a script that needs to "clean up" when it is exited: it needs to clear a special logging file and other small things that affect the next startup of the script. The script has a GUI written in Tkinter, if that is relevant at all. Is there … | |
I'm having problem with opening php pages in browser. I'm using apache web server and the problem is that instead of a page browser shows php code that i wrote in text editor (for example it shows <?php phpinfo(); ?> instead list with informations about php). Everything worked fine before … | |
I'm testing this program for: x^2 + 0.17714x -2.5147583 with k = 1.4997 I've been looking at this for hours and have worked through it on paper, but can't figure out why line 59 is calculating C[1] as 0.17714. C[1] should be 1.6768. Can anyone please help me figure this … | |
Hello all, I have been trying for a few days now and done quite a bit of reasearch on the internet and this website to find out how I can authenicate to a website. It could very well be that this particualar web server is picky I'm not to sure. … | |
Hello :) This is my first post on daniweb forum and I hope this site will help me improve. I'm a first year college student in computer science, and I've only recently started C++. This means that code posted by me might seem very lousy and /or unprofessional. I have … | |
this is a small example that, i hope reflects the larger project that i am working on. i am making a board game that uses a combination of mouse listener and jbutton action listener for the player to move. when it is time for the computer to take its turn, … | |
Hi everyone. I've got this code that I've been following along with a sample. However, whenever I debug it, I get the error 'XML Exception was unhandled: Root element is missing.' Here's the code I have so far. [code=c#] namespace SpiveyPropertyRental { public partial class Tenants : Form { public … | |
Hi , i have 2 txt files full of names , read line by line and compare. If name from first file exist in second , i don't write it to result file. My code work excelent with small files , but when i try big files (100 MB) , … | |
Hi, I am "googling" for the whole morning, but I am not able to find an HttpUtility.UrlPathEncode in C# Compact Framework - simply, I need to encode/decode URL and post data for my windows mobile application making a web request. Please, do you know, how to do it? M. | |
Hi, I'm trying to write a function that takes in a c-string, and remove all 'T' and 't' from the string. So here's what I have so far, but every time I try to compile it, it gives an empty character constant error. [CODE] void removeT(char* msg) { char* ptr; … | |
Hi, I need to make a program, which I think should be simple if you know what you are doing. You have an array of integers A(m, n) and B(m). Delete an element from A array, which index is in the B(m) array. Print original and modified arrays. I don't … | |
Hey, I have a program that it supposed to read two columns of data and then perform a calculation on them. The problem is reading the data in from the file. I have a function to count the lines, this works correctly. It returns it's value into a variable called … | |
Hi, I'm having trouble just printing particular strings out of a sentence. <h1>hi my name is</h1> if i just want the program to print out <h1> </h1> and ignoring the text in between, how would i do that? i have tried converting everything to ascii and printing within the range, … | |
In the following c code, the num_elements is gobal. But if i make it as local and return , it gives strange value just before return it becomes '0' ...can anybody explain why ? [code] int num_elements =0; //generates a psuedo-random integer between min and max int randint(int min, int … | |
Hi i'm new here ,and i'm still rookie at working with C++ Builder 6 I have a task ,which i don't understand. My task is like that :.. Number array E (m,n) and i need to replace all the line and column even(oddly) numbers to 0(zero). Please im praying you … | |
Hey. I have been trying to do a drafts board, but i am having major problems with adding the pieces. Heres my Board. Any Suggestions?? [code] import java.awt.*; import javax.swing.*; public class Board { protected JPanel[][] squares; protected JFrame boardFrame; protected Container container; public void paint (Graphics g) { } … | |
i am not able to figure out why python throws an error when i call this function. In the code snippet below when i call set_greyLevel() python throws an error. If i comment the function call it works fine. Please help. Thanks in advance. [code=python] def set_greyLevel(self, grayScale): if grayScale … | |
I use netbeans but was wondering if anyone knew how to add a Java compiler to visual studio 2008? | |
hey i am a beginner as far as python is concerned..i am having diff in understanding this code..i am supp to do it in python..if anyone can tell me wht it does it wud be really helpful [code] for qid,query in "as2.qrys": for word in query: docs = set(index[word]) for … | |
I've got a large array of coordinates (a struct containing x and y, among other things) and for each pair of coordinates, I'm trying to find another pair that's closest to it from that array. [code] int i, j, d = 0, cd = 0, closest; for(i=0;i<size;i++){ closest = 0; … | |
Hello: If I have a 2d Vector and I want to convert it to a 2d Array what would be the best way to accomplish that. I know that I can go through a for loop to do it element by element but I would prefer to use the copy … | |
If you were asked to describe the techniques to C++ would you talk about like, Inheritence, Re-use etc or something else? I don't understand :( Help please! | |
Hi, how is the system function done? Atm I am doing it like this: invoke ShellExecute, NULL, addr szopen, addr cmdexe, addr szparams, NULL, SW_SHOW But it requires the program to know the persons homedrive. Is there a system(); function that can be used in assembly? If so, what library … | |
Hey everyone I am trying to read a hexadecimal registry value from a registry key, I am opening the key and then calling RegQueryEx, but I can't seem to get it right. Can someone post an example. Thanks. | |
Hi, for one of my projects at uni i have to create a PHP based text game, i am basing mine on the colossal cave game. i am trying to use the explode function to split my string up into variables to check against my database but am getting the … | |
Is there a command that change's server's file's inside buffer? Change file's inside text? I hope you understand me | |
Hello! I am new one here. Firstly I would like to say that I'm really poor in english, so be patient with me.. In the school we had a new task. So let me explain: we have a 2d array with numbers.. like this: 0 1 2 4 5 6 … | |
Example of what im trying to do: [U]Definition: test.txt[/U] Apples //line1 Coke //line2 Money/line3 [CODE] #include <fstream> using namespace std; fstream teststream; teststream.open("test.txt"); string line1; string line2; string line3; [/CODE] //I want it so line1 = apples //I wan tit so line2 = coke //I want it so line3 = … | |
Hey. Im having problems adding my Jmenubar to my board. It compiles fine just wont display. Any advice really appreciated. Thanks, Pd [CODE] import java.awt.*; import javax.swing.*; import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.Font; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; import … | |
So here is the problem. This won't compile. It always gives an error like : d.cpp:24: error: ‘string’ was not declared in this scope d.cpp:24: error: expected ‘,’ or ‘;’ before ‘{’ token Compilatie failed. [CODE=C]#include <iostream> #include <string> #include <stdlib.h> #include <time.h> int d(int amount, int dots){ // d(X,Y) … | |
im using borland [CODE]/*Write a function that will scan/read each line of a given text file and determine whether a line is valid or invalid. A line is said to be valid if and only if it satisfies the ff: a. the line is composed only of characters a and … | |
I have searched for a way before what the most effective way and in this case important the fastest way is to seek backwards in a file to read the very last line in a file. Like in this case I want to search from the end and backwards to … | |
I am writing a application where i need to know which games are installed on a system. I have 3 ways by which i think i can detect the games 1: Scan specific parts of registry and look for key names that match with a List of Publishers. The list … | |
Hi to all and good day... I'm still studying about vb 6's data report designer and the data environment...but what i need to know is how can i make or [B]generate[/B] a report at [U]run time[/U]... for example, generate report for the employee names. (names of the employees will populate … | |
how could i call the above function so that when i input something like 21 for the mark the ouput is "the grade is A", and when the user inputs something more than 25 and less than 0 hes asked to input it again..? [code] def mark2Grade(mark): if mark >=20: … | |
I wanted to get some opinions on a good visual c++ book to buy. I am intermediate level when it comes to programming. I have already been through a class on C and almost done with my class on C++. So I want a book that is heavy on the … | |
I am trying to get a value from a specific cell in a dataGridView. I know how to choose a Row / Column but not at the same time. I have tried to get the value from row 3 in column 2 like below. But I cant find a Column … | |
Hi, using old pure C, I was able to define a custom windows message. Once done, it was possible to broadcast the message across my application. Any object, with defined listener was able to receive and process the message. OK, right now, I need to do the same in C#. … | |
In my database I have a field date and eventname.I want to retieive eventnames after the current date.How can I do it? | |
If I build an application using BS 2008 in C# that uses an SQL database, Do I have to include SQL Express as part of the deployment package? In other words, does the user need SQL Express on his/her machine in order to use my application if my app does … | |
ok I've been looking all over the net and I cannot find anything about this issue anywhere, other than the same problem is mentioned once in a great while, but never shown how to rectify this. I'm at a point where I can't do anything else and I could use … |
The End.