43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Philosophy

I am just wondering if there is a way to put the following code into a loop or two so that it is easier on the eyes and doesn't take us so many lines. I have not been able to think of a way to do this with so many …

Software Development c++
Member Avatar for Philosophy
0
438
Member Avatar for cshemby86

Using Data1.txt and Data2.txt, create two control break reports. The first should break on name and report the highest frequency style or styles. Send the report to result1.txt. Include appropriate headers. The second should break on style and report the total quantity ordered for that style. Send the report to …

Software Development c++
Member Avatar for cshemby86
-3
205
Member Avatar for killerpopiller

Problem with storing extracted values in SQLite - How to adress or index list of values for proper insertion into table. The Regex works fine: input logging data looks like: 0.0.0(06026104) 1.6.1(0.1501)(1011111000) 1.6.1*32(0.1446)(1010190800) 1.8.1(02484.825) 1.8.1*32(02449.574) correct regex output: 06026104 0.1501 02484.796 [CODE] with open("usage.log") as fp: for line in fp: …

Software Development python regex sqlite
Member Avatar for killerpopiller
0
244
Member Avatar for shiftee

Hi all, I have a simple question that I can't find the answer to i'm using the following Exam.java (interface) ExamImpl.java (implementation) ExamFactory.java (interface) ExamFactoryImpl.java (implementation) The ExamFactory interface says the newExam() method return type is "Exam" The ExamFactoryImpl code currently returns "ExamImpl" Is this a problem?? i.e. Are Exam …

Software Development java user-interface
Member Avatar for JamesCherrill
0
286
Member Avatar for Joey_Brown

Hello. I have encountered a following problem "find all duplicate letters in a 2d char array and replace them with '@'" So for instance if I have this : a a b c The output would be @ @ b c So. I have come up with the following algorithm …

Software Development algorithm c c# c++ printer
Member Avatar for Joey_Brown
0
125
Member Avatar for coril

So far, I have: [CODE]def printSquare(x,y): for z in range(0,x): print(x*y)[/CODE] printSquare(3,'%') prints out something like this: %%% %%% %%% instead of using the '*' operation, is there a way to print x numbers of y separated by commas (for better spacing) ie: print(y,y,y)?

Software Development python
Member Avatar for Gribouillis
0
574
Member Avatar for kdcorp87

i convert some opengl code from visual c++ 2006 to visual c++ 2010 i mean visual studio framework. problem is in visual studio 10 they r running but mainloop is not working, i mean windows r supposed to wait for key input but it shows and gone at instant. no …

Software Development c c++ opengl visual-studio
Member Avatar for Fbody
0
409
Member Avatar for ajst

Hi, I'm trying to use JAVA GUI for first time. I've got a Jframe that when loaded adds a jpanel. the problem is it will not show any swing controls that get added to the jPanel. I'm using netbeans 6.9.1. any idea to why is happerning would be greatful [CODE] …

Software Development gui java java-netbeans java-swing
Member Avatar for JamesCherrill
0
3K
Member Avatar for hisan

Hi, I want to know how to use Python variables in My sql statement and below is the syntax i am using import MySQLdb name="XYZ" number="123456" db=MySQLdb.Connect("localhost","root","12345","phone") cursor=db.cursor() sql= ("""INSERT INTO phonebook(number, Mobile) VALUES(%s,%s)""" , name,number) cursor.execute(sql) db.commit() db.close() but this throws the error please refer the attached screen shot …

Software Development python sql
Member Avatar for hisan
0
6K
Member Avatar for DaveTran

I would like to sort an array of objects by their distance. The problem is that the distance value is a floating point and IComparer only will accept an integer as a return value. [CODE] class SortDistanceAscending : IComparer<ObjectDistance> { static IComparer<ObjectDistance> comparer = new SortDistanceAscending(); public int Compare(ObjectDistance a, …

Software Development
Member Avatar for DaveTran
0
2K
Member Avatar for keltik

Hi there, at university i have to program OO-style in Python. What i got now is a "Point"-class and a "Triangle"-class. The "Triangle"-class has a method [ICODE]a()[/ICODE] that needs to return the length of the AB-edge, but it doesn't instead it concatenates the Point.__str__() methods return values together, which is …

Software Development python
Member Avatar for TrustyTony
0
153
Member Avatar for dmurder

it keeps looping over and over again no matter what i put in [CODE]def getScores(totalScores, number): score = input('Enter their score: ') while score <=0 or score >=100: print'You must enter a number between 0 and 100' score = input('Enter a number between 0 and 100:') for counter in range(0, …

Software Development python
Member Avatar for richieking
0
150
Member Avatar for divakar.it

Hi, Me again. Now the requirement is slightly changed now. Requiremetn: When I enter a employee id in a text box and click "Show calender", the code will run a query to fetch Allocation date and release date of the employee for a project and the dates between Allocation date …

Software Development open-source visual-basic
Member Avatar for AndreRet
0
435
Member Avatar for moroccanplaya

after my program finishes i get this message and dont why, can anyone explain *** glibc detected *** ./tryp: double free or corruption (top): 0x089b8008 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xb7729591] /lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xb772ade8] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb772decd] /lib/tls/i686/cmov/libc.so.6(fclose+0x14a)[0xb7719aaa] ./tryp[0x804875c] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb76d4bd6] ./tryp[0x8048521] ======= Memory map: ======== 08048000-08049000 r-xp 00000000 07:00 1725249 /home/k/cprog/tryp 08049000-0804a000 r--p 00000000 07:00 …

