132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for HoneyBadger

Guys, I am trying to sort a list. But Python does not let me set my new sorted list into a variable. here: [CODE]list1 = ['a', 'z', 'b', 'y'] sorted_list = list1.sort() return sorted_list[/CODE] When I run this on my interpreter, instead of printing my string sorted, it prints "None" …

Software Development python
Member Avatar for ultimatebuster
0
91
Member Avatar for hurkagurk

Hi all! I'm creating a program that opens a small form for each row in a database (each form is an instance of Notebox). The user can create a new Notebox by clicking on a button (noteboxSibling) at the bottom of each existing Notebox. All Noteboxes exist inside Form1 which …

Software Development peer-to-peer
Member Avatar for hurkagurk
0
131
Member Avatar for brando|away

im using fasm (flat assembler 1.68), and im trying to output a string with int21h/ah=09h [code] jmp main msg db "hello world$" main: mov dx, msg mov ah, 09 int 21h [/code] this code outputs "hello world", but it outputs some control characters before it ([SOME WEIRD CONTROL CHARACTERS]hello world) …

Software Development assembly
Member Avatar for davibq
0
3K
Member Avatar for sairakhalid

How can i make addition in my linked lists if the nodes are stroing two values: 1) int element 2) int colomnvalue i have to make the addition on the basis that the nodes having the same colomvalue, thier element should be added. This addition is to be made in …

Software Development c++ linked-list
Member Avatar for Taywin
0
164
Member Avatar for cbsinc

This compiles with no problem, but my calcCost function returns jibberish. I’ve tried many different combinations and I know it’s something simple. If I change my calcCost function to void and cout totalCost, it works fine, But I need the return value for another class (Order) that I need to …

Software Development c++
Member Avatar for Taywin
0
116
Member Avatar for Shijo Jose

I am trying to create a program to log the medal tally of the cwg. However,I'm still getting wind of using binary files. It seems as if nothing is being read from or written into them. Below is my entire code. It would be of help if somone could direct …

Software Development c++ ios
Member Avatar for Taywin
0
201
Member Avatar for AndreiZ3

Hi, I am doing a mobile application. Someone else is passing me the datatable via a webservice so I get in the following: DataTable dt = new DataTable(); // create a datatable dt System.Guid guidCustomer = new Guid(Common.sCustomerID); // pass the guid dt = ws.BoningRoomOrdersCustomerOrderItems(guidCustomer); // send guid to webservice …

Software Development c c# c++ listview
Member Avatar for darkagn
0
152
Member Avatar for manofhouse

This is the Header file [CODE]#ifndef STUDENT_H #define STUDENT_H // class Student definition class Student { public: Student( char *nPtr ); ~Student(); void displayGrades() const; Student addGrade( int ); static int getNumStudents(); private: int *grades; char *name; int numGrades; int idNum; static int numStudents; }; // end class Student #endif …

Software Development c c++
Member Avatar for thelamb
0
381
Member Avatar for lykathea

