199,114 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for Geekitygeek

In the simplest of terms, a Class is like a cookie cutter. It describes what members and methods an object should have. You use the cookie cutter (class) to make (instantiate) one or more cookies that are all the same shape. The cookies are called objects. The same way that …

Member Avatar for ddanbe
2
494
Member Avatar for OliverW

I'm adding about 25,000 objects to a vector and it's taking too long so I wanted to try and speed it up. Currently I'm adding them in the format: [CODE]vector<MyClass> MyVector; MyVector.push_back(MyClass(Param1, Param2, Parm3, Param4));[/CODE] As I understand this would involve creating two instances of the object and copying one …

Member Avatar for Clinton Portis
2
132
Member Avatar for Iam3R

i run the below code and surprised to see the o/p . take a look and let me know whats happenning there. [CODE]#define print(x) printf(#x"=%d\n",x) int main(){ int a[10]; print(a); print(*a); print(*a+1); print(*a+3); print(*a+1-*a+3); return 0; } [/CODE] Out Put: [QUOTE] [Zonnie@telnet CPz]$gcc funny.c [Zonnie@telnet CPz]$ ./a.out a=-1073745776 *a=1 *a+1=2 …

Member Avatar for ssharish2005
2
203
Member Avatar for ddanbe

Whenever you hear the word recursion, factorials or Towers of Hanoi are never far away. Well here they get mentioned, because we are not going to talk about these guys at all! Iteration and recursion are in fact quite similar: they both loop until a certain condition is met. As …

2
3K
Member Avatar for Graphix

This script can be used for star ratings on for example forum or music sites. The scriptinformation is included within the script. ~G

2
423
Member Avatar for Clinton Portis

Unfortunately in c++, there is really no good way go locate lines in your file without reading the entire file 'character at a time.' So, if you [I]have[/I] to read only a single line from a file, we know we are at some point going to have to be inefficient... …

Member Avatar for Clinton Portis
2
2K
Member Avatar for muffinhead

I'm writing a program that is supposed to be able to bubble sort data by name and by average. The data I'm given is student last name followed by 3 scores, all put into a text document. I'm to read the names and scores into their respective parallel arrays, and …

Member Avatar for Ancient Dragon
2
121
Member Avatar for roverphoenix

This program was written and tested in unix/linux environment (in EMacs editor )with a GCC compiler.

Member Avatar for Ancient Dragon
2
248
Member Avatar for ShadyTyrant

I am designing a module to perform some actions for a library database application. The methods are not implemented yet but I was wondering what you all think about nested classes in this situation. Design One [CODE=Python] #!/usr/bin/env python # File: .py # Author: shadytyrant@gmail.com # Date: 2009-11-25 # Notes: …

Member Avatar for ShadyTyrant
2
262
Member Avatar for smachee

Hi. I am new to Java and am trying to figure out a homework problem. It is a password verifier with the following criteria: [LIST] [*]at least 6 characters long [*]conatin at least one uppercase and one lowercase letter [*]should have at least one digit [/LIST] This is what I …

Member Avatar for smachee
2
3K
Member Avatar for ahamed101

Hi All, Let me explain the problem. I have multiple include files as in class1.inc, class2.inc, class3.inc etc. Contents of an include file will be like class1.inc [code=c] { "john", 12, 68, "steve", 12, 98, "mat", 12, 95, }; [/code] This will basically serve as a static array of structures. …

Member Avatar for gerard4143
2
1K
Member Avatar for klackey19

I am writing a program that sorts an array of either floats or doubles -- this is specified at compile time via a command to the compiler. I also must use void pointers. My program compiles, but when I try to run it with floats I get a "segmentation fault" …

Member Avatar for klackey19
2
308
Member Avatar for vegaseat

This code snippet shows you how to sort more complicated objects like a list of lists (or tuples) by selecting an index of the item to sort by.

Member Avatar for Ene Uran
2
375
Member Avatar for Stefano Mtangoo

When you add a page in CMS (Like Wordpress' admin) what does it actually do? Add predefined table? Or what? Thanks!

Member Avatar for Atli
2
100
Member Avatar for StaticX

Hi, i am making a program that contains an integer array of an unknown size.The user is prompted to enter numbers into the array,and press 'x' to exit. What i am going to do then,is to pass the array from the main into a class which contains another array,but before …

Member Avatar for VernonDozier
2
127
Member Avatar for mrPaul

Hello daniweb peeps, been learning c++ from a beginners book for the past week or two but have got myself a bit confused, follows is the code that compiles but isn't doing what i want it to (Im hoping the fault is obvious!) [code] #include <iostream> using namespace std; int …

Member Avatar for mrPaul
2
108
Member Avatar for johnyjj2

Hello :-)! [quote]SUMMARY: How to run pocketsphinx_continuous on mobile phone with Symbian, and how to do it with simulator of mobile phone with Symbian. PocketSphinx can be downloaded for free here, for both Linux and Windows: [url]http://cmusphinx.sourceforge.net/html/download.php[/url] .[/quote] ------------------------------------------------------------------------------------------------------------ SHORT EXPLANATION I'd like to create application for mobile phone and …

