132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for oggiemc

Hi, Can someone explain to me what is going on in the code below as im new to pointers and not quite sure what is going on..In particular, an explanation of the first couple of iterations in the for loops would be helpfull.. Thanks [code=c] #include<iostream> 5 using namespace std; …

Software Development c
Member Avatar for gerard4143
0
78
Member Avatar for ccube921

I wanted every variable in the array to have .x, .y, and .cont, the error occuired on line 11: [CODE]#include <iostream> using namespace std; struct attrib{ char x; int y; char cont; } attrib brd[8][8]; //ERROR WAS HERE int main() { for ( x=-1; X<8; x++) //accesses all columns in …

Software Development c++
Member Avatar for Unimportant
0
128
Member Avatar for ibdatx

Hi all, I am new to XAML however I have an understanding of XML. I am trying to bind a button to an XML file such that when the button is clicked, it the xml element is displayed within a listbox. Then I want the listbox selected item to be …

Software Development asp.net xml
0
112
Member Avatar for n0de

Hi, i'm getting only one digit after floating point after conversion from string to float. Have tryed from standart functions to i don't know.. the problems is that conversion whatever it would be (strtod(), stringstream >> float, atof(), don't even rembember all other wacky ways to do that) brings me …

Software Development c++
Member Avatar for n0de
0
203
Member Avatar for chudapati09

I need to write a program that changes a Roman Numeral to a numeric value. I've been inputing the roman numeral "CCLXXXVII", expecting it to output "287". Instead I've been getting "7101". Here is my code: [CODE] #include <iostream> #include <string> using namespace std; const int VALUE_I = 1; const …

Software Development c++
Member Avatar for chudapati09
0
178
Member Avatar for frogboy77

How do i create a large array in c++? Apologies if this has been answered already but after searching didn't find what i was looking for. i want to create an integer array of size 1500000 i.e int array[1500000] but my compiler wont allow it. I remember seeing something about …

Software Development c++
Member Avatar for frogboy77
0
323
Member Avatar for chintan_1671

Hi i have a code which counts no of lines in a code. I want something like it reads a file and counts all lines in a code. Ex: ls cd date ls ls cd cd ls cd ls I want to print output like: ls cd # 2 date …

Software Development c++
Member Avatar for chintan_1671
0
154
Member Avatar for chintan_1671

I have created a binary tree. I have a function which counts the odd values from nodes of tree. I am always getting the output as if it is just returning the odd count from node->right. I am loosing the value of node->left count. [code=c] #include <stdio.h> #include <stdlib.h> #include …

Software Development c++
Member Avatar for chintan_1671
0
2K
Member Avatar for RobBobSmith

Hello all: I would appreciate some advice on array subscripts. I am having problems passing 2-D arrays to functions I have written. The reason is that some of the arrays are dynamic arrays subscripted as array[i][j], whereas some of them were created in a class I wrote and these are …

Software Development c c# c++
Member Avatar for RobBobSmith
0
138
Member Avatar for chudapati09

I have to write a program where the user would input multiple numbers. This is what it could look like. [CODE] 3 29 98 78 88 100 9 70 73 81 [/CODE] The input is never the same, and I just need to access each number one at a time. …

Software Development c++
Member Avatar for chudapati09
0
156
Member Avatar for glenak

So far, from what I've learned from the c++ book I'm reading, the [B]int main()[/B] function in a c++ class is kind of like the [B]public static void main(String args[])[/B] method in java. (I'm a java person and I'm new to c++). However, I found out that within my source …

Software Development c++
Member Avatar for gerard4143
0
144
Member Avatar for yonderyellow

Hello, i have to interface an energymeter (RS485) to the RS232 port on the PC and develope a program in Visual Basic to manipulate the data received from the meter (according to IEC1107 protocol). I must be able to read the data recieved real time and also save the data …

Software Development vb.net visual-basic
Member Avatar for craigcl
0
131
Member Avatar for ddalgibbang

Hello Please excuse my lack of knowledge to python, but I just cannot understand how time complexity works. I've read many threads on this forum regarding time complexity but I am still quite confused. Our prof has given us this example: [CODE]def foo(n): ! while (n > 0): ! ! …

Software Development python
Member Avatar for Gribouillis
0
115
Member Avatar for ceyesuma

I keep getting this error. The app is looking for a class and in fact so am I where should this class be? I can't find it in the: [b]db-derby-10.6.2.1-bin[/b] and check sup of the dl said it was unaltered? Thanks [code] java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) …

Software Development apache java
Member Avatar for ceyesuma
0
2K
Member Avatar for ricardo.crudo

Is necessary deallocate memory of pointer-to-pointer? Example: [CODE] my_type_t **example; example = (my_type_t **) calloc(10, sizeof(my_type_t *)); for (i = 0; i < 10; i++) { example[i] = (my_type_t *) malloc(sizeof(my_type_t)); } // ... free(example); // it enough? // Or is necessary do this... for (i = 0; i < …

Software Development c
Member Avatar for gerard4143
0
90
Member Avatar for hanvyj

I have a load of methods that throw exceptions sometimes, if they throw them I want to catch them, call a functino and then try them again a few times, here is what I am currently doing: [CODE]bool loop = true; int i = 0; while (loop) { try { …

Software Development
Member Avatar for nick.crane
0
236
Member Avatar for tpkemme

I have a pretty simple coding function that returns all possible substrings of a string including the string itself def main(): str = raw_input ("Enter first string: ") size = len(str) for sub_len in range (1, size + 1): for idx in range (0, size - sub_len + 1): sub_str …

Software Development python
Member Avatar for TrustyTony
0
137
Member Avatar for claw72

Hello everyone. i really need help on this one.. sorry for bad english! I have made 2 listbox.. listbox1 and listbox2. data on listbox 2 comes every after i double click listbox1 data. my codes for that works properly. i am working in a excel worksheet. i have these columns …

Software Development visual-basic
Member Avatar for AndreRet
0
179
Member Avatar for Jsplinter

The following code generates an error when the [code]//vector<int> myVofInt2(n);[/code] line is uncommented. I get: error C2059: syntax error :'constant'. Does anyone know why it treats the declaration/initializations differently when the vector is inside a class? The vector<int> in the main function creates a vector<int> with ten elements, which is …

Software Development c++
Member Avatar for Jsplinter
0
175
Member Avatar for ganeshredcobra

am using debian lenny and tried to create a shutdwon script using python import os os.system("sudo shutdown -h now") i cant use this in debian lenny then how will i implement

Software Development debian python
Member Avatar for Gribouillis
0
2K
Member Avatar for amecily

Hey everyone, I am developing a Windows application in Visual Studio 2005, V2.0 using VB.NET. I am coding part of an Emergency Response Information System. On my form, I have two combo boxes (cboBaseStationID and cboPriority). I am trying to populate the datagrid with records from my database based on …

Software Development open-source vb.net visual-studio
Member Avatar for lolafuertes
0
171
Member Avatar for johnlop1

How do I write an event listener that displays an image when I click the upload button? so far i have [CODE] jButton1 = new javax.swing.JButton(); jButton1.setText("Upload"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });[/CODE] and then [CODE]//the LOAD button for loading the file private void jButton1ActionPerformed(java.awt.event.ActionEvent …

Software Development gui java java-swing
Member Avatar for Ezzaral
0
114
Member Avatar for plasticfood

[CODE] String[] names = new String[namesListSet.size()]; int[] nums = new int[namestimesSet.size()]; namesListSet.toArray(names); [B]namestimesSet.toArray(nums);[/B] for (String s : names) { System.out.print(s); } [/CODE] i'm getting an error on the bold part. getting symbol not found.

Software Development java
Member Avatar for plasticfood
0
82
Member Avatar for techie1991

Can someone please direct me to the code for the class <int> in python. I know that it must have written in C, but I could not understand, where to ask this query. Though I tried to figure it out myself, but could not even understand, which folder to attack …

Software Development python
Member Avatar for techie1991
0
156
Member Avatar for DoEds

[CODE]String[] myArray = {"Player 30","Player2 35"};[/CODE] This statement [CODE]Arrays.sort(scoreArray);[/CODE] will sort myArray by Letters. Output: [CODE]aPlayer 30 bPlayer 35[/CODE] Problem: Is there a way to sort myArray by numbers from highest to lowest? The output should be: [CODE]bPlayer 35 aPlayer 30[/CODE] I even tried foolish things like. [CODE]String[] myArray = …

Software Development java
Member Avatar for JamesCherrill
0
128
Member Avatar for sirlink99

The [COLOR="Red"]red[/COLOR] is where the problem is: Thanks for the help. [code] // The "ChoseYourStory" class. import java.awt.*; import hsa.Console; public class ChoseYourStory { static Console c; // The output console public static void main (String[] args) { c = new Console (); int move; String start = ("yes"); int …

Software Development java
Member Avatar for JamesCherrill
0
159
Member Avatar for gedas

can somebody tell me what this code actually does? [CODE] int i = 0; while (i < -1) { double x = xCoordinates[i]; double y = yCoordinates[i]; long xx = getWidth() - Math.round((double) getWidth() * x / 1024.0); long yy = getHeight()- Math.round((double) getHeight() * y / 768.0); g2.translate(xx, yy); …

Software Development java
Member Avatar for gedas
0
92
Member Avatar for hanvyj

Ok, I have a huge program and I ran it today and found that its using 100% of the CPU and bogging down the system to such a degree moving the mouse is an effort - let alone opening a window. I've been trying all day to narrow down the …

Software Development c++
Member Avatar for Ketsuekiame
0
306
Member Avatar for vavazoom

[CODE] #include <iostream> #include <fstream> using namespace std; int main (int argc, char* argv[]) { int length; char * buffer; string searchWord = argv[2]; string compareStr; int searchSize = searchWord.size(); ifstream readFile; readFile.open (argv[1], ios::in ); ofstream writeFile; writeFile.open("newData.txt", ios::out); readFile.seekg (0, ios::end); length = readFile.tellg(); readFile.seekg (0, ios::beg); buffer …

Software Development c++ ios
Member Avatar for vavazoom
0
171
Member Avatar for churva_churva

Can someone teach me or guide me using GUI..or can some one help how to understand right away the GUI..and please give the link which can help me to learn more about GUI..

Software Development gui java
Member Avatar for Ezzaral
0
145
Member Avatar for shanker86

Hi all here is my pair.h file which when I run using g++ on linux I am getting error like "pair.h:39: error: expected constructor, destructor, or type conversion before ‘ostream’" any help would be greatly appreciated! Thanks WRAP template <class T1, class T2> class pair2 { private: T1 first_; T2 …

Software Development c++
Member Avatar for shanker86
0
431
Member Avatar for rcogq7

//This is the error that i have Exception in thread "main" java.lang.NullPointerException //at CardTest.main(CardTest.java:16) /** * @(#)CardTest.java * * * @Robert Coughlin * @version 1.00 2010/10/15 */ //this is the main public class CardTest { public static void main(String [] args) { Card [] randomCard=new Card[20]; for(int i= 0; i<20; …

Software Development java oop
Member Avatar for kramerd
0
234
Member Avatar for sadhawan

Hi Guys, I want to read html file and parse it and then assign the extracted info to the dataobjects. How can i do this .Thanks

Software Development html-css
Member Avatar for hyperion
0
145
Member Avatar for xinyonz

how can i read system time using c or c++ commands?

Software Development c
Member Avatar for Ancient Dragon
0
71
Member Avatar for whitetigerclaws

I have the same assignment someone else ask help with. The assignment calls for a test score calculator that calculates and displays the score total, score count, and average score. If the user clicks the Display scores button, the application sorts the scores and displays them in a message box. …

Software Development
Member Avatar for sean_king
0
345
Member Avatar for DoEds

I have this txt file containing names and scores. "[COLOR="red"]ex. Player1 35[/COLOR]". My program able to read it and store it to an Array of String. Here's my question. Is possible to separate the name and the score and store them in different Arrays? [CODE]ex. myArray = {"Player1 35","Player2 30"};[/CODE] …

Software Development java
Member Avatar for DoEds
0
108
Member Avatar for Roadphantom13

Hello everyone. This is my first post so if something doesn't work, bear with me. I'm a beginner at python and tried to write a program that will calculate Average Word Length. I wrote what I thought should work but the final answer keeps coming out to an average of …

Software Development python
Member Avatar for forsakenedzero
0
5K
Member Avatar for VIeditorlover

Hi, I have an app generating xml output using xmlwriter. It is loooooong xml, hundreds of thousand of items, is not possible to keep it all in memory, and always few errors occurs. Is there a way how to cancel part of already writen xml within try-catch section and move …

Software Development xml
Member Avatar for VIeditorlover
0
142
Member Avatar for ja0

Hi, I want to parse the time from a string in c#, something like, [CODE]TimeSpan a = new TimeSpan(); string pattern = @"^\d{1}:\d{1}@"; if ( dt.Rows[x][y].ToString() != "" && System.Text.RegularExpressions.Regex.IsMatch(dt.Rows[x][y].ToString(), pattern ) ) { if ( !TimeSpan.TryParse(dt.Rows[x][y].ToString(),out a ) ) { MessageBox.Show(b.ToString()); } }[/CODE] So, if I have a string …

Software Development regex
Member Avatar for ja0
0
95
Member Avatar for DARK_BYTE

Hi I have a project in which I have to build an algorithm visualization tool. Up until now I have been going in a static direction thinking of having in built menus that allowed a user to create an animation of a sorting algorithms but now my tutor wants me …

Software Development java
Member Avatar for JamesCherrill
0
154
Member Avatar for jbrock31

I am exporting data to an excel file. This works, however, one of my columns doesn't format properly with currency. Through code, how can i make an entire column currency just like when i do it through Excel itself, by going to the format options. I have tried using the …

Software Development microsoft microsoft-office
Member Avatar for jbrock31
0
119
Member Avatar for Acidburn

Hey guys, Just wondering how I check for the space bar input...since my program doesn't seem to want to know when I hit the space bar..... It just outputs a space on the konsole window and then hitting enter makes a new line... cheers John

Software Development c++
Member Avatar for Nirvin M
0
238
Member Avatar for Yutxz

Why is my while statement being ignored? [B]Problem:[/B] Write a method called squareRoot that takes a double as a parameter and that returns an approximation of the square root of the parameter, using this algorithm. You may not use the built-in method Math.sqrt. As your initial guess, you should use …

Software Development algorithm java
Member Avatar for masijade
0
260
Member Avatar for Erslich

Hi all :) I'm having a few problems with this assignment I'm working on. Its a Java - C# conversion of a Mandelbrot program. What I'm trying to do, is draw the Mandelbrot to a Bitmap, and then print it onto the Windows form. So far I've been able to …

Software Development c c# c++
Member Avatar for Chrisakak9
0
622
Member Avatar for developer_2010

hi First post here, im currently developing a little application which needs to export the data from my datagridview to a csv file. So far I have: Dim gridData(DataGridView1.Rows.Count - 1) As String For Each r As DataGridViewRow In DataGridView1.Rows If r.IsNewRow Then Exit For Dim cellValues(DataGridView1.Rows(r.Index).Cells.Count - 1) As …

Software Development file-system vb.net
Member Avatar for developer_2010
0
369
Member Avatar for dustbunny000

So I have this list of strings. They all of the strings have a 18 capital letters. I want to assign each letter a value and them sum up the total score. [CODE]window=['SALHWRAAGAATVLLVIVL', 'ALHWRAAGAATVLLVIVLL', 'LHWRAAGAATVLLVIVLLA', 'HWRAAGAATVLLVIVLLAG', 'WRAAGAATVLLVIVLLAGS', 'RAAGAATVLLVIVLLAGSY', 'AAGAATVLLVIVLLAGSYL', 'AGAATVLLVIVLLAGSYLA', 'GAATVLLVIVLLAGSYLAV', 'AATVLLVIVLLAGSYLAVL', 'ATVLLVIVLLAGSYLAVLA', 'TVLLVIVLLAGSYLAVLAE', 'VLLVIVLLAGSYLAVLAER', 'LLVIVLLAGSYLAVLAERG', 'LVIVLLAGSYLAVLAERGA', 'VIVLLAGSYLAVLAERGAP', 'IVLLAGSYLAVLAERGAPG', 'VLLAGSYLAVLAERGAPGA', …

Software Development python
Member Avatar for slate
0
183
Member Avatar for Overachievious

Hey, I am working on a program for my class where we are supposed to count the letters that occur in a given string, with decreasing frequency. For instance, it would say there are 150 A's, 234 B's, 25 C's, etc. Plus, it would then become possible to sort the …

Software Development python
Member Avatar for TrustyTony
0
226
Member Avatar for markdean.expres

How do I create an installer for my application other than than selecting Build>Publish?

Software Development vb.net
Member Avatar for markdean.expres
0
73
Member Avatar for vskumar19

Hii all, Using Scanner class I am accepting an input string which serves as a password field Is it possible to mask the field while the input is being given ?? eg: This is how my output will be : Username : abcde1 Password : abcd@xyz This inputs are given …

Software Development java
Member Avatar for masijade
0
185
Member Avatar for antikceo

Hi, I have the following code that is meant to serve as a t9 program like the one in mobile phones. It initially loads a dictionary file, stores the values in a dictionary, and prompts the user to enter a string of numbers between 2 and 9. For some reason …

Software Development c linked-list
Member Avatar for antikceo
0
1K

The End.