VB Programmer needs java help

I am a VB programmer and have started to learn Java a little bit. I need this program to be written anytime by Monday, but it must be written in java because they plan to use it on multiple platforms. Our java programmer quit and I don't know enough to write it in java. The program is to figure payroll. The user will input their name and remove the check in the hourly check box if they are salaried. If the employee is hourly, then any hours worked over 40 are time and a half. If they are salaried, they must choose what company level they are. I have included the three salary levels below. The program then needs to print to the screen in the bottom text box their yearly salary computed for a 40 hour work week. Can anyone help me and write the program? Whoever will do this for me, I will award 34 duke dollars. That is all I have.
Thank you so much for your help,
Kori
Name:
Text box here for name
(check box) Hourly
Hours:
Text box here for hours
(option button) Level 1
(option button) Level 2
(option button) Level 3
(option button) Level A
(option button) Level B
Total Pay:
Number Processed:
(command button) (command button)
Calculate Pay__________Clear
(text box)
shows "payoll report"
Level 1 = 6.25f
Level 2 = 8.15f
Level 3 = 10.85f
Level A = 27000f
Level B = 42000f
Max hours is 80.0f

I am a VB programmer and have started to learn Java a
little bit. I need this program to be written anytime
by Monday, but it must be written in java because they
plan to use it on multiple platforms.Do this this little toy program in VB so you have a working solution on one platform by Monday. Show it to your boss and say you did a rapid prototype first for people to evaluate. Then take your time and convert it to Java.
/Ulrika the pragmatical.

