199,124 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for lorettah

import java.io.*; public class Appliance { public static void main(String args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file); int ch; while((ch=f.read()) { System.out.print((char)ch); } } catch(FileNotFoundException fnfe) { System.out.println("Exception: "+fnfe.toString()); } catch(IOException ioe) { System.out.println("Exception: "+ioe.toString()); } } }

Member Avatar for jon.kiparsky
0
123
Member Avatar for Mitja Bonca

The code gets all the files (only names, if you want to get the paths too, simply remove for loop (its only one) from the code. Files are stored into a generic list. Mitja

Member Avatar for ShahanDev
0
1K
Member Avatar for six_sic6

My form is like the above [CODE] <form method="post" name="publishResult" onsubmit="return g(this);"> <select id="options1" name="se1" > <option value="0" >-- Grade --</option> <option value="A+">A+</option> <option value="A">A</option> <option value="A-">A-</option> <option value="B+">B+</option> <option value="B">B</option> <option value="B-">B-</option> <option value="D">D</option> <option value="F">F</option> </select> <select id="options2" name="se2" > <option value="0" >-- Grade --</option> <option value="A+">A+</option> <option …

Member Avatar for six_sic6
0
189
Member Avatar for elson.james

Hi everyone! I am new in Web Programming. I want in my ComboBox to pop up a question everytime a user changes the combo box. It will ask, "Are you sure you want to update" then if the user clicks on yes it will be redirected to another page and …

Member Avatar for SolidSolutions
0
490
Member Avatar for AMADH

Hello, I was wondering if someone could help me. I am new to mysql/php and I was wondering if there is a way that I can have php create pages for me. What I want is that I no longer need to create new page, so I will have a …

Member Avatar for pixelsoul
0
826
Member Avatar for printman55

I am a web designer and specialize more in front end design and graphic work. I need help developing the code for a interface for a client to upload text and PDF file descriptions to a MySQL database. The interface would also facilitate PDF file uploads to a directory plus …

Member Avatar for smantscheff
0
70
Member Avatar for ajst

Hi, I've got a job interview coming up and was wondering if people would be so kind to help me with some revision for the interview. It's it a programming role(surprisingly) so would be greatful if people would post the questions they have been asked or ask in job interviews. …

Member Avatar for Moschops
0
92
Member Avatar for ravenous

Hi guys, I'm sure that the answer to this is simple, but I don't know what it is and it's bugging me. For reasons that aren't important, I'm trying to make a kind of light-ish weight array class. I want to be able to use syntax like that of [icode]std::vector[/icode] …

Member Avatar for ravenous
0
255
Member Avatar for maniza

i have to develop a game to teach object oriented concepts clearly by using a game. 1 game should include all 5 concepts ( inheritance,polymorphism,abstraction,encapsulation and message passing) please tel me a way to develop that game. thank you

Member Avatar for maniza
0
96
Member Avatar for ahtaniv

1. Do we have static classes in C++? 2. If so what are they useful for? 3. Is this the name given to classes that should not be allowed instantiation? 4. If so, how is it different from abstract classes?

Member Avatar for Narue
0
188
Member Avatar for Jake.20

Guys forgive me if this topic is belongs to database forum, i don't have a clue if this topic is for database or vb.. Guys can you give me some idea on how will i link my login accounts that are stored in the database on their own profile forms(vb) …

Member Avatar for Jake.20
0
83
Member Avatar for J-Dubs

Hello, I am a student taking APCS and I am getting very frustrated with this program. Usually I can get everything figured out but I can't figure this out. It compiles but when I run it, it seems to give the wrong number for the number of bombs in adjacent …

Member Avatar for J-Dubs
0
2K
Member Avatar for Ignatius88

[CODE]document.getElementById('login').innerHTML += '<p><a href = "/<Project name>/<Servlet name>" onclick="sendRequest("/<Project name>/<Servlet name>", "uid=' + FB.getSession().uid + '", AJAXresult, "post")">Recommend me a movie!</a></p>';[/CODE] The code above works fine outside of the innerHTML. Is there something wrong with the code above?

Member Avatar for SolidSolutions
0
106
Member Avatar for pragati_2010

The value i am getting in a tag is like <text>customers/id/name/place</text> now i want to retrieve the last value after the / that is 'place'.The problem i am facing is the value in text is changing for e.g it could be <text>customers/id/name/place</text> <text>suppliers/id/Germany/thing</text> <text>supply/id/location/book</text> what i want is the last …

Member Avatar for xml_looser
0
103
Member Avatar for i.ibrahem

I need help please, I want to write a program that requests and reads two integers on one line representing a range, the program should output the sun of all even numbers in the range. if anyone can help please do, thank you.

Member Avatar for Akill10
0
249
Member Avatar for rosstafarian

Hi guys, basically i have a form with textboxes such as First name surname phone number in. and each row has an auto number assigned to it. that auto number is the customers reference number. basically i want to be able to enter a reference number into a text box …

Member Avatar for Pgmer
0
113
Member Avatar for facarroll

I have the following code which displays something like this; William Science Monday William Math Tuesday William English Thursday but I want it to display without repeating the name William in the lines after the first line. [CODE] <?php $query = mysql_query("SELECT userId, quizTitle, addDate FROM quiz WHERE managerId='".$userid."' AND …

Member Avatar for facarroll
0
138
Member Avatar for Progr4mmer

Im making an applet that moves a red ball using the WASD keys but it doesnt work for some reason help? [CODE]package Game; import java.applet.*; import java.awt.event.*; import java.awt.*; public class AppletOne extends Applet implements Runnable, KeyListener{ int x_pos = 10; int y_pos = 100; int x_speed = 3; int …

Member Avatar for Progr4mmer
0
200
Member Avatar for Masks.be

Hi webdevelopers, I am trying to INSERT INTO a table, a RETRIEVED gender SELECT FROM another table, but it misses a piece of code, to function: [CODE]$page_title = 'Register'; include ('./header2.html'); // Connect to the database. require_once ('./Script14.1_mysql_connect.php'); if (isset($_POST['submitted'])) { if (!empty($_POST['types']) && ($_POST['types_id']) > 1) { $g = …

Member Avatar for Masks.be
0
81
Member Avatar for Lemonader

Hi. It says that the operator and return statement don't work. Can someone please explain what is wrong, and why it's wrong? I don't get it. [CODE] package hello; private class Person { private string firstName, lastName; private Date birthDate; public Person(String fN, String lN, int month, int day, int …

Member Avatar for Progr4mmer
0
99
Member Avatar for aguilaron

I am having trouble with this program in the if else part I feel that is a really simple problem, I have tried 'else if' as well as 'else' but all sorts of errors come up. [CODE] #include <stdlib.h> #include <iostream> using namespace std; int main() { double a, b, …

Member Avatar for Narue
0
1K
Member Avatar for boifang

[CODE]class MOrders { int nooforders; // Data members of the class public int getorder() { nooforders = 500; } public void displayorders() { System.out.println("The number of orders to be delivered: "+ nooforders); } public static void main(String args[]) { MOrders obj = new MOrders (); obj.getorder(); obj.displayorders(); }[/CODE] getting a …

Member Avatar for masijade
0
73
Member Avatar for Charlton21

I need to turn this code for a class that checks for a out-of-bound value: class array {public : int & operator [] (int); // Prototype; overloaded operator int size () // In-line function {return ub - lb + 1; }; int lbound () {return lb; }; int ubound () …

Member Avatar for Narue
0
306
Member Avatar for miku003

I'm trying to make an array-based queue that inserts and removes the elements... The default array is {0,0,0,9,10}. after the 0's are filled up it should say that its Full and will return to the loop. I'm having trouble making 3 particular methods which is dequeue, isEmpty, and isFull.. [CODE]class …

Member Avatar for miku003
0
189
Member Avatar for illuminatus89

[CODE]#include<stdio.h> #define ARSIZE 1000000 int main() { int i=0,j=0,c=0,k,n; int prep[ARSIZE]; for(i=0;i<1000000;i++) { j++; for(k=2;k<j;k++) { if(j%k==0) c++; } if(c==2) prep[i]=j; c=0; } printf("Enter N : "); scanf("%d\n",&n); printf("%d",prep[n-1]); getch(); return 0; } [/CODE] why is this code giving segmentation fault??

Member Avatar for vikashj
0
76
Member Avatar for lochnessmonster

i was told objects can be created in C just like c++. Does anyone happen to have any examples of how this is done or any recommended resources on this :) thx

Member Avatar for Narue
0
182
Member Avatar for Abdel_eid

i googled on how to create a class dynamicly and i found that code [code] Date today = new Date(); String todayMillis = Long.toString(today.getTime()); String todayClass = "z_" + todayMillis; String todaySource = todayClass + ".java"; public static void main (String args[]){ MakeTodayClass mtc = new MakeTodayClass(); mtc.createIt(); if (mtc.compileIt()) …

Member Avatar for ~s.o.s~
0
353
Member Avatar for VRamone

Hi guys,how are you? =) i have a doubt,with ListBox =/ i want to get the selected item the user clicks and then put in another listbox,but it´s not happening,it says 'cannot be indexed because it has no default property' is there an easy way to solve it? my code …

Member Avatar for vuyiswamb
0
147
Member Avatar for paulablanca

Hello! Is there someone who can help me to make a timer on my entrance exam? I want every question last for only 30 seconds, after that, the next question will appear. Thanks and God Bless.! :D

Member Avatar for paulablanca
0
118
Member Avatar for lisaroy1
Member Avatar for McCurry0x77

What is the best way to assign values to variables of various data types from reading a file (while importing as few things as possible and making use of the simplest code)? I need to write a program which can assign values from a .dat file, if that's relevant. If …

Member Avatar for masijade
0
125
Member Avatar for novice20

Hi, I have a for loop something like: [CODE]for n in range(no_of_rows): #--configuring ODU Op mode odu_op_mod=list1[n] odu_op_mode= odu_enum["%s"%odu_op_mod] if (odu_op_mod == 'blahblah'): #------------ elif(odu_op_mod == 'aaa'): #-------- elif(odu_op_mode =='xxx'): #----- elif(odu_op_mod == 'yyy'): #------------------- elif(odu_op_mod == 'zzz'): #------------- logging.info("*******************************************************************") subprocess.call(['python link_config_idu12.py %s'%addr],shell=True) [/CODE] I have different lists, list1 #for …

Member Avatar for novice20
0
3K
Member Avatar for dips255

I have the following code that converts text in querystring to an image. This is giving image with white background. Need help to get a transparent background. [code] <%@ Page Language="VB" ContentType="image/gif" Debug="true" Explicit="true" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %> <%@ Import Namespace="System.IO" %> <script runat="server"> Protected …

Member Avatar for questpond
0
293
Member Avatar for elson.james

Hi everyone! I am new in PHP. Is there a way to store a value from a combo box to an array? Can you show me an example. Thanks! :)

Member Avatar for elson.james
0
889
Member Avatar for steelshark

Hi, I have a problem using the AJAX toolkikt TextboxWatermarkExtender. It does not show up on my page. I have set up the code as follows: [CODE] <tr> <td> Name: </td> <td> <asp:TextBox ID="name" runat="server"></asp:TextBox> <asp:TextBoxWatermarkExtender ID="nameField" runat="server" WatermarkText="Section name" TargetControlID="name"> </asp:TextBoxWatermarkExtender> </td> <td> <asp:RequiredFieldValidator ID="nameVal" runat="server" ErrorMessage="Please give in …

Member Avatar for vadmkp
0
124
Member Avatar for SunnySideUp

Hello, I am just starting out with ASP.Net using VB.Net. I am trying to build a football website for my football club that has a backend CMS system. I have the database designed with primary and foerign keys in SQL Server 2005. I would like some help to: 1) Insert …

Member Avatar for questpond
0
217
Member Avatar for sonia sardana

Hey frnds plz reply of mine questions.I want to just confirm my answers.Plz reply it by today only if poss.bz tom is my another interview [B]1)[/B] How to Delete Dynamically Allocated Array? a) delete a[] b)delete a[0] c) delete[] a d)delete [0] a [B]My answer a.Correct or not[/B] [B]2)[/B]Can we …

