64,152 Solved Topics
Remove Filter ![]() | |
I am using Visual C# Express and I have a window that I would like to be able to enter 2 dates ( a 30 day period) and connect to the 2005 Sql Express database and return a range of data that I can eventually graph. I want to add … | |
Hi i am so lost and stressed please can some help me. My question is how do i code the follwoing • Constructor: Copy The copy constructor should check the validity of the Entry object parameter through the use of the isValid method and copy the valid objects media and … | |
I'm just learning java and this is my first sort program. I can't get it to run. I sure could use some help. public class SortCharArray { public static void main(String[] args) throws Exception { char[] someChars = new char[10]; int x; for(x = 0; x < someChars.length; ++x) { … | |
Hi all, We just hit functions, and I assigned my students to write ten short functions to do things like convert Fahr. to Cels., etc. My "brilliant" :rolleyes: plan was to create a test suite and have them import their file and run the tests. Because the filename wasn't absolutely … | |
I have a data file with chemical names (one name per line) and want to load that into a Tkinter GUI listbox and then be able to select it by clicking on the line. Need some help. | |
Hi I would like offer the user a choice of displaying search results. They should be able to select which column to ORDER BY and in ascending or descending order. $sort_order contain colums name $sort_type contain desc or asc How can I use these two arrays in the order by … | |
Hello ladies and gents, I'm reading The C++ PL from B.Stroustrup and in chapter 5 the second exercise goes like this: What on your system, are the restrictions on the pointer types char*, int*, and void*? For example, may an int* have an odd value? Hint: alignement. I actually have … | |
I'm not sure if my title makes sense. My problem is the following: I input a string and the function in my program is supposed to change every digit (except for 0) it finds in the string to a value -1 of that digit (eg 'er345ut' should be changed to … | |
i am using the combobox on panel and it got fill when panel loads ,it has 7 enteries and i want whenevr the panel opens or the combo fills i'll see "money "as my default selected value out of those 7(whose position is not fixed).plz help me to do this(urgent) | |
OK, so the part of my course about files is over, but now I am wondering: if you have a file with, say, a bunch of names (each in its own line), is it possible to use "C" to make a new file with the names aranged alphabetically? For example, … | |
Hi, I have one doubt in mysql command using limit. I want to delete a first record in a table using mysql query. I using the below query DELETE from view_me where member_id = '$sess' LIMIT 0,1 But if I used the above query mysql cannot deleted the record. It … | |
I have the following sample code: [CODE]]import wx class TestFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title="tree example", size=(600,30)) self.tree = wx.TreeCtrl(self) root = self.tree.AddRoot("Example") items = [ "test1", "test2", "test3",] self.AddTreeNodes(root, items) self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded, self.tree) self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed, self.tree) self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged, self.tree) self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnActivated, self.tree) self.tree.Expand(root) def AddTreeNodes(self, parentItem, items): for item … | |
I cant get my function code to work. Its should return an average of however many numbers are entered, but it always returns 775863 no matte what... can anyone tell me whats wrong? [code] #include <stdio.h> int avg(int av[], int y, int x, int z); int main(){ int x=0; int … | |
![]() | OK Can anyone help me understand what a tokenizer does? And why I have to put *tokenPtr? What is the * for? I am having a heck of a time figuring out how to write a program that takes the last two letters of a word in a sentence puts … |
![]() | My while statement does not work. This program is only performing the function on the first word in the sentence. Can anyone help me get the while statement to do all of the words in the sentence? [code=c] #include <iostream> using std::cin; using std::cout; using std::endl; #include <cstring> using std::strtok; … |
![]() | Hello I'm writing a little selection sort program in C. Unfortunately the algorithm doesn't work correctly. After the selection sort some float numbers in the array are rounded down to whole ints. Here's the example: [inlinecode] Code: enter input filename:data // input numbers 5.000000 7.000000 -48.400000 8.800000 8.400000 1.500000 8.400000 … |
I have a funtion executing a loop, which semes to be progressing normally until the debugger halted with this message; Program received signal SIGSEGV, Segmentation fault. I pulled up a a backtrace and it had "normal lookuing" addresses for the this pointer and the reference variable. I could probably figure … | |
I am experimenting (playing around) with the Python Tkinter Gui, and wondered if there is a way to play a sound like from a .wav or .au file? | |
I'm trying to make a loop that that will skip a number but has a certain limit to how high it goes... For example: I have a for loop: [code]for (i = 0; i < count; i++ ) { stuff }[/code] but lets say I want to skip a number … | |
Hi everyone, I have a small problem. I am writing a program for school in which I will construct a hash table for dictionary words, using the soundex code of the word as the hash function. For the hash function, I have to take the soundex code and convert it … | |
I'm fairly new to C and have been doing pretty good up until arrays. I understand the basics of them but not exactly how to use and impliment them in more complicated ways. I am trying to write a program that will display a table of strings and intigers from … | |
(c++) Ok so I understand how to use the system function, and how to output to a file. How do I pipe the output of say system("last") to a file? system() returns an int, so if I mystream << system("last") it will put an int in the file. I need … | |
![]() | I am back this week with another homework problem. My array is not working like I thought it would. My brain is about to explode trying to comprehend what is going on. This code will compile but, it won't do what I want it to. The array is supposed to … |
Here we go, I am working on some code to store an IP address in an object. I have overloaded operators >>, <<, and == and they are working fine with 1 problem. I am supposed to be able to cin >> ip1 >> ip2 >> ip3; but after I … | |
hi! im somekind in a lost mode.how can i call a txtfile out so that it can run a machine? eg if i press this cmdA, it will call out txtfile1 and txtfile1(the command to run the machine is stored in here) will run the machine. and also how is … | |
I working on a program that summerizes text documents and I need a way to find the length of the longest and shortest lines in the file and display it in a log file. I've already done a character count and line count. Also say I wanted to created different … | |
Hi, So it seems my self-teaching experience isnt going as well as i hoped. Every time i think im starting to understand something new pops up that halts me in my tracks :-) lol Was wondering if someone could just give me a quick pointer in the right direction of … | |
[code] #define _CRT_SECURE_NO_DEPRECATE #include <iostream> #include <fstream> #include <cstring> #include <cctype> #include <cstdlib> #include <ctime> using namespace std; const int MAXWORDS = 8000; const int MAXWORDLENGTH = 6; const int MINWORDLENGTH = 4; int nWords; void fillWords(char words[][MAXWORDLENGTH + 1], int maxwords, int& num); int playOneRound (int wordnum); void correct … | |
This program is supposed to show the adjacency lists that are built given the input pairs:: 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3 I am having trouble with the syntax of my code. Could someone please help? [code] #include <iostream> using namespace::std; int V; struct node { int v; … | |
Hi i am making a simle gui using wxpython and here is the script [code] import wx class bide(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "just a test", pos=(0, 0), size=wx.DisplaySize()) panel = wx.Panel(self, -1) statusBar = self.CreateStatusBar() toolbar = self.CreateToolBar() #toolbar.AddSimpleTool(wx.NewId(), images.getNewBitmap(),"New", "Long help for 'New'") toolbar.Realize() menuBar = wx.MenuBar() … | |
Hi Guys, Just Wondering if it's possible to choose whether to run a macro or not depending on which user logs in. I've got a macro which updates the database everytime it starts. I want to restrict it to only limited number of users. Thanks for your time | |
[COLOR=#0000ff][code]#include<[/code][/COLOR][code=c][color=#800000]iostream>[/color] [color=#0000ff]using [/color][color=#0000ff]namespace[/color][color=#000000] std;[/color] [color=#0000ff]consta[/color]code][color=#0000ff]nt[/color][color=#000000] namesize=21;[/color] [color=#0000ff]void[/color][color=#000000] getName([/color][color=#0000ff]char[/color][color=#000000],[/color][color=#0000ff]int[/color][color=#000000]);[/color] [color=#0000ff]int[/color][color=#000000]main()[/color] { [color=#0000ff]int[/color] index=5; [color=#0000ff]int[/color] count; [color=#0000ff]char[/color] names[21]; [color=#0000ff]char[/color] *aString=names; [color=#0000ff]for[/color](count=0;count<index;count++) { [color=#0000ff]char[/color] names; getName(*aString,index); cout << [color=#800000]"You entered: "[/color]; cout << &names; } } [color=#0000ff]void[/color][color=#000000] getName ([/color][color=#0000ff]char[/color][color=#000000] names[][21], [/color][color=#0000ff]int[/color][color=#000000] index)[/color] { cout << [color=#800000]"enter a name: "[/color]; cin >> names[index]; } … | |
This block of code will compile, but gives me a runtime error: before the first comment is a header that is included in the file that you may need to analyze my code. [code= c] typedef char *string; typedef struct { string fieldName; string value; }oneField; /* this starts the … | |
I know that Pyhon compiles source code to a Byte Code before the interpreter works on it. What does this Byte Code look/behave like? | |
Say I have an edit box in a MFC application (let's call it IDC_EDITBOX), and I enable (because I have it greyed out by default)it using [code=c]GetDlgItem(IDC_EDITBOX)->EnableWindow(TRUE)[/code] How do I set the focus to that control? In other words, when I enable the control, how can I get the cursor … | |
I'm pretty much new to using files, so I'm not sure if this is a banale question. Here's the assignment: "[I]Each line of the file dec.txt contains a whole number (>0). Write a program that creates a file called hex.txt. Each line of this file is to contain a string … | |
I am working to add some simple user input checking into my program; there are three (3) int choices from a menu-- 1, 2, or 3. The user must choose one of these. I am able to check whether or not the input is 1, 2, or 3-- but I … | |
I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation? | |
Hi all, Platform: winxp Version: Python 2.3 I have a task of reading files in a folder and creating an one excel file with sheets, one sheet per file, with sheet named as filename. I am facing problem in handling special characters. I am using XLRD and XLW package to … | |
the problem is that, the function is only replacing the number that I want to delete with th number after it, but everything remains the same after. e.g. it is showing me 1 2 3 5 5 6 7 8 9 10 [code] #include <stdio.h> int rem(int a[],int pLen,int pos) … ![]() | |
I am writing a MFC application and need to have the program pause for a few seconds. I am trying to use the OnTimer event and am having troubles. The following code causes the program to freeze and stop responding [code=c] m_iCount = 0; SetTimer(ID_TEST_TIMER, 1000, NULL); while(m_iCount <= 5) … | |
Which Graphics User Interface (GUI) would you recommend for a beginner? I have seen some examples of Tkinter, wxPython and GTK. | |
I have a color data file that gives the color name and its RGB values, for instance like this: [CODE] red RGB(255,0,0) green RGB(0,128,0) blue RGB(0,0,255) brown RGB(165,42,42) gold RGB(255,215,0) maroon RGB(128,0,0) [/CODE]I like to create a color dictionary from this file that looks like this: [CODE] {'red': (255,0,0), 'green': … | |
Hello: Something as seemingly simple as an If\ Else statement is causing me much trouble and I cannot figure out where the error lies. I believe it to be in:[LIST] [*]The variable scope [*]The use of the static variable [*]Or, the misplacement of curly brackets (something that has a tendency … | |
Here is my code: [php]# search for a file, and show all files found in that file's directory # delete them if wanted import os import pickle def file_find(folder): """search for a filename fname starting in folder""" for root, dirs, files in os.walk(folder): for file in files: # make search … | |
I am just trying to print out my array of binary values from 0 to 15. The output I get is wrong, very very wrong. Can someone take a look at my code and enlighten me? [code] #include <iostream> #include <conio.h> using namespace std; int binA[16][4] = { (0,0,0,0),(0,0,0,1),(0,0,1,0),(0,0,1,1), (0,1,0,0),(0,1,0,1),(0,1,1,0),(0,1,1,1), … | |
Hey all, I have an array of uppercase letters, mixed with other non-alphaitalic charcters. I need to keep a frequency of the each of the uppercase letters, and how many other characters entered. JONN:sad: | |
Hi, guys! Got a problem here. :) I have a form that when it loads spawns a thread which in turn fills a publicly declared dataset with a table by a dataadapter and then binds a field from the table to a combobox. [code=vb]combobox1.DisplayMember = "fieldName" combobox1.ValueMember = "fieldName" combobox1.DataSource … | |
Hi everyone. Im having some real head-ache inducing issues with my code. I want to update a statictext label to display the value of a slider bar. Simple enough? Here is my code... [CODE=python]Speed_Slider_Panel = wx.Panel(Automatic_Control_Panel) Speed_Slider = wx.Slider(Speed_Slider_Panel, ID_SPEED_SLIDER, 0, 0, 10, style = wx.HORIZONTAL | wx.SL_AUTOTICKS) Speed_Slider.SetTickFreq(1, 1) … | |
When do you use a for loop and when to use a while loop. Are there other loop types in Python? Some of the slicing examples almost look like loops. |
The End.