Software Development c
Member Avatar for moroccanplaya
0
120
Member Avatar for hq1

A magic square is an N by N array of integers. The sum of the values of each row, each column, and the main diagonals are equal. Write a program that reads the size of a square, then each row, and verifies if the square is a magic square using …

Software Development c++
Member Avatar for jonsca
0
3K
Member Avatar for dreamer_lek91

Hi I have this form which works well when it is in list box. but when I change the list box to combo box, the form does not works and I will be stuck at "record does not exist" even though i choose the record from the combo box. this …

Software Development microsoft-access visual-basic
Member Avatar for AndreRet
0
713
Member Avatar for divakar.it

Hi, I have a requirement that when a user click on a record in the datagrid (the record holds Emp_id and his/her project allocation date and release date), then the dates from allocation date to release date in monthview should display bold. I have written the code but i dont …

Software Development open-source visual-basic
Member Avatar for AndreRet
0
483
Member Avatar for MysticMan3000

hey guys, i was wondering if you could help me with my problem! i made a program that uses 3 arguments as inline commands: argv[0] is the name of the program) argv [1] is the name of the first file argv[2] is the name of the second file The purpose …

Software Development c
Member Avatar for vinitmittal2008
0
320
Member Avatar for ceyesuma

Hello. I have search my app for all classes to implement java.io.Serializable. I think that the needed classes are covered.I create and serialize JInternalFrames. When I re-open a JInternalFrame some of the JMenuItems do not do thier job. Also when I right click the Tabs on the JTabbedPane to bring …

Software Development java
Member Avatar for ceyesuma
0
90
Member Avatar for gizmo7008

I'm just wondering if someone could point me to some sources on linked lists. I'm trying to make it so the user inputs how many they want to add to the list and the list will stop after that amount. I'm just looking for some examples on it to help …

Software Development c++ linked-list
Member Avatar for gizmo7008
0
85
Member Avatar for moroccanplaya