Member Avatar for questpond
0
353
Member Avatar for Thunder--

I am getting this error on other pages that lead to this one, but i can't find out what I'm doing wrong... can anyone help? The error reads: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in ...on line 9. Can anyone help me? [CODE]<? if(!defined('TBL_ACTIVE_USERS')) { …

Member Avatar for erry
0
78
Member Avatar for Sanit

Hey guys, I'm trying to echo a link that has an onclick attribute attached to it, but when I click on the link on the page, just goes to the desired page, and doesn't preform the onclick action. Here's my code: [code=php]<?php if(session_is_registered("sesvar")){ echo ("<a href='../../admin/comment-delete.php?id=$id2' onclick='return(confirm('Are you SURE you …

Member Avatar for leo_gatmaytan
0
2K
Member Avatar for maye13

This code is part of this program I'm doing. I've edited it so it would get shorter. [code] #include<stdio.h> #include<string.h> main() { char zero[5][6] = {"|||||", "| |", "| |", "| |" , "|||||"}; char secOnes[5][6]; strcpy(secOnes,zero); y=10; for(i=0;i<5;i++){ gotoxy(20,y++); printf("%s", secOnes[i]); } getch(); } [/code] When I try to …

Member Avatar for castrogang
0
1K
Member Avatar for akshayreddy

Write a Python script/program that reads an arbitrary file and build a concordance of the words in the file. The concordance should contain the line number on which the word first occurs as well as the number of times the word occurs in the file. The program needs to print …

Member Avatar for TrustyTony
0
261
Member Avatar for f_atencia

Hi peoples, Suppose I have an XML file [CODE] <Application> <Segment1> <ID>Sam</ID> <Fee>2.50</Fee> <Fee>1.00</Fee> </Segment1> </Application> [/CODE] In a nutshell, I want to move the two <Fee> Elements to another section so it looks like this; [CODE] <Application> <Segment1> <ID>Sam</ID> </Segment1> <Segment2> <Fee>2.50</Fee> <Fee>1.00</Fee> </Segment2> </Application> [/CODE] It would invlove …

Member Avatar for mrame
0
133
Member Avatar for bhagvad30

Hi, I am developing a windows application, In that i use richtextbox control in that i allow only character. when i copy number and paste in richtext box it takes number, but when i type a number it work properly and shows error message. so please give me answer.

Member Avatar for Momerath
0
292
Member Avatar for cpp_learn

Hi, I need to do the following: 1. read the text file with names and surnames 2. convert each char to int than add them 3. the number must keep adding each other until it is under 10 This is what I have so far ====================================================================== #include <iostream> #include <fstream> …

Member Avatar for jonsca
0
568
Member Avatar for front_&_center

i found this code to upload a file into a sql database using the asp.net fileupload object (or vb) i found it here [url]http://forums.asp.net/p/1480079/3451771.aspx[/url] i think it works, but i am a learning noob and have a question...where does my dbase info go in the code? [CODE] 1. If FleUpload.HasFile …

Member Avatar for Netcode
0
563
Member Avatar for ahtaniv

Hello all, My understanding is that the Objects created are stored in the heap segment. What if the objects are created for a class with static data members? Do the static data alone reside in the data segment, while the rest of the members are allocated on the heap? I …

Member Avatar for ahtaniv
0
373
Member Avatar for srilekha nikky

Hi I want to create upload file and i want to read the same file which is uploaded in c#.net I wrote a code like this can u please check it. [code]private void btnUpload_Click(object sender, EventArgs e) { if (openFileDialog2.ShowDialog() == DialogResult.OK) { filename = openFileDialog2.FileName; txtUpload.Text = filename; } …

Member Avatar for srilekha nikky
0
271
Member Avatar for xZombeast

I made my IO exception and everything to copy a file to an existing spot and then overwrite it. I programmed the IO fine, but I get the error saying 'File in use' [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; …

Member Avatar for rohand
0
133
Member Avatar for kinz653

Hi, Just started using python. I can run simple python programs from the terminal in OS X. It says python version 2.6.1. I wanted to try turtle. I copied some code I found from others on here and tried to run it, and ran into problems right away with things …

Member Avatar for kinz653
0
3K
Member Avatar for EneilShade

I was humming along, and decided to try out data sorting. So, I did a few pieces of research, and came up with a really cool looking algorithm: Quicksort. I did what I should have, and started to program. Now, here is where I sound like an idiot: Why is …

Member Avatar for EneilShade
0
223

The End.