132,726 Archived Topics
Remove Filter ![]() | |
How can I determine position and size of rectangle on my image and fill rectangle with my texture using System.Drawing class or something else? Basically I have to change the color of the particular part of an image on button click. Any idea how to do this? | |
Hi, I am trying to use the "partition" from STL algorithms. I get the following error: [CODE]error: no matching function for call to ‘partition(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, <unresolved overloaded function type>)’ /usr/include/c++/4.2.1/bits/stl_algo.h:2098: note: candidates are: _ForwardIterator std::partition(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int, … | |
package hw3; import java.math.*; public class Main { public static void main(String[] args) { int i, j=0; double t=0; //input int m=4; int n=5; hw3.Point[] p = new Point[m]; hw3.Point[] q = new Point[n]; p[0] = new Point(0,0); p[1] = new Point(0,1); p[2] = new Point(0,3); p[3] = new Point(0,5); … Software Development java | |
[CODE]Public Class Form1 Private Sub btnCompute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCompute.Click Dim percent As Double percent = (txtGrams.Text * 9) / txtCalories.Text * 100 Dim fmtstr As String = "{0, -15:p3}" lstResult.Items.Clear() lstResult.Items.Add(String.Format(fmtstr, txtFood.Text & " containts " & percent & _ " calories from fat.")) … Software Development vb.net | |
I wrote a function to read an expression (i.e. A+B-C) from the keyboard one character at a time, and ignoring spaces insert each char into a queue. I tried something I though would be fairly elegant, but I don't think I did it right. This is my function: [code] void … | |
Ok guys, firstly i'm sorry for the long code. Don't worry, it is only a small problem related to a small part of the code in the main class. I've highlighted the .area I have a problem here. The first piece of code is my main class. I call a … Software Development java java-swing | |
Here is 2 classes: [CODE] class Test(object): def __init__(self, var1=123): self.var1 = var1 class Test2(Test): # ... [/CODE] As you can see, Test2 is an instance of Test, which has var1. var1's default value is 123. How can I change the var1 in Test2 without __init__ again? Or better yet, … Software Development python | |
Hey there guys, First time poster here, so I apologize for being a rookie. This is my first VB class and im having a hard time with For-Next loops. The question assigned is as follows: Request and odd number, and display a triangle similar to this: [code] ***** **** *** … Software Development vb.net | |
Hey guys, I'm creating a Maze class along with a client class where it allows the user to input a direction (U/L/R/D), and then the validity of the move will be returned as well as the new position of the maze. So far, I've got this, but when I try … Software Development java java-swing programming-construct | |
please help... here's the code [CODE]import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JPasswordField; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JOptionPane; import javax.swing.JButton; import javax.swing.Icon; import javax.swing.ImageIcon; public class Button extends JFrame{ private JButton reg; private JButton custom; public Button(){ super("BUTTON"); setLayout(new FlowLayout()); reg = new JButton("reg BUTTON"); add(reg); Icon … Software Development java java-swing | |
This displayBits function works fine in this code in displaying the bits of the input integer. I put the same thing into function reverseBits and have been trying different things to get it to reverse the order, but can't seem to get it right. I think it's a minor modification … Software Development c | |
![]() | I have 2 classes inside bluej, member class and trip class so when I make a member object with student ID, name and course, how can I make an ArrayList or HashSet on trip class which needs to store those students. If you have used bluej you know what I … Software Development java ![]() |
Hi people,in the assignment I was give the main function and was told to write a class, and the output is supposed to be like this: BLANK(0,0) Destination (6.2,16,7) BLANK (45,0) Destination (6.2,33.4) The x coordinate of source is:45 The y coordinate of source is :33.4 The label of point … Software Development c++ | |
I am trying to teach myself C#. I spent about ten hours trying to find a solution and could not come up with a working one. So I am trying this from a different approach. I got the answer and I am going to work my way back to the … Software Development | |
I've realized that it would be very helpful to me to SET the mouse cursor to a particular location. Having done the usual internet searches, I can't seem to find anything on how to do it. Any ideas? (So I'm still set on converting to wx, but the project I've … | |
Im using xcode to write my program. Every time I build and run the program it will do everything fine, until the end. It keeps giving me an answer of 0 no matter what i put. Need help to figure out what im doing wrong thanks in advance. [CODE]//price_converter #include … Software Development c++ | |
[CODE]#WEAVING A RUG WITH PYTHON #################################################################################### ## END STRINGS## for rows in range(1): for cols in range(36): print('~', end='') print('\n') ## SEAM ## for rows in range(1): for cols in range(12): print('- -', end='') print() ## DUAL ROW DESIGN ## for rows in range(2): for cols in range(36): print('*', end='') … Software Development python | |
Hi, I see the following error when i open my file with IE. <PARAM-CONF-CONTAINER-DEF UUID="ECUC:8e498821-8d5c-4512-88fc-8d4d90dca1ab"> <SHORT-NAME>DioChannelGroup The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- A semi colon character was … Software Development api data-structure xml | |
I am a little unclear on what is happening here and if it's even necessary. [code] ICOMInterface** pICOMInterface = new ICOMInterface*[reserve]; for(SIZE_T i = 0; i < required; i++) pICOMInterface[i] = new ImplementingClass; for(SIZE_T i = (reserve-1); i >= required; i--) delete pICOMInterface[i]; [/code] I'm trying to get a set … Software Development c++ | |
[CODE]#include <iostream> template<class T1, class T2> class TwoThings { T1 thing1; T2 thing2; public: TwoThings(T1 t1, T2 t2) : thing1(t1), thing2(t2) {} template<class T3, class T4> friend std::ostream& operator<<(std::ostream& os, const TwoThings<T3, T4)&); }; template<class T1, class T2> std::ostream&::operator<<(std::ostream& os, const TwoThings<T1, T2>& tt) { std::cout<<tt.thing1<<' '<<tt.thing2; return os; } … Software Development c++ | |
Which would be considering a better coding style, this is for a merge sort in case you are wondering what I am doing with this line of code [CODE] int j = 0; // used to track for the temp array earlier in my code // reset it to be … Software Development c++ | |
I am doing an C++ assignment on customizable scientific calculator. I wish to ask how to write a program that can automatically identify the variables when i load a formula? for example, when i input a formula: x + y the program will display: x? y? | |
Hi, I've had a quick look through this forum and can't really see anything to help. I've got a basic but fair knowldge of C++ but I'm unfortunately not very good at putting my knowledge into raw code :D. I'm currently doing an assignment to read data from one of … Software Development c++ file-system | |
Good Day Folks! I'm having a difficult time getting this operator overloading function to work. I have try various syntax to get it to work. When I run the following code I get this compile error. [COLOR="Red"]g++ -Wall hmw6.cpp -o driver set.h: In instantiation of `correaj::set<int>': hmw6.cpp:9: instantiated from here … Software Development c++ | |
[CODE]#include<stdio.h> int lcm(int a,int b); int main() { int a; int b; printf("Enter two numbers to find lcm of ? :-\n1. "); scanf("%d",&a); printf("2. "); scanf("%d",&b); printf("%d is the lcm of %d and %d\n\n",lcm(a,b),a,b); getchar(); return(0); } /******************* FUNCTION *****************************/ int lcm(int a,int b) { int i,g,pr,z,q,dummy,lc = 0; /************************************************************************/ … Software Development c | |
I am getting many many warnings of this kind in my code. It comes every time I typecast something in my code, which I am doing to variable addresses in order to use integer arithmetic on them. How do I fix these warnings? Thank you! I would appreciate any constructive … Software Development c | |
hello there. there's an error in my program that I cannot identify. Every time i call a function for my declared variable of type Stack, there will suddenly be a run time error. I really don't get what's wrong with my code because my implementation seems to be right but … Software Development c++ | |
Hey guys! I must have some sort of logic problem that I'm just not seeing. I just want to read a file into a 2D array. The dimensions of the array are given by the very first line of the input file. Everything works hunky dorey except that when I … Software Development c++ | |
Hi Can anyone have a look at my code and tell me where im going wrong??? What im trying to do is display my details in a listbox then the one that is selected frm the listbox is displayed in the textboxes and when delete button is clicked it is … Software Development microsoft-access open-source vb.net | |
In the code below I am opening a .txt file to count the characters in it. I am assuming that the user does enter a .txt file, but how can I go in checking that the file is truly a .txt. I was thinking of using a java function to … Software Development file-system java | |
can somebody tell me the line: [B][U]public static[/U][/B] void main(String[] args) {} especially the highlighted ones in detail. why do we need to use static? public? Software Development java | |
Hi everyone, I'm sure I'm doing something silly here! Basically my constructor creates a pointer initialised to null, then in one of my functions I create an integer array on the heap using the new keyword. Now basically I have a data structure that needs to be copied, like so … Software Development c++ data-structure | |
![]() | I'm using Dev-C++ 4.9.9.2 Im making my arrays dynamically and I am calling on a function to allocate the memory for me, but I received the warning: "[Warning] assignment makes pointer from integer without a cast " This occurs in main when [B][COLOR="Red"]alocate [/COLOR][/B]is called Main funtion: [code=C] int main() … Software Development c ![]() |
I have to write a program that finds the smallest index of an array and am having a bit of trouble. Can anyone find anything wrong with this? [CODE]import java.util.Scanner; public class SmallestIndex { static final int LINESIZE = 10; static final int MAXSIZE = 50; static final int MINVALUE … Software Development java | |
The assignment was to write a program that generated a random sequence of six non-repeating numbers between 1 and 53 until it matched a user inputted sequence (lotto). Here is the entire program. [CODE=c] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <cctype> #include <iostream> #include <windows.h> #include <time.h> using namespace … Software Development c++ | |
Hi =) I'm a beginner with c + + so I have a small problem with Visual C + + When im typing } in vc + + it will not type } so I was wondering how do I fix this problem? Software Development c++ | |
Okay, so I have a main form which has a button for the user to add a new record. I have everything working except making sure the user enters appropriate values. I have it so a message box pops up the value is not valid, but it goes into an … Software Development | |
I read somewhere else and found some code that had something like this in it: [CODE]char buf[] = {0};[/CODE] what does this do? thanks mitch9654 Software Development c++ | |
Hi I am creating a program that needs to take 10 grades and give you the average, lowest, and highest grades. It needs to use arrays. Have I used arrays or used they correctly so far? Where do I need to put the grades in at? I have written part … Software Development java | |
Hello, I am working on a merge sort but I keep getting the following error : ds07(6443) malloc: *** error for object 0x100100098: incorrect checksum for freed object - object was probably modified after being freed. I don't see what my error is with the creation and deletion of my … Software Development c++ | |
Hey I posted earlier a few days ago about a program I am having trouble with. Well I have worked on it but still need a little bit of help. I have to write a program that will store 10 grades into an array. The program will need to output … Software Development java | |
Hi again. I want to have a file for one of my python programs, that looks something like this: [CODE]<WINDOW> #Window size 640 480 <WINDOW TITLE> App Platform Test <ICON> icon.png[/CODE] I have a function that reads each line of, and uses the data to make a window. What happens … Software Development python | |
I have created a number guessing game that writes and reads scores from a text file. When a section of code was added to sort and right-align the scores from lowest to highest, a problem was encountered. This is my code: [CODE] import random print "Welcome to the Great CP1200 … Software Development python | |
It provides the average grade of an student. Assignment: How many students are in the class ? 3 Enter five test scores for student number 1 80 90 70 90 80 The average for student number 1 is 85 Enter five test scores for student number 2 100 60 60 … Software Development c++ | |
Hi. I need some help with some code i'm writing. I'm new to c++ and to be honest i feel like i have tried everything but cant get this bit working. I've included the small part of the program i have so far. I still have a lot to do … Software Development c++ | |
I have problem in database file which I made in Access, language C#,It works fine after installation in default location "C:/program files/default company name/project name/abc.mdb", but when I install it in different drive (non-window drive) then my project doesn't find the database file.So,how can I remove this problem. Software Development | |
hey all, im a dutch student and for a project I am responsible for the pc application. we are making a paint application, the picture that are drawed are saved in a bitmap so I can use the getpixel() function to get the collors form the image. the size of … Software Development | |
good evening folks its me again, folks i need your help in flexgrid idont know how to use it in editing a database, can you give me some sample program thanks folks may god bless you:) Software Development visual-basic | |
I'm doing school assignment. But I can't solve it yet. Will you help me? Using shared memory,I have to copy structure to second program. But it does not operate well. Maybe it's type problem especially shmat part. Will you help me guys? Thanks you in advance. [CODE]struct work_list { int … |
The End.