Help with bug

Hello there,
I ve been trying to find an error in my code for several days with no success. Can anyone help me please?
I have used a JPasswordField to enter a password to recognize a user.
The class below uses the findUser method to find a user according to its user number aUserNo.
import java.util.*;
public class RestaurantLogInOut {
ArrayList users = new ArrayList();
char[] waiterPassword = {};
char[] managerPassword = {'3','3','3'};
public RestaurantLogInOut() {
users.add(new Waiter("MAX","10", waiterPassword));
users.add(new Waiter("TOM","11", waiterPassword));
users.add(new Waiter("KAYE","12", waiterPassword));
//the class Manager is a subclass of Waiter//
users.add(new Manager("ELLI", "1", managerPassword));
public Waiter findUser (String aUserNo) {
for (int i=0; i < users.size(); i++) {
Waiter aWaiter = (Waiter ) users.get(i);
if (aWaiter.getServerNo().equals(aUserNo))
return aWaiter;
return null;
When I click on the button that checks the password the following code is fired:
void passwordButton_actionPerformed(ActionEvent e) {
aWaiter = aRest.findUser(userNoTextField.getText());
serverPassword = aWaiter.getPassword();
String aString = new String(serverPassword);
System.out.println("The manager name is: "+ aWaiter.getServerName());
System.out.println("The manager user number is: "+ aWaiter.getServerNo());
System.out.println("The manager password is: "+ aString);
char[] inputPassword = passwordField.getPassword();
String bString = new String(inputPassword);
System.out.println("The input password is: "+ bString );
if(aWaiter.isPasswordCorrect(passwordField.getPassword(), serverPassword))
System.out.println("Password OK ");
else
JOptionPane.showMessageDialog(this,
"Incorrect password. Please re-enter password.",
"Input error",
JOptionPane.ERROR_MESSAGE);
//this method checks that the manager password and the input password match//
public boolean isPasswordCorrect(char[] input, char[] aServerPassword) {
boolean isCorrect = true;
if (input.length != aServerPassword.length) {
isCorrect = false;
} else {
for (int i = 0; i < input.length; i++) {
if (input[i] != aServerPassword) {
isCorrect = false;
//Zero out the password.
for (int i = 0; i < aServerPassword.length; i++) {
aServerPassword[i] = 0;
return isCorrect;
When I enter the wrong password for example: '2','2','2'
I get the correct output:
The manager name is: ELLI
The manager user number is: 1
The manager password is: 333
The input password is: 222
However if I attempt to re enter the correct password the manager password is not there anymore:
The manager name is: ELLI
The manager user number is: 1
The manager password is:
The input password is: 333
Can anyone explain to me what I am doing wrong?
Thanks a lot.
Max

Use code tags please
Your code is long enough - its even harder to read without the tags.
import java.util.*;
public class RestaurantLogInOut {
ArrayList users = new ArrayList();
char[] waiterPassword = {};
char[] managerPassword = {'3','3','3'};
public RestaurantLogInOut() {
users.add(new Waiter("MAX","10", waiterPassword));
users.add(new Waiter("TOM","11", waiterPassword));
users.add(new Waiter("KAYE","12", waiterPassword));
//the class Manager is a subclass of Waiter//
users.add(new Manager("ELLI", "1", managerPassword));
public Waiter findUser (String aUserNo) {
for (int i=0; i < users.size(); i++) {
Waiter aWaiter = (Waiter ) users.get(i);
if (aWaiter.getServerNo().equals(aUserNo))
return aWaiter;
return null;
When I click on the button that checks the password the following code is fired:
void passwordButton_actionPerformed(ActionEvent e) {
aWaiter = aRest.findUser(userNoTextField.getText());
serverPassword = aWaiter.getPassword();
String aString = new String(serverPassword);
System.out.println("The manager name is: "+ aWaiter.getServerName());
System.out.println("The manager user number is: "+ aWaiter.getServerNo());
System.out.println("The manager password is: "+ aString);
char[] inputPassword = passwordField.getPassword();
String bString = new String(inputPassword);
System.out.println("The input password is: "+ bString );
if(aWaiter.isPasswordCorrect(passwordField.getPassword(), serverPassword))
System.out.println("Password OK ");
else
JOptionPane.showMessageDialog(this,
"Incorrect password. Please re-enter password.",
"Input error",
JOptionPane.ERROR_MESSAGE);
//this method checks that the manager password and the input password match//
public boolean isPasswordCorrect(char[] input, char[] aServerPassword) {
boolean isCorrect = true;
if (input.length != aServerPassword.length) {
isCorrect = false;
} else {
for (int i = 0; i < input.length; i++) {
if (input != aServerPassword) {
isCorrect = false;
//Zero out the password.
for (int i = 0; i < aServerPassword.length; i++) {
aServerPassword = 0;
return isCorrect;
}

Similar Messages

  • Help with Bugs, Please!!!

    To make a long story short,
    I first was having problems (still am) with "core audio overload", I would play a project then boom error. Sometimes this happens every few seconds which makes it impossible to do anything and makes you look like an idiot when you are showing someone your progress.
    I get the error even with only a few recorded instruments. I always hit option x to get the status bar for the CPU and DISK. The CPU and disk run really low (maybe 5-10%) with all of the songs I work on, then I get an error after which the CPU spikes. I have changed all of the different audio settings some have helped a little.
    I have tried to play the sample songs that Logic came with specifically the Shiny Toy Guns - LeDisko and it happens with that song too. I saved the project to my hard drive thinking the issues was having it on the CD. It still does not play without the overload error. I would think a 3.0ghz MacPro with 6Gb of RAM and 500Gb HD X4 (OS on one and logic files on another hard drive) would be able to handle this?!?
    I have done a lot of different searches on different boards and it seems like I need to wait for an update. Anyone have something to try?
    The next thing that has happened on a few of my projects is Logic seems to be overlapping the different audio tracks. I will have guitar on one track and a drum loop another. If I turn up the guitar volume (which can barely be heard), it changes the drum volume. On another project the drum loop cannot be heard and have not found a way to get the volume up. I have to place it is another audio track.
    Does anyone have any experience with this issue? Please any help would be wonderful!!!
    I have had other issues but won't even go there. I am thinking about taking it to the Genius Bar just don't have a lot of extra time.
    I am getting pretty frustrated with these bugs and am thinking about switching back to Logic Pro 7.2

    Hello there.. I am having the same issues. Right after the last OSX Update the core audio quits and lag time whenever I edit or try to edit anything turns "the wheel of terror" and I am not able to save anything on Logic 8. I got so frustrated after calling Apple and accomplishing absolutely nothing . They suggested I would #1 defragment the drive (done) and roll back the operating system to an earlier version which would totally suck because of the number of pluggins that I would have to re-install or re authorize would take me weeks. The other delightfull errors I am getting are Audio was too slow ...error # 10010 .. or drive was too slow to process data. I have literally exhausted all options and I am a geek and nothing short of re-installing or rolling back the OS that seems to be the best option according to Apple although they are too proud to admit that they need updates are more bug filled than the previous version.. What a nightmare..! If you happen to come accross any fixes please email me or reply to this post and good luck..
    Peter

  • Help with bug fix

    hey peeps i am running the following code to call a seperate gui from a seperate call but i get this error what does it mean? and how can i fix it
    C:\Documents and Settings\suresh\Desktop\ass\Mailc.java:107: non-static method setVisible(boolean) cannot be referenced from a static context
    Send.setVisible(true);
    public void actionPerformed(ActionEvent e)
    if (ac.equals("Open")){
              Send = new Send();          
             Send.setVisible(true);
        }

    this is the class i'm trying to call
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    //import javax.mail.*;
    //import javax.mail.event.*;
    //import javax.mail.internet.*;
    public class Send extends Frame {
    String mailHost = "smtp.ntlworld.com";
    Label toLabel = new Label("To:");
    Label fromLabel = new Label("From:");
    Label subjectLabel = new Label("Subject:");
    Label contentLabel = new Label("Content:");
    Label statusLabel = new Label("Status:");
    TextField destination = new TextField();
    TextField source = new TextField();
    TextField subject = new TextField();
    TextArea content = new TextArea();
    Button send = new Button("Send Message");
    TextArea status = new TextArea();
    public static void main(String args[]){
      Send app = new Send();
    public Send() {
      super("Send");
      setup();
      addWindowListener(new WindowEventHandler());
      setSize(550,450);
      show();
    void setup() {
      setupMenuBar();
      layoutComponents();
      send.addActionListener(new ButtonHandler());
    void setupMenuBar() {
      MenuBar menuBar = new MenuBar();
      Menu fileMenu = new Menu("File");
      MenuItem fileExit = new MenuItem("Exit");
      fileExit.addActionListener(new MenuItemHandler());
      fileMenu.add(fileExit);
      menuBar.add(fileMenu);
      setMenuBar(menuBar);
    void layoutComponents() {
      int x = 10;
      int y = 50;
      // Set bounds
      toLabel.setBounds(x,y,50,25);
      destination.setBounds(x+70,y,300,25);
      fromLabel.setBounds(x,y+40,50,25);
      source.setBounds(x+70,y+40,300,25);
      subjectLabel.setBounds(x,y+80,50,25);
      subject.setBounds(x+70,y+80,300,25);
      contentLabel.setBounds(x,y+120,50,25);
      content.setBounds(x+70,y+120,300,100);
      statusLabel.setBounds(x,y+240,50,25);
      status.setBounds(x+70,y+240,300,100);
      send.setBounds(400,y,100,30);
      // Add components
      add(toLabel);
      add(destination);
      add(send);
      add(fromLabel);
      add(source);
      add(subjectLabel);
      add(subject);
      add(contentLabel);
      add(content);
      add(statusLabel);
      add(status);
      add(new Label(""));
    void sendMessage() {
      Properties properties = new Properties();
      properties.put("mail.smtp.host",mailHost);
      properties.put("mail.from",source.getText());
      //Session session = Session.getInstance(properties, null);
      try {
      // Message message = new MimeMessage(session);
      // InternetAddress[] address =
      //  {new InternetAddress(destination.getText())};
      // message.setRecipients(Message.RecipientType.TO, address);
      // message.setFrom(new InternetAddress(source.getText()));
      // message.setSubject(subject.getText());
      // message.setContent(content.getText(),"text/plain");
      // Transport transport = session.getTransport(address[0]);
      // transport.addConnectionListener(new ConnectionHandler());
      // transport.addTransportListener(new TransportHandler());
      // transport.connect();
      // transport.sendMessage(message,address);
      }catch(Exception e){
       status.setText(e.toString());
    // class ConnectionHandler extends ConnectionAdapter {
    // public void opened(ConnectionEvent e) {
      // status.setText("Connection opened.");
    // public void disconnected(ConnectionEvent e) {
    //  status.setText("Connection disconnected."); 
    // public void closed(ConnectionEvent e) {
      // status.setText("Connection closed."); 
    //class TransportHandler extends TransportAdapter {
    // public void messageDelivered(TransportEvent e) {
      // status.setText("Message delivered."); 
    // public void messageNotDelivered(TransportEvent e) {
      // status.setText("Message NOT delivered."); 
    // public void messagePartiallyDelivered(TransportEvent e) {
    //  status.setText("Message partially delivered."); 
    class ButtonHandler implements ActionListener {
      public void actionPerformed(ActionEvent ev){
       String s=ev.getActionCommand();
    //  if(s.equals("Send Message")) sendMessage();
    class MenuItemHandler implements ActionListener {
      public void actionPerformed(ActionEvent ev){
       String s=ev.getActionCommand();
       if(s=="Exit"){
        System.exit(0);
    class WindowEventHandler extends WindowAdapter {
      public void windowClosing(WindowEvent e){
       System.exit(0);
    //

  • Beginner Seeking Help with Bug Issue

    Hi, after learning C++ for a while, my class started teaching Java. There's this odd problem that I've never seen before.
    The code (console app):
    public class Practice2
         public static void main(String[] args)
              System.out.println("Hello World!");
    The Error Message:
    Exception in thread "main" java.lang.NoClassDefFoundError: Practice 2

    Harlow,
    First the solution provided by aghost should be tried if it holds true then
    The Error Message:
    Exception in thread "main" java.lang.NoClassDefFoundError: Practice 2
    The following error is basically caused becoz your java file is not compiling and thats why your compiler does not find the class file(which is the compiled form of your java file), either the java file name is not proper, try compiling from command prompt it would give u a more logical error about the problem.
    rgds
    Sachin Saurabh Saxena

  • Need help with a currently "in-use" form we want to switch to Adobes hosting service

    Hi, I am in desperate need of help with some issues concerning several forms which we currently use a paid third party (not Adobe) to host and "re-distribute through email"...Somehow I got charged $14.95 for YOUR service, (signed up for a trial, but never used it)..and now I am paying for a year of use of the similar service which Adobe is in control of.  I might want to port my form distribution through Adobe in the hopes of reducing the errors, problems and hassles my customers are experiencing when some of them push our  "submit button". (and I guess I am familiar with these somewhat from reading what IS available in here, and I also know that, Adobe is working to alleviate some of these " submit"  issues, so let's don't start by going backwards, here) I need solutions now for my issues or I can leave it as is, If Adobe's solution will be no better for my end users...
    We used FormsCentral to code these forms and it works for the most part (if the end-user can co-operate, and thats iffy, sometimes), but I need help with how to make it go through your servers (and not the third party folks we use now), Not being cruel or racist here, but your over the phone "support techs" are about horrible & I cannot understand them or work with any of them, so I would definitely need someone who speaks English and can understand the nuances of programming these forms, to please contact me back. (Sorry, but both those attributes will be required to be able to help me, so, no "newbie-interns" or first week trainees are gonna cut it).... If you have anyone who fits the bill on those items and would be willing to help us, please contact me back at your earliest convenience. If we have to communicate here, I will do that & I can submit whatever we need to & to whoever we need to.
    I need to get this right and working for the majority of my users and on any platform and OS.
    You may certainly call me to talk about this, and I have given my number numerous times to your (expletive deleted) time wasting - recording message thingy. So, If it's not available look it up under [email protected]
    (and you will probably get right to me, unlike my and I'm sure most other folks',  "Adobe phone-in experiences")
    Thank You,
    Michael Corman
    VinylCouture
    Phenix City, Alabama  36869

    Well, thanks for writing back...just so you know...I started using Adobe products in 1987, ...yeah...back then...like Illustrator 1 & 9" B&W Macs ...John Warnock's Helvetica's....stuff like that...8.5 x 11 LaserWriters...all that good stuff...I still have some of it working on a mac...much of it was stuff I bought. some stuff I did not...I'm not a big fan of this "cloud" thing Adobe has foisted upon the creatives of the world...which I'm sure you can tell...but the functionality and usefulness of your software can not be disputed, so feel free to do whatever we will continue to pay for, ...I am very impressed with CC PS on the 64 bit PC and perhaps I will end up paying you the stipend that you demand for the other services.
    So  I guess that brings us to our problem.. a few years back and at the height of the recession and near bankruptcy myself,  I was damn lucky and hit on something and began a small arts and crafts supply service to sell my products online to a very "niche market" ...I had a unique product and still sell that product (plus others) online...My website is www.vinylcouture.com...Strange? Yes...but there is a market it seems, for everything now, and this is the market I service...Catagorically, these are 99%+ women that use these "adhesive, sticky backed vinyl products"  to make different "craft items" that are just way too various and numerous to go into... generally older women, women who are computer illiterate for the most part...and all this is irrelevant to my problem, but I want you to have every bit of background on this and especially the demographic we are dealing with, so we can get right to the meat of the problem.
    OK...So about two years ago, I decided to offer a "plain sheet" product of a plain colored "stick back" vinyl... it is available in multiple quantities of packs ( like 5 pieces, 10 pieces, 15 pieces, in a packi  & so on)...and if you are still on my site.. go to any  "GO RIGHT TO OUR ORDER PAGE"  button, scroll down a little...and then to the "PLAIN VINYL" section...you will see the Weebly website order process.) You can back out from here, I think,..but, anyway this product is available in 63 colors + or - a few. So then the problem is,  how do they select their individual colors within that (whatever) pack?... .
    So my initial idea was to enable a "selection form" for these "colors" that would be transmitted to me via email as 'part" of the "order process".. We tried getting our customers to submit a  " a list" ( something my competitiors still do, lol, poor bastards)......but that..is just unbelievable..I can't even begin to tell you what a freakin' nightmare that was...these people cannot even count to 10, much less any higher... figuring out what colors to list and send me... well, lets just say, it wasn't working......I had to figure out a better way...Something had to be done.
    So after thinking this all out,  and yeah...due to my total ignorance, i figured that we could make a form with Live Cycle Designer (Now Forms Central)...(back then something that was bundled with Adobe Acrobat Pro), I believe, and thats what this thing was authored in... and it would be all good...LOL!
    Well not so simple...as you well know, Adobe Acrobat would NOT LET YOU EMAIL anything from itself.....it just wouldn't work (and I know why, and all that hooey), but not being one to take NO for answer,.I started looking for a way to make my little gizmo work.. So I found this company that said they can "hijack" (re-direct actually) the request to email, bypass the wah-wah, and re-transmit it to the proper parties.....for less than $100 a year,  I think...its called http://pdf-fillableforms.com/.
    A nice gentleman named Joseph Silva helped us program the thing to go to his servers and back out. Please dont hassle them...I need them...for now..it basically does work...try it...you should get back a copy of the form that you filled out...good luck however,  if you're on MAC OSX or similar...
    I have included a copy of both of our forms (and feel free to fill it out and play with it)...just put test somewhere on it...(and you must include YOUR email or it will balk)..they are supposed to be mostly identical, except one seems to be twice as large....generating a 1.7 meg file upon submission, while the other one only generates a 600K file or so...thats another issue for another day or maybe you can advise on that also...
    OK so far so good......In our shop, once Grandma buys a 10 pack (or whatever), Only then she gets to the link on her receipt page ro the relevant "selection form" ,(this prevents "Filling and Sending"  with "no order" and "no payment", another early problem we had)... which they can click on and it will usually download and open up on their device if all goes well...Then our little form is supposed to be fillable and is supposed to ADD UP all the quantities, so grandma knows how many she is buying and so forth right on the fly,  and even while she changes her mind..., and IT'S LARGE so grandma can see it, and then it TOTALS it all up for them, ( cause remember, they can NOT add)..,  except there is a programming bug (mouse-click should be a mouse-up probably or something..) which makes you click in the blank spaces to get to a correct TOTAL...about 70-80% of our customers can enable all these features and usually the process completes without problems for them especially on PC's running Windows OS and Acrobat Reader X or XI...at least for most... Unfortunately it is still not the "seamless process" I would like or had envisioned for the other folks out there that do have trouble using our form....  Many folks report to us the following issues that we know of.  First of all it takes too much time to load up...We know its HUGE...is there anyway that you can see, to streamline this thing? I would love for it to be more compact...this really helps on the phones and pads as I'm sure you well know.
    Some just tell us,"it WON'T work"....I believe this is because they are totally out of it and dont even have Adobe Reader on their machine, & don't know how to get it ( yes, we provide the links).....or it's some ancient version....no one can stop this one...
    It almost always generates some kind ( at least one time)  of "error message" which we do warn them about..., telling one,  basically that "Acrobat doesnt even like this happening at all, and it could be detrimental to ones computer files", blah-blah...(this freaks grandma out really bad)...& usually they end up not even trying to send it...  and then I get calls that even you wouldn't believe...& If they DO nut up and push the Red "Submit Form" button, it will usually send the thing to us (and also back to them at the "required email address" they furnished on the form, thats what the folks at the "fillable forms place" do) so, if it's performing it's functions, why it is having to complain?. What are we doing wrong?....and how can I fix it?...Will re-compiling it or saving it as a newer version of "FormsCentral" correct any of these problems ?
    Ok, so that should keep you busy for a minute and we can start out with those problems...but the next thing is, how can I take advantage of YOUR re-direct & hosting services?, And will it get rid of the error messages, and the slowness, and the iOS incompatibilities ? (amazingly,  the last iOS Reader version worked almost OK.. but the newest version doesnt seem to work with my form on my iphone4)  If it will enable any version of the iOS to send my form correctly and more transparently, then it might be worth the money...$14.95 a MONTH you say. hmmmmm...Better be good.
    Another problem is, that I really don't need 5000 forms a month submitted. I think its like 70-100 or less....Got any plans for that?  Maybe I'm just not BIG ENOUGH to use Adobe's services, however in this case, I really don't care whose I do use as long as the product works most correctly for my customers as well as us. Like I said, If I'm doing the best I can, I won't change anything, and still use the other third party, If Adobe has a better solution, then i'm all for that as well. In the meantime, Thanks for any help you can provide on this...
    Michael Corman
    VinylCouture.com
    (706) 326-7911

  • New Mac user looking for help with Finder, Preview, Keyboard, & Dock

    So about a month ago I switched over from a lifelong Windows user to a brand new MacBook Pro, and while I am adjusting pretty well, there are still some things that I haven't quite figured out.
    First up on the list is Finder! I like my files to be arranged just like how they are in Windows Explorer--folders first alphabetically, then files alphabetically. I've managed to acquire this setting by messing around with the "clean up by" and "arrange by" functions but I don't really know the specific combination. Most of the time these preferences are saved and set as the defaults under "View Options" but every once in a while it resets and I have to tinker around with the settings all over again. Does anyone know of a way to fix this? It's only happened twice so far, but I'd rather not have it happen again. Also, occasionally when I delete an item, there is a blank space left where the icon was instead of all the files following it bumping up a space. Any quick fixes for this bug?
    Next up is Preview. Again, I like the Windows Way and I like to be able to browse between the files in a folder while using Preview/Windows Photo Viewer. I know that there is a way to browse between files if you select the whole folder and stick it in Preview, but is there a way to achieve the same result without having to do that? An app or "extension" of some sort that adds arrows in to browse between photos? I've had no luck finding anything other than the aforementioned option. Is there a good free alternative to Preview that will function similarly with the browse between photos option?
    One of my favorite things about my new Mac is the backlit keyboard function. My old laptop didn't have it and as someone who is online more often at night it is super helpful. But is there a way to turn it off during the day/in bright settings? A way to put it on a timer? In System Preferences I selected the option "Adjust keyboard brightness in low light", which I assumed to mean would have the keyboard NOT very bright when there IS light, but it continues to light up just the same. Any apps or extensions to help with this one?
    And finally, the dock! This question is more about aesthetics than functionality but help is appreciated all the same. Currently, my dock looks like this: http://i42.tinypic.com/35ktxlz.png It is rather opaque and the indicator lights can barely be seen. However, in a lot of tutorial videos I've been watching, many people have docks that look like this: http://i.i.cbsi.com/cnwk.1d/i/tim/2011/07/19/Lion_LaunchPad.png It is a darker shade of gray, the divider is dashed rather than a straight line, and the indicator lights are clearly visible. Does anybody know how to get this look for the dock? I've looked in the dock preferences but there's not really anything in there other than magnification/size/effects.
    That about sums things up! I'm sorry if any of these seem like "silly" questions but they are all things I have been unable to find answers for. Any and all tips, tricks, and help is appreciated! Thanks in advance for all your help!!

    congratulations on coming over from the dark side.
    Seems like you are interested in column view, which would show you the hierarchy of folders and files:  Column View in Mac OS X Mountain Lion - For Dummies Not sure what's going on if your finder settings don't stay put. May be a corrupted preferences file, which is easy to fix, but is perhaps a topic for another discussion.
    What I'd suggest is to have an open mind and try to see what the mac can do, rather than force it to look like your windows machine. I mean, if you just want it to look like windows, then why bother switching? If you give it a little time, you'll start to appreciate the mac way of doing things, and see how it is infinitely more awesome, powerful, creative, intuitive, and better designed (and the software way better written)  than what you left behind. But that's your call.
    There are some threads on this forum with complaints about the backlight. Keyboard backlight settings query...: Apple Support Communities  Evidently it depends on the angle of the screen and the light sensor relative to the light. Some suggest that a SMC reset may help: Intel-based Macs: Resetting the System Management Controller (SMC)  This is not an issue for me, I just adjust the brightness with the keyboard buttons if I want. Real men shift their own gears, drink their coffee black, and adjust their own keyboard brightness. I am not aware of any software to exert more control over this feature but a search of macupdate  Download Apple Mac Software & iPhone Software : MacUpdate may help. I mean, it's up to you what is important. I can waste a lot of time playing around with the GUI and with unnecessary software, or I can just get my work (and play) done.
    You might prefer the no-glass dock, that removes the shelf, and makes the indicator lights like more discrete orbs. You can do this with the terminal. Using the terminal is also, perhaps, a topic for another discussion.I like the 2D dock much better. If you want I'll give you some directions for how to do it. Otherwise, here's a reference: 2D Dock - MacRumors Forums

  • The best way to get help with logic

    I was posting in a thread on support for logic which appears to have been deleted. anyway, what I was going to say I think is useful info for people, so I'm going to post it anyway. to the mods - it doesn't contain any speculation about policies or anything like that. just an explanation of my views on the best way to deal with issues people have with logic, which I think is a valuable contribution to this forum.
    I think there's a need for perspective. when you buy an apple product you get 90 days of free phone support to get everything working nice and neat. you can call them whenever, and you could actually keep them on the phone all day if you wanted, making them explain to you how to copy a file, install microsoft office, or any number of little questions no matter how simple - what is that red button thingy in my window for?.. on top of that, you've got a 14 day dead on arrival period (or 10 days I can't remember) in which if your machine has any kind of hardware fault whatsoever it's exchanged for a totally new one, no questions asked. a lot of people complain that applecare is overpriced.. and if you think of it just as an extended warranty, then it is a little pricey. but if you are someone that could use a lot of phone support, then it's actually potentially a total bargain. the fact that 2 or more years after you bought a computer, you could still be calling them every single day, asking for any kind of advice on how to use anything on the machine, is quite something. many people on this forum have had problems when they made the mistake of upgrading to 10.4.9 without first creating a system clone or checking first with their 3rd party plug in vendors to make sure it was ok. so, with apple care, you could call them and keep a technician on the phone _all day_ talking you through step-by-step how to back up all of your user data, how to go through and preserve your preferences and any other specific settings you might not want to lose, and then how to rollback to an earlier OS version.. they'll hold your hand through the whole thing if you need them to.
    as for applecare support for pro apps like logic, I'd be the first person to agree that it's not great for anyone except beginners and first time users. if you look at what it takes to get even the highest level of logic certification, it's all pretty basic stuff. and logic doesn't exist in a vacuum, there is an entire universe of 3rd party software and hardware, as well as studio culture and advanced user techniques that are going to be totally invisible to some poor phone support guy at apple that did a logic 101. but it's not hard to see that apple are trying to promote a different kind of support culture, it's up to you to decide whether you want to buy into it or not.
    the idea is that they are able to provide basic setup support for new users, including troubleshooting. because it's a simpler level of support, at least they can do this well. so there's no reason why any new user with say a new imac and logic can't get up and running with the 90 days of phone support they get for free.
    but the thing is, for extremely high end pro users it's a different matter altogether. pro use of logic within the context of say, a studio or a film composition scenario is a very different world. it's almost a nonsense to imagine that apple could even hire people capable of giving useful support for this end of the spectrum, over the phone. there are so many variables, and so many things that require a very experienced studio person or in-work composer to even begin to understand the setup, let alone troubleshoot it. and it's a constantly evolving world, you actually have to be working in it and aware of developments on 3rd party fronts as well as changes in hardware.. not to mention even changes in the culture of studio production and the changed expectations that come from that. there's no way some poor little guy sitting at a help desk at apple can even hope to be privy to that kind of knowledge. it's already good enough that they don't outsource their support staff to india, let alone go out to studios and hire the very people with the skills that should be staying in the studio! not answering phones for apple.
    so, given this reality.. companies have two choices. they can either offer an email based support ticket system, which others do. but in my opinion.. this can just be frustrating and only a half-solution. sure you 'feel' like you are getting a response from the people that make the software and therefore must know it.. but it's not really the case due to what I said above. DAWs don't exist in a vacuum, and so much of what you need to understand to help people requires an intimate knowledge of the music industry in which they are working. you still won't get that from steinberg, even if they sort of answer your emails. the other problem is that this kind of system can mean sporadic answers, a lot of tail-chasing, and quite often you won't get an answer that helps you in the end anyway.
    the other model is to foster a strong user support culture. some people react in the wrong way to this idea.. they just think it's a big brush off from the manufacturer, saying we don't care, go sort it out yourselves.. but this isn't true. apple has a classification for pro resellers called 'apple solutions expert - audio'. what this means is that these dealers are recognised as audio specialists and they can receive extra support and training from apple for this. but more importantly than this.. most of them are music stores, or pro gear dealerships that are also mac and logic dealers. they already employ people that have worked or do work in the music industry, and are constantly on top of all of this stuff. apple encourages these dealers to run workshops, and to provide expert sales advice in the very niche area that logic is in, which they can do far better than some generic apple store ever could. but most importantly, they are encouraged to offer their own expert after-sales support and whatever other value-adding expertise they can, to get sales. because margins in computer gear are so tight nowadays, discounting is not really a viable option for these dealers to guarantee getting musicians to buy computers and logic setups from them. the only companies that can entice people with a lower price a big online wholesalers or big chain stores. so the best idea for these niche expert stores to get sales is to offer you their own experts to help with configuration, ongoing support and to generally make it a better idea that you bought your system from them rather than from some anonymous online store. I can see the wisdom of this.. it puts the support back out there on the ground where it's needed, and also where it can work best. apple could never hope to offer the same level of expertise in helping a film composer work through some issues with a specific interface or some highly specific issue they have with getting a task done. no big software manufacturer could do this anywhere near as well as people out there that have worked in studios or currently do work in studios. so in my opinion it's a far better model to foster this kind of support culture, along with training courses, books and training video support. also user forums like this one are possibly one of the most valuable ports of call anyone could ask for. apple couldn't replicate this with their own staff, even if they tried. and even if they made a system where some of the people close to logic development were able to answer emails, it would still be nowhere near as useful, as rapid or as capable of being up to speed with logic use out in the real world with 3rd pary gear, as any of these other methods are.
    the only thing I think they could do better would be to publish a list of known bugs which are officially recognised. this would help everyone and put an end to a lot of wasted time and speculation on if something is a bug totally to do with logic, or if it's a specific issue raised by a particular configuration.
    but really, in my view, a 3rd party support and training culture through a combination of specialist dealers, consultants that literally run a business setting up computers for pro-users and helping them keep it all working, online user-to-user forums and published materials really are the way forward.

    In all honesty this is currently the 3rd "logicboard" (motherboard)
    in my powerbook due to a design flaw regarding the 2nd memory slot....
    Yep. Mine failed five weeks after I bought it. However, I bought it for work and couldn't afford being without it for four weeks while they fixed it, so I had to live with it. My serial number did not entitle me to a replacement either, post Applecare.
    My firewire ports have burnt out from a third-party defective device (no hot-plugging involved)
    My screen is blotchy (my PW serial number did not entitle me to a replacement).
    My battery serial number did not entitle me to a replacement, and is not that good these days.
    My guaranteed Powerbook-compatible RAM is actually not, causing RAM related problems, most notably these days meaning that as soon as I switch to battery power, the laptop crashes, so I can only use mains power. The company I bought it from stopped taking my calls and wouldn't replace it after they replaced it once, so I'm stuck with it. And of course, only one ram slot is working, so I can't even use my original stick in the first slot, which would shift the dodgy stuff away from the lower system area.
    My power supply failed at the weak spot and caught fire. I managed to break apart the power supply and recable it so I didn't have to buy a new power supply, although the connection at the laptop end is loose (all the more fun that as soon as power is lost, the laptop crashes - see above). The power supply is held together with gaffa tape. Silver gaffer tape though, so it's still kind of 'Appley"...
    My internal hard drive is dying - four or five times now it clicks and won't power up, causing the laptop to die.
    One foot has fallen off (but glued back on).
    The lid is warped.
    The hinge is loosish.
    The S-Video adaptor cable is intermittent.
    But aside from all that, I have looked after it well, and I love it to death. Just as well, because it doesn't look like it will be that long...
    But it still "just works". Apart from the battery power obviously. And the ram slot. And the ram. And the screen. And the hard drive. And the firewire ports. And the feet.
    But everything apart from the main board, the screen, the case, the hard drive and the power supply works fine. So thats... er..
    Hmm.

  • Help with exporting Deski to text file via Web Intelligence

    We are currently converting from BO version 5 to BO XI rev2. I have a report that must be scheduled to a flie in plain text format. I am using a deski report. When I save as to text, the file is fine. When I schedule it in webi, the file seems to be missing the end of line character for each row in the table, so it cannot be used for an import to another program. Can anybody help with this?-

    well, in that case you need to determine if this issue only happens with a perticular report or all of them, if it happens only with reports imported from 5.x or with newly created reports as well.
    Looks like it is happening only when report is exported from Infoview, not in the Deski client. This might indicate a problem at the Web Apllication server (tomcat or one you use).
    If this issue is happening with any report - it might be a bug. In that case you have no options as there are no more patches for XIR2.
    On the other hand - if all you need is to extract data for consumption in another tool , why not use Data integrator instead ?
    Also, if this desn't work in Deski - does it work if you convert your reports to webi and export from those ?

  • Need Help With File Matching Records

    I need help with my file matching program.
    Here is how it suppose to work: FileMatch class should contain methods to read oldmast.txt and trans.txt. When a match occurs (i.e., records with the same account number appear in both the master file and the transaction file), add the dollar amount in the transaction record to the current balance in the master record, and write the "newmast.txt" record. (Assume that purchases are indicated by positive amounts in the transaction file and payments by negative amounts.)
    When there is a master record for a particular account, but no corresponding transaction record, merely write the master record to "newmast.txt". When there is a transaction record, but no corresponding master record, print to a log file the message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record). The log file should be a text file named "log.txt".
    Here is my following program code:
    // Exercise 14.8: CreateTextFile.java
    // creates a text file
    import java.io.FileNotFoundException;
    import java.lang.SecurityException;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class CreateTextFile
      private Formatter output1;  // object used to output text to file
      private Formatter output2;  // object used to output text to file
      // enable user to open file
      public void openTransFile()
        try
          output1 = new Formatter("trans.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          output2 = new Formatter("oldmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openOldMastFile
      // add transaction records to file
      public void addTransactionRecords()
        // object to be written to file
        TransactionRecord record1 = new TransactionRecord();
        Scanner input1 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0) and amount.","? ");
        while (input1.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record1.setAccount(input1.nextInt());    // read account number
            record1.setAmount(input1.nextDouble());  // read amount
            if (record1.getAccount() > 0)
              // write new record
              output1.format("%d %.2f\n", record1.getAccount(), record1.getAmount());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input1.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0) ",
            "and amount.","? ");
        } // end while
      } // end method addTransactionRecords
      // add account records to file
      public void addAccountRecords()
        // object to be written to file
        AccountRecord record2 = new AccountRecord();
        Scanner input2 = new Scanner(System.in);
        System.out.printf("%s\n%s\n%s\n%s\n\n",
          "To terminate input, type the end-of-file indicator",   
          "when you are prompted to enter input.",
          "On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
          "On Windows type <ctrl> z then press Enter");
        System.out.printf("%s\n%s",
           "Enter account number (> 0), first name, last name and balance.","? ");
        while (input2.hasNext())  // loop until end-of-file indicator
          try // output values to file
            // retrieve data to be output
            record2.setAccount(input2.nextInt());    // read account number
            record2.setFirstName(input2.next());      // read first name
            record2.setLastName(input2.next());       // read last name
            record2.setBalance(input2.nextDouble());  // read balance
            if (record2.getAccount() > 0)
              // write new record
              output2.format("%d %s %s %.2f\n", record2.getAccount(), record2.getFirstName(),
                record2.getLastName(), record2.getBalance());
            } // end if
            else
              System.out.println("Account number must be greater than 0.");
            } // end else
          } // end try
          catch (FormatterClosedException formatterClosedException)
            System.err.println("Error writing to file.");
            return;
          } // end catch
          catch (NoSuchElementException elementException)
            System.err.println("Invalid input. Please try again.");
            input2.nextLine(); // discard input so user can try again
          } // end catch
          System.out.printf("%s %s\n%s", "Enter account number (> 0),",
            "first name, last name and balance.","? ");
        } // end while
      } // end method addAccountRecords
      // close file
      public void closeTransFile()
        if (output1 != null)
          output1.close();
      } // end method closeTransFile
      // close file
      public void closeOldMastFile()
        if (output2 != null)
          output2.close();
      } // end method closeOldMastFile
    } // end class CreateTextFile--------------------------------------------------------------------------------------------------
    // Exercise 14.8: CreateTextFileTest.java
    // Testing class CreateTextFile
    public class CreateTextFileTest
       // main method begins program execution
       public static void main( String args[] )
         CreateTextFile application = new CreateTextFile();
         application.openTransFile();
         application.addTransactionRecords();
         application.closeTransFile();
         application.openOldMastFile();
         application.addAccountRecords();
         application.closeOldMastFile();
       } // end main
    } // end class CreateTextFileTest-------------------------------------------------------------------------------------------------
    // Exercise 14.8: TransactionRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    public class TransactionRecord
      private int account;
      private double amount;
      // no-argument constructor calls other constructor with default values
      public TransactionRecord()
        this(0,0.0); // call two-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public TransactionRecord(int acct, double amt)
        setAccount(acct);
        setAmount(amt);
      } // end two-argument TransactionRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set amount
      public void setAmount(double amt)
        amount = amt;
      } // end method setAmount
      // get amount
      public double getAmount()
        return amount;
      } // end method getAmount
    } // end class TransactionRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: AccountRecord.java
    // A class that represents on record of information
    package org.egan; // packaged for reuse
    import org.egan.TransactionRecord;
    public class AccountRecord
      private int account;
      private String firstName;
      private String lastName;
      private double balance;
      // no-argument constructor calls other constructor with default values
      public AccountRecord()
        this(0,"","",0.0); // call four-argument constructor
      } // end no-argument AccountRecord constructor
      // initialize a record
      public AccountRecord(int acct, String first, String last, double bal)
        setAccount(acct);
        setFirstName(first);
        setLastName(last);
        setBalance(bal);
      } // end four-argument AccountRecord constructor
      // set account number
      public void setAccount(int acct)
        account = acct;
      } // end method setAccount
      // get account number
      public int getAccount()
        return account;
      } // end method getAccount
      // set first name
      public void setFirstName(String first)
        firstName = first;
      } // end method setFirstName
      // get first name
      public String getFirstName()
        return firstName;
      } // end method getFirstName
      // set last name
      public void setLastName(String last)
        lastName = last;
      } // end method setLastName
      // get last name
      public String getLastName()
        return lastName;
      } // end method getLastName
      // set balance
      public void setBalance(double bal)
        balance = bal;
      } // end method setBalance
      // get balance
      public double getBalance()
        return balance;
      } // end method getBalance
      // combine balance and amount
      public void combine(TransactionRecord record)
        balance = (getBalance() + record.getAmount()); 
      } // end method combine
    } // end class AccountRecord -------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatch.java
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.util.NoSuchElementException;
    import java.util.Scanner;
    import java.util.Formatter;
    import java.util.FormatterClosedException;
    import org.egan.AccountRecord;
    import org.egan.TransactionRecord;
    public class FileMatch
      private Scanner inTransaction;
      private Scanner inOldMaster;
      private Formatter outNewMaster;
      private Formatter theLog;
      // enable user to open file
      public void openTransFile()
        try
          inTransaction = new Scanner(new File("trans.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openTransFile
      // enable user to open file
      public void openOldMastFile()
        try
          inOldMaster = new Scanner(new File("oldmast.txt"));
        } // end try
        catch (FileNotFoundException fileNotFoundException)
          System.err.println("Error opening file.");
          System.exit(1);
        } // end catch
      } // end method openOldMastFile
      // enable user to open file
      public void openNewMastFile()
        try
          outNewMaster = new Formatter("newmast.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openNewMastFile
      // enable user to open file
      public void openLogFile()
        try
          theLog = new Formatter("log.txt");
        catch (SecurityException securityException)
          System.err.println("You do not have write access to this file.");
          System.exit(1);
        } // end catch
        catch (FileNotFoundException filesNotFoundException)
          System.err.println("Error creating file.");
          System.exit(1);
      } // end method openLogFile
      // update records
      public void updateRecords()
        TransactionRecord transaction = new TransactionRecord();
        AccountRecord account = new AccountRecord();
        try // read records from file using Scanner object
          System.out.println("Start file matching.");
          while (inTransaction.hasNext() && inOldMaster.hasNext())
            transaction.setAccount(inTransaction.nextInt());     // read account number
            transaction.setAmount(inTransaction.nextDouble());   // read amount
            account.setAccount(inOldMaster.nextInt());     // read account number
            account.setFirstName(inOldMaster.next());      // read first name 
            account.setLastName(inOldMaster.next());       // read last name
            account.setBalance(inOldMaster.nextDouble());  // read balance
            if (transaction.getAccount() == account.getAccount())
              while (inTransaction.hasNext() && transaction.getAccount() == account.getAccount())
                account.combine(transaction);
                outNewMaster.format("%d %s %s %.2f\n",
                account.getAccount(), account.getFirstName(), account.getLastName(),
                account.getBalance());
                transaction.setAccount(inTransaction.nextInt());     // read account number
                transaction.setAmount(inTransaction.nextDouble());   // read amount
            else if (transaction.getAccount() != account.getAccount())
              outNewMaster.format("%d %s %s %.2f\n",
              account.getAccount(), account.getFirstName(), account.getLastName(),
              account.getBalance());         
              theLog.format("%s%d","Unmatched transaction record for account number ",transaction.getAccount());
          } // end while
          System.out.println("Finish file matching.");
        } // end try
        catch (NoSuchElementException elementException)
          System.err.println("File improperly formed.");
          inTransaction.close();
          inOldMaster.close();
          System.exit(1);
        } // end catch
        catch (IllegalStateException stateException)
          System.err.println("Error reading from file.");
          System.exit(1);
        } // end catch   
      } // end method updateRecords
      // close file and terminate application
      public void closeTransFile()
        if (inTransaction != null)
          inTransaction.close();
      } // end method closeTransFile
      // close file and terminate application
      public void closeOldMastFile()
        if (inOldMaster != null)
          inOldMaster.close();
      } // end method closeOldMastFile
      // close file
      public void closeNewMastFile()
        if (outNewMaster != null)
          outNewMaster.close();
      } // end method closeNewMastFile
      // close file
      public void closeLogFile()
        if (theLog != null)
          theLog.close();
      } // end method closeLogFile
    } // end class FileMatch-------------------------------------------------------------------------------------------------
    // Exercise 14.8: FileMatchTest.java
    // Testing class FileMatch
    public class FileMatchTest
       // main method begins program execution
       public static void main( String args[] )
         FileMatch application = new FileMatch();
         application.openTransFile();
         application.openOldMastFile();
         application.openNewMastFile();
         application.openLogFile();
         application.updateRecords();
         application.closeLogFile();
         application.closeNewMastFile();
         application.closeOldMastFile();
         application.closeTransFile();
       } // end main
    } // end class FileMatchTest-------------------------------------------------------------------------------------------------
    Sample data for master file:
    Master file                         
    Account Number            Name                     Balance
    100                            Alan Jones                   348.17
    300                            Mary Smith                    27.19
    500                            Sam Sharp                   0.00
    700                            Suzy Green                   -14.22Sample data for transaction file:
    Transaction file                    Transaction
    Account Number                  Amount
    100                                         27.14
    300                                         62.11
    300                                         83.89
    400                                         100.56
    700                                         80.78
    700                                         1.53
    900                                         82.17  -------------------------------------------------------------------------------------------------
    My FileMatch class program above has bugs in it.
    The correct results for the newmast.txt:
    100  Alan  Jones  375.31
    300  Mary  Smith  173.19
    500  Sam  Sharp  0.00
    700  Suzy Green  68.09The correct results for the log.txt:
    Unmatched transaction record for account number 400Unmatched transaction record for account number 900------------------------------------------------------------------------------------------------
    My results for the newmast.txt:
    100 Alan Jones 375.31
    300 Mary Smith 111.08
    500 Sam Sharp 0.00
    700 Suzy Green -12.69My results for the log.txt
    Unmatched transaction record for account number 700-------------------------------------------------------------------------------------------------
    I am not sure what is wrong with my code above to make my results different from the correct results.
    Much help is appreciated. Please help.

    From the output, it looks like one problem is just formatting -- apparently you're including a newline in log entries and not using tabs for the newmast output file.
    As to why the numbers are off -- just from glancing over it, it appears that the problem is when you add multiple transaction values. Since account.combine() is so simple, I suspect that you're either adding creating transaction objects incorrectly or not creating them when you should be.
    Create test input data that isolates a single case of this (e.g., just the Mary Smith case), and then running your program in a debugger or adding debugging code to the add/combine method, so you can see what's happening in detail.
    Also I'd recommend reconsidering your design. It's a red flag if a class has a name with "Create" in it. Classes represent bundles of independant state and transformations on that state, not things to do.

  • Need help with overlapping divs!

    Hey everyone,
    I'm working on another website and I have come up against a common problem for newbie designers from what I hear, the dreaded overlapping div problem!  I have a 2 column fixed layout with a floating left div.  My left div has my nav bar and various images.  When my main content div has more content than the left floating div, the left div border does not reach the footer!  Until now, I have gotten by with just hitting return in my left column div until it reaches the footer.  I am sure it is not the right way to do it but it has worked so far.  The problem is, now one of the pages has the left column div overlapping onto the footer!  I did some reading and I am guessing it involves either the box properties or clear float which I am not too familiar with.
    Any advice would be stellar!  I know this is just another stumbling block to get over but I would feel so much better if I was doing it the right way. 
    Here are screens of my issue,
    And here is my code for the page in question.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="shortcut icon" href="http://www.xldesignsonline.com/fchi/favicon.ico">
    <title>Full Circle Home Inspections</title>
    <link href="_css/main.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixLtHdr #sidebar1 { width: 230px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixLtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixLtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <style type="text/css">
    <!--
    body {
         background-color: #FFF;
    .paragraphLead {
         font-size: 110%;
         font-weight: bold;
    a:link {
         text-decoration: none;
         color: #CF0;
    a:visited {
         text-decoration: none;
    a:hover {
         text-decoration: none;
    a:active {
         text-decoration: none;
    #apDiv1 {
         position:absolute;
         width:236px;
         height:157px;
         z-index:1;
         left: 692px;
         top: 372px;
    #apDiv2 {
         position:absolute;
         width:200px;
         height:192px;
         z-index:2;
         left: 697px;
         top: 1443px;
    #apDiv3 {
         position:absolute;
         width:158px;
         height:204px;
         z-index:2;
         left: 643px;
         top: 1502px;
    -->
    </style>
    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    </head>
    <body class="twoColFixLtHdr">
    <div id="container">
      <div id="header">
        <h1><!-- end #header -->
      </h1></div>
      <div id="sidebar1">
        <h3 align="center">
          <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="620">
            <param name="movie" value="_assets/menu.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="opaque" />
            <param name="swfversion" value="6.0.65.0" />
            <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
            <param name="expressinstall" value="Scripts/expressInstall.swf" />
            <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
            <!--[if !IE]>-->
            <object type="application/x-shockwave-flash" data="_assets/menu.swf" width="200" height="620">
              <!--<![endif]-->
              <param name="quality" value="high" />
              <param name="wmode" value="opaque" />
              <param name="swfversion" value="6.0.65.0" />
              <param name="expressinstall" value="Scripts/expressInstall.swf" />
              <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
              <div>
                <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
              </div>
              <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
          </object>
        </h3>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.nachi.org/"><img src="_images/interNACHI.png" alt="InterNACHI" width="190" height="164" border="0" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.nachi.org/education.htm"><img src="_images/education-seal-small.gif" alt="education seal" width="150" height="150" border="0" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.iac2.org/"><img src="_images/iac2-all.gif" width="174" height="126" alt="IAC" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.inspectopia.com/profile.b.507.r.16181.u.03bcfb.html"><img src="_images/logo_top.png" alt="Inspectopedia" width="190" height="45" border="0" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.energystar.gov/"><img src="_images/img_energy_star_partner.jpg" width="160" height="191" alt="Energy Star Partner" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://cjenterprises.myshaklee.com/us/en/welcome.html#"><img src="_images/Shaklee.gif" alt="Shaklee" width="119" height="160" border="0" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://activerain.com/"><img src="_images/ARLogoSmall.gif" alt="Active Rain" width="135" height="36" border="0" /></a></p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"><a href="http://www.insiderpages.com/b/15246780294"><img src="_images/insider_pages.gif" alt="Insider Pages" width="89" height="37" border="0" /></a></p>
    <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
        <p align="center"> </p>
      </div>
      <div id="mainContent">
        <h2>Radon Gas Inspection</h2>
        <div id="paragraphFloat">
          <h5>What Is Radon?</h5>
          <p> Radon is a cancer causing radioactive gas. You cannot see, smell or taste radon, but it may be a problem in your home. The Surgeon General has warned that radon is the second leading cause of lung cancer in the United States today. </p>
          <div id="apDiv1">
        <div align="center"><a href="http://www.epa.gov/radon/video/epa-epu.wmv"><img src="_images/psa_revised.jpg" alt="What Is Radon?" width="200" height="172" border="0" /></a></div></div></div>
        <p>If you smoke and your home has high radon levels, you're at high risk for developing lung cancer. Some scientific studies of radon exposure indicate that children may be more sensitive to radon. This may be due to their higher respiration rate and their rapidly dividing cells, which may be more vulnerable to radiation damage. </p>
    <p> </p>
        <h5>Why Is It Dangerous?</h5>
    <p> The U.S. Environmental Protection Agency (US EPA) and the Surgeon General's Office have estimated that as many as 20,000 lung cancer deaths are caused each year by radon. Radon is the second leading cause of lung cancer. Radon-induced lung cancer costs the United States over $2 billion dollars per year in both direct and indirect health care costs.</p>
    <p>According to the US EPA, nearly 1 in 3 homes checked in seven states and on three Indian lands had screening levels over 4 pCi/L, the EPA's recommended action level for radon exposure.</p>
    <p>The alpha radiation emitted by radon is the same alpha radiation emitted by other alpha generating radiation sources such as plutonium.</p>
    <p>A family whose home has radon levels of 4 pCi/l is exposed to approximately 35 times as much radiation as the Nuclear Regulatory Commission would allow if that family was standing next to the fence of a radioactive waste site. (25 mrem limit, 800 mrem exposure)</p>
    <p> At the 4 pCi/l EPA action guideline level, radon carries approximately 1000 times the risk of death as any other EPA carcinogen. It is important to note that the action level is not a safe level, as there are no &quot;safe&quot; levels of radon gas.</p>
    <p> </p>
    <h5>How Does It Get Into My Home?</h5>
    <p> Radon is a radioactive gas. It comes from the natural decay of uranium that is found in nearly all soils. It typically moves up through the ground to the air above and into your home through cracks and other holes in the foundation. Your home traps radon inside, where it can build up. Any home may have a radon problem. This means new and old homes, well-sealed and drafty homes, and homes with or without basements.</p>
    <p> Radon from soil gas is the main cause of radon problems. Sometimes radon enters the home through well water. In a small number of homes, the building materials can give off radon, too. However, building materials rarely cause radon problems by themselves.</p>
    <p><strong>Radon gets in through:</strong></p>
    <ul>
      <li>Cracks in solid floors
        <div id="apDiv3">
          <div align="center"><a href="http://www.fullcirclehomeinspections.com/_assets/CitizensGuideRadon.pdf"><img src="_images/citguidecoverradon.jpg" alt="Guide To Radon" width="154" height="200" border="0" /></a></div>
        </div>
      </li>
      <li>Construction joints</li>
      <li>Cracks in walls</li>
      <li>Gaps in suspended floors</li>
      <li>Gaps around service pipes</li>
      <li>Cavities inside walls</li>
      <li>Surrounding water supply</li>
    </ul>
    <p> </p>
    <h5>What Can I Do?</h5>
    <p> Radon is a national environmental health problem. Elevated radon levels have been discovered in every state. The US EPA estimates that as many as 8 million homes throughout the country have elevated levels of radon. Current state surveys show that 1 home in 5 has elevated radon levels.</p>
    <p> Testing is the only way to know your home's radon levels. There are no immediate symptoms that will alert you to the presence of radon. It typically takes years of exposure before any problems surface. </p>
    <p>Let <strong>Full Circle Home Inspections</strong> ensure your family and your home are protected and safe from radon exposure!</p>
    <p> </p>
    <h5>Radon Myths</h5>
    <p><strong><em>MYTH:</em> Scientists are not sure that radon really is a problem.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> Although some scientists dispute the precise number of deaths due to radon, all the major health organizations (like the Centers for Disease Control and Prevention, the American Lung Association and the American Medical Association) agree with estimates that radon causes thousands of preventable lung cancer deaths every year. This is especially true among smokers, since the risk to smokers is much greater than to non-smokers.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Radon testing is difficult, time-consuming and expensive.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> Radon testing is easy. You can test your home yourself or hire a qualified radon test company. Either approach takes only a small amount of time and effort.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Homes with radon problems can't be fixed.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> There are simple solutions to radon problems in homes. Hundreds of thousands of homeowners have already fixed radon problems in their homes. Most homes can be fixed for about the same cost as other common home repairs; check with one or more qualified mitigators. Call your <a href="http://www.epa.gov/radon/whereyoulive.html">state radon office</a> for help in identifying qualified mitigation contractors.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Radon affects only certain kinds of homes.</strong></p>
    <blockquote>
      <p><strong><em>FACT: </em></strong>House construction can affect radon levels. However, radon can be a problem in homes of all types: old homes, new homes, drafty homes, insulated homes, homes with basements, and homes without basements. Local geology, construction materials, and how the home was built are among the factors that can affect radon levels in homes.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Radon is only a problem in certain parts of the country.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> High radon levels have been found in every state. Radon problems do vary from area to area, but the only way to know your radon level is to test.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> A neighbor's test result is a good indication of whether your home has a problem.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> It's not. Radon levels can vary greatly from home to home. The only way to know if your home has a radon problem is to test it.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Everyone should test their water for radon.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> Although radon gets into some homes through water, it is important to first test the air in the home for radon. If your water comes from a public water supply that uses ground water, call your water supplier. If high radon levels are found and the home has a private well, call the Safe Drinking Water Hotline at 1-800-426-4791 for information on testing your water.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> It's difficult to sell homes where radon problems have been discovered.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em></strong> Where radon problems have been fixed, home sales have not been blocked or frustrated. The added protection is some times a good selling point.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> I've lived in my home for so long, it doesn't make sense to take action now.</strong></p>
    <blockquote>
      <p><strong><em>FACT: </em></strong>You will reduce your risk of lung cancer when you reduce radon levels, even if you've lived with a radon problem for a long time.</p>
    </blockquote>
    <p><strong><em>MYTH:</em> Short-term tests can't be used for making a decision about whether to fix your home.</strong></p>
    <blockquote>
      <p><strong><em>FACT:</em> </strong>A short-term test, followed by a second short-term test* can be used to decide whether to fix your home. However, the closer the average of your two short-term tests is to 4 pCi/L, the less certain you can be about whether your year-round average is above or below that level. Keep in mind that radon levels below 4 pCi/L still pose some risk. Radon levels can be reduced in most homes to 2 pCi/L or below.</p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p align="center"><img src="_images/CA-3.jpg" width="520" height="207" /></p>
    </blockquote>
      </div>
      <div id="footer">
        <p align="center"><strong>© 2009 XL Designs Online - All Rights Reserved </strong></p>
      </div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    swfobject.registerObject("FlashID");
    //-->
    </script>
    </body>
    </html>
    And here is my CSS if needed,
    @charset "utf-8";
    body  {
         font: 100% Verdana, Arial, Helvetica, sans-serif;
         background: #666666;
         margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
         padding: 0;
         text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
         color: #000000;
    .twoColFixLtHdr #container {
         width: 950px; /* the auto margins (in conjunction with a width) center the page */
         border: 1px solid #000000;
         text-align: left; /* this overrides the text-align: center on the body element. */
         margin-top: 20px;
         margin-right: auto;
         margin-bottom: 20px;
         margin-left: auto;
         background-color: #557050;
    .twoColFixLtHdr #header {
         border-bottom: 1px solid #000000;
         height: 250px;
         background-color: #DDDDDD;
         padding-top: 0;
         padding-right: 10px;
         padding-bottom: 0;
         padding-left: 20px;
         background-image: url(../_images/homebanner1.png);
    .twoColFixLtHdr #header h1 {
         margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
         padding: 20px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
         text-align: center;
         font-size: 48px;
         font-family: Tahoma, Geneva, sans-serif;
         color: #000;
    .twoColFixLtHdr #sidebar1 {
         float: left; /* since this element is floated, a width must be given */
         width: 200px;
         border-right: 1px solid #000000;
         background-color: #557050;
         padding-top: 0px;
         padding-right: 10px;
         padding-bottom: 15px;
         padding-left: 10px;
    .twoColFixLtHdr #mainContent {
         margin-top: 0;
         margin-right: 0;
         margin-bottom: 0;
         margin-left: 250px;
         padding-top: 0;
         padding-right: 20px;
         padding-bottom: 0;
         padding-left: 20px;
         text-align: left;
    .twoColFixLtHdr #mainContent h1 {
         font-size: 48px;
         font-family: "Arial Rounded MT Bold";
         font-weight: bold;
    .twoColFixLtHdr #mainContent h2 {
         font-family: "Arial Rounded MT Bold";
         font-size: 32px;
    .twoColFixLtHdr #mainContent h3 {
         font-family: Georgia, "Times New Roman", Times, serif;
         font-style: italic;
         color: #CF0;
         font-size: 125%;
    .twoColFixLtHdr #mainContent h5 {
         font-size: 120%;
    .twoColFixLtHdr #footer {
         padding: 20px 10px 20px 20px;
         border-top: 1px solid #000000;
         background-color: #A3A3A3;
         font-family: Arial, Helvetica, sans-serif;
    .twoColFixLtHdr #footer p {
         margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
         padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
         float: right;
         margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page */
         float: left;
         margin-right: 8px;
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
         clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    #paragraphFloat {
         width: 350px;
    #paragraphFloat2 {
         width: 350px;
    Please if anyone knows what I'm doing wrong please please let me know!  Since I am learning, I really want to get main concepts like this down so I am not constantly doing things the hard way!  Thank you! 
    Jayson

    1) Regarding validation, what does it do?
    It validates by telling you where your code isn't er... valid.  Sometimes the results are a bit jumbled but if you work through them one at a time and revalidate, it's a good way to learn.  If you fix all of the errors shown up through the validator you should end up with standards compliant code.  Not necessarily the best, most efficient code you can write but at least it will be valid and it helps you spot errors that hours of code-staring never seems to find.
    I don't use the DW validation tool because I find the W3c one easier.
    The W3c validator has a check box of HTML Tidy which can tidy up your code but it's not always as easy to see what changes.
    2) I know the <p> tag for spacing is wrong, I could just feel it in my bones.  I just didn't know what else to do.  If I <br> all the way down won't the code be just as cluttered?
    You're obviously a born web coder!
    <br> will bloat your page if you use them to position elements.
    Here you need to get used to a) the Block Model and b) CSS positioning.  Once you crack these, CSS opens up for you and becomes a little more intuitive.
    if you have two elements on top of each other rather than push them apart with other elements you do it with padding and/or margin.  There are things to watch out for here namely, collapsing margins but if you start to read up on the above, you'll get it.
    I just thought of something.  If I add a div in main content, align it to the bottom center with CSS, use a line break between it and the text above, and add the image in question in the new div, will the spacing between the text and image work itself out?  I just really want to get out of the <p> bad habit.
    Keep thinking!  Web design is not like desktop publishing or print.  Elements on a HTML page don't behave like paragraphs on a page.  Once you begin to figure out why not it all gets a little easier.
    If you want an image at the bottom an element you put that at the end of the content in that element.  Then you need to ensure there is no margin, padding or border between the img element and the next element (your footer).  HTML elements come with some styling that is applied by default in the browser.  Many web developers include a rule like this:
    body {
    margin: 0;
    padding:0;
    This sets the margin and padding to zero of course and it's purpose is to override the defaults.  Some people advocate applying similar rules to all elements and if your interested try googling Eric Meyer who has written about it online.
    One of the key purposes of CSS is to take styling out of the page.  It's leaner, more efficient for the viewer and the coder and helps with site management.
    3) AP divs are weird, and I did only use as a last resort.
    See? You're a natural!
    The reason is I am confused by the float and clear float classes.  My left column is floated left and that element is what I was having problems understanding.  I tried to make new divs and float right but I screwed it all up.  I am sure I am just not applying the clear float in the right places.
    Getting the hang of floating is key to CSS positioning.  You use a float if you want two elements to sit side by side on the page.  It disrupts the "document flow."  Ordinarily HTML elements are rendered one after the other, on top of each other.  Floating an element takes it out of the document flow and allows other elements to occupy its space.  When you float an element it should always have a width.  If the element below it also has a width, that width has to be sufficiently narrow to allow it to occupy the space.  In short, floated elements can't be wider than their containing element.
    The clear property is used after a float to stop an element occupying the space left by a floated element.  It works but confuses the heck out of me!
    So that leads me to my final point.  I am a novice too!  I might have fluffed a few of the technical points above but it's pretty much there.
    Regards
    Martin

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Need help with almost completed plugin engine project

    Hi all,
    For a while now I have been working on a plugin engine. After a few iterations, the engine is similar to the Eclipse engine, in that plugins use extension points and extensions to allow contributions. Unlike the eclipse engine I have added the ability for plugins to fire events through the engine and other plugins can add listeners, all through the plugin.xml manifest. Dependencies are mostly handled automatically at plugin load time (when extensions get resolved to extension points, and listeners get resolved to events). For the case where a plugin needs to use classes from another plugin, dependencies are also allowed to be declared. Like the eclipse engine, activation of plugins occurs the first time a class is used within the plugin's classpath, OR a plugin can be activated after it is loaded.
    What I need help with is testing, working on examples to provide with the engine project, and feedback/suggestions before we release the M1 build. I am asking for those that are interested in this type of work to volunteer to help where applicable and possible. I want to provide a solid plugin engine to the java community, one that is easy to use, works well, and is pretty effecient in terms of resource usage and performance.
    Of particular interest to me right at the moment is dealing with multiple versions. As I see it, the engine will be used within an application and as such plugins would be distributed with a specific application version. The plugin version itself is more of a notification as to what version a plugin is, although I imagine it will help when updating at runtime as well.
    Just a few other details of the engine. It handles (or will soon) dynamic load, unload and reload of plugins at runtime. Plugins can be distributed in an archive file format, we call .par (Plugin ARchive), with additional plugin filename extensions configurable at runtime. The plugins can be developed and deployed in an expanded directory format as they are in Eclipse as well, or in the archive format. In the archive format they do not need to be unzipped when deployed, and they can contain embeded jar/zip libraries. The engine handles finding and creating classes directly out of the .par file at runtime.
    Multiple locations to find plugins are configurable before the engine starts, and even after it starts more could be added to allow additional locations to find plugins. URLs are supported, and soon the HTTP protocol will be supported so that plugins can be downloaded and installed at runtime.
    The project can be found at www.sourceforge.net/projects/genpluginengine. If you would like to get involved and help out, please sign up on the dev mail list and send an email to introduce yourself to the rest of the members on the list.
    I'll also add that I am working on a Swing UI Framework built entirely from plugins. It provides a ready-to-launce UI application that developers can simply add their plugins to, extending various extension points of the framework to have menu items, toolbar buttons, status bar access, help and preferences dialog additions, file i/o choosers, tons of open-source components ready to use (or extend to add on to), and like Eclipse, hopefully... draggable window frames that can be dropped on any other frame to form a tabbed frame of windows. Some of this is a ways off, some is getting there now. Presently you can add menu items that do allow plugin activation when first clicked, so plugins can be loaded but not activated until needed. The Preference dialog works but is not completed, and a plugin that adds a plugin control panel to view all loaded plugins, activate them, load/unload/reload, view extension points, extensions, dependencies, etc is partially completed. The point is, to allow a ready to run UI framework in Swing with an easy path for developers to quickly build applications with. If you are interested in this, when you join the mail list and introduce yourself, indicate that you are interested in this as well, as we need help with plugin development for it and would appreciate more help here too.
    Look forward to some replies.

    Might I suggest setting up a project at a known project-site? I've seen your progress and questions posted here from time to time, but one of the drawbacks is that you have to fill each post with the entirity of your vision to explain what you're doing. That's a lot of text to read - and most folks will skip right over it.
    On the other hand, a well-crafted, good-looking project web-site, with appropriate links and docs and vision statements, diagrams, etc. will have more likelyhood of attracting volunteers. java.net and sourceforge.net are likely spots to set up shop. In addition, you get CVS and bug-tracking systems, which can be quite valuable in such a large-scale project where there are lots of pieces.

  • Mail.app - Applescript - Looking for help with my 1st Applescript

    Okay… so I am taking the plunge. I've finally found something that is bugging me enough that I want to make a script to resolve it.
    *Here's the situation:*
    I use Smart Mailboxes a lot. It's my primary window into dealing with email.
    I use MailTags (an addon for Mail) to apply keywords to messages, via Mail Act-On rules (an addon by the same company).
    I use Smart Mailboxes to show me messages with various keywords etc.
    What I have found is that Smart Mailboxes do NOT automatically update themselves. For instance, when a message in the Smart Mailbox is changed in such a way that the filter on that mailbox should not display it, the message will still sit there until I either leave the mailbox and return, or hit Rebuil in the Mailbox menu.
    The same applies for when new mail comes into my Inbox. If there is new mail that qualifies for inclusion in the smart mailbox I am currently viewing, it will not appear until I do one of the above two things.
    What I discovered was this script:
    tell application "Mail" to activate
    tell application "System Events"
    click menu item "Rebuild" in menu ¬
    "Mailbox" in menu bar 1 of process "Mail"
    end tell
    This is what got me thinking about scripting a solution.
    The other option is to assign a keyboard shortcut to the Rebuild command. But I would like the Rebuild to take place automatically when I apply certain rules to messages. I want my Mail Act-on rule to trigger the a Rebuild. I figure I can do this by having it trigger the Rebuild script shown above.
    *HERE IS MY QUESTION:*
    Is there a way to have the script check what the currently active/selected Mailbox is? Or, put another way, can I get it to NOT run if certain mailboxes are selected?
    Here's what I am thinking.
    Under no circumstances do I want this script to be triggered if the current mailbox is NOT a smart mailbox, and IS any of my IMAP mailboxes… most especially the Inboxes. That would trigger a complete cleaning out and rebuilding of the entire IMAP inbox, which has many gigs of mail in it.
    What I am trying to figure out, and would love some help with, is how I can make sure this script ONLY runs when the current mailbox is either ANY smart mailbox, or NOT an IMAP mailbox, or some other logic that keeps it from running in an IMAP mailbox.
    Any tips are greatly appreciated.
    With thanks,
    Jonathan
    Message was edited by: InspiredLife
    Message was edited by: InspiredLife

    Thanks Camalot,
    I appreciate your help with this. I am also enjoying learning more about AppleScript. It seems much easier that other scripting languages, if for no other reason that it uses basic english logic and words.
    When I run your script with an inbox selected, I get the following Result:
    tell application "Mail"
    get selected mailboxes of message viewer 1
    --> {mailbox "INBOX" of account "JE Gmail"}
    end tell
    Result:
    {mailbox "INBOX" of account "JE Gmail" of application "Mail"}
    When I run it with a smart mailbox selected the following is produced:
    tell application "Mail"
    get selected mailboxes of message viewer 1
    --> {current application}
    end tell
    Result:
    {application "Mail"}
    So get the impression it's not throwing up an error. Certainly, either way it does not run what I put into the On Error section, which was simply
    display dialog "Success"
    Is this useful? Can I test if the output contains the word "INBOX" ?
    I notice that if I have, for instance, a SENT folder select, it gives the following result:
    Result:
    {mailbox "INBOX/Sent Messages" of account "[email protected]" of application "Mail"}
    Which again has the word INBOX in there. Drafts comes up a little different.
    Result:
    {mailbox "Drafts ([email protected])" of application "Mail"}
    So if there was a way to parse the result through a test against "INBOX" "DRAFT" etc then this might work. What do you think?
    I have no idea how to go about that though, so your input would be very helpful.
    Thanks,
    Jonathan

  • Need help with the Nokia N8 or I need to send it b...

    I purchased a new N8 from Amazon and I have had nothing but issues. It has been very disappointing and I need to know if it the new firmware will fix any of these or not.
    1. Once a day, while I am on a call, the phone says "insert a SIM card" and then reboots. I have to then turn off (after the reboot), release and reinsert the SIM card and restart. This works about 75% of the time. I have seen this issue reported on here but not answers.
    2. Accuwearther widget stopped working. I called accuweather and they said:
    Thank you for making AccuWeather.com your source of weather information on the go! We are aware that the widget will get stuck in a ?Loading...? mode which does not allow you to view the weather. We have contacted Nokia and have been informed that the application is not having an issue but there is a bug within the phone build that is causing this message. While we regret to inform you that we do not have a timeline from Nokia when to expect this fix,....
    Is there a fix coming?
    3. You cannot manually setup an IMAP Gmail account. The wizard forces you into the default POP3 and then my mail is not synced. I have tried MfE but then HTML does not work correctly.Any chance this can be fixed.
    4. I cannot use data and voice at the same time. During the long drive today, I tried a to navigate while on a conference call. It says "cannot find connection". I had to end the call, update the maps and then redo the call "10 TIMES". I know AT&T supports this because my E71 works fine. What happened to this feature.
    5. The GPS is funky. I walked to a local tavern using the maps. When I got inside, I tried to update my location on Facebook for my friends to find me, but it kept saying that I was 4 blocks away. I thought the GPS/aGPS would be better.
    6. There are only two social networks I can update. **bleep**?
    7. WfE keeps failing on replies.
    8. I cannot get out of "Battery Save Mode" I have released it about 20 times and it still asks me if I want to get out (this could be the data/voice problem above).
    I have switched back to the E71 and am going to send this back to Amazon unless there is a major update on the way.
    I don't mean to rant but as far as quality, this is terrible. Shame on you Nokia. Here is your chance to at least gain back some customers and you put this in the field.
    Don

    Ok, I have to say I was really impressed by the effort. Nokia Support (in The Philippines) called me 4 times over the last 2 days to help with my phone.
    Here is there responses have put them in order of my questions.
    1. I am to reinstall the operating system on the phone. They said that this is the most likely (but not confirmed) fix to the SIM card problem (although they would not confirm it was a problem with the phone).
    2. No answer because we did not get that far.
    3. To setup a gmail IMAP account you MUST us Nokia messaging. Period. Since I have security concerns, that is out of the question.
    4. This is the big one that stopped it. The Nokia N8 is a Class B cell phone meaning that you cannot use data and voice at the same time. They told me that all Nokia phones were Class B, but I told them my E71 is not. After research, I found that the E71 and E72 is Class A (Can do voice and data at the same time) and that the N8 is Class B. Here is an article explaining the difference. This was a deal breaker. I cannot access the internet while I am on a call. Reminds me of a dial up modem.
    5. Reinstall the software and it might fix it.
    6. No answer.
    7. Use Nokia Messaging.
    8. Reinstall the software and it might fix it.
    So, I am sending the phone back because I cannot use it. I cannot imagine a smart phone on the market that cannot do internet and voice at the same time.
    Too bad.The N8 is a terrific camera and you should buy it for that, but look elsewhere for a smartphone.
    Thanks to all that read and helped.
    Don

  • Need help with my usecase based on transient ViewObject

    I am using 11.1.1.4.0 Jdev version. I need help with my usecase.Been trying it for 2 days but couldn't figure out the issue.
    I have a transientVO . In this VO Rows will be populated programmatically. CountryId is an attribute of this VO. I have created a viewAccessor "CountriesVA" from Country VO of HR schema.
    I have a LOV for the countryId which is based on this VA ,getting countries from CountryTable.
    This is the model part which works fine.
    Before the page load i have called  a method to create a row for this transientVO.Once the row is created i can see the SOC in my page which i have created as below.
    Now i want to insert a row in the transientVO if user selects a country and restrict duplicate entry . (As One row is already created 1st time there will be no rows created.after that rows will be inserted)
    The issue is :: Suppose there are 2 countries. A & B .When user does the following actions :
    Insert A . Done //as 1st entry
    Insert B . Done //as 1st time entry
    Insert A . duplicate not inserted
    Insert B . getting inserted // the bug.
    <af:selectOneChoice value="#{bindings.CountryId.inputValue}"
                            label="#{bindings.CountryId.label}"
                            required="#{bindings.CountryId.hints.mandatory}"
                            shortDesc="#{bindings.CountryId.hints.tooltip}" id="soc1"
                            immediate="true" autoSubmit="true"
                            valueChangeListener="#{pageFlowScope.managedBean.countryIdVC}">
        public void countryIdVC(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String oldValue=null;
              setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
              if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
             oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
                    setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
            String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
             DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
             //access the underlying RowSetIterator
             RowSetIterator rsi = dciter.getRowSetIterator();
          boolean duplicate=true;
          if(oldValue!=null){
                    rsi.getCurrentRow().setAttribute("CountryId", oldValue);
        //  Row row= rsi.findByKey(new Key(new Object[] { newValue}), 1)[0];
          Key key =new Key(new Object[] { newValue});
          Row row=rsi.getRow(key);
          if(row==null){
          System.err.println(duplicate);
            duplicate=false;
          }else{
            rsi.setCurrentRow(row);
             if(!duplicate){
             //get handle to the last row
             Row lastRow = rsi.last();
             //obtain the index of the last row
             int lastRowIndex = rsi.getRangeIndexOf(lastRow);
             //create a new row
             Row newRow = rsi.createRow();
             newRow.setAttribute("CountryId", newValue);
             //initialize the row
             newRow.setNewRowState(Row.STATUS_INITIALIZED);
             //add row to last index + 1 so it becomes last in the range set
             rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
             //make row the current row so it is displayed correctly
             rsi.setCurrentRow(newRow);

    I read the reply from Andrejus Baranovskis and thought of studying and implementing that in my useCase.Well it worked . I implemented the same Logic but rowIteration was done in AppModule.
    Con-Fusion, Bugs, Facts &amp;amp; Workarounds: Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development B…
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0206
    9.7.6 What You May Need to Know About Programmatic Row Set Iteration
    The problem is solved ,the above links helped me solve the problem.
    what i did is i have created a method in appmodule to iterate rows and all the method y operation bindings and my logic works fine ....
    MY Advice to all Adf developers ,though i am not an expert but i can assure you to follow the above process for rowIteration.If you use the  iterator binding in the manage bean to navigate the rows u'll face issues which are unexpected.
    In AppModule :::::
        public boolean createRow(String oldValue,String newValue){
         System.err.println(oldValue+""+newValue);
          ViewObjectImpl vo=getViewObj1();
          boolean duplicate=false;
          if(oldValue!=null){
          RowSetIterator iter = vo.createRowSetIterator(null);
          System.err.println("iterating rows ");
             while (iter.hasNext()) {
                 Row r = iter.next();
                 System.err.println(iter.getRangeIndexOf(r)+" row is "+r.getAttribute("CountryId"));
                 if(r.getAttribute("CountryId").toString().equals(newValue)){
                     duplicate=true;
                     break;
                 // Do something with the current row.
             // close secondary row set iterator
             iter.closeRowSetIterator();
          return duplicate;
    In ManageBean :::::
        public void countryIdVC(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String oldValue=null;
           System.err.println("Old Value"+valueChangeEvent.getOldValue());
              setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
              if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
             oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
                    setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
            String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
             //access the name of the iterator the table is bound to. Its "allDepartmentsIterator"
             //in this sample
             DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
             //access the underlying RowSetIterator
             RowSetIterator rsi = dciter.getRowSetIterator();
             if(oldValue!=null){
                          rsi.getCurrentRow().setAttribute("CountryId", oldValue);
               OperationBinding operation = bindings.getOperationBinding("createRow");
               operation.getParamsMap().put("oldValue", oldValue);
               operation.getParamsMap().put("newValue", newValue);
          if(!(Boolean)operation.execute()){
          //get handle to the last row
          Row lastRow = rsi.last();
          //obtain the index of the last row
          int lastRowIndex = rsi.getRangeIndexOf(lastRow);
          //create a new row
          Row newRow = rsi.createRow();
          newRow.setAttribute("CountryId", newValue);
          //initialize the row
          newRow.setNewRowState(Row.STATUS_INITIALIZED);
          //add row to last index + 1 so it becomes last in the range set
          System.err.println("Inserting row at index "+lastRowIndex+1);
          rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
          //make row the current row so it is displayed correctly
          rsi.setCurrentRow(newRow);
          else{
            System.err.println("Data found So not inserting,only setting current Row");
          Key key =new Key(new Object[] { newValue});
            rsi.setCurrentRow(rsi.getRow(key));

Maybe you are looking for

  • Connecting a Computer to an HDTV

    Hey everyone, One of the most frequently asked home theater questions we see here on the forums is “How do I connect my computer to my HDTV?”  Well, depending upon the model(s) you own you may have a number of options. For starters, the most common o

  • Export or Print different line weights (like in AutoCAD)

    Is there a way to Export / Print / Save As artwork with reduced line weights like you can in AutoCAD? i.e. Export a PDF and all line thickness is reduced by 50% I have a map project that I'm working on and I want to export different sections of the m

  • Receiving error in upgrep process

    Hi i am trying out an upgrde of SBA 8.0 to SIA 8.0. on solaris. i ran the database configuration wizard in upgrep mode and initialized the upgrade wizard manually. After completion of 5 % the process got hang, when i checked the log file the followin

  • Error while getting apps code: 1009

    has anyone had this error while downloading or buying an app on app store?? error code: 1009

  • Auto Size All Columns

    _Auto Size All Columns_ no longer auto sizes the Name column in the Windows version of iTunes. Furthermore, _Auto Size All Columns_ ought to be a configurable option that works automatically whenever you select different music in the library to appea