64,152 Solved Topics
Remove Filter ![]() | |
I'm attempting to iterate over a list and when a chosen value is found remove it but I can only remove 1 value (the first one found). Why is this and how can it be solved. Here's the code I use [CODE] for (int i = 0; i<list.size(); i++) { … | |
i need to sum anything that is input in input form numbers. And this has to be in order like 5,4,3 and then it has to sum like 5+4+3 = 12. Can anyone help? I came as far as the code shows above. this is the example of how it … | |
It makes since that, when working with javascript, document.getElementById() can't find the Id of an object that hasn't yet been added to the DOM, however when I nest document.getElementById() in a function and call it after the object has been created, document.getElementById() still can't find the object. is there a … | |
how do i rewrite the following code using the ternary operator [CODE] if ( isset( $page_title ) ) { echo $page_title; } else { echo 'Welcome to Auto-Zim'; } [/CODE] thanks in advance | |
I'm not able to do this after trying several times, maybe someone out there will know a way. I have several lists, each have 5 string elements inside them. I want to loop through the list and put each item on a String (if the item hasn't been added to … | |
Hello all. The problem: I have started a session. Now I would need to set an expiry time (24 hours) on the cookie it creates (if it creates it). How do I achieve this? Thanks to all, who anwsers. | |
Alright, I am trying to count words in a file. The user running the program can choose a file that the program can count how many words are in the file. I have it working, but.... it keeps looping the last sentence [CODE]cout<<"There are "<<words<<" words."<<endl;[/CODE] over and over and … | |
I have a block of JavaScript code that is designed to be embedded into any web page. It displays a list of items from a database. In the .js file is actually a lot of PHP code within JavaScript. The problem: The cut-n-paste widget does not actually show up. It's … | |
hi i just started php, my code works on ie, bit when i open the webpage on firefox and chrome the image does not display?, can anyone help [CODE] $car = "C:\wamp\www\porche.jpg"; $banner = "<img src=\"$car\" "; $banner .= "width=\"380\" height=\"110\" border=\"0\" >"; echo($banner); [/CODE] | |
hello..i've made a structure given below and the objects of that struct are stored in an arraylist [code] struct node { public int x; public int y; public int cost; public object parent; } [/code] now when i'm adding a new object this type..i want to check if the arraylist … | |
I have a problem with this code too. right now I have a segmentation fault but before I couldn't get the correct maxValue. [code] int maxValue(node* head, int max) { node* p; if (head == NULL) { return(1); } else { p = head; max = p-> item; while(p != … | |
I am trying to send results to a new page.The results are fine. i.e. once the form is submitted and all input validated I want the result to appear on the results.html page. I have been able to display the results.html but no data displayed. I attach some relevant code: … | |
Every day on his way home, little Billy passes by his great aunt Clara Mitchum's house. Generally he stops in for a chat with his aunt and sometimes he asks for some lollies. When he does, she generally gives him some, but then adds now don't be asking for any … | |
i referred a site which said that using the include() we can include code of another page into the current page But i am not getting the output as they showed. this is my code [CODE] <html> <head> <style type="text/CSS"> body { background-color:#696565; font-style:italic; } h1 { color: green; text-decoration:underline; … | |
This is what the question is stating: Write a program that inputs a line of text using function fgets() into a char array s[90], then it outputs the line converted to uppercase. For function [ICODE]fgets[/ICODE] to be used, am i correct if I understand that the user doesn't have to … | |
Consider there is a string [COLOR="Red"]"hai welcome..."[/COLOR] I need to [COLOR="red"]print the string [/COLOR]as such [COLOR="red"]leaving the first three characters..[/COLOR] I should not use in-built functions or others... It should b [COLOR="red"]done in a single printf statement [/COLOR]by [COLOR="red"]changing the control string pattern..[/COLOR] | |
I have a TreeView control in VS 2010 that I need to be able to INSERT (not add) nodes to. I have stored a unique key in the TAG for each node and know how to find the value of the tag in the tree. However, I can't figure out … | |
I have a combobox I need to display some data in from a Database, but there are duplicates and I don't know how to select the distinct ones. Any help? | |
Hi guys, First post so please don't be too harsh :D. I'm trying to open a .txt file, search for a specific line starting with (" Performance Summary"), copying the first and third numbers in the columns of the 4th line below it and every line below that until there … | |
[CODE] import java.util.*; public class PetrinetSim { public int noofplaces=0; public int nooftransitions=0; public inputarc[] ip=new inputarc[50]; public outputarc[] op=new outputarc[30]; ArrayList<place> pl= new ArrayList<place>(); public Scanner in=new Scanner(System.in); place[] p; transition[] t; void createplaces() { int i; p=new place[noofplaces]; for(i=0;i<noofplaces;i++) { p[i]=new place(); p[i].token=0; p[i].id=i; } } void createtransitions() … | |
Alright, I am having a problem with an error message that comes up, i am pretty sure the code is alright, but it might be the code, i have tried re-installing VB (Visual Basic 2010). i have tried a few things on the web and nothing. here is the error … | |
can someone please help me with this code? i am getting the following error : [Linker error] undefined reference to `enr(int, int, double, double, double)' thanks #include <iostream> #include <fstream> #include <math.h> #include <string> using namespace std; float ran1(long *); #define IA 16807 #define IM 2147483647 #define AM (1.0/IM) #define … | |
Hi there! So I'm working on my next assignment and it's all about implementing a few exceptions in order to get us familiar with the topic. I am tasked with implementing 3 very simple exceptions to my previous program. So far I have 2 out of 3 working fine with … | |
Can someone please explain to me why I am getting errors with this? [CODE] /** This class stores data about a room. */ public class Room { private int walls; // Number of walls private int windows; // Number of windows private String ceiling; // Type of ceiling private String … | |
I have created a form that uses a drop-down box to save information to a MySQL database using a php script I wrote. That works perfectly, but the problem I have is when I am trying to edit the information in the database. I have created an edit form that … | |
When I make an OpenGL game on this computer, it runs at normal speed. If I run it on literally any other computer, it goes really fast, making the games unplayable. Does anyone know what might be causing this? | |
Hi I need to add the following sample url, [url]http://www.mysite.com/home[/url] to my .htaccess file to redirect it to the following url: [url]http://www.mynewsite.com/welcome[/url]. I've seen that my htaccess uses RewriteCond, and tried a code like this: RewriteCond %{HTTP_HOST} ^www\.mysite\.com/home$ [NC] RewriteCond ^(.*)$ http://www.mynewsite.com/welcome$1 [R=301,L] However am getting Internal Server Error 500. … | |
A question regarding inheritance implementation. Let's say we have 2 classes: [CODE]class B { public: int x; // for the sake of argument it's public, don't stone me }; class D: public B { public: int x; // again x, i know ... stupid dilemma };[/CODE] Now, if you will … | |
I have a form with a number of controls on it, and I had thought that the "Controls" property of the form instance contained all of the controls on the form as per the documentation. Actually it does, but now iterating over all of my controls becomes similar to iterating … | |
Hello there..i'm trying to implement a tree in C#..the basic node structure is give below [code] struct node { public int _x; public int _y; public int _cost; public node _parent; public pos(int i, int j,int cost,pos parent) { _x = i; _y = j; _cost = cst; _parent = … | |
I just have a quick question, I tried to figure this out from my textbook but can't seem to find it. j = 5, i =7 Evaluate (++j == i) + 3 How does C evaluate the expression? To me, it just doesn't make sense. I'm not looking for the … | |
Is it possible to have multiple input streams open at the same time? I know it takes a lot of time to open a file, and I am trying to be as efficient as possible. I really need to have two streams open at the same time. The data is … | |
Overload new and delete operator to manipulate objects of Student class.Class Student must contain data members like char * name,int roll_no,int branch etc.The overloaded new and delete operator must allocate and deallocate memory for the student class object and its data members. Here is my code. The problem is that … | |
[CODE]Bitmap cropImg = new Bitmap(747, 591, System.Drawing.Imaging.PixelFormat.Format24bppRgb); cropImg.SetResolution(300, 300); //create a new graphics object from our image and set properties using (Graphics grPhoto = Graphics.FromImage(cropImg)) { grPhoto.CompositingMode = CompositingMode.SourceCopy; grPhoto.SmoothingMode = SmoothingMode.AntiAlias; grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic; grPhoto.PixelOffsetMode = PixelOffsetMode.HighQuality; //now do the crop // grPhoto.DrawImage(loadedImage1, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height), imageBounds1.Location.X … | |
Hello all. This program is supposed to maintain inventory for 5 warehouses with 3 items each warehouse. Each in a different city. You can place an order or send a shipment to each warehouse. When you place an order, if one warehouse does not have enough of the item it … | |
Hello, I have been beating my head over this issue for almost a week now. I have my pages setup to where the user can register and I can display these members. Here is where it gets fun. Where the applicants are display they are in the rows so that … | |
Hi I'm stumped on how to make this program that I'm working on to output the information to the text file in a nice fashion instead of writing it in a funny way. I basically want this program to output the student record information line by line and organized. The … | |
Hi, there im a new member, I have a few questions. i am having a problem i am trying tp find words that are related together by one word for example "dous" Tremen[B]dous[/B],stupen[B]dous[/B] ect... I have my code working so that it goes through my text file and picks out … | |
I've looked on the site and I've Google'd this for the past couple days to no avail. Either this is just completely obvious and I'm terrible at programming(I'm new, so this is possible). Anyway, the assignment is to accept two whole numbers that are 512 digits or less. Then we … | |
Hello Daniweb, I've searched all over including a few threads here on this topic and it looks like I'm running out of options. I'm developing a travel reservations website with a promotional code field on the payment page. The admin wants to be able to create coupon codes with an … | |
[B]Edit2: I realized the title of the thread was misleading after the post was made..it's more like There's 6 lines per student..I need to make a list for each student. So it's 6X..where X is the number of students.[/B] Hi all.. I have a text file that looks like so: … | |
I have a menustrip with several levels of submenus as in below Client 1 [INDENT]Project 1[/INDENT] [INDENT][INDENT]Project 1 Task 1[/INDENT][/INDENT] [INDENT][INDENT]Project 1 Task 2[/INDENT][/INDENT] [INDENT]Project 2[/INDENT] [INDENT][INDENT]Project 2 Task 1[/INDENT][/INDENT] [INDENT][INDENT]Project 2 Task 2[/INDENT][/INDENT] Each entry is clickable, even if it has children. In the above example, I can select … | |
Hello everyone, I'm new to Java. I found this site and the members to have a lot of knowledge and was hoping I can get some assistance. I have written this 2D array code to find the lowest value in each row and return the values. "getLowestInRow" is the method … ![]() | |
First I tried getting a SQL query into an array, and then mail it. Made the data incomprehendable. So someone told me to use CSS to build a table format, filling it with the array. A LOT of hard work (since I had to learn css all the way from … ![]() | |
hi i am trying to accepte text in text box only numbers and capital alphabets in keypress event below code is not converting lower case to upper case [CODE]Private Sub Tbx_AcctCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Tbx_AcctCode.KeyPress Dim KeyAscii As Short KeyAscii = Asc(e.KeyChar) If KeyAscii >= … | |
[code] public class Book { String title; boolean borrowed; public Book(String bookTitle) { } public void borrowed() { } public void returned() { } public boolean isBorrowed() { } public String getTitle() { } public static void main(String[] arguments) { Book myBook = new Book("Da Vinci"); myBook.name = "The Da … | |
// Linked list Hi... Below is the codes that I wrote so far... everything is fine but just abit headache on when trying to read the data from the file...and it give me a weird things... my output suppose is like this [CODE]============================================================== No Name/Site Location Weight 01 ThunderStone Russia … | |
Hi guys ive been working on this mini pokedex program. unfortunately im having a little problem. Im so sleepy right now and I think i need help. [CODE]/* Program Description: a mini pokedex */ import java.util.Scanner; public class Pokedex { public static void printOptions () { System.out.println(" POKEDEX ver 1.0 … | |
Hello i just want to ask you guys if you can help me with this problem: I need to write an javascript that writes out chess board like table, and that table must include onclick function that changes background color of that cell that is clicked on. I would really … | |
Hey i am wondering if it is possible to have a switch statement in a function that is leading to another switch statement and another switch statement afterwards. Question. Write a program that will give the user the option to select a shape or a three dimensional object. The program … |
The End.