[CODE] unsigned char buffer[1000] while(buffer < 0) num = fread(buffer,1, 1000, original_pointer); fwrite(buffer,1,num,copy_pointer); if(buffer > 1000) { //this is the place where i am stuck if the buffer exceeds how do i clear it then carry on reading and writing to a file ? [/CODE]

Software Development c
Member Avatar for moroccanplaya
0
157
Member Avatar for Xcelled194

My curse seems to be SendInput... I have tried many sites and code variations and it never works right... it always returns an error. So can someone just whip together a quick class that has 3 public methods, one for keyboard (that takes a Keys data type) one for mouse, …

Software Development vb.net
Member Avatar for Unhnd_Exception
0
5K
Member Avatar for dmurder

i have an introduction to programming class and i'm trying to write this program and the program is supposed to loop if you don't input a number within a specific range but it doesnt do it [CODE]def main(): endProgram = 'no' print while endProgram == 'no': totalScores = 0 averageScores …

Software Development python
Member Avatar for TrustyTony
0
88
Member Avatar for hystaspes

[CODE] #ifndef HYS_MAIN_HEADER_H #define HYS_MAIN_HEADER_H #include <windows.h> #include <windowsx.h> #ifndef HYS_GLOBAL_VARIABLES #define HYS_GLOBAL_VARIABLES namespace hys { const short Null = 0; const bool True = 1; const bool False = 0; }; #endif // HYS_GLOBAL_VARIABLES #endif // HYS_MAIN_HEADER_H [/CODE] I want to avoid using macros as much as possible (C++ …

Software Development c++
Member Avatar for hystaspes
0
979
Member Avatar for TechieNoob

ok here is my project here so far: Main.cpp #include "Library.h" void main() { //GENERIC WECLOME SCREEN cout <<"\n\nWelcome to Hollow's Eye\n"; cout << "<Programmed by Ethan Rigel>\n"; cout << "Hollow's Eye a once bountiful and gorgeous land but alas; the\n"; cout << "Mighty Dragon has destroyed and ravaged our …

Software Development c c# c++
Member Avatar for mitrmkar
0
331
Member Avatar for Swedenrock

Hi! I'm working on a solitaire game, with a different card deck. First I create a big list with 81 elements (cards in this case), cardList. From this list, six cards are ramdomly picked and put into another list, playerCardList, and printed on the court. Once the cards are printed …

Software Development python
Member Avatar for woooee
0
143
Member Avatar for furret

Hey, I've got an array full of random numbers and I want to say if the array is below a certain value, say 15, then to make everything in that array that less than 15 equal to zero. So far I've tried a few things and they've not worked, and …

Software Development python
Member Avatar for woooee
0
102
Member Avatar for lasl0w

Hey all, I'm doing a project to create an address book which uses a binary search tree (AVL node) structure to store, search and sort the data. There are 14 main fields for each address contact. All fields can be represented as strings. The 14th field can have unlimited entries. …

Software Development c++ data-structure seo web-design
Member Avatar for mike_2000_17
0
199
Member Avatar for 1989sam

I have these 3 string: YELLOW,SMALL,STRETCH,ADULT,T21fdsfdsfs YELLOW,SMALL,STRETCH,ADULT,Tdsfs YELLOW,SMALL,STRETCH,ADULT,TD I would like to remove everything after the last "," including the comma. So i want to remove these parts ",T21fdsfdsfs" ",Tdsfs" and "TD". How could i do that in Python?

Software Development python
Member Avatar for seanbp
0
107
Member Avatar for xtra333

Hi people. I am having trouble printing out a list of items with n items per line. Here is my current code. [CODE]def printList(lst, lineCount): # given a list of items, print it out in # lineCount items per line. count=0 strList= '[ ' for element in lst: strList = …

Software Development python
Member Avatar for richieking
0
149
Member Avatar for denmarkstan

what is report writting in programming and its uses by organization. let someone explain pls

Software Development
Member Avatar for denmarkstan
0
111
Member Avatar for qvyhnl

Problem stated: Write the function flip_lines(). Open the input and output files file using the parameters. Return true if both files can be opened and processed, false otherwise. If both files can be opened, write each successive line of output in reverse order. (In other words, switch line 1 and …

Software Development c++ file-system
Member Avatar for qvyhnl
0
413
Member Avatar for Tankadin

Hi all! I have moved on to learning about classes.....they don't seem as bad as the past things I have done so far. I have, however, hit a few snags along the way. Here is my code for my Rectangle class [code] public class Rectangle { private int x; private …

Software Development java
Member Avatar for quuba
0
431
Member Avatar for hystaspes

Is there any drawbacks for using "this" pointer? For example: [CODE] Window_Properties::Window_Properties(wchar_t* wnd_title, wchar_t* wnd_class_name): window_width(1280), window_height(720), window_X(0), window_Y(0) { this->window_title = new wchar_t[ wcslen( wnd_title ) ]; if( this->window_title ) { wcscpy( this->window_title, wnd_title ); } this->window_class_name = new wchar_t[ wcslen( wnd_class_name ) ]; if( this->window_class_name ) { wcscpy( …

Software Development c++
Member Avatar for hystaspes
0
124
Member Avatar for Nickl246

Hi there, I'm working on a 'queue program' which will queue 30 job numbers(case 1) between 1 and 30, validated, in an array, display the array , (case 3) and remove a number from the back of the queue.(case 2) I have the display array and remove from front of …

Software Development java queue
Member Avatar for Nickl246
0
282
Member Avatar for rhoit

[CODE] #include <iostream> int main() { for(int i; i<3; i++){ volatile char str[]="hello\n"; std::cout<<str<<std::endl; } return 0; } [/CODE] Why? its gives output [ICODE] 1 1 1 [/ICODE]

Software Development c++
Member Avatar for rhoit
0
543
Member Avatar for sharkbate24

Hello, I basically have 2 GUI windows in my project. Just to explain it better, let's call the 2 GUI windows: - Window A - Window B In Window A, there is a variable that I want to change, but I have to change the value of the variable in …

Software Development gui java
Member Avatar for sharkbate24
0
222
Member Avatar for noydoy

[CODE]import javax.swing.*; import java.awt.*; class Calculator{ JFrame frame; JPanel panel1, panel2; JTextField textField; JButton button[]; Container contentPane; void launchFrame(){ frame = new JFrame("My Calculator"); panel1 = new JPanel(); panel2 = new JPanel(new GridLayout(4,4)); textField = new JTextField(10); button = new JButton[17]; for (int i=0; i <10; i++) button[i] = new …

Software Development java java-swing
Member Avatar for noydoy
0
415
Member Avatar for JDCyrus

Hello. It's been a while since I was on here. I'm writing a Java class with a generic type parameter. Among other things, it maintains an internal ArrayList of the same generic type as itself. In a perfect world, the code would go like this: [CODE=Java]import java.util.ArrayList; public class MyGenericClass<T> …

Software Development java
Member Avatar for JDCyrus
0
184
Member Avatar for allen2663

I have made a program that loads all the songs on my computer into a listview and plays them at random (at least that is what I want) right now I have them moveing to another list and removeing them from the current list so that none are played twice …

Software Development listview vb.net
Member Avatar for allen2663
0
459
Member Avatar for crimes

[CODE] #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { int x; cout << "Press the number 1, 2 ,or 3"; cin >> x; while (x!=1){ cout<<"Please try to pick a difference selection."; cin>>x; } if ((x==1) { cout<<"\nYou chose ";cout<<x; } system("PAUSE"); return 0; } [/CODE] …

Software Development c++
Member Avatar for crimes
0
148
Member Avatar for flukebob

I need to build a Windows program with Visual C++ that sends an SMTP email when an alarm condition occurs. I will be reading data out of several PLCs (automation controllers) with the help of active-x controls purchased earlier for other projects. New to Visual C++, (I'm mostly an old …

Software Development c++ email
Member Avatar for flukebob
0
158
Member Avatar for iamthesgt

Hello, I need to take a file filled with numbers and input them into a two-dimensional array. The file would look like: 3 6 3.9 4.5 2.1 1.0 2.4 4.3 3.1 4.2 5.1 6.2 1.0 2.7 1.2 2.3 3.1 4.2 5.2 6.4 where the first two numbers are the vertical …

Software Development c++
Member Avatar for iamthesgt
0
189
Member Avatar for hbluthi

I'm making a Card class and need to make sure that the suit is valid. When I call on the Card class and construct one setting the suit to 'Jordan' it actually ok's that suit and prints 'Ace of Jordan'. Instead it should become the default, of Spades. What am …

Software Development python
Member Avatar for hbluthi
0
660
Member Avatar for emko

Hello, I have to create a graph based program that will validate a zip code given an expression to match eg. ddddd - dddd, where d is a digit 0 - 9. I am new to graphs and don't know how to accomplish this. I'm trying to make graph class, …

Software Development c++
Member Avatar for emko
0
127
Member Avatar for jsav

I'm new to file I/O in C++ and have encountered a problem. My program checks to see if file "projectdb.txt" exists. If it does, it uses its data to populate an array. If it doesn't exist, it is supposed to create the file. This is where I am having the …

Software Development c++
Member Avatar for Agni
0
149
Member Avatar for el_jk

hi, I'm just trying to make the Cancel button on my form close that form on Enter key but the problem is that it closes it when i hit space key and if i change code below to [CODE]if (e.KeyChar == (char)Keys.Return) this.Close();[/CODE] it does not work. it just works …

Software Development
Member Avatar for Mitja Bonca
0
95
Member Avatar for jamesl22

I am trying to write some code that reads a file line by line and then outputs the text of each line using cout. Here is what I have so far: [CODE]#include<iostream> #include<string> #include<fstream> #include<sstream> using namespace std; int main() { ifstream input("test.txt"); if (input.fail()) { cerr << "File not …

Software Development c++
Member Avatar for Agni
0
180
Member Avatar for Oldguy1

Hey I'm very new to the programming world, and what i am trying to do is produce a Koch Snowflake via turtle from python2.5. this is what I have so far... [CODE] from turtle import * def snowflake(lengthSide, levels): if levels == 0: return forward(lengthSide), right(120), forward(lengthSide), right(120), forward(lengthSide) forward(lengthSide) …

Software Development python
Member Avatar for ohernandezmit
0
3K
Member Avatar for hystaspes

This code is from MSDN ([url]http://msdn.microsoft.com/en-us/library/6t4fe76c(v=VS.80).aspx[/url]). [CODE] #include <string.h> class String { public: String( char *ch ); // Declare constructor ~String(); // and destructor. private: char *_text; size_t sizeOfText; }; // Define the constructor. String::String( char *ch ) { sizeOfText = strlen( ch ) + 1; // Dynamically allocate the …

Software Development c++
Member Avatar for hystaspes
0
226

The End.