43,549 Solved Topics
Remove Filter ![]() | |
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++ | |
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++ | |
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: … | |
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 | |
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 … | |
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 | |
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 | |
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 | |
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 … | |
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 | |
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 | |
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 | |
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 | |
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 | |
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++ | |
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 | |
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 | |
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 | |
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 | |
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 | |
[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 | |
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 ![]() | |
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 | |
[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++ | |
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 … | |
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 | |
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 | |
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 | |
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 | |
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 | |
what is report writting in programming and its uses by organization. let someone explain pls Software Development | |
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 | |
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 | |
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++ | |
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 … | |
[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++ | |
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 … | |
[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 | |
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 | |
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 … | |
[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++ | |
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 … | |
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++ | |
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 | |
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++ | |
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++ | |
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 | |
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++ | |
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 | |
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++ |
The End.