132,726 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for lirexin

I just wondering is there any possible way to use rand() in a function to generate a random? #include<stdio.h> #include<stdlib.h> #include<time.h> int get_random(void); int main(void){ int i; for(i=0;i<=5;i++){ printf("%d\n",get_random()); } return 0; } int get_random(void){ srand((unsigned)time(NULL)); int x; x = rand()%2; return x; } I run above code and generate …

Software Development c
Member Avatar for [Alpha]-0mega-
0
170
Member Avatar for herberwz

please me on how to insert a picture am new to netbeans [CODE]package LibraryDatabase; import static javax.swing.JOptionPane.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class PostLibraryDatabase extends JFrame implements ActionListener { JTextField firstName, surName, id, serialNumber, category, dateToday, coverTitle, isbnNumber, authoursName, coAuthoursName, pubDate, loanDate, returnedDate, email, details; JButton writeBtn, displayBtn, …

Software Development gui java java-netbeans java-swing
Member Avatar for herberwz
0
157
Member Avatar for DARK_BYTE

Hi I successfully wrote a program that keeps sending data from client to server and from server back to client where the client prints the data. But now I'm trying to write one whereby the user enter numbers at the client and they are sent to the server whereby they …

Software Development client-server java socket-programming
Member Avatar for JamesCherrill
0
103
Member Avatar for clarkeboy

How Can I use Clear screen and jump to next line?? like for example. press enter y for yes and n for no to proceed to next line and next screen.

Software Development c++
Member Avatar for GuitarComet
0
190
Member Avatar for danholding

hey guy n girls i hope one of you can help me with this. plan of action is to : create a python script to... sort a list of files from a directory into sorted list with most recent modified date at the top. then I want to get rid …

Software Development python
Member Avatar for danholding
0
204
Member Avatar for Xufyan

Is it possible to call a constructor if we entered know value in the output screen ??? example !! [CODE]import java.io.*; class Employee{ int num; static int count=0; float compensation; public void print(){ System.out.println ("Employee number: " + num + ", Employee Compensation: $" + compensation); } public Employee(){ num …

Software Development java oop
Member Avatar for group256
0
194
Member Avatar for bdell11

I am in the middle of a project where I use four different folders containing all .wav files. Depending on the results of a sign on (ID) I want to use one of the four files. I am using the results of that sign in a "if..then" comparison to determine …

Software Development visual-basic
Member Avatar for AndreRet
0
189
Member Avatar for Tweed

Alright I am going to try to put this in the least confusing way possible. I have a form that contains multiple textboxes. These textboxes are initially disabled and their text has been grabbed from a file that has been read in. No problems yet. There are 20 lines that …

Software Development vb.net
Member Avatar for codeorder
0
607
Member Avatar for rajasekhar1242

hi , i am trying to develop one jsp application with tag concept on netbeans tool. but i am getting this error "According to TLD or tagfile, Attribute uri is mandatory for tag dbquery " . i could not run my application due to this error. In Jsp file i …

Software Development java java-jsp java-netbeans xml
Member Avatar for rajasekhar1242
0
176
Member Avatar for prem2

Hi, I have a doubt in overriding the methods in java. Sample program For overriding .This program executes fine. [code] import java.io.*; import java.util.*; class one { public void show(){ System.out.println("I am in class one-Super Class"); } } class two extends one { public void show(){ super.show(); System.out.println("The subclass two"); …

Software Development java
Member Avatar for tong1
0
101
Member Avatar for NewbyChic

Alright, Ive moved onto my next mission. I have to draw a set of four triangles using for loops. I have the first two done, the second two have to have spaces prior to printing the asterisks. example: ***** **** *** ** * * ** *** **** ***** This is …

Software Development java
Member Avatar for javaAddict
0
178
Member Avatar for alkeshnayak

Hi All I have some image file. and i want to make my own OCR (Optical Charactor Recognised) Software. Please tell me which control i use. Sorry For My Bad English Thanks In Advance

Software Development image visual-basic
Member Avatar for vb5prgrmr
0
86
Member Avatar for aquarian

hi to all, can anyone plz send me the source code of apriori algo in vb / vb.net

Software Development algorithm vb.net
Member Avatar for codeorder
0
251
Member Avatar for Orphæus

Hi all! I am making a TimeCard application and I got stucked.. Anyway, the program looks like this: the user inserts date,start hour and finnish hour into 3 textboxes. On the fourth textbox it will show how many hours he has spent. I am using StreamWriter to save the data …

Software Development vb.net visual-basic
Member Avatar for codeorder
0
120
Member Avatar for archana.c07

Hi all, I am trying to implement singleton class having static method. my requirement is as below: A.h Class A{ Public : Static A* getInstance(); } B.cpp #include A.h Class B : public class A{ A* A::getInstance() { //some code. Return *A } } D.cpp #include B.h A* pter = …

Software Development c++
Member Avatar for archana.c07
0
101
Member Avatar for potato4610

[CODE]#include <stdio.h> int MyStrlen(const char *si); int main() { char str[] = "a"; char str1[] = "HELLO"; char str2[] = ""; printf("Length: %d \n", MyStrlen(str)); printf("Length: %d \n", MyStrlen(str1)); printf("Length: %d \n", MyStrlen(str2)); return 0; } int MyStrlen(const char *si) { int input; for(input = 0; *si; si++) input++; return …

Software Development c
Member Avatar for potato4610
0
447
Member Avatar for painejake

Well I recently got my new Mac and with previous knowledge of C# decided to start playing about with Cocoa. I am trying to make a simple application that on button press will show in a textbox or label 1 of say 5 sentences pre-coded. If anyone could point me …

Software Development c
Member Avatar for Adak
0
96
Member Avatar for abu taher

when a datareport show, there has a button to print the page manually. I want when I click the button (to show the data report,it will not show), the page print directly. I don't want to show data report and don't click that button (print) in this page.

Software Development visual-basic
Member Avatar for abu taher
0
147
Member Avatar for abu taher

some data entry in some field. like: ID name amount 01 taher 100 02 kamal 200 01 taher 500 I don't know what data entry in field. in my vb project i have some textbox. I want one textbox show the Id: 01 and other text box show the (total …

Software Development visual-basic
Member Avatar for abu taher
0
85
Member Avatar for Marc.Gauthier9

Hello, I am working with form having multiple tabpages. I need to set the focus on first textbox of all tabpages. I tried to declare the following when the form loads, but only txtbox1.select() is working. Private Sub frmMaintab_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load txtbox1.select() 'First …

Software Development vb.net
Member Avatar for codeorder
0
470
Member Avatar for abu taher

in my project man can entry their income or expenses. like: paper sale, pencil sale etc. they entry it like: paper $200.00, pencil $100.00. they also made a group or category. here they entry paper and pencil under 'sales' group. so every thing depend on user. here I want the …

Software Development visual-basic
Member Avatar for abu taher
0
84
Member Avatar for abu taher

when i want to link a child command with parent command (in data environment) then show this massage. but i make a relation with same field. then why show this massage. nb: i write sql in command.

Software Development visual-basic
0
54
Member Avatar for keanoppy

Hi all...i'm currently trying to manipulate strings from tokens. may i know how to eliminate a char from a token without splitting it?Below is some code that i tried.How can i eliminate a certain word after the tokens are set? [CODE] package autotextsum; import java.util.*; import java.util.StringTokenizer; public class AutoTextSumm …

Software Development java
Member Avatar for keanoppy
0
260
Member Avatar for sawant_nitesh

Why this code fails.... ? [CODE] String a = "abcd/dgws"; a.replaceAll("/", "\\"); [/CODE] it results in ...... Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(String.java:558) at java.util.regex.Matcher.appendReplacement(Matcher.java:696) at java.util.regex.Matcher.replaceAll(Matcher.java:806) at java.lang.String.replaceAll(String.java:2000)

Software Development java regex
Member Avatar for sawant_nitesh
0
315
Member Avatar for Denxerator

Is there such a code when activated will create a new window and display a text file? Like e.g. (You open the debug), there is a button. If you click the button, a new window pops up and displays a certain text file on the hard drive. P.S. I am …

Software Development hard-drive vb.net visual-basic
Member Avatar for codeorder
0
2K
Member Avatar for tedtdu

Assumming that program name is "XML.java", I need to perform the followings for each input file in command line--without running the code for every test file: java Xml < input1.txt java Xml < input2.txt : So My Code IS: [CODE]BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));[/CODE] [CODE]String fileName = bf.readLine();[/CODE] [CODE]File …

Software Development java xml
Member Avatar for tedtdu
0
133
Member Avatar for Garee

I am trying to assign variables in my array diveScore using a for-each loop. However, I don't understand why it isn't working and every element is 0.0 after the loop has ended. Eclipse is showing no errors so I am sure there is something wrong with my logic. Thanks. [code=java] …

Software Development java
Member Avatar for jon.kiparsky
0
114
Member Avatar for TrueVb.NetNoob

Hi Guys! I wanna ask questions about the code [CODE]Me.hide[/CODE] I have a button to switch between two forms, and I used the me.hide code to perform the action. However When I exit the program, the debug is still on, meaning that the form which I hide is still running. …

Software Development vb.net
Member Avatar for codeorder
0
590
Member Avatar for mrkaran

i have a piece of code: [CODE] struct myKeyword { string name; int id; }; myKeyword keywords[]={{"include",INCLUDE}, {"void",VOID},{"main",MAIN},{"int",INT},{"float",FLOAT},{"cin",CIN},{"cout",COUT},{"if",IF},{"elseif",ELSEIF},{"else",ELSE},{"exit",EXIT},{"for",FOR},{"while",WHILE}}; int j=0; cout<<keywords[0].id; //not able to access keywords.id part flag=0; for (j=0;j<11;j++) { if (lexeme==keywords[j].name) { temp->assign(lexeme,keywords[j].id); flag=1; break; } } getchar(); }[/CODE] why cout<<keywords[0].id is not working? thanks in advance

Software Development c++
Member Avatar for mrnutty
0
129
Member Avatar for vbx_wx

How can i demonstrate that inline functions have internal linkage ?

Software Development c++
Member Avatar for mrnutty
0
101
Member Avatar for gallantlex

Firstly, Here's my code running in VS 2010 [CODE=c] #include <iostream> #include <fstream> #include <string> #include <list> using namespace std; class Student { friend ostream& operator<<(ostream&, Student); friend istream& operator>> (istream&, Student&); private: int stuId; string name; int gpa; public: Student(int, string, int); int getStudId(); }; ostream& operator<<(ostream& out, Student …

Software Development c++ ios
Member Avatar for gallantlex
0
968
Member Avatar for QB_Pete

I need to install something called .Net Framework. I have checked several sites on Microsoft and this issue is as clear as mud. There is a file called dotnetfx.exe that is supposed to be able to install the .Net Framework to my Windows 98. (I have an 8K console application …

Software Development asp.net microsoft microsoft-windows vb.net
Member Avatar for codeorder
0
1K
Member Avatar for ak_barik

When runnning scapy from command prompr (windows XP), the output cannot be stored. When the following command is executed in command prompt: scapy >C:\dir.txt The following error shows up: C:\automation\atg\GeneralFiles?_AC\ScapyExe?>scapy >C:\dir.txt INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import PyX. Won't be able …

Software Development file-system python
Member Avatar for Beat_Slayer
0
449
Member Avatar for farahlyna

In C a structure is passed to a function by value. This means that the structure valued is copied for processing in the body of the function. Therefore any changes made to the value by the function would not give any effect on the value of the structure Any idea …

Software Development c
Member Avatar for gerard4143
0
126
Member Avatar for creeps

I'm trying to validate a day of the month, so that if the user enters a negative value or a value above 31, the program prints an error message and prompts for another day. The code below doesn't work as expected. Instead, it gets caught inside an infinite loop, printing …

Software Development c
Member Avatar for Adak
0
331
Member Avatar for Xufyan

I've a assignment question, A point on two dimensional plane can be represented by two numbers: an x coordinate and y coordinate. Eg (4,5). The sum of two point can be defined as a new point whose x coordinate is the sum of the x coordinates of two points similarly …

Software Development java
Member Avatar for Xufyan
0
125
Member Avatar for sepadl71

hi to all I'm a c# programmer i have a 1 question : how can i send data to controls of other application windows?? for example : how can i send & received message with C# to this windows ??? [URL="http://aks98.com/images/pkwp4j2ye0ze1djpqe07.png"]http://aks98.com/images/pkwp4j2ye0ze1djpqe07.png[/URL] please help me thanks

Software Development c#
Member Avatar for alc6379
0
348
Member Avatar for jaz854

Hi All, I am getting the below error message when I try to degug my program. The 'Migrosoft.Jet.OLEDB.4.0' provider is not registered on the local machine Thanks in advance.

Software Development vb.net
Member Avatar for JSS at MSSU
0
185
Member Avatar for apple621

Write a function whose prototype is string NumberToName(int x); that returns the string of english name of each digit of number x. Using this function, write a main program that reads a positive integer number and prints the english name of each digit of that number in a single line …

Software Development c++
Member Avatar for programing
0
133
Member Avatar for kpen

Hello, I am fairly new to all this and I am hoping somone can help. I am writing a C# application that requires use of the Clipborad for inter-process communication. C# has methods I can leverage in order to accomplish this: [CODE]Clipboard.SetText(string);[/CODE] Unfortunately, there is an unacceptable delay when using …

Software Development assembly
Member Avatar for kpen
0
370
Member Avatar for -ordi-

[CODE]print divmod(1024, 26) # 39[/CODE] [CODE]print chr(39 + ord('A') - 1) # g[/CODE] but: AA, AB etc, how to convert this to number?

Software Development python
Member Avatar for TrustyTony
0
131
Member Avatar for skyyforever

Hello, I have a problem opening Excel file which I have created using a xslt. Actually, I had a xml file which I transformed to an excel file and saved. I don’t know how to open it. Everything I have tried, didn’t work. Please, if someone knows the answer...

Software Development c c# c++ microsoft-office xml
0
82
Member Avatar for Mitja Bonca

I would like to create a simple program, like a game, but so far without any graphical interface. Only a code, supported with some numbers, so that the user will know whats going on in the background. I was thinking of creating a racing game (like formula 1 or sometihng …

Software Development user-interface
Member Avatar for papanyquiL
0
110
Member Avatar for Duki

For whatever reason, I can't figure this out. I'm getting this error: [quote]error C2082: redefinition of formal parameter 'user' [/quote] In this code: [code=c++] #pragma once #include "Standard Libs.h" #include "Ability.h" #include "Spell.h" #include "Item.h" class Adventurer { private: string name; int level; int xp; int gold; int attack; int …

Software Development c++
Member Avatar for Duki
0
101
Member Avatar for monstercameron

i had an idea to make my own file formats but... have nearly zero coding experience. the image is just text which a program would parse and receive relevant pixel data from it(like xml based stuff). i wrote up some plan for the file: [CODE] `meta data [(title)test image] [(date)1,1,2010] …

Software Development image python xml
0
319
Member Avatar for Bold Eagle

I have a txt file that I need to read into a listview, but I need to read from a specific line in that file. Can someone point me in a direction on doing this. Below is a sample of the txt file to read, 6400,3200,2,95.5,84,76.6,0 1,2,-20,15,0,0,0,"NO",0,0 TOTAL GPM= 6400 …

Software Development listview vb.net
Member Avatar for codeorder
0
197
Member Avatar for toferdagofer

Im trying to make it so that my menu options that i've highlighted are their own method but i was having issues with returning them so i could use the selection as an int for my switch statement.Any ideas? [CODE]import javax.swing.JOptionPane; public class ConversionProgram { /** * @param args */ …

Software Development java java-swing
Member Avatar for toferdagofer
0
139
Member Avatar for frogboy77

Hi, total beginner here, trying to learn at home. Just thought i'd get that in. if i have a number eg 123 trying to figure out a way of calculating all the possible cominations 123 132 213 231 312 321 can do it with pencil and paper but don't know …

Software Development c++
Member Avatar for frogboy77
0
84
Member Avatar for warbird43

[B]somebody please tell me why im not getting String(X) value as ID,Name,FName are being printed on console correctly but the name of ID(4) from my DB_table is not going into string(X); [/B] [CODE] package gym.resources.busyicons; import java.sql.*; class OdbcAccessQuery { public static void main(String [] args) { Connection con = …

Software Development java
Member Avatar for warbird43
0
107
Member Avatar for Swiftle

I'm preparing for my ASM exam and I'm having trouble understanding the concept of passing parameters via the stack. Usually we must use local variables when writing recursive procedures. Here's a little code snippet that I'm unable to test atm: [code] procedure1: PUSH EBP MOV EBP, ESP PUSH EAX PUSH …

Software Development assembly
Member Avatar for sDJh
0
136

The End.