Help with a simple project
I am new to writing in Java. I've been slacking probably more than I should be, and I have a small project that is due on Thursday for my class. Currently, I know how to write in C++ and C++ only. If someone could help me in writing the simple code for my project, that would be great.
The program is simple. It should allow a user to input a string of digits, and then output the sum of those digits.
For example; the user inputs 3563
the program would then output 17 (3+5+6+3)
Thanks for any help.
well, i think I figured out how to do this, except I am having a small error. Here is my code;
public class digitsum {
public static void main(String[] args)
throws java.io.IOException {
int number = 0;
int sum = 0;
System.out.println("Enter an integer number: ");
number = (int) System.in.read();
System.out.print(+number);
do
sum = sum+(number%10);
number = number/10;
}while(number>0);
System.out.print(" The sum is " +sum);
Now when I run the program, it is clear that it is correctly calculating the sum, but for some reason it converts the number which the user inputs into something else.
For example, here is a test run of my program;
Enter an integer number:
56
53 The sum is 8
56 is the number I input, and 53 is the number the program reads. As you can see, it says the sum is 8 (which is correct for 53, but I entered 56).
I am confused.
Similar Messages
-
Nead help with a simple project.
i nead to make a program for generating the first 20 numbers Fibonacci series using dynamic array.
:S How do i do this?From what it sounds like, you have two problems:
1. Generating numbers in the Fibonacci sequence
2. Figuring out how to create a "dynamic array" and store #1's results
The first one can be found just [by searching|http://www.google.com/search?q=java%20fibonacci], and isn't really a Java problem. The second one.. if it's an introductory course to computer science, maybe you have to write your own implementation of a dynamic array. Maybe the professor provided one and you're supposed to use it. Otherwise, you can use one of the Collections like ArrayList . -
Help with photos in project???!!
Hello,
I just bought an iMac about a month ago so that I could edit home movies and create DVD's of family vacations/events to share with my family. I have done this in the past on the PC with Pinnacle Movie Studio Software but it was buggy and more of a pain than it was worth.
So far pretty impressed with the iMac and FCE seems like it has potential. However I keep having problems with still photos in my video.
Here is what I have done - created a new project using the NTSC 48k template (not at my desktop now so I'm working off memory as far as naming). I captured all of my Sony Mini DV footage to the PC and dropped it into my timeline and edited it. Went smoothly. At the end of my movie I want to insert a "recap of the trip" using the still photos that I took with my digital camera and use the ken burns effect and transitions with music playing. My plan is to render and burn to DVD with iDVD for playback on a 1080p 60 inch plasma.
My photos are jpegs saved on my hard drive. I cropped them and adjusted color, etc in CS2. I didn't do anything as far as re-sizing them etc in photo shop as this is a little new to me and I didn't want to mess them up. Do I need to resize them for FCE? Seems like the program does this? If I need to resize them what size should I make them? Remember I want to be able to zoom in by creating the burns effect.
I have taken the photos and imported them into FCE. I drop them on the timeline and push play and everything looks great. When I start adding transitions with and applying the ken burns effect with key points the image plays fine by itself in the viewer window. However, when I watch the project play back in the canvas the stills appear very jumpy - not like a frame is missing in the render - the still literally looks like it jumps up and then settles back down. This is driving me nuts! FCE has to be able to do this smoothly. Can anyone provide me with a simple step by step on what settings I should be using for my sequences, etc to make this work. The settings really mess me up and I must be missing something.
I do have Tom's book but I can't find anything to help me with this issue. It is driving me nuts. Thank you in adavnce!Thank you for the link. I went there and read the information. I still have questions:
Assuming I am using just still photos (let's keep it easy at first and assume no video) - what settings do I use for FCE under easy set up and for the sequence? Photos are jpg images shot with a digital camera that have been saved on my computer for a few years. I want to output my contents to DVD using iDVD and play back on a 1080p plasma tv.
Do I have to edit or resize the photos in photoshop first? It sounds like I can just import them into FCE and that it should work. I am not working with advanced photoshop images - just simple jpg images - no layers. The chart on page 2 of the link above says for 1080i - rectangular size N/A and square size 1920x1080. What does this mean? Is this telling me to resize my images to 1920x1080 before I import into FCE? If I want to use the Ken Burns effect and zoom should I double this to 3840x2160?
If someone can tell me step by step what they would do with the settings for FCE if they wanted to create a still photo slideshow with music, transitions and pan and zoom I would appreciate it. Again - source material is jpg images and I want to output to DVD using iDVD to display on a 1080p plasma tv. Also assuming that you had a standard landscape photo shot with a 4 megapixel camera what steps would you go through to prep it for FCE in Photoshop - if any?
Sorry that I am asking for a detailed example but I learn much better that way - after I am able to get one photo into an acceptable format for FCE the rest will be easy.
Has anyone actually created a successful slide show in FCE using transitions and the Ken Burns effect or do they get jitters in their photos as well - the image doesn't appear to flow smoothly. -
Need help with lost iMovie project.
I was creating an iMovie project for school and needed to save it on a USB, so I clicked on 'Export Movie' from the 'Share' options menu in iMovie. I chose the type I wanted it saved in (viewing for computers) and then a smaller screen in iMovie popped up saying it was exporting the movie, or something like that. It took about a good 30 minutes and my project was a 7 minute movie with film clips, music, transitions, ect. I exported this project to my USB but when it finished it wasn't on there and when I finally found it on the Mac somewhere, I went to drag it into my USB but it said it was full. I then dragged the project onto my desktop and tried to open it to see if it worked. When I did the iMovie icon jumped once and stopped. I clicked on iMovie and it was still there in the projects screen. I then decided to close iMovie and open the project again from my desktop to see if it would play like a normal movie but once I clicked it the iMovie icon jumped again, opened but my project that I was trying to open was not there anymore and wouldn't open from my desktop file. I cannot open it at all and view it, it has been lost from my iMovie. Is there a way that I can get it back? Really need some help with this.
What version of iMovie are you using?
Matt -
Need help with a simple process with FTP Adapter and File Adapter
I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
I can provide additional info such as the contents of my bpel and wsdl files if needed.
Would appreciate if someone can help me with this at the earliest.
Thanks
Jaypersiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Need help with a simple basketball game.
Hi im new here and I need help with making this simple basketball game.
Im trying to recreate this game from this video. Im not sure if he is using as2 or as3
Or if anyone could help me make a game like this or direct me to a link on how to do it It would be greatly appreciated.If you couldn't tell whether it is AS2 or AS3, it is doubtful you can turn it from AS2 into AS3, at least not until you learn both languages. There is no tool made that does it for you.
-
Help with Rendering/Finalizing Project Please?
Hi,
I am so new to this entire Adobe and video making that I've spent the last few hours pulling hair literally. I am hoping that some of you experts can take some time to give this novice some much needed guidance. Okay, I'm begging!
I recorded a wedding on a XHA1 MiniDV camera in 1080p 24fps. Captured the clips to PP CS4 which in turn makes them MPEG, I believe. Included in my project are addition clips imported from a Canon HF S21 also in 1080p 24fps and a Rebel T2i in ?? format. Didn't use too many clips from the rebel.
Anyhow, my project settings in PP are:
Video - Display format = Frames
Audio - Display format = Audio Samples
Capture Format = HDV
All Scratch disks are saved on to my desktop with 284 GB
Here is a picture of the sequence settings:
Again, sorry for the ignorance and stupiditiy. I am wondering what would help.
I am trying to burn it all with chapter markers and additional features to a DVD.
- What would be the BEST settings for exporting to Encore?
- Should I separate each section into a different sequence - would that help? For example, the pre-ceremony to one sequence. The ceremony to another. The reception to another. Or should I make new projects for each?
- How can I make my computer faster? Is it the memory, ram, etc? What should I do?
Right now, it has failed over and over in rendering in After Effects. It stops encoding when I export to AME. It says 158 hours for rendering in PP.
HELP!
I am using an iMac and here are computer specs (again, I am not even sure what to post to help you all help me):
Model Name: iMac
Model Identifier: iMac11,3
Processor Name: Intel Core i7
Processor Speed: 2.93 GHz
Number Of Processors: 1
Total Number Of Cores: 4
L2 Cache (per core): 256 KB
L3 Cache: 8 MB
Memory: 8 GB
Processor Interconnect Speed: 4.8 GT/s
Boot ROM Version: IM112.0057.B00
SMC Version (system): 1.59f2
Here is a pic of what I'm working on. I know the pic-in-pic feature probably doesn't help with rendering time either but 158 hours is killing me. In fact, when I go to sleep, I wake up to an error message where PP has closed.leevang,
Your computer looks great. I wouldn't be too worried about the time PP shows for encoding etc.
I have found that right when I first start to encode a project, 73 hours or 12 hours is normal. Rendering is not necessary for encoding. However when I look back later, the time has dropped greatly.
Down to 2 or 3 hours. that's when I follow Jeff B.'s suggestions when I do a 2X scan....... -
Need help with a simple program (should be simple anyway)
I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
====================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Message extends JFrame implements ActionListener {
public void actionPerformed(ActionEvent evt) {
text1.setText(" ");
text2.setText("RE: ");
text3.setText(" ");
public Message() {
super("Write a Message - by Kieran Hannigan");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(370,270);
FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
setLayout(flo);
//Make the bar
JMenuBar bar = new JMenuBar();
//Make "File" on Menu
JMenu File = new JMenu("File");
JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
JMenuItem f2 = new JMenuItem("Open");
JMenuItem f3 = new JMenuItem("Save");
JMenuItem f4 = new JMenuItem("Save As");
JMenuItem f5 = new JMenuItem("Exit");
File.add(f1);
File.add(f2);
File.add(f3);
File.add(f4);
File.add(f5);
bar.add(File);
//Make "Edit" on menu
JMenu Edit = new JMenu("Edit");
JMenuItem e1 = new JMenuItem("Cut");
JMenuItem e2 = new JMenuItem("Paste");
JMenuItem e3 = new JMenuItem("Copy");
JMenuItem e4 = new JMenuItem("Repeat");
JMenuItem e5 = new JMenuItem("Undo");
Edit.add(e5);
Edit.add(e4);
Edit.add(e1);
Edit.add(e3);
Edit.add(e2);
bar.add(Edit);
//Make "View" on menu
JMenu View = new JMenu("View");
JMenuItem v1 = new JMenuItem("Bold");
JMenuItem v2 = new JMenuItem("Italic");
JMenuItem v3 = new JMenuItem("Normal");
JMenuItem v4 = new JMenuItem("Bold-Italic");
View.add(v1);
View.add(v2);
View.add(v3);
View.addSeparator();
View.add(v4);
bar.add(View);
//Make "Help" on menu
JMenu Help = new JMenu("Help");
JMenuItem h1 = new JMenuItem("Help Online");
JMenuItem h2 = new JMenuItem("E-mail Programmer");
Help.add(h1);
Help.add(h2);
bar.add(Help);
setJMenuBar(bar);
//Make Contents of window.
//Make "Subject" text field
JPanel row2 = new JPanel();
JLabel sublabel = new JLabel("Subject:");
row2.add(sublabel);
JTextField text2 = new JTextField("RE:",24);
row2.add(text2);
//Make "To" text field
JPanel row1 = new JPanel();
JLabel tolabel = new JLabel("To:");
row1.add(tolabel);
JTextField text1 = new JTextField(24);
row1.add(text1);
//Make "Message" text area
JPanel row3 = new JPanel();
JLabel Meslabel = new JLabel("Message:");
row3.add(Meslabel);
JTextArea text3 = new JTextArea(6,22);
messagearea.setLineWrap(true);
messagearea.setWrapStyleWord(true);
JScrollPane scroll = new JScrollPane(text3,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//SpaceLine
JPanel spaceline = new JPanel();
JLabel spacer = new JLabel(" ");
spaceline.add(spacer);
row3.add(scroll);
add(row1);
add(row2);
add(spaceline);
add(spaceline);
add(row3);
setVisible(true);
public static void main(String[] arguments) {
Message Message = new Message();
}persiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Help with a simple program.
I need some help writing a simple program. Can anybody help??
thanks to all.
2. HTML Java Source Code Reserved Word Highlighter
Write a program that inputs a Java source code file and outputs a copy of that file with Java keywords surrounded with HTML tags for bold type. For example this input:
public class JavaSource
public static void main ( String[] args )
if ( args.length == 3 )
new BigObject();
else
System.out.println("Too few arguments.");
will be transformed into:
<B>public</B> <B>class</B> JavaSource
<B>public</B> <B>static</B> <B>void</B> main ( String[] args )
<B>if</B> ( args.length == 3 )
<B>new</B> BigObject();
<B>else</B>
System.out.println("Too few arguments.");
In a browser the code will look like this:
public class JavaSource
public static void main ( String[] args )
if ( args.length == 3 )
new BigObject();
else
System.out.println("Too few arguments.");Here is something that may get you started...
import java.io.*;
import java.util.*;
public class HtmlJava{
public static void main(String arg[]){
if(arg.length!=1){
System.out.println("Usage java HtmlJava sourceFile");
else
new HtmlJava(arg[0]);
HtmlJava(String source){
try{
BufferedReader sourceReader=new BufferedReader(new InputStreamReader(new FileInputStream(source)));
BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(source+"Html.txt")));
Vector keywords=new Vector();
addKeywords(keywords);
String line;
StringTokenizer tokenizer=null;
String word;
while((line=sourceReader.readLine () )!=null){
tokenizer=new StringTokenizer(line);
while(tokenizer.hasMoreTokens()){
word=tokenizer.nextToken();
if(keywords.contains(word)){
writer.write(""+word+" ");
else{
writer.write(word+" ");
writer.write("\r\n");
writer.close();
sourceReader.close();
System.out.println("Output File written to "+source+"Html.txt");
catch(Exception ex){
ex.printStackTrace();
private void addKeywords(Vector keywords){
keywords.addElement ( "abstract");
keywords.addElement( "boolean");
keywords.addElement( "break");
keywords.addElement( "byte");
keywords.addElement( "byvalue");
keywords.addElement( "case");
keywords.addElement( "cast");
keywords.addElement( "catch");
keywords.addElement( "char");
keywords.addElement( "class");
keywords.addElement( "const");
keywords.addElement( "continue");
keywords.addElement( "default");
keywords.addElement( "do");
keywords.addElement( "double");
keywords.addElement( "else");
keywords.addElement( "extends");
keywords.addElement( "false");
keywords.addElement( "final");
keywords.addElement( "finally");
keywords.addElement( "float");
keywords.addElement( "for");
keywords.addElement( "future");
keywords.addElement( "generic");
keywords.addElement( "goto");
keywords.addElement( "if");
keywords.addElement( "implements");
keywords.addElement( "import");
keywords.addElement( "inner");
keywords.addElement( "instanceof");
keywords.addElement( "int");
keywords.addElement( "interface");
keywords.addElement( "long");
keywords.addElement( "native");
keywords.addElement( "new");
keywords.addElement( "null");
keywords.addElement( "operator");
keywords.addElement( "outer");
keywords.addElement( "package");
keywords.addElement( "private");
keywords.addElement( "protected");
keywords.addElement( "public");
keywords.addElement( "rest");
keywords.addElement( "return");
keywords.addElement( "short");
keywords.addElement( "static");
keywords.addElement( "super");
keywords.addElement( "switch");
keywords.addElement( "synchronized");
keywords.addElement( "this");
keywords.addElement( "throw");
keywords.addElement( "throws");
keywords.addElement( "transient");
keywords.addElement( "true");
keywords.addElement( "try");
keywords.addElement( "var");
keywords.addElement( "void");
keywords.addElement( "volatile");
keywords.addElement( "while");
}Hope it helped -
Help with a simple 1811 configuration
I have a very basic level of understanding with Cisco products and I need help with what should be simple and even doable by me.
I have a Cisco 1811 integrated router and am simply trying to use it on my home network. I can configure the router with an enable secret password, password encryption, VTY, aux, and cons logins with no issues. The router has 2 Ethernet interfaces, 0 and 1 and 8 switch ports.
The idea is to bring Comcast ISP service into one of the Ethernet ports and then have three machines on the switch ports able to access the Internet. Also I have an off-the shelf wireless router that I thought I would just plug that into an available switch port and allow a wireless AP as well.
This is so simply, that I can't believe I can't figure it out, but I can't.
I set int F1 to DHCP, performed a 'no shut', and connected the ISP's router and have an up and up indication. I have setup a static network with my three machines on the switch ports and enabled all applicable ports and have up and up indications - however, no traffic flow, even amongst my static Layer 2 switched LAN - not even a 'ping'. By my understanding of Layer 2, this should work right now, whether the ISP service is working or not - WHAT AM I DOING WRONG?
The addressing scheme I have ended up on is 172.16.1.0/28
Obviously without the first hurdle cleared, of why the switched LAN doesn’t work, I haven't got any deeper. Do I need to configure NAT? I don't think I would need to in the scenario right?
All of my experience, and none at the CCNA level, has been with larger Cisco equipment. One thing I noticed on the 1811 was that when trying to create a new VLAN, it appears to work yet does not do anything and the 'sh vlans' output returns nothing, not even the VLAN1 I can see with 'sh ip int brief".
Anyway, if anyone has time to help a newbie out I would appreciate it; I’m lost.
Thanks,
JoshThanks for the help Andrew! You know, I think if this was two separate devices (switch and router) I think I would be up and running, but this integrated stuff is throwing me off, not to mention that the IOS is a much older version (I guess) than what I'm used to.
They were throwing this 1811 in the trash can at work, so I just emptied the trash can. I have no documentation at all but I have since found the 1800 series documentation on Cisco.com and have tried to implement the basic configurations cited; with what seems like success, but still no joy. I did have to recover the password and did so with 0x2142, I bypassed the setup and compared the default configuration with what is listed in the documentation and they DO NOT match; I also tried to go through setup mode with the same indications. Additionally I've also learned that the 1800 series is pre-configured on certain options (DHCP, VLAN), which is new to me - I thought Cisco routers were not configured by default - isn't that kind of the point? (By the way, the below port status may not be correct since I now have all the ports unplugged)
Anyway, here is the 'show run' command, the 'sh ip int brief' command, followed by the 'sh version' command:
Show Run
Casino#sh run
Building configuration...
Current configuration : 2006 bytes
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
hostname Casino
boot-start-marker
boot-end-marker
enable secret 5 $1$meWw$nsMTp6US7axi/uE0MWULK.
enable password 7 06535E741C1B584C55
no aaa new-model
ip cef
no ip dhcp use vrf connected
ip dhcp excluded-address 172.16.1.1
ip dhcp pool Casino
import all
network 172.16.1.0 255.255.255.240
default-router 67.165.208.1
dns-server 68.87.89.150
domain-name hsd1.co.comcast.net
no ip domain lookup
ip domain name GinRummy.localhost
ip name-server 68.87.85.102
ip name-server 68.87.69.150
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
multilink bundle-name authenticated
archive
log config
hidekeys
interface Loopback0
ip address 172.16.1.1 255.255.255.240
interface FastEthernet0
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet1
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
interface BRI0
no ip address
encapsulation hdlc
shutdown
interface FastEthernet2
interface FastEthernet3
interface FastEthernet4
interface FastEthernet5
interface FastEthernet6
interface FastEthernet7
interface FastEthernet8
interface FastEthernet9
interface Vlan1
no ip address
ip nat inside
ip virtual-reassembly
interface Dialer0
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 1
ppp authentication chap
ip forward-protocol nd
no ip http server
no ip http secure-server
ip nat pool Casino 172.16.1.2 172.16.1.14 netmask 255.255.255.240
ip nat inside source list 1 interface Dialer0 overload
access-list 1 permit 172.16.1.0 0.0.0.15
dialer-list 1 protocol ip permit
control-plane
line con 0
password 7 080E5916584B4442435E5C
login
line aux 0
password 7 013C135C0A59475A70191E
login
line vty 0 4
password 7 09635B51485756475A5954
login
end
Show IP Interface Brief
Casino#sh ip int brief
Interface IP-Address OK? Method Status Prl
FastEthernet0 unassigned YES NVRAM administratively down do
FastEthernet1 unassigned YES DHCP up do
BRI0 unassigned YES NVRAM administratively down do
BRI0:1 unassigned YES unset administratively down do
BRI0:2 unassigned YES unset administratively down do
FastEthernet2 unassigned YES unset up do
FastEthernet3 unassigned YES unset up do
FastEthernet4 unassigned YES unset up do
FastEthernet5 unassigned YES unset up do
FastEthernet6 unassigned YES unset up do
FastEthernet7 unassigned YES unset up do
FastEthernet8 unassigned YES unset up do
FastEthernet9 unassigned YES unset up up
Vlan1 unassigned YES NVRAM up up
Loopback0 172.16.1.1 YES manual up up
Dialer0 unassigned YES manual up up
NVI0
'show version'
Casino#sh ver
Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 12.4(15))
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Thu 24-Jan-08 13:05 by prod_rel_team
ROM: System Bootstrap, Version 12.3(8r)YH12, RELEASE SOFTWARE (fc1)
Casino uptime is 52 minutes
System returned to ROM by reload at 17:09:25 UTC Fri Jul 1 2011
System image file is "flash:c181x-advipservicesk9-mz.124-15.T3.bin"
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
[email protected].
Cisco 1812 (MPC8500) processor (revision 0x400) with 118784K/12288K bytes of m.
Processor board ID FHK120622J3, with hardware revision 0000
10 FastEthernet interfaces
1 ISDN Basic Rate interface
31488K bytes of ATA CompactFlash (Read/Write)
Configuration register is 0x2102
Thanks again for your help,
Josh -
Hello
I am very new to Java and am currently studying a course in the language.
I am working through a tutorial at the moment and a question has been asked and I am struggling a bit
I have been given the code to a program that creates a window with a ball bouncing around inside the window.
There are 2 classes (code below) - Call class - this contains all the code need to create the ball and BallWorld Class (the main Class) this create the window and moves the ball, it also detects if the ball hits the edge of the window, whne this happens it redirects the ball. I understand how all this code works
I have been asked the following:-
Rather than testing whether or not the ball has hit the wall in the nmain program, we could use inhertitance to provide a specialized forom of Ball. Create a class BoundedBall that inherits from the class Ball. The constructor for this class should provide the height and width of the window, which should be maintained as data fields in the class, rewrite the move method so that the ball moves outside the bound, it automatically reflects its direction. Finally rewrite the BallWorld class to use an instance of BoundedBall rather than ordianary Ball, and elimiante the bounds test in the main program.
I am having trouble with this and I can not get my code to work, I think I may be going in completly the wrong direction with the code can sombody please provide me with a simple working code for both the BoundedBall and ammended BallWorld class, as this will help me understand whare I am going wrong
Ball class
//a generic round colored object that moves
import java.awt.*;
public class Ball {
public Ball (Point lc, int r) { //constructor for new ball
//ball centre at point loc, radius rad
loc = lc;
rad = r;
protected Point loc; //position in window
protected int rad; //radius of ball
protected double changeInX = 0.0; //horizontal change in ball position in one cycle
protected double changeInY = 0.0; //vertical change in ball position in one cycle
protected Color color = Color.blue; //colour of ball
//methods that set attributes of ball
public void setColor(Color newColor) {color = newColor;}
public void setMotion(double dx,double dy)
{changeInX = dx; changeInY = dy;}
//methods that access attributes of ball
public int radius() {return rad;}
public Point location() {return loc;}
//methods to reverse motion of the ball
public void reflectVert(){ changeInY = -changeInY; }
public void reflectHorz(){ changeInX = -changeInX; }
//methods to move the ball
public void moveTo(int x, int y) {loc.move(x,y);}
public void move(){loc.translate((int)changeInX, (int)changeInY);}
//method to display ball
public void paint (Graphics g) {
g.setColor(color);
g.fillOval(loc.x-rad, loc.y-rad, 2*rad, 2*rad);
BallWorld class
//A bouncing ball animation
import java.awt.*; //import the awt package
import javax.swing.JFrame; //import the JFrame class from the swing package
public class BallWorld extends JFrame{
public static void main (String [] args){
BallWorld world = new BallWorld(Color.red);
world.show();
for(int i = 0; i < 1000; i++) world.run();
System.exit(0);
public static final int FrameWidth = 600;
public static final int FrameHeight = 400;
private Ball aBall = new Ball(new Point (50,50),20);
private BallWorld(Color ballColor) { //constructor for new window
//resize frame, initialize title
setSize(FrameWidth, FrameHeight);
setTitle("Ball World");
//set colour and motion of ball
aBall.setColor(ballColor);
aBall.setMotion(3.0, 6.0);
public void paint (Graphics g) {
//first draw the ball
super.paint(g);
aBall.paint(g);
public void run(){
//move ball slightly
aBall.move();
Point pos =aBall.location();
if ((pos.x < aBall.radius()) ||
(pos.x > FrameWidth - aBall.radius()))
aBall.reflectHorz();
if ((pos.y < aBall.radius()) ||
(pos.y > FrameHeight - aBall.radius()))
aBall.reflectVert();
repaint();
try{
Thread.sleep(50);
} catch(InterruptedException e) {System.exit(0);}Here - you can study this :0))import java.awt.*;
import javax.swing.*;
public class MovingBall extends JFrame {
mapPanel map = new mapPanel();
public MovingBall() {
setBounds(10,10,400,300);
setContentPane(map);
public class mapPanel extends JPanel {
Ball ball = new Ball(this);
public void paintComponent(Graphics g) {
super.paintComponent(g);
ball.paint(g);
public class Ball extends Thread {
mapPanel map;
int x = 200, y = 20, xi = 1, yi = 1;
public Ball(mapPanel m) {
map = m;
start();
public synchronized void run(){
while (true) {
try{
sleep(10);
catch(InterruptedException i){
System.out.print("Interrupted: ");
move();
public void move() {
map.repaint(x-1,y-1,22,22);
if (x > map.getWidth()-20 || x < 0) xi = xi*-1;
if (y > map.getHeight()-20 || y < 0) yi = yi*-1;
x = x + xi;
y = y + yi;
map.repaint(x-1,y-1,22,22);
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setColor(Color.red);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.fillOval(x,y,20,20);
g2.dispose();
public static void main(String[] args) {
new MovingBall().show();
} -
PE4 with MF6 + trial version, help with Blu-Ray project
Is there a work flow I can read up on to accomplish this. I have a Canon HV20 HDV media. Use HD Split import M2T files into PE4 preset 1080i 30, render than save to desktop as same. The file is 1440x1080. I'm trying to make a high definition disk to playback on our Pioneer Blu-Ray player. Using Movie Factory 6+ trial version. Thank you.
Thanks for the reply Paul I appreciate that. Let me go back over what I've done so far as my last post was incorrect. Moved M2T clips from HDsplit into PE4 with a new project setting of NTSC-HDV 1080i 30. Saved to computer with a select MPEG pre-set HD 1080i 30. The short clip plays fine with WMP and properties is at 1920x1080. Using MF6+ I would like to burn my high definition movie clips to a standard DVD to be played back in our Blu-Ray player. Are these the right steps so far to import the clip into MF6+? I just recently downloaded the trial version but last night I found a help/info section in MF6+ so I plan on reading through that to get acquainted with their terminology.
Will I be burning a data disk to make this work? Maybe a couple of cliff notes to get me started so I can better understand how to do this. Your advice and suggestions are welcome.
Jake -
Help with final Graduation Project
I've done with the majority of it, however I need help with the remove method for a B tree. when removing from a non-leaf node, your remove must replace the removed item with the smallest item in the right subtree.
The code:
import java.util.Stack;
public class BTreeG<E extends Comparable< ? super E>> {
// Each Btree object is a B-tree header.
// This B-tree is represented as follows: order is the maximum number
// of children per node, and root is a link to its root node.
// Each B-tree node is represented as follows: size contains its size; a
// subarray items[0...size-1] contains its elements; and a subarray
// childs[0...size] contains links to its child nodes. For each element
// items, childs[i] is a link to its left child, and childs[i+1] is a
// link to its right child. In a leaf node, all child links are null.
// Moreover, for every element x in the left subtree of element y:
// x.compareTo(y) < 0
// and for every element z in the right subtree of element y:
// z.compareTo(y) > 0.
private final int order;
private Node root;
public BTreeG () {
// Construct an empty B-tree of order 5.
this(5);
public BTreeG (int k) {
// Construct an empty B-tree of order k.
root = null;
order = k;
public E get(E item){
if (root == null)
return null;
Node node = root;
while (true) {
int pos = node.searchInNode(item);
if (item.equals(node.items[pos]))
return (E)node.items[pos];
else if (node.isLeaf())
return null;
else
node = node.childs[pos];
public void insert (E item) {
// Insert element item into this B-tree.
if (root == null) {
root = new Node( item);
return;
Stack ancestors = new Stack();
Node curr = root;
while (true) {
int currPos = curr.searchInNode(item);
if (item.equals(curr.items[currPos]))
return;
else if (curr.isLeaf()) {
curr.insertInNode(item, null, null, currPos);
if (curr.size == order) // curr has overflowed
splitNode(curr, ancestors);
return;
} else {
ancestors.push(new Integer(currPos));
ancestors.push(curr);
curr = curr.childs[currPos];
private void splitNode (Node node,
Stack ancestors) {
// Split the overflowed node in this B-tree. The stack ancestors contains
// all ancestors of node, together with the known insertion position
// in each of these ancestors.
int medPos = node.size/2;
E med = (E)node.items[medPos];
Node leftSib = new Node(
node.items, node.childs, 0, medPos);
Node rightSib = new Node(
node.items, node.childs, medPos+1, node.size);
if (node == root)
root = new Node( med, leftSib,
rightSib);
else {
Node parent =
(Node) ancestors.pop();
int parentIns = ((Integer)
ancestors.pop()).intValue();
parent.insertInNode(med, leftSib, rightSib,
parentIns);
if (parent.size == order) // parent has overflowed
splitNode(parent, ancestors);
public void remove (E item) {
// your code goes here
public void print () {
// Print a textual representation of this B-tree.
printSubtree(root, "");
private void printSubtree (Node top, String indent) {
// Print a textual representation of the subtree of this B-tree whose
// topmost node is top, indented by the string of spaces indent.
if (top == null)
System.out.println(indent + "o");
else {
System.out.println(indent + "o-->");
boolean isLeaf = top.isLeaf();
String childIndent = indent + " ";
for (int i = 0; i < top.size; i++) {
if (! isLeaf) printSubtree(top.childs[i], childIndent);
System.out.println(childIndent + top.items[i]);
if (! isLeaf) printSubtree(top.childs[top.size], childIndent);
//////////// Inner class ////////////
private class Node<E extends Comparable< ? super E>>
// Each Node object is a B-tree node.
private int size;
private E[] items;
private Node[] childs;
private Node (E item) {
this (item, null, null);
private Node (E item, Node left, Node right) {
// Construct a B-tree node of order k, initially with one element, item,
// and two children, left and right.
items = (E[])new Comparable[order];
childs = new Node[order+1];
// ... Each array has one extra component, to allow for possible
// overflow.
this.size = 1;
this.items[0] = item;
this.childs[0] = left;
this.childs[1] = right;
private Node ( E[] items, Node[] childs, int l, int r) {
// Construct a B-tree node of order k, with its elements taken from the
// subarray items[l...r-1] and its children from the subarray
// childs[l...r].
this.items = (E[])new Comparable[order];
this.childs = new Node[order+1];
this.size = 0;
for (int j = l; j < r; j++) {
this.items[this.size] = items[j];
this.childs[this.size] = childs[j];
this.size++;
this.childs[this.size] = childs[r];
private boolean isLeaf () {
// Return true if and only if this node is a leaf.
return (childs[0] == null);
private int searchInNode (E item) {
// Return the index of the leftmost element in this node that is
// not less than item.
int l = 0, r = size-1;
while (l <= r) {
int m = (l + r)/2;
int comp = item.compareTo((E)items[m]);
if (comp == 0)
return m;
else if (comp < 0)
r = m - 1;
else
l = m + 1;
return l;
private void insertInNode (E item, Node leftChild,
Node<E> rightChild, int ins) {
// Insert element item, with children leftChild and rightChild, at
// position ins in this node.
for (int i = size; i > ins; i--) {
items[i] = items[i-1];
childs[i+1] = childs[i];
size++;
items[ins] = item;
childs[ins] = leftChild;
childs[ins+1] = rightChild;I've done with the majority of it, however I need
help with the remove method for a B tree. when
removing from a non-leaf node, your remove must
replace the removed item with the smallest item in
the right subtree. It's hard to implement a B tree. That's why you rather use a standard implementation. If not you're basically on your own. Don't expect others to do it for you. Why should they bother? Please tell us when you're finished and where we can download you B-tree implementation -:) -
Can someone help with this simple application
I am taking my first java class and there are limited resourses for the class as far as getting help with coding.
Any hoo if any one can point me in the correct direction from the following information listed below I would be greatfull. I am trying to use the set and get methods on the instance veriables and then I am goign to post the results once I get them workign to a JOption pane window.
examples are most welcome thanks
// Invoice.java
// Homework assignment 3.13
// Student Arthur Clark
public class Invoice // public class
String partNumber;// instance veriable quantity
String partDescription;// instance verialbe partDescription
//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructors
//method getpartNumber
public String getpartNumber()
return partNumber;
}//end method getpartNumber
public String getpartDescription()
return partDescription;
}// end method getpartDescription
public void displayMessage()
//this is the statement that calls getpartNumber
System.out.printf(" part number # \n%s!\n the description", getpartNumber(), getpartDescription() );
} // method displaMessage
}// end method main
// Fig. 3.14 InvoiceTest.java
// Careate and manipulate an account object
import java.util.Scanner;
import javax.swing.JOptionPane;//import JOptionPane
public class InvoiceTest{
// main method begins the exciution of the program
public static void main ( String args [] )
// create Scanner to obtain input from mommand window
Scanner input = new Scanner ( System.in );
// create a Invoice object and assig it to mymethod
Invoice myMethod = new Invoice();
Invoice myMethod2 = new Invoice();
// display inital value of partName, partDescriptoin
System.out.printf( "inital partname is %s\n\n", myMethod.getpartNumber() );
// prompt for and read part name, partDescription
System.out.println( "please enter the Part Number:" );
String theNumber = input.nextLine(); // read a line of text
myMethod.setpartNumber( theNumber ); // set the part name with in the parens
System.out.println();// outputs blank line
myMethod.displayMessage();
System.out.println( "please enter the Part Description" );
String theDescription = input.nextLine(); // read a line of text
myMethod2.setpartDescription( theDescription );// set the part description
System.out.println();// outputs blank line
myMethod2.displayMessage();
}// end main mehtod
}// end class//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructorsThe above code is not a constructor. You do not include a return type, void or anything else. Also, the constructor should be called the same as your class.
public Invoice( String number, String description )
partNumber = number;
partDescription = description;
} Another thing, comments should only be used when it isn't bleedingly obvious what your code is doing.
P.S. is your middle initial C? -
Help with a Flash project im attempting
need a little help with the direction of where i want to go
with a flash app im trying to make. What it is that im doing is an
prototype application for a treasure hunt. (The prototype is so
that it can be used on a hand held PDA) the specification are
below:
A Treasure Hunt provides participants with clues which leads
them to discover a route and requires them to answer questions
along the way. Answers are scored as follows:
Correct answers 10 points
After 1 hint 5 points
After 2 hints 2 points
Incorrect answers -2 points
The 2nd hint gives the exact position on the map so that the
participant can keep to the route and not get lost.
I am going to design a Flash application (for the Flash 6
player only) which will run on a mobile device (PDA) with Windows
Mobile 2003 as the operating environment with a small screen
240x320 pixel resolution either portrait or landscape and 65K
colour depth. The device has a pointing device (stylus),
microphone, speaker and earphone socket. It is WiFi enabled to take
advantage of WiMax which will enable mobile devices to access the
internet over a wide geographic area such as a town.
I have considered providing the following functionality:
· Setup options eg: choose the Treasure Hunt from
alternatives, language options, accessibility options such as voice
output (could simulate voice command input)
· Present clues as either text or image (could simulate
voice output)
· Provide access to the internet eg: Google for
searching for information
· Keep a record of the score and allow participant to
keep track
· Present progress along the route on the map
–needs zoom in/out and/or scroll
· Save progress if a pause is needed
· Total time taken
· Provision for one or more sponsoring
organisation’s advert/logo (doesn’t have to be on
screen all the time)
Now ive been trying to think for the last couple of days what
the best way to create this is, but im having a really big mental
block on it. Now im not the best at flash, so it need only be a
basic application. I know how im going to do the map and then
language changes but thats about it at the moment.
So can anyone give me any advice on how to go about creating
this sort of thing, if you could give me any information, and where
would be the best place to start - i'd appreciate it greatly!Thinking about it, (its late) because its only a prototype
that i have to create, it doesn't necessarily have to work, im only
just showing examples of what it can do so all of those features do
not have to work correctly. That sounds about right doesn't it? lol
jees im tired :D
Maybe you are looking for
-
Intermitte​nt PDF printing with HP 8620
Inconsistent printing of PDF files (some print - some do not). All PDF files print when using ePrint (HP version of remote printing). Using Laptop. Setup to print and system locks after seeing screen Updated with number of pages printing (percentage
-
Following a botched repair and subsequent non genuine Windiws 7install to my HP G62-107SA Notebook, I decided to order an HP Recovery Kit. Disk 1 seems to install fine without error messages then the system asks for Disk 2. When Disk 2 is inserted, t
-
Hi gurus, I'm facing the follow issue: In some transactions as SNOTE or SPAU while I'm trying to implement a correction by selecting the menu option Goto > Determine Adjustment Mode > Specify Adjustment Modes and Delete Objects, the transaction seem
-
Hello Experts, i am seeing following error messages in database alert log. based on error message OS process was not able to connect one of the cell server. is there any way to find why it is failing to connect cell server? OSPID: 27669: connect: oss
-
Event 1001 Bug Check Windows 7 Ultimate 64-bit
Log Name: System Source: Microsoft-Windows-WER-SystemErrorReporting Date: 1/17/2014 6:56:51 PM Event ID: 1001 Task Category: None Level: Error Keywords: Classic User: N/A Computer: KT-PC Descriptio