Similar Messages

  • Oracle developer needs Java help

    I develop applications in Oracle 8i on NT4. As part of a trigger, I need to perform an update to an extremely large table which takes many minutes. Because it's tied to a web page, I can't wait for the update to complete. Oracle natively doesn't support system calls -- I use the Shell() command in VB -- but Oracle DOES support Java stored procedures. I'm hoping that a Java stored procedure will be able to spawn/execute a new process/program specified by a command line instruction (ie: "C:\SQLPLUS.EXE SCOTT/TIGER @update.sql") and return immediately - without waiting for the process to complete. There doesn't need to be any handle for or call back from the process - just fire and forget. Can anyone provide me some direction, or better some existing Java code that does this? THANKS!

    Hi "todmcg",
    I'm not sure that I have understood your question correctly, but here goes anyway...
    Yes you can create a java stored procedure and have a trigger execute that procedure. In order to execute system commands in java, you usually use the "exec()" method of class "java.lang.Runtime". It is also easy to spawn new threads using java. So yes, you can have your java stored procedure execute a system command in a background thread.
    In my opinion, the Oracle documentation explains very well how to create a java stored procedure. The documentation is available from:
    http://tahiti.oracle.com
    Also, examples of how to call system commands from java stored procedures are available at this Web site:
    http://asktom.oracle.com
    You may also find relevant information at:
    http://metalink.oracle.com
    and
    http://technet.oracle.com
    Of-course, you can also use JDBC from your java stored procedure to execute your "update.sql" script -- without the need to execute a system command.
    Basic code skeleton:
    [NOTE: Untested and may contain syntax errors.]
    public class SystemCommand implements Runnable {
      private static String cmd;
      public void run() {
        Runtime runtime = Runtime.getRuntime();
        runtime.exec(cmd);
      public static void execCommand(String cmd) {
        this.cmd = cmd;
        new Thread(new SystemCommand()).start();
    }Hope this helps you.
    Good Luck,
    Avi.

  • Need java help urgent plzzz

    Ive never visited a Java forum other than this one and its been over 2 years now. Out of curiosity I just went to JavaRanch.
    Ive seen a lot of heated flaming from both sides (on these forums)
    but i figured id take a look today.
    The FIRST post i look at someone asks what the purpose of an
    interface is and one of the responses he gets is:
    "Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.
    You can edit your display name here. Thank you for your prompt attention!"
    i wish i could go to 33 pt font: WTF IS THAT?
    WEIRD!
    Thats just way to creepy for me and im out... as if the brown and the
    meesen (brian regan joke) everywhere werent enough.
    Anyone know any other good ones?
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=33&t=019908

    JavaRanch scares me as well. Yea i think the ranch is making an army of cattle.
    Ill check out devshed.
    http://www.javaranch.com/name.jsp
    SO F*CKING SCARY:
    "I understand that in some cultures there is no such thing as "first name and last name" - there is just one name. If you are one of these people, I WOULD LIKE TO HUMBLY ASK YOU TO SACRIFICE A PIECE OF YOUR CULTURE to help me build this culture."
    apparently the cows love the policy though:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=10&t=001017

  • Newbie needs java help

    Hi,
    I have used Captivate for a while, but have no idea where to
    begin to insert JavaScript into Captivate. Everyone talks about it,
    but I can't find a very basic beginner explanation for this. I
    don't even know WHERE to put the JavaScript.

    Dear Altruistic
    Thanks for the link to the Netbeans quickstart webpage sadly it does not contain any visual cues as to what proceedures are neccessary to implement the instructions.
    For someone like me ( learning disability) this can cause difficulties I learn in a slightly different way to those who are able to assimilate written instructions.
    The text might as well have been ancient Greek ...
    I really need a discriptive walk through lets give an exampleso you will understand my needs ... say I wanted to open a Microsoft word document on the desktop of a windows PC (ok not a good choice but there you are ) here is how I would begin to write the proceedure
    1. look at the bottom left hand side of your screen
    can you see a windows symbol with start displayed ?
    yes ..
    Hold your mouse over the start icon and left click .. then use the cascading menu feature to select office 2003 ...
    Do you get the general idea about what I need here ....?
    So have a look at the link on my original post that points to David Eck's website where he lists some Java source code and if possible give me the proceedure of how to run this from within the Netbeans environment.
    Once I can do this I will be able to teach myself ....
    I guess in a nutshell what I am saying is why on earth is their not just a simple feature on the GUI that allows you to import some code and for Netbeans to run in Demo mode ! I know their is sample projects included within the application but here again this does not solve my problem of notbeing able to find a way to run source code from the application.
    I hope this makes sense !

  • Need java help

    hi, i hope this is the right place to put this question. i have a optiplex gxi with a 3geg. hardrive. and 64mb of ram.with windows me. when i download java to play on pogo the games will load but they drag and freeze up. the only java download i can get is jre 5.0 update 16 i think i have uninstalled it compleatly.because i keep getting all kinds of errors one i get is ie6 will hang and i get a send to microsoft error report. when i try to update java i get an error number 1723 windows installer error. i can not update the windows installer or even download net framework. please can someone help. (i miss pogo) i have tried to install msjvm but that doesn't work either. sorry for my typeing skills i hope you can help thank you.

    brightsmile29 wrote:
    thank you for your reply however my computer is not compatable with ie7 i have windows me. whice is not supported. and i can not download java so therefore i have no java installed. any help would be gratefull.That ME based system is beyond it's life span at this point in time. You can use JRE's that were developed about that time--Up to 1.4x (I think, you may get away with early 5).
    So basically you have to face reality--that OS, machine, and JVM's have fallen off the grid for the most current games.
    If you have completely uninstalled Java, then run regclean several times and then load the last usable version of Java that you have had installed in the past--and realize, the newer stuff is not made for that era of machine.

  • Need Java Help on a Mortgage program

    I keep getting the following error.
    java:20: illegal start of expression
    public Scanner myScanner = new Scanner(System.in);
    /*Danielle Safonte*/
    /* Week 2 Mortgage Calculator*/
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    float interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public static void months()
    public Scanner myScanner = new Scanner(System.in);
    System.out.print("What month of the loan is this?" + months);
    if (months = term) {
    System.out.print("You have paid off your loan");
    else
         months = myScanner.next();
         float Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance = princple) {
              System.out.print("You have paid off your loan");
         else
              System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
              System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
              System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

    It is in my post at 10:02, but here it is again:
    These are the errors that I am left with. I worked through the rest.
    .java:29: '.class' expected
    months = myScanner.next(int);
    ^
    .java:29: ')' expected
    months = myScanner.next(int);
    ^
    2 errors
    Tool completed with exit code 1
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    double  interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public void months()
    Scanner myScanner = new Scanner(System.in);
       System.out.print("What month of the loan is this?" + months);
    if (months == term) {
       System.out.print("You have paid off your loan");
    else
         months = myScanner.next(int);
         double Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance == princple) {
                 System.out.print("You have paid off your loan");
         else
                 System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
                 System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
                 System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

  • I'm lost when I try to figure out what exaclty is Java.... I need your help

    Hi, I know that java is OOP, Multiplatform, etc, etc...
    But when I try to look on google for jobs about java or "learn Java" what "Should I know in java"... I always found... whebshpere, oracle, linux, jboss, glassfish, opensolaris, struts, hibernate, spring, eclipse, netbeans, jidea, and so on!!!...
    I'm lost... I will be sincere ...
    I've started thank for a friend in a world of programming with .NET (ASP.NET SQL .NET Silverlight Windows Server) and was good BUT i feel inside that I prefer Java.
    I don't know why but with java I feel free, i think will be a good technology for a long time.
    But some things make my crazy.
    I cant found a fast path or the right path without getting mess. Like I posted above.
    So I need your help, if You are an advance programmer... tell what Should I learn ( essencially ) to get a good job. Oracle + Java ? linux + oracle + java? websphere + java? eclipse or netbeans?? all thouse things are awesome... but I am a HUMAN... I can't learn thouse all things and less in little time.... I just want to have a good preparation for to start to look a job in early time.
    I look forward yours answers.
    Thanks community.

    vidix wrote:
    Hi, I know that java is OOP, Multiplatform, etc, etc...
    So I need your help, if You are an advance programmer... tell what Should I learn ( essencially ) to get a good job. Oracle + Java ? linux + oracle + java? websphere + java? eclipse or netbeans?? all thouse things are awesome.The answer to that depends on what you want to do at work. I know great developers that never have written a single SQL statement, and I'm always trying to stay away from everything that has a web interface :)
    Decide what you want to do at work, and then figure out what technologies you need to know.

  • Urgent  help needed(java frames)

    Hi,
    I need urgent help for correcting a piece of code.
    I have written a piece of code for building a gui with some buttons, drawing some geometric shapes.The code consists of two files called Graph and Frame.
    The problem I suppose in the last part of the Graph file, which Rectangle and Circle are called together, the only shape that the program draws is rectangle.Here is the code:
    //Graph
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.*;
    public class Graph extends JPanel {
    LinkedList color;
    LinkedList figures;
    public Graph() {
    setBackground(Color.white);
    figures = new LinkedList();
    color = new LinkedList();
    int z;
    class Point {
    int x;
    int y;
    public Point(int x, int y) {
    this.x = x;
    this.y = y;
    public Point(Point p) {
    x = p.x;
    y = p.y;
    public String toString() {
    return "(" + x + ", " + y + ")";
    public void move(Point dist) {
    x += dist.x;
    y += dist.y;
    abstract class GeomFigur {
    public abstract void move(Point p);
    class Line extends GeomFigur {
    Point p1, p2;
    public Line(Point p1, Point p2) {
    this.p1 = new Point(p1);
    this.p2 = new Point(p2);
    public String toString() { return "Line from " + p1 + " to " + p2;  }
    public void move(Point dist) {
    p1.move(dist);
    p2.move(dist);
    class Rectangle extends Line {
    public Rectangle(Point p1, Point p2) {
    super(p1, p2);
    public String toString() { return "Rectangle from " + p1 + " to " + p2; }
    class Circle extends GeomFigur{
    Point centre;
    int radius;
    public Circle(Point centre, int radius) {
    this.centre = new Point(centre);
    this.radius = radius;
    public String toString() {
    return "Circle, centre " + centre + ", radius " + radius;
    public void move(Point dist) { centre.move(dist); }
    public void addRectangle(int x, int y, Color col) {
    Rectangle r =new Rectangle(new Point(x,y),new Point(x+20,y+20));
    figures.addLast(r);
    color.addLast(col);
    repaint();
    public void addCircle(int x, int y, Color col) {
    Circle c =new Circle(new Point(x,y), 1 );
    figures.addLast(c);
    color.addLast(col);
    repaint();
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    for (int i=0;i < figures.size();i++) {
    Rectangle rect = (Rectangle)figures.get(i);
    //Circle circ = (Circle)figures.get(i);
    g.setColor(Color.black);
    g.drawRect(rect.p1.x,rect.p1.y,20,20);
    g.setColor((Color)color.get(i));
    g.fillRect(rect.p1.x,rect.p1.y,20,20);
    //g.setColor(Color.black);
    // g.drawOval(circ.centre.x,circ.centre.y,20,20);
    // g.setColor((Color)color.get(i));
    // g.fillOval(circ.centre.x, circ.centre.y, 20, 20);
    //Frame
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class Frame extends JFrame implements ActionListener {
    JButton button1, button2, button3, button4, button5 ;
    Graph gr;
    JComboBox cbx;
    JComboBox cby;
    JComboBox col;
    JMenu filemenu;
    JMenuItem quit;
    JMenuBar menubar;
    int x=10;
    int y=10;
    Color color=Color.red;
    public Frame() {
    menubar = new JMenuBar();
    filemenu = new JMenu("File");
    filemenu.setMnemonic('F');
    quit = new JMenuItem("Quit");
    quit.addActionListener(this);
    quit.setMnemonic('Q');
    quit.setAccelerator(KeyStroke.getKeyStroke('Q',Event.CTRL_MASK,false));
    filemenu.add(quit);
    menubar.add(filemenu);
    setJMenuBar(menubar);
    button1 = new JButton("Rectangle");
    button1.addActionListener(this);
    button2 = new JButton("Circle");
    button2.addActionListener(this);
    button4 = new JButton("Ellipse");
    button4.addActionListener(this);
    button5 = new JButton("Triangle");
    button5.addActionListener(this);
    button3 = new JButton("Reset");
    button3.addActionListener(this);
    String[] elements_x= {"10","20","30","40","50","60","70"};
    cbx = new JComboBox(elements_x);
    cbx.addActionListener(this);
    cbx.setActionCommand("cbx");
    String[] elements_y= {"10","20","30","40","50","60","70"};
    cby = new JComboBox(elements_y);
    cby.addActionListener(this);
    cby.setActionCommand("cby");
    String[] elements_color = {"Red","Blue","Green","Orange","Yellow" };
    col = new JComboBox(elements_color);
    col.addActionListener(this);
    col.setActionCommand("col");
    gr = new Graph();
    JPanel top = new JPanel(new BorderLayout());
    JPanel inputs = new JPanel(new GridLayout(6,1));
    inputs.add(button1);
    inputs.add(button2);
    inputs.add(button3);
    inputs.add(button4);
    inputs.add(button5);
    inputs.add(cbx);
    inputs.add(cby);
    inputs.add(col);
    top.add(gr,BorderLayout.CENTER);
    top.add(inputs,BorderLayout.WEST);
    getContentPane().add(BorderLayout.CENTER, top);
    setSize(500,300);//set window size
    //take care of actions
    public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    if (command.equals("Quit")){
    System.exit(0);//terminate program
    else if (command.equals("Rectangle")){
    //add Rectangle to graph at
    //position x,y and with certain color
    gr.addRectangle(x,y,color);
    else if (command.equals("Circle")){
    gr.addCircle(x,y,color);
    else if (command.equals("Reset")){
    else if (command.equals("Triangle")){
    else if (command.equals("Ellipse")){
    else if (command.equals("cbx")){
    x=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("cby")){
    y=Integer.valueOf((String)((JComboBox)e.getSource()).getSelectedItem()).intValue();
    else if (command.equals("col")){
    String temp=(String)((JComboBox)e.getSource()).getSelectedItem();
    if (temp=="Red") color=Color.red;
    else if (temp=="Blue") color=Color.blue;
    else if (temp=="Green") color=Color.green;
    else if (temp=="pink") color=Color.pink;
    else if (temp=="lightGray") color=Color.lightGray;
    //main program
    public static void main(String [] args) {
    Frame appl = new Frame();
    appl.setVisible(true);
    Thanks in advance
    Marina

    Hi,
    You are very lucky that I'm currently boored. You should never tag a question as urgent. It might be urgent to you, but not to us who answer. And you should also use code formatting when you post code (see the formatting tips, or use the code-button).
    I made some changes to your Graph class. The most important thing is the abstract draw method that I added to the GeomFigur class.
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Graph extends JPanel {
        LinkedList figures;
        public Graph() {
            setBackground(Color.white);
            figures = new LinkedList();
        int z;
        abstract class GeomFigur {
            protected Color color;
            public GeomFigur(Color color) {
                this.color = color;
            public abstract void move(Point p);
            public abstract void draw(Graphics g);
        abstract class Line extends GeomFigur {
            Point p1, p2;
            public Line(Color c, Point p1, Point p2) {
                super(c);
                this.p1 = new Point(p1);
                this.p2 = new Point(p2);
            public String toString() {
                return "Line from " + p1 + " to " + p2;
            public void move(Point dist) {
                p1.move(dist.x, dist.y);
                p2.move(dist.x, dist.y);
        class Rectangle extends Line {
            public Rectangle(Color c, Point p1, Point p2) {
                super(c, p1, p2);
            public String toString() {
                return "Rectangle from " + p1 + " to " + p2;
            public void draw(Graphics g) {
                System.out.println("Draw rectangle at " + p1 + " with color " + color);
                g.setColor(Color.black);
                g.drawRect(p1.x, p1.y, 20, 20);
                g.setColor(color);
                g.fillRect(p1.x, p1.y, 20, 20);
        class Circle extends GeomFigur {
            Point centre;
            int radius;
            public Circle(Color c, Point centre, int radius) {
                super(c);
                this.centre = new Point(centre);
                this.radius = radius;
            public String toString() {
                return "Circle, centre " + centre + ", radius " + radius;
            public void move(Point dist) {
                centre.move(dist.x, dist.y);
            public void draw(Graphics g) {
                System.out.println("Draw circle at " + centre + " with color " + color);
                g.setColor(Color.black);
                g.drawOval(centre.x, centre.y, 20, 20);
                g.setColor(color);
                g.fillOval(centre.x, centre.y, 20, 20);
        public void addRectangle(int x, int y, Color col) {
            System.out.println("x,y,col " + x + ":" + y + ":" + col);
            Rectangle r = new Rectangle(col, new Point(x, y), new Point(x + 20, y + 20));
            figures.addLast(r);
            repaint();
        public void addCircle(int x, int y, Color col) {
            System.out.println("x,y,col" + x + ":" + y + ":" + col);
            Circle c = new Circle(col, new Point(x, y), 1);
            figures.addLast(c);
            repaint();
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            for (int i = 0; i < figures.size(); i++) {
                GeomFigur drawable = (GeomFigur)figures.get(i);
                drawable.draw(g);
    }/Kaj

  • Can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    Java is no longer included in Mac OS X by default. If you want Java, you will have to install it.
    However, note that you should think twice before installing Java for such a trivial need as looking at stock market quotes. There are other ways to get that information that don't involve Java, and using Java in your web browser is a HUGE security risk right now. Java has been vulnerable to attack almost constantly for the last year, and has become a very popular, frequently used method for getting malware installed via "drive-by downloads." You really, truly don't want to be using it. See:
    Java is vulnerable… Again?!
    http://java-0day.com

  • HT5675 i need java 1.6 to get ,m,inecraft but it wont ever work please help?

    i need java 1.6 to get minecraft but it wont ever work someone please help me!

    Hello,
    What version of Mac OS X are you running on your iBook?
    Also check what version of java is currently installed by doing the following,
    Open Terminal, type in java -version then press Enter.  Then retrieve the current java version, in this example being 1.6.0_24

  • Complete Java n00b...need some help

    I'm very new to Java and I need some help writing a basic program.
    I need to write a program that lets the user add up an infinite amount of floating point numbers. The program should compute the sum of all the numbers entered thus far. So for example if the user enters 2 and 3, it should give a number of 5. If the user then enters 4, I should give me 9 etc.
    I'm not really sure how to get started on writing that. I can add up two numbers but I don't know how to tell the program to keep adding additional numbers to that sum. Can someone please help me out? thanks

    It's ok... it can be hard to understand even the simplest concepts with only text and no help.
    There needs to be an int variable outside (before) the loop initialized to 0.
    float num = 0;Next, you need to have an infinite loop that requests floats to add onto the number.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        num += toAdd;
        System.out.println("Current sum " + num);
    }Putting all this together and putting it into a main method will work, but we have a bit of an issue. The program won't stop! For that reason, we need to specify a number which can exit the program. I like to use 0 for this purpose.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
            break;
        num += toAdd;
        System.out.println("Current sum " + num);
    }So, this code will work:
    import java.util.Scanner;
    class AddNumbers {
        public static void main(String[] args) {
            float num = 0;
            Scanner input = new Scanner(System.in);
            while (true) {
                float toAdd = input.nextFloat();
                if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
                    break;
                num += toAdd;
                System.out.println("Current sum: " + num);
    }Edited by: Arricherekk on May 18, 2008 3:19 PM

  • Beginner in java and need your help about DES

    hello,
    I m a new guy in java programming and learn from many books.I m making a website and portal right now and dying need your help about DES.my portal (using java) requires somebody to make a login name and a password.I m done with the server and client things and rite now stuck with this "DES" stuff.
    so I make some conditions and algorithm below..
    1. when a user login,the password is encrypted.at this point,cleartext(id) and encryption (M,N) are involve.
    2. then the key is changed based on algorithm.
    3.the key changed by key(id) is received and the original text should be encrypted.
    the algorithm
    1. the original text x1.x2.x3.x4.x5.x6.x7.x8 (64 bits)
    2. encypt the password
    a. Each character is changed into an int type by the ASCII code, and let the 1st bit be an odd number parity bit.
    b.The 1st bit of the 1st character in (IP) is set to '1', and the 8th bit of the 8th character as '64'.
    c.the rest (IP) is like this
    1 2 3 4 5 6 7 8
    0 # 58 50 42 34 26 18 10 2
    8 # 60 52 44 36 28 20 12 4
    16 # 62 54 46 38 30 22 14 6
    24 # 64 46 48 40 32 24 16 8
    32 # 57 49 41 33 25 17 9 1
    40 # 59 51 43 35 27 19 11 3
    48 # 61 53 45 37 29 21 13 5
    56 # 63 55 47 39 31 23 15 7
    d. and lastly,from above,,it should be done like this
    1 2 3 4 5 6 7
    0 # 40 8 48 16 56 24 64 32
    8 # 39 7 27 15 55 23 53 31
    16 # 38 6 26 14 54 22 52 30
    24 # 37 5 25 13 53 21 51 29
    32 # 36 4 24 12 52 20 50 28
    40 # 35 3 23 11 51 19 49 27
    48 # 34 2 21 10 50 18 48 26
    56 # 33 1 20 9 49 17 47 25
    e. key y1,y2,y3,y4,y5,y6,y7,y8 (64bit)
    f. generate the key based on ID
    a. Each character is changed into an int type by the ASCII code, and let the 1st bit be an even number parity bit.
    b.the process is repeat again.
    anybody has an idea to help me with the sample program?
    thanks in advance...

    just ask about a simple program how to receive a
    password from somebody and change it to a key..and
    then confirm it with DES.Once again I have a problem understanding what you are asking.
    Are you trying to use the password as a key to encrypt some 'standard thing' and place this encrypted value in a database? If so then look in the JCE for 'password based encryption' such as PBEWithMD5AndDes. This seems back to front to me but I can see nothing wrong with the approach since the 'standard thing' you would encrypt is in effect a key. If this is for a commercial application then I would find a security expert to evaluate your proposal!
    In my experience it is more normal to encrypt the user's password with DES and store the result in the database. To do this just look in the JCE for DES encryption and consider using DES with CBC and PKCS5 padding. Also, consider encrypting the concatenation of the user's 'user name' with the password as this will (almost certainly) avoid having two encrypted values in the database that are the same even if two users have the same password.
    For both of these you might consider using Base64 or Hex to turn you encrpted bytes into ASCII characters before trying to store them in your DB.

  • Photoshop will not launch. Window indicates need JAVA SE6. Already have it, but re-installed. Photoshop will still not launch. Help! MacOS 10.10.1

    Since installing Mac OS 10.10.1 photoshop will not run, it will not launch. A window indicates that it needs JAVA SE6 to run. JAVA SE6 is installed. I have re-installed and restarted but photoshop will not run and I get the same message window that I need to install JAVA SE6. How do I make this work?

    Have you added any Photoshop Add-on that uses an external JavaScript.  Photoshop itself has is own ScriptingSupport Plug-in and does not use an external java.  Also Java SE6 is old and has security issues you should update to version SE8
    Note the plug-in is system info
    Adobe Photoshop Version: 2014.2.1 20141014.r.257 2014/10/14:23:59:59 CL 987299  x64
    Required plug-ins:
       3D Studio 15.2.1 (2014.2.1 x001 x003)
       Accented Edges 15.2.1
       Adaptive Wide Angle 15.2.1
       Angled Strokes 15.2.1
       Average 15.2.1 (2014.2.1 x001 x003)
       Bas Relief 15.2.1
       BMP 15.2.1
       Camera Raw 8.7
       Camera Raw Filter 8.7
       Chalk & Charcoal 15.2.1
       Charcoal 15.2.1
       Chrome 15.2.1
       Cineon 15.2.1 (2014.2.1 x001 x003)
       Clouds 15.2.1 (2014.2.1 x001 x003)
       Collada 15.2.1 (2014.2.1 x001 x003)
       Color Halftone 15.2.1
       Colored Pencil 15.2.1
       CompuServe GIF 15.2.1
       Conté Crayon 15.2.1
       Craquelure 15.2.1
       Crop and Straighten Photos 15.2.1 (2014.2.1 x001 x003)
       Crop and Straighten Photos Filter 15.2.1
       Crosshatch 15.2.1
       Crystallize 15.2.1
       Cutout 15.2.1
       Dark Strokes 15.2.1
       De-Interlace 15.2.1
       Dicom 15.2.1
       Difference Clouds 15.2.1 (2014.2.1 x001 x003)
       Diffuse Glow 15.2.1
       Displace 15.2.1
       Dry Brush 15.2.1
       Eazel Acquire 15.2.1 (2014.2.1 x001 x003)
       Embed Watermark 4.0
       Entropy 15.2.1 (2014.2.1 x001 x003)
       Export Color Lookup Tables NO VERSION
       Extrude 15.2.1
       FastCore Routines 15.2.1 (2014.2.1 x001 x003)
       Fibers 15.2.1
       Film Grain 15.2.1
       Filter Gallery 15.2.1
       Flash 3D 15.2.1 (2014.2.1 x001 x003)
       Fresco 15.2.1
       Glass 15.2.1
       Glowing Edges 15.2.1
       Google Earth 4 15.2.1 (2014.2.1 x001 x003)
       Grain 15.2.1
       Graphic Pen 15.2.1
       Halftone Pattern 15.2.1
       HDRMergeUI 15.2.1
       HSB/HSL 15.2.1
       IFF Format 15.2.1
       IGES 15.2.1 (2014.2.1 x001 x003)
       Ink Outlines 15.2.1
       JPEG 2000 15.2.1
       Kurtosis 15.2.1 (2014.2.1 x001 x003)
       Lens Blur 15.2.1
       Lens Correction 15.2.1
       Lens Flare 15.2.1
       Liquify 15.2.1
       Matlab Operation 15.2.1 (2014.2.1 x001 x003)
       Maximum 15.2.1 (2014.2.1 x001 x003)
       Mean 15.2.1 (2014.2.1 x001 x003)
       Measurement Core 15.2.1 (2014.2.1 x001 x003)
       Median 15.2.1 (2014.2.1 x001 x003)
       Mezzotint 15.2.1
       Minimum 15.2.1 (2014.2.1 x001 x003)
       MMXCore Routines 15.2.1 (2014.2.1 x001 x003)
       Mosaic Tiles 15.2.1
       Multiprocessor Support 15.2.1 (2014.2.1 x001 x003)
       Neon Glow 15.2.1
       Note Paper 15.2.1
       NTSC Colors 15.2.1 (2014.2.1 x001 x003)
       Ocean Ripple 15.2.1
       OpenEXR 15.2.1
       Paint Daubs 15.2.1
       Palette Knife 15.2.1
       Patchwork 15.2.1
       Paths to Illustrator 15.2.1
       PCX 15.2.1 (2014.2.1 x001 x003)
       Photocopy 15.2.1
       Photoshop 3D Engine 15.2.1 (2014.2.1 x001 x003)
       Photoshop Touch 14.0
       Picture Package Filter 15.2.1 (2014.2.1 x001 x003)
       Pinch 15.2.1
       Pixar 15.2.1 (2014.2.1 x001 x003)
       Plaster 15.2.1
       Plastic Wrap 15.2.1
       PLY 15.2.1 (2014.2.1 x001 x003)
       PNG 15.2.1
       Pointillize 15.2.1
       Polar Coordinates 15.2.1
       Portable Bit Map 15.2.1 (2014.2.1 x001 x003)
       Poster Edges 15.2.1
       PRC 15.2.1 (2014.2.1 x001 x003)
       Radial Blur 15.2.1
       Radiance 15.2.1 (2014.2.1 x001 x003)
       Range 15.2.1 (2014.2.1 x001 x003)
       Read Watermark 4.0
       Render Color Lookup Grid NO VERSION
       Reticulation 15.2.1
       Ripple 15.2.1
       Rough Pastels 15.2.1
       Save for Web 15.2.1
       ScriptingSupport 15.2.1  <------------------------------------------------------------------ Photoshop Scripting Support Plug-in
       Shake Reduction 15.2.1
       Shear 15.2.1
       Skewness 15.2.1 (2014.2.1 x001 x003)
       Smart Blur 15.2.1
       Smudge Stick 15.2.1
       Solarize 15.2.1 (2014.2.1 x001 x003)
       Spatter 15.2.1
       Spherize 15.2.1
       Sponge 15.2.1
       Sprayed Strokes 15.2.1
       Stained Glass 15.2.1
       Stamp 15.2.1
       Standard Deviation 15.2.1 (2014.2.1 x001 x003)
       STL 15.2.1 (2014.2.1 x001 x003)
       Sumi-e 15.2.1
       Summation 15.2.1 (2014.2.1 x001 x003)
       Targa 15.2.1
       Texturizer 15.2.1
       Tiles 15.2.1
       Torn Edges 15.2.1
       Twirl 15.2.1
       U3D 15.2.1 (2014.2.1 x001 x003)
       Underpainting 15.2.1
       Vanishing Point 15.2.1
       Variance 15.2.1 (2014.2.1 x001 x003)
       Virtual Reality Modeling Language | VRML 15.2.1 (2014.2.1 x001 x003)
       Water Paper 15.2.1
       Watercolor 15.2.1
       Wave 15.2.1
       Wavefront|OBJ 15.2.1 (2014.2.1 x001 x003)
       WIA Support 15.2.1 (2014.2.1 x001 x003)
       Wind 15.2.1
       Wireless Bitmap 15.2.1 (2014.2.1 x001 x003)
       ZigZag 15.2.1
    Optional and third party plug-ins:
       CUR (Windows Cursor) NO VERSION
       Face Control II 2.00
       Fine Touch 3.25
       GREYCstoration NO VERSION
       ICO (Windows Icon) NO VERSION
       Reduce Noise 7.0.0.0
       ScriptListener 13.0
       StarFilter Pro 3 3.0.5.1
       SuperPNG 2.0
       Variations 14.2.1 (14.2.1 x001)
    Plug-ins that failed to load: NONE
    Flash:
       Libraries
       Adobe Color Themes
    Installed TWAIN devices: NONE

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • Need some help with a program Please.

    Well, im new here, im new to java, so i need your help, i have to make a connect four program, my brother "Kind of" helped me and did a program for me, but the problem is i cant use some of those commands in the program and i have to replace them with what ive learned, so i will post the program and i will need your help to modify it for me.
    and for these programs, also i want help for:
    They have errors and i cant fix'em
    the commands that i've leaned:
    If statements, for loops, while loops,do while, strings, math classes, swithc statement, else if,logical operators,methods, one and two dimensional arrays.
    Thanx in advance,
    truegunner
    // Fhourstones 3.0 Board Logic
    // Copyright 2000-2004 John Tromp
    import java.io.*;
    class Connect4 {
    static long color[]; // black and white bitboard
    static final int WIDTH = 7;
    static final int HEIGHT = 6;
    // bitmask corresponds to board as follows in 7x6 case:
    // . . . . . . . TOP
    // 5 12 19 26 33 40 47
    // 4 11 18 25 32 39 46
    // 3 10 17 24 31 38 45
    // 2 9 16 23 30 37 44
    // 1 8 15 22 29 36 43
    // 0 7 14 21 28 35 42 BOTTOM
    static final int H1 = HEIGHT+1;
    static final int H2 = HEIGHT+2;
    static final int SIZE = HEIGHT*WIDTH;
    static final int SIZE1 = H1*WIDTH;
    static final long ALL1 = (1L<<SIZE1)-1L; // assumes SIZE1 < 63
    static final int COL1 = (1<<H1)-1;
    static final long BOTTOM = ALL1 / COL1; // has bits i*H1 set
    static final long TOP = BOTTOM << HEIGHT;
    int moves[],nplies;
    byte height[]; // holds bit index of lowest free square
    public Connect4()
    color = new long[2];
    height = new byte[WIDTH];
    moves = new int[SIZE];
    reset();
    void reset()
    nplies = 0;
    color[0] = color[1] = 0L;
    for (int i=0; i<WIDTH; i++)
    height[i] = (byte)(H1*i);
    public long positioncode()
    return 2*color[0] + color[1] + BOTTOM;
    // color[0] + color[1] + BOTTOM forms bitmap of heights
    // so that positioncode() is a complete board encoding
    public String toString()
    StringBuffer buf = new StringBuffer();
    for (int i=0; i<nplies; i++)
    buf.append(1+moves);
    buf.append("\n");
    for (int w=0; w<WIDTH; w++)
    buf.append(" "+(w+1));
    buf.append("\n");
    for (int h=HEIGHT-1; h>=0; h--) {
    for (int w=h; w<SIZE1; w+=H1) {
    long mask = 1L<<w;
    buf.append((color[0]&mask)!= 0 ? " @" :
    (color[1]&mask)!= 0 ? " 0" : " .");
    buf.append("\n");
    if (haswon(color[0]))
    buf.append("@ won\n");
    if (haswon(color[1]))
    buf.append("O won\n");
    return buf.toString();
    // return whether columns col has room
    final boolean isplayable(int col)
    return islegal(color[nplies&1] | (1L << height[col]));
    // return whether newboard lacks overflowing column
    final boolean islegal(long newboard)
    return (newboard & TOP) == 0;
    // return whether newboard is legal and includes a win
    final boolean islegalhaswon(long newboard)
    return islegal(newboard) && haswon(newboard);
    // return whether newboard includes a win
    final boolean haswon(long newboard)
    long y = newboard & (newboard>>HEIGHT);
    if ((y & (y >> 2*HEIGHT)) != 0) // check diagonal \
    return true;
    y = newboard & (newboard>>H1);
    if ((y & (y >> 2*H1)) != 0) // check horizontal -
    return true;
    y = newboard & (newboard>>H2); // check diagonal /
    if ((y & (y >> 2*H2)) != 0)
    return true;
    y = newboard & (newboard>>1); // check vertical |
    return (y & (y >> 2)) != 0;
    void backmove()
    int n;
    n = moves[--nplies];
    color[nplies&1] ^= 1L<<--height[n];
    void makemove(int n)
    color[nplies&1] ^= 1L<<height[n]++;
    moves[nplies++] = n;
    public static void main(String argv[])
    Connect4 c4;
    String line;
    int col=0, i, result;
    long nodes, msecs;
    c4 = new Connect4();
    c4.reset();
    BufferedReader dis = new BufferedReader(new InputStreamReader(System.in));
    for (;;) {
    System.out.println("position " + c4.positioncode() + " after moves " + c4 + "enter move(s):");
    try {
    line = dis.readLine();
    } catch (IOException e) {
    System.out.println(e);
    System.exit(0);
    return;
    if (line == null)
    break;
    for (i=0; i < line.length(); i++) {
    col = line.charAt(i) - '1';
    if (col >= 0 && col < WIDTH && c4.isplayable(col))
    c4.makemove(col);
    By the way im using Ready to program for the programming.

    You can't really believe that his brother did this
    for him...I did miss that copyright line at the beginning when
    I first looked it over, but you know, if it had been
    his brother, I'd be kinda impressed. This wasn't a
    25 line program. It actually would have required
    SOME thought. I doubt my brother woulda done that
    for me (notwithstanding the fact that I wouldn't need
    help for that program, and my brother isn't a
    programmer).I originally missed the comments at the top but when I saw the complexity of what was written then I knew that it was too advanced for a beginner and I relooked through the code and saw the comments.

Maybe you are looking for