43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for BestJewSinceJC

I'm having trouble with storing bits as a byte. I've read probably 30 different sources about this already. I'm doing Huffman Compression. Lets say I read in the character "c" and I am supposed to output "1010". How would I go about doing that? I know how to write bytes …

Software Development java
Member Avatar for BestJewSinceJC
0
135
Member Avatar for FlamingBlade

I can't figure out how to display a local webpage. I've tried messing with the webBrowser control but it keeps adding "http://" to the front of the local webpage address, and if I try to change it from within the code like this: [code=C#]webBrowser1.Url = "file:\\webpage\Maphs v1.htm";[/code] I get the …

Software Development
Member Avatar for FlamingBlade
0
165
Member Avatar for sid78669

I was going through walkthoroughs as a practice for my final and i came across this question. Although i was able to do it correctly, I was not able to get the presence of a colon in one of the lines(line 35): [CODE] #include <iostream> using namespace std; class base{ …

Software Development c++ os-x
Member Avatar for jbennet
0
151
Member Avatar for RaDeuX

Okay, so my program is very close to completion. The only problem is that the program leaks memory. The deleteNode, deleteManager, and destroyList are the ones to blame, or so I think. When I delete a node other than the first one it works while leaking memory. However, when I …

Software Development c linked-list
Member Avatar for Salem
0
174
Member Avatar for Sgtplank

Hi, ive got to make a program to find the perimeter and area of a triangle made using vectors, and i have not a clue, ill post the code i have done so far and if any1 could give me the code for the area and perimeter you would be …

Software Development java
Member Avatar for stephen84s
0
310
Member Avatar for Vallnerik25

I have a few questions about c strings, string literals, c++ string objects and how pointers and constantness all come together. I am wondering why a c string can be set like this but can't be changed dynamically with an assignment operator like this. [CODE] char str [] = "string1"; …

Software Development c c# c++ legal
Member Avatar for Vallnerik25
0
189
Member Avatar for MrDiaz

I'm trying to create a simple program that will check for any given number (an ID) provided by the user and check this ID with an array of numbers inside my program. If the correct ID is given, it will display "Valid ID" if the ID provided by the user …

Software Development java
Member Avatar for MrDiaz
0
130
Member Avatar for happymadman

How do you assign a random int to a variable more then once say i use this code [code] import random x = 1 while x == 1: random = random.randint(1,100) print random raw_input ("Push <enter> to print another random number") [/code] It will print out the first random number …

Software Development python
Member Avatar for happymadman
0
232
Member Avatar for Erikmmp

Hi everyone, I am trying to make a program that times how long it runs for in seconds or milliseconds or whatever. The unit of time doesn't matter, I just need to know if C has any function I could use to do this. So, just as an example, I'm …

Software Development c
Member Avatar for Erikmmp
0
127
Member Avatar for MC Rove

I am taking a intro programming course currently. I am stumped by my current assignment. The program is suppose to do the following using functions only (no other code allowed in main): 1. Get data from an input file and put into a parallel array. 2. Find and display the …

Software Development c++
Member Avatar for vmanes
0
80
Member Avatar for mrjoli021

I am trying to write a program that will monitor my routers and servers and notify me when they go down. I am looking for a way to ping the host and read the reply. The InetAddress.isReachable method is the only thing i could find but it uses the echo …

Software Development java
Member Avatar for darkagn
0
164
Member Avatar for jcafaro10

Hey all, What does it mean when you get an error that says ImportError: no module named main. I wasn't aware I was trying to import a module named main. I don't even have a module named main. I'm using Jython and I'm reflecting on an instance of a python …

Software Development python
Member Avatar for jcafaro10
0
5K
Member Avatar for lllllIllIlllI

Hi guys, I was making a program yesterday that would send an email using the email modules of python as well as the smtp module. My problem is when i put it into an exe using py2exe and vega's code snippet setup i get some problems. This is the error …

Software Development python
Member Avatar for lllllIllIlllI
0
2K
Member Avatar for Blackeagle

Hello, i'm working on netbeans and want to access my database using this code: [CODE=java] import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class connect { /** * @param args */ public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (Exception ex) { System.out.println("error \n"); …

Software Development java java-netbeans mysql
Member Avatar for Blackeagle
0
401
Member Avatar for kyosuke0

the program i have to write involves a dynamically linked stack to evaluate if the grouping symbols '[B]([/B]' , '[B])[/B]' , '[B]{[/B]' , '[B]}[/B]' , '[B][[/B]' , '[B]][/B]' in expressions are balanced. The expression is input through keyboard. For example: expression: {A+(B-C)*D} is balanced expression: T+{(R+M)/G-V*L is not balanced expression: …

Software Development c++
Member Avatar for kyosuke0
0
202
Member Avatar for xlx16

hello again i have three questions again: how can i use malloc or calloc for a two demontional arrays? is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation? the third question which is a bit irrelevent to programming how memorey locations …

Software Development c
Member Avatar for Salem
0
371
Member Avatar for kodak

I have developed a program in an XP enviroment using Borland Builder 6. It has since been installed on a computer with Vista. The program opens text files which are stored in the root directory of the program. The pathname is set in global constants like "name.txt". This works fine …

Software Development c++
Member Avatar for kodak
0
122
Member Avatar for VBNick

hi, I have used LoadImage() to load a bitmap as HBITMAP. If I use SelectObject() to attach it to an HDC, and then BitBlt() it to the screen, that works fine. I need an array that would be compatible with the one produced by CreateDIBSection(). I have tried GetBitmapBits(), and …

Software Development c++
Member Avatar for VBNick
0
475
Member Avatar for tomtetlaw

Im testing out blit() and i ran into this error: [code=python] Traceback (most recent call last): File "/home/tom/Desktop/pygame/test/main.py", line 15, in <module> screen.blit('image.jpg', (10,10)) TypeError: argument 1 must be pygame.Surface, not str this is my code: import pygame pygame.init() running = 1 while running == 1: screen = pygame.display.set_mode((800, 600)) …

Software Development python
Member Avatar for tomtetlaw
0
2K
Member Avatar for koa636

error message cannot find constructor `lottery(int[])` import java.util.Random; public class Lottery { private final int NUM_DIGITS = 5; private int[] lotteryNumbers = new int[NUM_DIGITS]; private int[] userNumbers; private int matches; public int[] getLottery(int[] l) { // Create an array the length of l. lotteryNumbers = new int[5]; // Random object. …

Software Development java
Member Avatar for Ezzaral
0
115
Member Avatar for gothicmisery85

I am working on a program, and I can't figure out what I'm doing wrong. Any help would be appreciated. Here is what I have to do: [b] Write a procedure named St_concat that concatenates a source string to the end of a target string. Sufficient space must exist in …

Software Development algorithm assembly
Member Avatar for crunchy_frog
0
3K
Member Avatar for meistrizy

Hello. Thanks in advance for helping a newbie. I am supposed to add a bottom loop (which I assume is a do while) that asks the user if he/she wishes to compute another series and as long as the answer is 'Y' or 'y' to iterate the loop until 'n' …

Software Development c++
Member Avatar for meistrizy
0
59
Member Avatar for gm999

Hi guys, I'm quite new to C++ and I'm having problems with a simple operation. I have to resize an array of structs, but seeing as I am having a problem with the concept, i'll post an example with a simple array of integers. Please bear in mind that this …

Software Development c++
Member Avatar for gm999
0
88
Member Avatar for stephen lowry

hi guys i have fairly good knowledge of vb6 but cant for some reason get my head around this i want to develop program where you can add multiple names (text string) then press generate and a name is randomly selected for quiz purpose , the name or string dos'nt …

Software Development visual-basic
Member Avatar for stephen lowry
0
79
Member Avatar for karang

Hi I have a virtual function setStartupDirectory() virtual bool setStartupDirectory(const SysString &sStartupDirectory) = 0; When I am calling this function setStartupDirectory((const SysString &)m_pApplicationFolderNarrow); I am getting this error Error 2 error C2664: 'setStartupDirectory' : cannot convert parameter 1 from 'const SysString' to 'const SysString &' Am I missing something

Software Development c++
Member Avatar for sweeya
0
129
Member Avatar for murderotica

Hello there, I've been working with threads right and I'm kinda stuck with how to implement the BackgroundWorker while I drop a lot of files in my form. I'm having a hard time how to arrange my code, specially on how to deal with the DoWork event of the BackgroundWorker …

Software Development
Member Avatar for LizR
0
110
Member Avatar for Jwhispers

I had to write a program to add two angles together. I've got the meat done, but i'm having a hard time figuring out how to code the program when i add the angles together so that when say Seconds is more than 60 it adds 1 to minutes. example: …

Software Development c++
Member Avatar for Jwhispers
0
265
Member Avatar for namehere05

Ah right! Im on my first steps on c++, What Im trying to do is have this "basic node" class wich just take an id and from there usign inheritance make "linked list node" and "binary tree node" classes my code so far looks like this [CODE]void main() { sLink* …

Software Development c++ linked-list
Member Avatar for namehere05
0
113
Member Avatar for Awebb999

I just learned about bubble sort and still don't know how to make it work in my program I hope someone can help me. This is my task I should use parallel arrays (of size 20) for student name, student number, test score, and letter grade. The list must be …

Software Development c++
Member Avatar for Awebb999
0
152
Member Avatar for cherryteresa

Hi there. I had to make a code to print out a Pascal Triangle. But I'm not getting it to display properly. For example, if the user types in 4, then it will print: 1 1 1 2 1 3 3 But it should print 1 1 1 1 2 …

Software Development c++ pascal
Member Avatar for cherryteresa
0
293
Member Avatar for teddybouch

This one's got me really confused, but hopefully y'all will see something I can't for lack of experience and expertise. The following segment of code is part of a larger function that performs a Hough Transform on a series of coordinates to find lines described by the points. I'm looking …

Software Development c++ linked-list
Member Avatar for teddybouch
0
122
Member Avatar for VirusTalker

[ICODE] public static boolean member(Integer obj,SimpleList<Integer> l); // returns true if obj is a member of l, false otherwise { }[/ICODE] the question is how could I use recursion to show that there is a member of a list? I thought that maybe if (l.isEmpty()) {return false} else ? thanks

Software Development java
Member Avatar for VirusTalker
0
108
Member Avatar for Martin88

Hey hi I have a problem with to C++ programs for my final project, the problem is that i tried to make the code but first the C++ program say general protection exception i read some of this but i still think that the structure of my program is not …

Software Development algorithm c++
Member Avatar for Martin88
0
201
Member Avatar for Freaky_Chris

Hi, i'm doing some work with double atm and i have what appears to be a simple expression. When i work this out in my head i get the answer to be 0. However running the code gives me a very obscure value -5.77338e-017 Any help as to what i …

Software Development c++
Member Avatar for StuXYZ
0
263
Member Avatar for teddybouch

I'm having trouble with passing a linked list between functions. I did some research online and found a few things, one of which was here, that led to the conclusion that I am not passing my linked list by reference. However, I have tried numerous different syntaxes to do this, …

Software Development c++ linked-list
Member Avatar for teddybouch
0
116
Member Avatar for Dewey1040

I know there are multiple threads on Matrix Multiplication but all of them are either different from what i need, or are unanswered. I am trying to multiply two N x N matrices. The two matrices and N are all found in a file via argv[1]. I have spent hours …

Software Development c matrix-multiplication
Member Avatar for Dewey1040
0
151
Member Avatar for NinjaLink

Hello all, My objective is simple. I have to take in 2 positive integers and multiply them by using addition. This is a recursive problem. Example of Output: [B]Please enter 2 positive integers to multiply: 4 2 4 * 2 = 8[/B] The problem is whenever the user types in …

Software Development c++
Member Avatar for mrboolf
0
756
Member Avatar for lmastex

Hi. Can you guys help me out with this link list method. The method issuppose to say if a list is in ascendent order or descendent order. I have this right now: [CODE] template <typename ListElement> int List <ListElement>::order() { NodePtr temp1; NodePtr temp2; temp1 = Head; temp2 = temp1->Next; …

Software Development c++
Member Avatar for lmastex
0
136
Member Avatar for acperson

[B]*When I compile the program it works. However, when I try to run the program, it outputs the first message then gives me the following error-*[/B] CSCI112LAB2.exe has encountered a problem and needs to close. We are sorry for the inconvenience. [B]*And when I tried to debug it*[/B] Unhandled exception …

Software Development c++ visual-studio
Member Avatar for acperson
0
2K
Member Avatar for StarZ

i have just been learning python(tuple) at school. And this is my first assignment. I can't seem to figure it out. The assignment is on this website: [url]http://schools.tdsb.on.ca/danforthcti/python/main.html[/url] Go to lesson 8>scroll down>its called programming Assignment 9. Can someone help me out? It's simple enough right? thank you!

Software Development python
Member Avatar for vegaseat
0
162
Member Avatar for Dewey1040

I have searched google and the forums here and I couldn't find what i need, if there is a thread somewhere just forward me to it. I am attempting to create a program that will prompt a user for a string. The program will not recognize this string to be …

Software Development c
Member Avatar for Dewey1040
0
206
Member Avatar for kiddo39

I have a small image with a black background and red lines in it and I need to count the red pixels. I know I need PIL, but I'm not sure which method to use. Then once I have the counts I need to equate them to a character, so …

Software Development image python
Member Avatar for vegaseat
0
2K
Member Avatar for acperson

I wrote a program for a class assignment that is supposed to use random number generator to produce sentences. The program has to use four arrays of (pointers to char) and each chosen word must be concatenated to the previous words in an array that has to be able to …

Software Development c++
Member Avatar for acperson
0
3K
Member Avatar for ITlang007

Hi everybody, I'm really new to java and I'm not sure how to do this, //Create an ArrayList of String type to hold first names of the students I created mine like this.... ArrayList<String> first = new ArrayList<String>();

Software Development java
Member Avatar for ITlang007
0
145
Member Avatar for ctaroz

can somebody help an old man? I started to study Python and I'm OK with IDLE. But I cannot understand how to use it as a server language with my local server Xitami (that I use very well with PHP). Please help me: I need very clear instructions Thank you, …

Software Development python
Member Avatar for ctaroz
0
171
Member Avatar for dr.eu

Hi! I have to write program, who print Triangle made with numbers from 1 to 9,like this: 1 21 321 4321 54321 654321 7654321 87654321 987654321 I wrote code: [code] #include <iostream.h> #include <stdlib.h> int main() { int first, last; cout << endl; for (first = 1 ; first <= …

Software Development c++
Member Avatar for dr.eu
0
181
Member Avatar for polo_coins

I discovered that there is a such class like StringBuilder but I don't find any thing that convince me to use it. Explain me it's advantage and disadvantage and if you gave some examples I like to see them thanks a lot Sergey

Software Development
Member Avatar for polo_coins
0
85
Member Avatar for Demonisya

Hello..... I want to ask you something..... My teacher gave us our final exam last October 16 & 17.... I want to ask you about this question: Create a program that could show this output * *** **** ****** using while or for..... what I put in my answer sheet …

Software Development c
Member Avatar for Demonisya
0
174
Member Avatar for pochacco

#include <iostream> using namespace std; int main() { double num_one, num_two, num_three, num_four, num_five, num_six, num_seven, num_eight, sum, product, average; char ans; cout << "Please enter eight numbers: "<< end; cin >> num_one >> num_two >> num_three >> num_four>> num_five >> num_six >> num_seven >> num_eight; cout << "The sum …

Software Development c++
Member Avatar for Salem
0
127
Member Avatar for benji_k

Help! I'm trying to solve a quadratic equation I keep getting the error : term does not evaluate to a function taking 1 arguments Heres the program. I highlighted the problem line // Macros 3 - finding the root of a quadratic equation // ax^2 + bx + c --> …

Software Development c++
Member Avatar for benji_k
0
145

The End.