132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for matrix0978

hey guys, i programmed a bubble sort function in C and it doesnt seem to be sorting properly. Ive searched the forums and have seen similar posts and tried them but they dont work. :( Hoping someone could look over it to see if the concept/sytax is right. [CODE] typedef …

Software Development c
Member Avatar for matrix0978
0
243
Member Avatar for yasaswyg

So I have part of my code done and I'm stuck on how to sort structures. This is the code i have until now. Its supposed to ask the user 3 things title, artist name, rating of song and im supposed to ask the user to sort them in certain …

Software Development c
Member Avatar for dkalita
0
203
Member Avatar for Bluesilver

I need help on an assignment I have. The first part was to write a program that would declare an array with 150 elements, assign the "#" symbol to each element, then print the elements in such a way that it would spell a letter (in this case, "A") within …

Software Development java java-swing
Member Avatar for BestJewSinceJC
0
101
Member Avatar for imolorhe

hello. please i would want to know how i can communicate with the system and find the system's present status such as logging off, shutting down, etc. vb codes would be most appreciated. thaNKS

Software Development visual-basic
Member Avatar for abu taher
0
80
Member Avatar for angermanaged

I am having a problem wih the compiling of my code. The whole program consists of a driver program and a header file. the problem is showing up around where it is compiling the header file. since the header file only has template functions in it and no input file …

Software Development c++
Member Avatar for dkalita
0
120
Member Avatar for Syakoban

Hi, We are web/Flash people but were asked if we can take on a project that I would describe as creating a shell environment for Windows (probably XP), to hide the normal Windows Interface. The idea is for the company's employees to work in this environment and only have access …

Software Development c++ flash
Member Avatar for Ancient Dragon
0
99
Member Avatar for steball

I am trying to load a list of image files into an image array. The following code snippet works: Graphics gImage(hdc); Image iTiles[intNumTiles] = {L"Image[0].jpg", L"Image[1].jpg", L"Image[3].jpg", ...}; gImage.DrawImage(&iTiles[0], 100, 50); gImage.DrawImage(&iTiles[1], 140, 90); gImage.DrawImage(&iTiles[1], 180, 130); ... The problem is, I don't know how many image files there are, …

Software Development c++
Member Avatar for Ancient Dragon
0
135
Member Avatar for valkerye

I'm having a lot of issues with a program I'm working on and I really use any suggestions I could get. The purpose of the program is to take an input file that has a users name, the number of minutes in their call plan, and the number of minutes …

Software Development c++ ios
Member Avatar for vmanes
0
165
Member Avatar for gerard4143

I wrote this very small program that works fine until I remove the comments for the fprintf function. Basically the program will prompt the user for a numeric value, when the user guesses right(1234) the program exits. When I remove the comments the program never exits...Does anyone have any idea …

Software Development c
Member Avatar for gerard4143
0
133
Member Avatar for cabosun

So I am suppose to write a program that will implementing one method if computing checksums for a file containing integers. I am executing the program by a command line from the following form: p4a inputfile outputfile I can compile the program in Dev C++ compiler with no errors. But …

Software Development c unix
Member Avatar for gerard4143
0
81
Member Avatar for valkerye

I'm having an issue with an end of file while loop. I have narrowed a problem with a previous program into a smaller bit of code and the error is in the read in and i hove no idea what to do about it... I have done this kind of …

Software Development c++ file-system ios
Member Avatar for Ancient Dragon
0
199
Member Avatar for fiz

#include<stdio.h> void AddMatrix(int[2][3],int[2][3],int[2][3],int,int); int main() { int i,j; int matrixA[2][3], matrixB[2][3], matrixC[2][3]; printf("This Program is to find the summation of matrixA and matrixB\n\n"); for(i=0;i<=1;i++){ for(j=0;j<=2;j++){ printf("Please enter matrixA[%d][%d]:",i+1,j+1); scanf("%d", &matrixA[j]); } } printf("\n\n"); for(i=0;i<=1;i++){ for(j=0;j<=2;j++){ printf("Please enter matrixB[%d][%d]:",i+1,j+1); scanf("%d", &matrixB[j]); } } printf("\n\n"); AddMatirix(matrixA,matrixB,matrixC); return 0; } void AddMatrix(int matrixC[2][3], …

Software Development c++
Member Avatar for xavier666
0
105
Member Avatar for pankaj.garg

i have 2 forms..when i start my application..form1 loads...then i navigate to form2 and adds some data in database using controls on form2, which should also reflect on form1... My data is not getting reflected on form1, after i hide form2...before giving "form2.hide", i tried giving "form1.show" and "form1.refresh" but …

Software Development visual-basic
Member Avatar for abu taher
0
274
Member Avatar for Danman290

I'm new to this forum and to python in general, so be easy on me please. :icon_smile: I'm making a class to handle all events including mouse events. (I'm using pygame by the way) Heres how it looks so far: [CODE] class Event: #controlls all actions relating to events including …

Software Development python
Member Avatar for Danman290
0
16K
Member Avatar for lookatmills

If I have a text file that contains strings and integers such as: Alabama 3200 Denver 4500 Chicago 3200 Atlanta 2000 what code could I use to print the smallest number (2000) after reading in that textfile. I know I first have to split the text so I'm just operating …

Software Development operating-system python
Member Avatar for pythopian
0
71
Member Avatar for venkatnams

[B]hello everybody, im venkat doing my b.e 3rd year... Im currently working on my project of college administration system using vb6. I need help on how to save an image in the access database...i have got the code on how to browse an image. but i'm not able to find …

Software Development image visual-basic
Member Avatar for RobCr
0
3K
Member Avatar for .11

Hey everyone... Well I am sorting items based upon a number. My first case is if tail == null, if so that the first element to be added in the list. My second case is if the element I want to add number is greater than the tail. If so …

Software Development java linked-list
Member Avatar for .11
0
130
Member Avatar for mebob

Hi, i have two questions about making a c++ based programming language. the first: is there a c++ function or something that can separate text by commas and parenthesis, so if i wanted to write function [I]foo[/I] with argument [I]arg1[/I] and [I]arg2[/I], i would need code to take foo(arg1,arg2) and …

Software Development c++
Member Avatar for mebob
0
102
Member Avatar for leoeroy

I need help with my java program. I can't seem to figure out how to print my output in 10 numbers and then go to the next line. For example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 here's my code [CODE] …

Software Development java
Member Avatar for leoeroy
0
108
Member Avatar for persianprez

I should be getting this as my output, but it keeps going through each result: [CODE]10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 ; length = 7 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> …

Software Development python
Member Avatar for persianprez
0
125
Member Avatar for donaldw

I am writing a program which should output some frequency shift keyed (FSK) audio. I am using a sin(...) function to find some values to plug into an array of unsigned ints which I am outputting using waveOutWrite with a sample rate of 44100 specified in the header. The values …

Software Development audio c++
Member Avatar for donaldw
0
513
Member Avatar for thure

I'm having trouble with a forking program. One process writes to a file, the other waits for the file to be written, prints something out, then deletes it. They essentially process in order based on whether the file is there or not. The processes should be outputting more useful information …

Software Development c
Member Avatar for thure
0
115
Member Avatar for abie

I am trying to optimize code for Monte Carlo simulation. Even minute performance differences piles up after 100 million iterations and thus I need to squeeze every nanosecond from math operations! One area where I thought I could save a lot stems from the fact that I only require precision …

Software Development c++
Member Avatar for mrnutty
0
173
Member Avatar for axed

[code] vector<int> vi(3); for (int i=0; i<vi.size(); i++) { cout << vi[i] << endl; } [/code] output1: 0 0 0 [code] vector<int *> vi(3); for (int i=0; i<vi.size(); i++) { cout << vi[i] << endl; } [/code] output2: 0 0 0 [code] vector<int *> vi(3); for (int i=0; i<vi.size(); i++) …

Software Development c++
Member Avatar for mrnutty
0
111
Member Avatar for dash8shamir

Hi people, I need help to produce a VHDL behavioral code for my final year project, I need to create a 256 point radix-2 fft processor on a spartan-3A DSP FPGA and I am so stuck using modelsim and XILINX 10.1, I have reached to this point the code is …

Software Development
Member Avatar for Rashakil Fol
0
148
Member Avatar for halona

hi .. I want to display an error if the user didn't enter the id or the password in the Text fild.. but nothing happed when I compare it to null .. or to "" .. is there any way to do this? I also tried to compare it with …

Software Development java
Member Avatar for chaines51
0
111
Member Avatar for denni2727

At the moment Im developing a java application but Im having a problem. Im using a JFrame that takes different JPanels, I mean i change its ContentPane for another JPanel everytime i want to show new information. Im using a database too, im reading data from it im writing them …

Software Development gui java
Member Avatar for denni2727
0
220
Member Avatar for ayan2587

int fun(int(*)()); int main() { fun(main); cout<<"in main"<<endl; return 0; } fun(int (*p)()) { cout<<"in fun"<<endl; return 0; } the output is.... in fun in main how and in which manner is "main" being passed in the fun function argument in main function. does this way of passing automatically mean …

Software Development c++
Member Avatar for ayan2587
0
125
Member Avatar for rcaldera43

For some reason, I can't even get a simple "Hello World" to print out in terminal. I'm using Borland C++ Builder 6. The Form1 window comes up but nothing is written in it. No errors, just a blank page.

Software Development c++
Member Avatar for tomdupuy
0
651
Member Avatar for figved

I have written a script for scraping a web site, and it works fine. What does not work fine, is when I try to use the write function, to write the results to a txt-file. I am trying to run this: import BeautifulSoup, urllib2, re, time import codecs path='C:/Users/Me/Documents/Python' outfile=open(r'C:/Users/Steinar/Documents/Python/Vegvesen/vegresultat.txt', …

Software Development python
Member Avatar for pythopian
0
322
Member Avatar for xm1014

Hello everyone, I'm learning Python and I have a few questions about Dictionaries and sorting them by a value other than the key. Lets say, for example, I have a Dictionary full of data that needs to be sorted on the 3rd value instead of the key. How would I …

Software Development python
Member Avatar for vegaseat
0
445
Member Avatar for Beasts

I was wondering if I can create an arraylist with info already in it... Ex... ArrayList playerinfo = [P0,[[1,2,3],[4,5,6]]] If that makes sense. The info I want in the arraylist will always be the same, as it will be what I am using to test my program. However I need …

Software Development java
Member Avatar for Beasts
0
82
Member Avatar for aj.wh.ca

Sample code for taking input from Shell demonstrating string and int input For simple programs or testing purpose its not always required to take input thru GUI.

Software Development gui java
Member Avatar for javaAddict
0
239
Member Avatar for mybluehair

Long story sort, I'm making a thread in c++ that starts a timer. When a user starts playing the game, it starts the thread, and when user logs out - thread stops. - thus giving me the total time played. Problem: When using the code to start the thread - …

Software Development c++
Member Avatar for Skeen
0
168
Member Avatar for john_prince

Hi, I am trying to match phone numbers, and want only having format xxx-xxxx. Here is what i have written so far : [CODE]sub OfficePhoneNumber { my @numbers = @_; my $number; my @results; foreach $number (@numbers) { if ($number =~ m/(^\d{3}-\d{4}$)/) { push @results, $number; } } return @results; …

Software Development perl
Member Avatar for john_prince
0
95
Member Avatar for Afi83

I want to calculate average of grades of each student with SQL command but I encounter problem with this code. I have 3 tables related to each other and want to calculate average of student grades. This is my SQL string but it dose not work. What is the problem …

Software Development sql visual-basic
Member Avatar for coolguy_krkr
0
149
Member Avatar for pyprog

I have a file of the following format: a 1 a 2 a 3 b 4 b 5 b 6 c 7 c 8 c 9 Here is my code: [CODE]def file_to_dict(fname): f = open("file.txt") d = {} for line in f: columns = line.split(" ") letters = columns[0] numbers …

Software Development python
Member Avatar for pythopian
0
1K
Member Avatar for NinjaLink

I am trying to determine if a word is a palindrome or not using queues, but I am receiving the wrong results. I have tried several things to get it to work using the boolean variable isPalin. Will someone lead me to the right direction please? I have been trying …

Software Development c++ queue
Member Avatar for JasonHippy
0
120
Member Avatar for Beasts

I am taking a Class on Java, and sadly the professor is not all that good. But we have a project to do... I have got to a point where I need to pull info out of an arraylist... But it is an arraylist that is made up of arraylists. …

Software Development java
Member Avatar for Beasts
0
142
Member Avatar for ellimist14

I know it's a lot of code but any help anyone can give would be amazing. Basically when I re-write out to the binary file it must not be working because when I try to print it it only prints the record I updated. [code] void updateRecord() { int key; …

Software Development c++ ios
Member Avatar for rdrast
0
164
Member Avatar for tasosa

Hi all; I am so new in C.I have problem about array .I want to remove same element in array but i dont know how can i do. Can anyone help me example : 1,2,3,5,67,31,13,5,2,1,1,4, the program should produce -->>1,2,3,5,67,13,31

Software Development c
Member Avatar for tashfeen
0
239
Member Avatar for pyguy420

i have to write a rock paper scissors program in python, but every time i run my code... [CODE]def rockPaperScissors(): import random computerIndex = random.randint(1,3) if computerIndex == 1: computer = "rock" elif computerIndex == 2: computer = "scissors" else: computer = "paper" player = raw_input("rock, paper or scissors :") …

Software Development python
Member Avatar for vegaseat
0
83
Member Avatar for sneek

Hi, may anybody tell me what "initializes the interpreter" mean in detail? Does this function starts a new process or thread of the python interpreter in the background or what does this call do?? Hopefully somebody can give me a little hint :) Jonny

Software Development python
Member Avatar for sneek
0
309
Member Avatar for Darkicon

Thanks to a friend I was able to code a sub that opens a StreamReader and Writer. The Reader reads a *.txt file and the Writer modifies it line by line as it's entered into the memory then writes it to a temporary file which is then copied over the …

Software Development file-stream vb.net
Member Avatar for Darkicon
0
152
Member Avatar for thure

Hi there, This is my first time working with an unsafe language, so naturally my first code would be full of memory-related bugs. I still have no idea how I ought to approach some of the problems I've been getting, and I've been resisting asking for help as much as …

Software Development c
Member Avatar for Aia
0
166
Member Avatar for shakunni

As part of my program, I have defined and initialized a structure. But when I compile it, gcc gives me the following error on all the initialization " initializer element is not constant". Anyone know why this is the case? [code] struct RECORD { char* username; char* password; char* type; …

Software Development c
Member Avatar for shakunni
0
130
Member Avatar for moorcroft

Hi, I have a solution set up in .Net with a website. Each page is written in aspx and each code behind file are in the format of aspx.cs. For some reason when I build the solution it builds successfully although does not compile these code behind files to a …

Software Development asp.net c#
Member Avatar for moorcroft
0
603
Member Avatar for RaveFantasy

Hello there~ Well, straight for the problem: I have a class with a private vector that stores pointers: [code]class MyClass{ private: vector<myOtherCls*> myVector; public: //using the following till now: vector<myOtherCls*>& getContainer(); };[/code] [code]class myOtherCls{ public: void someGetFunc(); };[/code] Now I dont want to use [icode]getContainer()[/icode] but rather he Subscript-Operator. [code]MyClass …

Software Development c++
Member Avatar for RaveFantasy
0
111
Member Avatar for Bandin03

Hey everyone, I have a job interview coming up and despite the fact that most of the job is in C++, they want me to do the interview test in C which I have no experience in, not to mention my C++ is kinda rusty. Now I would normally have …

Software Development c
Member Avatar for Bandin03
0
128
Member Avatar for rasizzle

Hi all, I want to take this code: [CODE]list_in_list = [[1,5,13,30,-4], [1,5,10,30,-4], [1,5,15,30,-4], [1,5,9,30,-4], [1,5,16,30,-8]][/CODE] and sort it by the 3rd item in each sublist (list_in_list[x][2]) I'd like to do it by the highest number so my output would be: [CODE]sorted_list_in_list = [[1,5,16,30,-8],[1,5,15,30,-4], [1,5,13,30,-4],[1,5,10,30,-4], [1,5,9,30,-4]][/CODE] Any help or suggestions?

Software Development python
Member Avatar for vegaseat
0
122

The End.