2
246
Member Avatar for RoyMicro

Suppose in my one particular piece of code, I am avoiding loops. ie instead of providing 'for' loop to do the task , I am copying and pasting a part three or four times to make it simple (?)to code. In this case what are the consequences of my action? …

Member Avatar for RoyMicro
2
90
Member Avatar for mu42774

Hi, would someone please help me with the following: I would like to implement the Round-Robin scheduling algorith for the below code. I am really facing a problem whenever i try to implement Round-Robin scheduling algorith in this code. Your prompt action and support is highly appreciated and I am …

Member Avatar for Johny cash
2
2K
Member Avatar for RoyMicro

Hello There seems to be different methods to create a text file in C#. I am getting a byte array from USB device. I need to store this as text file which is to be read, updated, and saved for future usage. The data comes in different packets not in …

Member Avatar for Geekitygeek
2
191
Member Avatar for lisedaton

hi all!!, can somebody help me?? I need to do a program that scan a decimal, transform it to binary and check if it is palindrome or not and print "palidrome" or "not palindrome".... i can only use functions and cant use arrays or anything else! can somebody help me??? …

Member Avatar for flipjoebanana
2
1K
Member Avatar for Ineedhelpplz

So everything in my program works except for the main itself. The program is supposed to take in a file provided through standard input and print out the descending order of words followed by the frequency that they occur. I can do this individually line for line but am having …

Member Avatar for Ancient Dragon
2
157
Member Avatar for confusedndazed

Pseudocode is still somewhat confusing and I've been reading and this assignment for the a while now and I wanted to make sure I am understanding what's being asked of me. Could someone please tell me if my pseudocodes are correct? Question: 1. Using pseudocode declare a Real number named …

Member Avatar for Tales
2
102
Member Avatar for paddowan34

My teacher gave us an assignment where she wanted us to write a program that would read test score data from a text file,drop the lowest test score,average the other three test scores, and output the data to a text file. I've spent three days trying to figure out how …

Member Avatar for StuXYZ
2
119
Member Avatar for userits

[CODE]include<stdio.h> void main() { int i=5; int c; c=i++ + ++i + i++ + --i; printf("\n%d",i++ + ++i + i++ + --i); printf("\n%d",c); }[/CODE] The o/p that I'm getting is 31 23 while my friend got 34 20. Also why are the 2 (printf ' c 'and printf 'expression') values …

Member Avatar for Aia
2
141
Member Avatar for rt.arti

