43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for bbman

Hey, I have the code: [CODE] Form1(void) { array<Label ^>^ labels = gcnew array<Label ^>(itemCount); InitializeComponent(); for (int i = 0; i < itemCount; i++) { labels[i] = (gcnew Label()); labels[i]->Tag = (int)i; labels[i]->Location = Point(1, (i + 1) * 50); labels[i]->Size = System::Drawing::Size(250, 50); this->Controls->Add(labels[i]); } } [/CODE] This …

Software Development c++
Member Avatar for bbman
0
325
Member Avatar for NathanOliver

He all I am currently working a on a problem to convert the entire contents of an STL container into a string. For example if I had this: [code=c++] int foo[] = {1, 2, 3, 4, 5}; vector<int> bar(foo, foo + 5); [/code] I would like to convert [icode]bar[/icode] into …

Software Development c++
Member Avatar for Bench
0
127
Member Avatar for avarionist

I am trying create a button that when clicked prints hello world in the text box above it. however im a complete noob on winforms. I normally just make console programs any tutorials on winforms ? with C++?

Software Development c++
Member Avatar for avarionist
0
174
Member Avatar for Victor C.

I was creating this code and I hit a brick wall. Maybe because I have been doing this code for 5 hours and I am burnt out. I just need help to get it working please. Here is the code [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; public class …

Software Development java java-swing
Member Avatar for NormR1
0
195
Member Avatar for wiluo

Hello, I am trying to write a program in python to test the reading speed to a file, apparently,after the file is created, it's automatically in the cache and read() method will grab the data from the cache thus result in a much faster reading speed, how should i directly …

Software Development python
Member Avatar for jcao219
0
4K
Member Avatar for andyg55

Hi, I'm trying to create a 2d array that will fill itself up with numbers i have in a text file. My text file looks like this: 1 5 4 2 6 3 3 9 4 4 1 8 5 2 2 So, I want to create an array with …

Software Development c++
Member Avatar for tagazin
0
2K
Member Avatar for CanYouHandstand

Hello All I’m trying to hook the mouse scroll wheel using SetWindowsHookEx with WH_MOUSE_LL. The callback function I am using operates correctly, and identifies when the mouse wheel is scrolled. However I am unsure of how to identify which direction the mouse has been scrolled. My code so far: [CODE] …

Software Development c++
Member Avatar for CanYouHandstand
0
2K
Member Avatar for abbyo

I'm a newbie at java and I need help in coming up with the correct answer for this JOption java program. I enter in 2k, 30fps, 4min, 0seconds, and I should get 10.6842041GB (16.02630615GB total space needed). Please let me know if you have any advice on how I could …

Software Development ide java java-swing storage
Member Avatar for abbyo
0
146
Member Avatar for zixizx

Hello im a new member to this forum so if this is in the wrong place im very sorry. any way i have been developing a piece of software that reads from a .txt file soo far i have got it working but only on my pc eg "c:\documents and …

Software Development
Member Avatar for zixizx
0
141
Member Avatar for God Coder123

if i were to create a program which required the user to enter multiple values, but i do not no how many. How would i go about anticipating the input. For instance if the user were permitted to input any amount of numbers and i wanted to add all the …

Software Development c++
Member Avatar for jonsca
0
106
Member Avatar for KAY111

Hi guys, I am stuck with this piece of code for a long time. The errors that come are: bfs.cc: In function 'void greedyMatch()': bfs.cc:9: error: expected initializer before '*' token The relevant code is [code=c] #define forallXNodes(u,G) \ for(arc *bfs_ee=(G.getSource())->firstOutArc(),arc *bfs_stopA=(G.getSource())->lastOutArc(),u=bfs_ee->head(); bfs_ee <= bfs_stopA;u = (++bfs_ee)->head()) #define forallYNodes(u,G) \ …

Software Development c++
Member Avatar for KAY111
0
1K
Member Avatar for bbman

Hey, I have just switched from C#, and in C# there was a way you could create an item (Example), and set parameters. [CODE] Example text = new Example(); Example.parameter = value; //etc [/CODE] I have searched the internet, and could not make any sense of it. Any help would …

Software Development c++
Member Avatar for Fbody
0
123
Member Avatar for sadhawan

Hi Guys, can anyone help me to write a regex function for the following string .So my string is contents=false book_title='The Old Man and His Sons' sections=[ 'The Old Man and His Sons' ] now i want to extract just The Old Man and His Sons so far my code …

Software Development regex
Member Avatar for Radical Edward
0
117
Member Avatar for anu07

A question has been knocking my mind today,is it possible to convert a executable file back to its source code in c++??

Software Development c c++
Member Avatar for anu07
0
118
Member Avatar for Sawamura

hi, sorry for this question, but i really didn't know. i want to load flash animation and put in my project? please help me.. thx, i really appreciate that.

Software Development flash visual-basic
Member Avatar for peter_budo
0
118
Member Avatar for YasaminKh

Hi everyone, Somewhere in my need i need to create strings like ( x,y,z ) with 0<x,y,z<N. I was trying to use 3 for loops but it didn't work. That's what i wrote: for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ for(int k=0;k<N;k++){ string t="( "; t+=i; t+=","; t+=j; t+=","; t+=k; t+=" )"; } …

Software Development c++
Member Avatar for YasaminKh
0
190
Member Avatar for mod666

hi! i have a class from which other classes are inhertited. I then create a function GetInput() & I want it to funtion for evry object inherited by MAIN. I don't want to create separate functions for each. Is there any way for it? Thank you.

Software Development c++
Member Avatar for Fbody
0
112
Member Avatar for Tommymac501

I cannot seem to get Reportlab's 4 state bar code to work. I keep getting "NameError: name 'USPS_4State' is not defined", yet if I 'dir' the module it's clearly loaded; dir(usps4s) arcode', 'USPS_4State', '__all__', '__builtins__', '__doc__', '__file__', '__ e__', '__package__', '__version__', '_crc11', '_initNof13Table', '_ru13', '_t The usage is correct as …

Software Development python
Member Avatar for Tommymac501
0
111
Member Avatar for baki100

Can this be done in python and which module would i have to look at. I haven't experimented with this and if I have to guess would it be the os.renames() function.

Software Development python
Member Avatar for baki100
0
92
Member Avatar for AkashL

This problem originates from a job interview which could be solved in C++ or C#. As far as I can remember it was to implement a queue that can be added to by multiple threads and accessed by multiple threads. I haven't tried it in C# yet although I think …

Software Development c++ queue
Member Avatar for Radical Edward
0
248
Member Avatar for jeeter19

Hi all, My question pertains to the reading of a text document. Currently I am reading a text file searching for certain syntax and once it finds it then it uses that line. The thing is, I am currently doing this: [CODE] while (reader.readLine() != null) { DOSTUFF(); } [/CODE] …

Software Development
Member Avatar for kvprajapati
0
1K
Member Avatar for DelilahDemented

I'm working on a problem where I am trying to validate the user input to verify only digits have been used. I'm trying to use the ASCII code to do so, but I'm stuck. I would greatly appreciate any help that can be provided. Thank you in advance!!! *Delilah* [CODE]#include …

Software Development c++
Member Avatar for Taywin
0
2K
Member Avatar for neknek

I downloaded OpenCV last Wednesday and tried to link it with DevC++ I followed the instructions found [URL="http://www.cypax.net/tutorials/opencv/index?language=en"]here[/URL] and I get the error cannot find -lhighgui ld returned 1 exit status I'm sure the code that I tried to compile is working because I previously compiled and ran that code …

Software Development c++
Member Avatar for neknek
0
177
Member Avatar for learner15

[CODE]import java.awt.*; import java.awt.event.*; import java.applet.*; /*<applet code="actionapplet" width=500 height=600></applet>*/ public class actionapplet extends Applet implements ActionListener{ String msg,str; Button b1,b2,b3; public void init(){ b1=new Button("substract"); b2=new Button("add"); add(b1); add(b2); b1.addActionListener(this); b2.addActionListener(this); } public void actionPerformed(ActionEvent ae) { str=ae.getActionCommand(); if(str.equals("add")) msg="addition is to be performed"; if(str.equals("substract")) msg="subtraction is to be …

Software Development java
Member Avatar for NormR1
0
101
Member Avatar for Alex_

Sending one image works, but when i repeat the cycle again it just doesn't work. my Client side code (excerpt): [code] for(int i=0;i<50;i++){//fromServer.contains("image") img = ImageIO.read(in); System.out.println("Got image."); label = new JLabel(new ImageIcon(img)); scrollPane.setViewportView(label); fromServer = reader.readLine(); }[/code]On the client side i have this output [code]Got image. Got image. Exception …

Software Development client-server java java-swing
Member Avatar for NormR1
0
1K
Member Avatar for Noober87

Hi everyone, I have the following code to save the text inside an editbox: [CODE]var Data: TStringList; begin Data := TStringList.Create; try Data.Append(Edit1.Text); Data.SaveToFile(Savedialog1.Filename +'.txt'); finally Data.Free; end; end;[/CODE] And this code to load it to that editbox where i saved it from: [CODE]var Data: TStringList; begin Data := TStringList.Create; …

Software Development pascal
Member Avatar for Noober87
0
161
Member Avatar for echellwig

Hi I was wondering if there is any way to created a series of lists in a for-loop so that the first list created is named NAME0 or name_0 or indexed in some way. What I have right now is [CODE]for j in range(int(L)): popsizelocus_j=[][/CODE] however, this is not working …

Software Development programming-construct python
Member Avatar for TrustyTony
0
48K
Member Avatar for NamrataC

Hi, I'm developing a window-based application where I've a Main Form A. I open another form B on a button click. When I close Form B, I want to reload the Form A. Please help as soon as possible. Thanks in anticipation.

Software Development vb.net
Member Avatar for NamrataC
0
1K
Member Avatar for Eric Cute

Help! Im trying to overwrite a certain record in a text file (basically a log in log out file). Im using Random Access File. I tried to write the updated record using writeBytes but what happens is that it was APPENDED after the record i wish to overwrite. from 150.20.111.0&2010062216:06:31 …

Software Development java
Member Avatar for Eric Cute
0
131
Member Avatar for viperdamus

Hi All, I am doing a project on a Video Library Management System for my final year Computer Science project and I've run into acouple of errors. Could anyone out there help me out...???? Please, I'm desperate...! Thanks.

Software Development visual-basic
Member Avatar for kvprajapati
0
227
Member Avatar for pula.alt

I'm making an application that converts units. I cant not for the life of me figure out why this isnt working. The answer returned is 0.0 when I convert from Fahrenheit to Kelvin or vice versa. The K to C conversions work though. Any insight would be amazing. This is …

Software Development java
Member Avatar for pula.alt
0
140
Member Avatar for Robertbra

Hey Guys : Here The problem is :to have a program to check the -(sys.argv) is long enough to have more than 3 elements if not then print "input more " -check (sys.argv) contain a specific elements for ex(P) ,& if P is found in the given elements then it …

Software Development python
Member Avatar for griswolf
0
117
Member Avatar for echellwig

Hi, I am trying to write elements from a list that I have created to an outfile using a for-loop with this code: [CODE]for j in range(int(Allele[i])): outfile.write(' allelelocus[j] * ')[/CODE] However when I do this I just get a whole bunch of allelelocus[j] in my out file. I was …

Software Development programming-construct python
Member Avatar for echellwig
0
155
Member Avatar for aframe

I have a Python script that creates a Tkinter window running in Ubuntu. In the script I have an if/else statement that changes the background color based on a variable. That all works. What I cannot figure out how to do is when it changes the background color, I also …

Software Development python tkinter ubuntu
Member Avatar for woooee
0
2K
Member Avatar for gangster88

Can someone help me with this code.. I get an error when I try to execute it [code] from graphics import * def main(): colour = raw_input("Enter the colour: ") win = GraphWin("Patch", 200, 200) drawCircle(win, 50, 50, colour) def drawCircle(win, x, y, colour): for i in range(5): for j …

Software Development python
Member Avatar for vegaseat
0
203
Member Avatar for ibdatx

I have this code and having matched the input, I want it split into two separate variables. The input is in the form of a range (e.g: 1-10) and is written in perl. Here is the code: [ if($pr=~m/^([0-9]+)\s*[-]\s*([0-9]+)$/){ print "Match"; } else { print "Not a match"; } ] …

Software Development perl
Member Avatar for ibdatx
0
123
Member Avatar for FudgeCoder

Here is the code: [CODE]#include <cstdlib> #include <iostream> using namespace std; //Declare function int triangle(int num); int main() { int n; cout<<"Enter a number and press RETURN: "; cin>> n; cout<<"Function returned:"<<triangle(n)<<endl; return 0; } //define function int triangle(int n){ int i; int sum=0; for(i=1; i<=n; i++) sum=sum+i; return sum; …

Software Development c++
Member Avatar for Taywin
0
156
Member Avatar for echellwig

Hi, I am having some trouble using the int function on an element of a list. My code currently looks like this. [CODE]for j in range(int(L)): for k in range(int(Allele[j])): alleleslocus_j.insert(k,loci.readline())[/CODE] where Allele is a list of length L inputted by the user. I am having problems with the second …

Software Development python
Member Avatar for echellwig
0
182
Member Avatar for eggmatters

Hi all, My cpp is rusty as all get out and I'm wondering why this doesn't seem to work. I've basically created a .cpp file with all of the structs and lower level data types in it. One of these is an enumerated type. The file. structs.cpp is as follows: …

Software Development c++
Member Avatar for eggmatters
0
148
Member Avatar for MrBlack

I created 2 winforms in one i create a button .when i click the button i want to go to the next form(form2) and close the form1. plz give me the code . this is my code it is not working form1 [CODE] namespace MyTest1 { public partial class Form1 …

Software Development
Member Avatar for MrBlack
0
101
Member Avatar for bubacke

hi all, i tried this code, but it doesnt work, it says vector subscript out of range: (sorry, i just dont understand how to correctly post code, if someone could tell me, please?) #include <iostream> #include <vector> using namespace std; vector<int> v; v.push_back(1); v.push_back(2); if (2 < v.size() && v[2] …

Software Development c++
Member Avatar for bubacke
0
132
Member Avatar for Grep

Hi all, In order to run an excel macro, I need my personal.xls excel file open so I open it along with the file I'd like to run the macro in. Problem is when I close the program I use save/close. But for some reason it still pops up a …

Software Development perl
Member Avatar for mitchems
0
957
Member Avatar for ryan461

I've got a couple of pdf's on python, but im having trouble grasping how to build classes. Was trying to do it for a poker program and i think im in over my head with that idea. (its a bit big just doing it with functions). So id like an …

Software Development pdf python
Member Avatar for ryan461
0
127
Member Avatar for Simes

[CODE=python]#Code should always be in a method or class #Always start variable names with lowercase, classes could be capital #input.upper() allows the user to use lower or upper case for each option import random from operator import itemgetter def isint(x): try: int(x) return True except: return False print "Invalid guess. …

Software Development python
Member Avatar for Simes
0
109
Member Avatar for tiddster

I have a list containing strings. I want to make a directory for each item in the list, with the name of the directory being the string. Does anyone know if this can be done, and it so, how?

Software Development python
Member Avatar for raj_developer
0
218
Member Avatar for sandorlev

Hello, guys! I've written a GUI for a program. It's written like shit, the goal was to get it done fast. Well it didn't exactly work out, so when I refresh the data, every label disappears. Here is the code: [CODE] class GUI: def __init__(self, master): self.master = master self.label …

Software Development gui python tkinter
Member Avatar for TrustyTony
0
10K
Member Avatar for dhruv_arora

I made a c++ program. I used cin.getline() function so I could input a string from the user. But when I run the program it does not input anything nor gives me a change to input anything instead it goes to the next statemement. For eg. this is my program …

Software Development c++
Member Avatar for dhruv_arora
0
113
Member Avatar for dhruv_arora

What's the difference between return (0); and return 0;

Software Development c++
Member Avatar for debugger09
0
90
Member Avatar for ShortYute

I'm knew to C++ and I always seem to have a problem but all I want to do is to pass an Object to a function by reference.. Thanks in advance Oh I user boost for directories, paths and files... Also I use c strings for UserName and password as …

Software Development c++
Member Avatar for ShortYute
0
922
Member Avatar for sonya_sml

Hi I recently developed a reportingApp which after downloading xml report from third party, converts it into csv format. This 3 party changed the dtd version of the reports saying it should not affect anyone But my app broke as the xmlns reference changed, thus it didn't performed conversion. so …

Software Development xml
Member Avatar for sonya_sml
0
921

The End.