I am trying to implement a stack where one can push to the front and to the back of the stack. However, my implementation is very slow. Can anyone help me think of a better method? Thank you! [CODE]public class Pch11_x1 { /** * @param args the command line arguments …

Software Development java
Member Avatar for lykathea
0
117
Member Avatar for xcarbonx

Hi, I'm having trouble lining up data from a file with their respectable columns in a list box. I am using print zones to space out data evenly, but when i run the program the output is still messy. So I need help lining up columns properly together. As of …

Software Development vb.net
Member Avatar for xcarbonx
0
1K
Member Avatar for muncher10

I can't seem to find out why it doesnt work with average or smallest but largest and sum does work. //constructor public class DataSet { private int sum = 0; private int count = 0; private int Smallest; private int largest; public DataSet() { } public void addValue(int a) { …

Software Development dataset java
Member Avatar for apines
0
157
Member Avatar for marvolo1300

Hi, Im trying code something which will launch an executable file. I have tried system("example") but the only problem is that the file which has been launched has to be closed before the rest of the code is executed. Does anyone have an alternative to this method?

Software Development c++
Member Avatar for Stefano Mtangoo
0
211
Member Avatar for Buffalo101

I'm using a JTable with a DefaultTableModel. I use the Load Button for populating the JTable. Anyway, the problem I have is with the Delete row button. (defaulttablemodel.removeRow). This is the whole project: [code=java] package proiect1; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import java.io.*; import javax.swing.event.*; import javax.swing.table.TableModel; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; …

Software Development file-stream java java-swing
Member Avatar for Buffalo101
0
442
Member Avatar for Purrenhage

2 week in programming I am learning to program in C++. I started off with 26 error, and now I am down to 1. I just dont understand what it is asking for in the errors. Can somebody help me out? I have tried to look on the internet but …

Software Development c++ visual-studio
Member Avatar for manojwali
0
154
Member Avatar for NewOrder

is the initialization happens in this order? The order of variable initiation is the following: 1) Static variable/methods are initialized first. 2) The object. 3) Object variables.

Software Development
Member Avatar for NewOrder
0
63
Member Avatar for choosenalpha

Hello All, I am getting the infamous Argument ___ isn't numeric in sprintf. I've looked around but I can't seem to fix the issue. It seems to occur if it has a 0. in front of the numeric pattern that causes it. Does anyone have any idea of what I …

Software Development html-css perl vbscript
Member Avatar for choosenalpha
0
414
Member Avatar for NewOrder

could someone remind me the rules of params. is it... the params method needs to be the last one and you can have only params as the parameter in the method and nothing else?

Software Development
Member Avatar for Momerath
0
71
Member Avatar for qvyhnl

I had created a Person class with 2 fields ages and name, its member functions are [CODE] Person::Person(string n, int a){ name = n; age = a;} string Person::get_name() const{ return name;} void Person::increment_age(){ age += 1;} void Person::print() const{ cout << name << endl; cout << age << endl;}[/CODE] …

Software Development c++
Member Avatar for qvyhnl
0
149
Member Avatar for Mona..

Hi.. this is my code: [code] import java.util.Scanner; public class Arrays { //private variables private int[][] list = new int [12][2]; private int highest; private int lowest; //public functions Arrays(){ highest = 55; lowest = 5; list = new int[12][2]; } public int getData(){ Scanner input = new Scanner(System.in); for …

Software Development java
Member Avatar for Mona..
0
155
Member Avatar for marboleon

I'm new to Python, so bear with me..... I'm calling the Dislin plotting package from python to plot in a wxPython panel. This works OK but the plot gets grayed out when another window is moved over it. There is a Dislin function, sendbf, which updates the graphics window with …

Software Development python
Member Avatar for TrustyTony
0
181
Member Avatar for dspjm

Suppose I have these two functions: [CODE]template<class T> bool largerthan(T a, T b) { if(a>b) return true; return false; } template<class T> int reduce(T ar[], int n) { list<T> buffer; buffer.insert(buffer.begin(), ar, ar+n); [COLOR="Red"]buffer.sort(largerthan);[/COLOR] buffer.unique(); copy(buffer.begin(),buffer.end(), ar); return buffer.size(); } [/CODE] I have two kinds of arrays for reduce(): string …

Software Development c++
Member Avatar for vijayan121
0
107
Member Avatar for Alerwiali

Could some one here tell me how to resolve the problem it says duplicate DecimalToString Dos that mean i cant use a macro twice in the same program if yes how to print more than one number Thanks in advance [CODE];Author :Alerwi Ali ; function: Calculate the sum of ; …

Software Development assembly
Member Avatar for Alerwiali
0
291
Member Avatar for hwalsh

I can't get my userName variable right, it prints out user name the first time, but the second time it prints out null...I've been at this same problem for nearly 24 hours. [CODE]import java.util.Random; import java.util.ArrayList; import java.util.Scanner; public class mlab { // instance variables - this instance will get …

Software Development java
Member Avatar for hwalsh
0
88
Member Avatar for fraky

Hi, I am new in python and programming basically. I have a code that compare 2 files by the first column and prints a file with the common lines. But i need it to compare the first 3 columns and print the file. I kind of have and idea of …

Software Development python
Member Avatar for TrustyTony
0
145
Member Avatar for kezkez

if i have a text file with data: test, 1, 2 again, 3, 4 Can someone give me an idea how to start puting each line into an object ? ObjectName o = new ObjectName(String s1, String s2, String s3); [CODE] class Action implements ActionListener { public void actionPerformed (ActionEvent …

Software Development file-system java
Member Avatar for JamesCherrill
0
155
Member Avatar for modesto916

Hi, I know that there are many topics about this, but, i read a lot of them, and no one solved my problem. I doing some exercises of the book "Deitel How to Program, 5", and in the exercise 4.27 i need to write a program that get a binary …

Software Development c++
Member Avatar for modesto916
0
98
Member Avatar for Joey_Brown

Hello I have a question regarding this program in c. My assignement is as follows : *read the angle in degrees *convert that angle in radians *Apply the formula for calculating cosine function with factorials *Then, automate the above calculating procedure by using loops *Afterwords calculate the absolute error between …

Software Development c
Member Avatar for Joey_Brown
0
124
Member Avatar for BlueZephyr

I have a list of things of things I need my code to do but I don't know where to begin. I need to: -Read the first line of a file which gives the number of grades in a set. -Transfer everything in a input file to and output file …

Software Development c++ file-stream file-system
Member Avatar for tkud
0
191
Member Avatar for BonaDrag

I have an XML-form (Silverlight application) with validations in C#. My XML-code works fine, but I'm having problems with the C# part. For every textbox I first check that the textbox is not empty (this works fine), and if it's not empty I check that the input is correct. My …

Software Development regex xml
Member Avatar for BonaDrag
0
176
Member Avatar for baconswife

My program is supposed to open files, initialize variables, use the functions sumGrades, averageGrade and printResults. I am having some errors and was hoping someone could help me out. To begin with some errors I'm getting are: line 10- two few arguments to function 'void printResult(int, int, float, float, float, …

Software Development c++
Member Avatar for VernonDozier
0
328
Member Avatar for Miyamoto

insertion into a set takes O(log n) time, which means ? I have heard about big O notation which desribes how memory usage changes when input changes. But log n ? n is probably the number for input values but i don't get it let's say i have 25 inputs …

Software Development c++
Member Avatar for arkoenig
0
980
Member Avatar for Dimansu

Hi, I want to get a count of each english letter in a text file.The lower case and upper case letter should be taken as 1 letter(i.e A and a should be counted as 1 letter).This is my code but it takes capital A ans simple a as 2 letters. …

Software Development
Member Avatar for ddanbe
0
343
Member Avatar for painejake

I work in a school and i am currently working on a program which can switch the proxy settings on-the-fly in Windows Vista and Windows 7. So far my code works fine if the browser is restarted but it doesn't on-the-fly. The settings will change once without a restart but …

Software Development microsoft-windows windows-vista
Member Avatar for ProxyFake
0
760
Member Avatar for VasquezPL

My menu function looks like this and it works great: [code] int menu(string * teksty, int ile) { static HANDLE h_we = GetStdHandle(STD_INPUT_HANDLE), h_wy = GetStdHandle(STD_OUTPUT_HANDLE); int wybor = 1; CONSOLE_CURSOR_INFO cci = {0}; GetConsoleCursorInfo(h_wy, &cci); cci.bVisible = false; SetConsoleCursorInfo(h_wy, &cci); COORD p = {0}; DWORD k; //FillConsoleOutputAttribute(h_wy, 0x07, 80 …

Software Development c++
Member Avatar for VasquezPL
0
156
Member Avatar for AKJo

Hello, I have an application with two MediaPlayers. MediaPlayer1 I want to play a video and MediaPlayer2 I want to play a sound file. My problem is that I don't know how to control the sound volume from MediaPlayer1. How can I set sound volume to zero for MediaPlayer1?

Software Development pascal
Member Avatar for AKJo
0
926
Member Avatar for hannon565

When I try to run the file I get this error, amen't sure how to fix it. [CODE]Exception in thread "main" java.lang.IllegalArgumentException: illegal component position at java.awt.Container.addImpl(Container.java:1035) at java.awt.Container.add(Container.java:408) at EmailWindow.CreateContent(EmailWindow.java:65) at EmailWindow.<init>(EmailWindow.java:22) at Lab6a.main(Lab6a.java:10)[/CODE] Heres my code sorry for lack of comments [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public …

Software Development java java-swing
Member Avatar for sakshamsak
0
1K
Member Avatar for wobuaini

hey, can anyone help me with these comlexity problems? I tried with myself but still want some clarifications..cheer,here is the code: [CODE](a) public void printPow2(int[] values) { for (int i = 1; i < values.length; i *= 2) System.out.println(values[i]); } (b) public void maxDifference(int[] values) { int max = 0; …

Software Development algorithm java
Member Avatar for apines
0
159
Member Avatar for v30

Hey guys, I'm new here and a n00b in Java, trying to figure things out though :) I want to make a polygon move in a Java Applet but I keep struggling with the keylistener (aka it doesn't do anything) Maybe someone can help me please? Here's my code: (I'll …

Software Development java
Member Avatar for apines
0
146
Member Avatar for Phil++

Hey, I'm working on a project that writes some HTML code to a file and then opens the file up. Now, there is a lot of HTML code and I don't really want to write it all into my C# program, because I may need to change the HTML in …

Software Development html-css
Member Avatar for Software guy
0
127
Member Avatar for gahhon
Member Avatar for gahhon
0
6K
Member Avatar for batchprogram

I recently made a switch to SDL as a cross platform alternative to directly accessing DirectX or OpenGL. In an attempt to port a section of my game framework, I encounter logic errors that (to me) make absolutely no sense. In this snippet, a sprite is simply a wrapper class …

Software Development c++ opengl
Member Avatar for venomxxl
0
209
Member Avatar for Sunshineserene

Hi, I have a text file that I'm going to read, and then parse it. After parsing it, how do I return it into it's original position or layout as before? Because now after parsing it, my output is printed out individually, instead of printing it out how it looks …

Software Development java
Member Avatar for Sunshineserene
0
207
Member Avatar for Protoroll

I am writing a toString method where a it returns three integers. If any of them are less than ten I have to add a zero before the number. For example if I had the variables 5, 6, and 2 it would read 05:06:02. I really can't figure out how …

Software Development java
Member Avatar for Buffalo101
0
106
Member Avatar for Weird Nerd

Hi, I need some help with my C++ program. I've got these custom-made PlaySound(char[MAX_PATH]) and PlayMusic(char[MAX_PATH], bool) functions that use the BASS sound engine. When I call an instance of OPENFILENAME (found in the samples), the sound (.wav and .mp3) plays perfectly. My problem is that once the sound declared …

Software Development c c# c++
Member Avatar for Weird Nerd
0
329
Member Avatar for DallasFan3

Hey, Iam trying to write a java application that acts as a one-word Pig Latin translator. The program should: 1.ask the user to enter a word 2.convert the entered word into proper Pig Latin translation, (I have to use a method named translate to get the Pig Latin translation of …

Software Development apple java
Member Avatar for peter_budo
0
726
Member Avatar for testie

Hi all, Ive been working on this little piece of code down there that removes the odd numbers from a list of numbers. I get an "IndexError: list index out of range" whenever I try to run it. From what I understand, it means that l[i] is attempting to use …

Software Development python
Member Avatar for Gribouillis
0
145
Member Avatar for beatenbob

Hi all, I know this is a trivial question but I really got stuck. I keep getting "non-1value in assignment" when trying to access the pointer variable "next" using the getNext() function. It didn't show any error if I change the last 2 lines to [CODE] temp_ptr->next = after->next; //when …

Software Development c++
Member Avatar for jonsca
0
373
Member Avatar for cppgangster

Hi sorry posting as a threat here, but i cound find any other relevant secion. I have learned c++ and i want to lear c languege, and I want find good book to lear from. could anyone recommend one please? thank you

Software Development c
Member Avatar for JDevelop
0
173
Member Avatar for seekdestroy

Ok, I'm getting a little confused on how to do this. Basically i got N stacks of cards. And need to check the topCard of every stack and check that N - 1 cards match then remove them. I peeked every stack of cards to get the top card, and …

Software Development java
Member Avatar for apines
0
13K
Member Avatar for JDevelop

Dear all, First of all I must say that I have just started with C. I've been doing some Java and C# as well but not very much of them too. In my new course of C, which goes on much rapidly than one can catch something, I am given …

Software Development c
Member Avatar for JDevelop
0
325

The End.