Hello All! I have been working on a network design problem and am having a problem in the following part- What I am trying to do here -- { for every set of edges (a,b), { for all arcs (l,m) assign length of -- arc [l,m] = edge [a,b][l,m] shortest_path …

Member Avatar for dkalita
2
115
Member Avatar for aman rathi

hello i am a student of sgrrits dehradun doing bca now a days my pointers chapter is going on its difficult to understand but mostly i did it but i want to know that how it is use ful for us in the c. i only find its 1 benefit …

Member Avatar for jbennet
2
118
Member Avatar for leeba

I am trying to write a program that reads a string and shortens it if the letters are in a row. For instance abcdghigjhkhdf becomes a-dg-igkhkhdf. I want that it erases the ;etters it erases but it is not working. HEre is my code: [code] #include <stdio.h> #define MAXSTRING 100 …

Member Avatar for kommuru
2
67
Member Avatar for AuSsIeStOnE

[B]fseek()[/B] and [B]ftell()[/B] work only for files < 2,147,483,647 bytes [B]fseeko64()[/B] and [B]ftello64()[/B] from [B]<stdio.h>[/B] can deal with files up to 18,446,744,073,709,552,000 bytes the printf format for unsigned long long val is [B]%I64d[/B] eg. Obtaining the file dimension (this code was tested with [B]GNU GCC compiler[/B] (MinGW/Cygwin) from code::blocks)

2
488
Member Avatar for vampgirl13

Hi, I was wondering if anyone can help me translate this into java. Thanks [CODE]#include "Element.h" #include <stdlib.h> element * Element(int s1, int w1, double c1, int x1, int k1) { element * retval = malloc(sizeof(element)); retval->s = s1; retval->w = w1; retval->c = (float) s1 / (float) w1; retval->x …

Member Avatar for vampgirl13
2
112
Member Avatar for richman0829

I got not one but two good answers to my last question, which was how to make a function that would both create an array and fill it. I was surprised to find that the first one of them was so simple - I had been making it harder than …

Member Avatar for richman0829
2
86
Member Avatar for power_computer

I have a linked list containing the following data struct node { string name; int hours; node* next; } I have all function I've made so far working, adding indiviual node, deleting node, printing data in nodes, Ive made the program to read from a file upon execution to create …

Member Avatar for power_computer
2
1K
Member Avatar for harshchandra
Member Avatar for Wong23

I am given the class definition of stack and queue classes where I have to write a templated function called reverseQueue(?) that takes a pointer to queue as a parameter and uses stack object to reverse the given queue. The function call to reverseQueue should reverse the data of the …

2
229
Member Avatar for pythopian

PlugIns in their simplest form can be just python modules that are dropped into some designated directory and dynamically loaded by the main application. This snippet can be used to do just that. [B][U]Usage[/U][/B] To load plugin modules: [CODE]>>> plugins = importPluginModulesIn('mypackage') >>> plugins {'foo': <module 'foo' from 'mypackage\foo.py'>, 'bar': …

Member Avatar for pythopian
2
828
Member Avatar for Ancient Dragon

This demonstrates how to get a list of your computer's logical drive letters under the MS-Windows operating system.

Member Avatar for Ancient Dragon
2
929
Member Avatar for pythopian

This is one simple way to emulate a singleton class on behalf of a normal class. (A singleton class is a class with at most one instance.) The implementation does not emulate a class 100% (for example it lacks the special attributes lile __dict__ or __bases__), but it should be …

2
235
Member Avatar for vinnijain

Hi!!!!!!! I have made a window application in which i am entering mathematical equations and side by side the corresponding math format is generated like we see in books. In this, I am using LATEX/MimeTEX for generating math format and it uses special symbols for generating math format. Like for …

Member Avatar for Geekitygeek
2
555
Member Avatar for vinnijain

I have made a project and now when it comes to designing I could not find any better way. I searched google and found certain applications which have already made user controls like silver panel,navigation bar etc........ Now can anyone tell me how can I use these user controls from …

Member Avatar for vinnijain
2
171
Member Avatar for Jx_Man

This is code for Encrypt and Decrypt. this a simple logic of encryption. Please leave comment or feedback if this code helps you. Thanks. Jery. :) the encrypt function place in a module. This Code needed : 1 Module 1 combo box (For input before encryption) text1 in this program …

Member Avatar for MATRIX123456
2
1K
Member Avatar for Loved

Hi, I am fairly new to java and have been playing around with scanners and while trying to understand this problem I am running into an error "Non-static variable vacation cannot be referenced from a static context" Obviously this isn't quite a completed program, but I am not sure why …

Member Avatar for Loved
2
165
Member Avatar for Nitricity

Hi ive been experimenting with basic calculations and using scanf to be able to enter an integer, if i give numb_1 a value it will divide and calculate the remainder fine but i cant get it to work by being able to enter a number, it just sits on the …

Member Avatar for Nitricity
2
151
Member Avatar for fortex

Hello everyone, right now I'm taking a java class, and I'm having one error in my app. Right now I have to .java files, one which calls the methods from another .java file. When I compile the first java file, it doesn't give me any error. But when compiling the …

Member Avatar for BestJewSinceJC
2
149
Member Avatar for newsguy

Mobile developers will be pleased to learn that Recursion Software has announced the availability of a C++ Toolkits Symbian bundle. The cross-platform, mobile and embedded app development tools specialist took the opportunity at the CTIA Wireless IT and Entertainment Expo 2009 to announce that C++ libraries for the iPhone and …

2
356
Member Avatar for ddanbe

Start a new Forms application. Drop a Panel and a Timer control on it. Set up a Timer_Tick, Form_Load and a Panel_Paint eventhandler and fill in the code. Run the app and watch the string rotate.

Member Avatar for Diamonddrake
2
1K
Member Avatar for programmingnova

Hello, I've been programming with C++ for only several weeks now, but I have come across a practice problem that has given me trouble. The objectives: collect data from a student including: his major (CIS or Math), last name, number of credits completed, GPA, and tuition paid. Then calculate and …

Member Avatar for programmingnova
2
134
Member Avatar for theo19

[CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calc extends JFrame implements ActionListener{ JFrame frame; JPanel textfield1,textfield2,rowpanel,calcb,mainpanel; JTextField display; JButton[] b; public Calc(){ frame=new JFrame("Calculator"); textfield1=new JPanel(); textfield2=new JPanel(); display = new JTextField(16); mainpanel = new JPanel(); textfield1.setLayout(new GridLayout(4,6)); textfield1.add(display); textfield2.add(textfield1); //array String[] cbuttons = {"7","8", "9","/", "4", "5", …

Member Avatar for BestJewSinceJC
2
191
Member Avatar for DdoubleD

Quite a few people have been asking how they can get their applications to talk to each other. More specifically, they have been wanting to know how to access information from another running application using .NET Remoting. Not having done this before, I decided to take up the challenge and …

Member Avatar for ddanbe
2
1K
Member Avatar for Daithi

I'm stuck on the very last part of a problem. [I] You've bought a square plot of land on ebay and you now want to plan how to develop this land. The trouble is, you've never been there. All you have is the engineer's terrain report which is an NxN …

Member Avatar for VernonDozier
2
141
Member Avatar for gibson.nathan

alright here are my instructions: [QUOTE]Display a menu giving the user a choice of character sets to use to construct the password. (Note: Do not use the first range of punctuation symbols with ASCII values from 33--47). 4. Allow the user to select the number of characters in the password …

Member Avatar for VernonDozier
2
1K

The End.