Counting Print Outs

Help. Does anyone know of a program we could install on all our employees MACs that would count the number of print outs printed from each MAC?
We are trying to save the planet by using less paper. Any help is greatly appreciated.
Thanks

If you have someone who understands a little bit about CUPS and unix, you can try these free apps:
http://www.librelogiciel.com/software/pkpgcounter/action_Presentation
http://www.cups.org/links.php?V130+Q

Similar Messages

  • How t print out selected values from a Jlist

    hi iam trying to get the selected values from a list to print out as a string but iam getting ,Invalid cast from java.lang.Object[] to java.lang.String.is there any way to get the selected values t print ut as a string?? import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MultipleSelection2 extends JFrame {
    private JList colorList, copyList;
    private JButton copy;
    private String colorNames[] =
    { "Black", "Blue", "Cyan", "Dark Gray", "Gray",
    "Green", "Light Gray", "Magenta", "Orange", "Pink",
    "Red", "White", "Yellow" };
    public MultipleSelection2()
    super( "Multiple Selection Lists" );
    Container c = getContentPane();
    c.setLayout( new FlowLayout() );
    colorList = new JList( colorNames );
    colorList.setVisibleRowCount( 5 );
    colorList.setFixedCellHeight( 15 );
    colorList.setSelectionMode(
    ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
    c.add( new JScrollPane( colorList ) );
    // create copy button
    copy = new JButton( "Copy >>>" );
    copy.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent e )
    // place selected values in copyList
    copyList.setListData(
    colorList.getSelectedValues());
    String s1 =(String)colorList.getSelectedValues();

    Since the JList method 'getSelectedValues' returns an object array you'll need to iterate through the array and cast each object in the array to a string as you access them.
    Object[] o = colorList.getSelectedValues();
    for(int count=0,end=o.length; count<end; count++) {
    String s = (String) o[count];
    Hope that helps
    Talden

  • How to print out the data from the file ?

    hi all,
    i have upload my file to here :
    [http://www.freefilehosting.net/ft-v052010-05-09 ]
    anyone can help me to print out the data from the file ?
    the content of the file should be like this :
    185.56.83.89 156.110.16.1 17 53037 53 72 1
    and for the seven column is
    srcIP dstIP prot srcPort dstPort octets packets

    hi all,
    i have try to do this
    public static void Readbinary() throws Exception
              String file = "D:\\05-09.190501+0800";
              DataInputStream dis = new DataInputStream(new FileInputStream(file));
              //but then how to read the content ??????can you give me more hint ?????
    i have find the netflow v5 structure by C
    struct NFHeaderV5{
    uint16_t version; // flow-export version number
    uint16_t count; // number of flow entries
    uint32_t sysUptime;
    uint32_t unix_secs;
    uint32_t unix_nsecs;
    uint32_t flow_sequence; // sequence number
    uint8_t engine_type; // no VIP = 0, VIP2 = 1
    uint8_t engine_id; // VIP2 slot number
    uint16_t reserved; // reserved1,2
    struct NFV5{ 
    ipv4addr_t srcaddr; // source IP address
    ipv4addr_t dstaddr; // destination IP address
    ipv4addr_t nexthop; // next hop router's IP address
    uint16_t input; // input interface index
    uint16_t output; // output interface index
    uint32_t pkts; // packets sent in duration
    uint32_t bytes; // octets sent in duration
    uint32_t first; // SysUptime at start of flow
    uint32_t last; // and of last packet of flow
    uint16_t srcport; // TCP/UDP source port number or equivalent
    uint16_t dstport; // TCP/UDP destination port number or equivalent
    uint8_t pad;
    uint8_t tcp_flags; // bitwise OR of all TCP flags in flow; 0x10
    // for non-TCP flows
    uint8_t prot; // IP protocol, e.g., 6=TCP, 17=UDP, ...
    uint8_t tos; // IP Type-of-Service
    uint16_t src_as; // originating AS of source address
    uint16_t dst_as; // originating AS of destination address
    uint8_t src_mask; // source address prefix mask bits
    uint8_t dst_mask; // destination address prefix mask bits
    uint16_t reserved;
    but how to translate the structure to java,then get the data from the file ?
    Edited by: 903893 on Dec 21, 2011 10:52 PM

  • OO: ALV + Header w/ logo print out

    Hi everyone!
    I have a container splitted in two: one for a Header area in wich I add a logo and some header texts, and the other split for an ALV Grid.
    The problem comes when I call the method PRINT_DOCUMENT from CL_DD_DOCUMENT. It print out only the header, but not the data in ALV Grid. Why is that? Is there any way to archieve this?
    Thanx in advance.

    Have u handled te print_top_of_page?
    * Class definition :
    *       CLASS v_lcl_event_receiver DEFINITION
    CLASS v_lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_print_top_of_page FOR EVENT print_top_of_page OF
                                           cl_gui_alv_grid,
        handle_top_of_page FOR EVENT top_of_page OF
                                     cl_gui_alv_grid.
    ENDCLASS.
    *       CLASS V_LCL_EVENT_RECEIVER IMPLEMENTATION
    CLASS v_lcl_event_receiver IMPLEMENTATION.
      METHOD handle_print_top_of_page.
        IF sy-pagno = 1.
            PERFORM top_of_page.
        ENDIF.
      ENDMETHOD.
      METHOD handle_top_of_page.
          PERFORM top_of_page.
      ENDMETHOD.
    ENDCLASS.
    DATA:        v_event_receiver      TYPE REF TO v_lcl_event_receiver.
    FORM top_of_page.
      WRITE: text-020,
    ENDFORM.                    " top_of_page
    In PBo of the screen
       DATA: v_split            TYPE REF TO cl_gui_easy_splitter_container,
             v_contnr_top       TYPE REF TO cl_gui_container,
             v_contnr_bot       TYPE REF TO cl_gui_container,
             v_grid_02          TYPE REF TO cl_gui_alv_grid,
             v_html             TYPE REF TO cl_dd_document,
             v_text20(255)      TYPE c,
             v_text16(255)      TYPE c,
    FORM f9000_objects_create.
      IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    Create a container
        CREATE OBJECT o_dockingcontainer
          EXPORTING
            ratio                       = '95'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            others                      = 6.
        IF sy-subrc NE 0.
          MESSAGE i000 WITH text-e01."Error in creating Docking container
          LEAVE LIST-PROCESSING.
        ENDIF.
        CREATE OBJECT v_split
             EXPORTING
               parent            = o_dockingcontainer
    *          ORIENTATION       = 0
               sash_position     = 25
               with_border       = 0
             EXCEPTIONS
               cntl_error        = 1
               cntl_system_error = 2
               others            = 3.
        IF sy-subrc NE 0.
          MESSAGE i000 WITH text-e01."Error in creating Docking container
          LEAVE LIST-PROCESSING.
        ENDIF.
    *   Get the containers of the splitter control
        v_contnr_top = v_split->top_left_container.
        v_contnr_bot = v_split->bottom_right_container.
        CREATE OBJECT o_alvgrid
       EXPORTING
         i_parent = o_dockingcontainer.
    *   Create an instance of alv control
        CREATE OBJECT o_alvgrid
             EXPORTING i_parent = v_contnr_bot.
    *   Object for display of selection parameters in HTML top container
        CREATE OBJECT v_html
             EXPORTING
               style = 'ALV_GRID'.
    *   Must be after the SET HANDLER for TOP_OF_PAGE and foreground only
        CALL METHOD o_alvgrid->list_processing_events
                         EXPORTING i_event_name = 'TOP_OF_PAGE'
                                   i_dyndoc_id  = v_html.
        v_text20 = text-020(summary Record counts)Any text.
        CALL METHOD v_html->add_gap
                    EXPORTING
                      width         = 120.
        CALL METHOD v_html->add_text
               EXPORTING
                 text          = v_text20.
        CALL METHOD v_html->new_line.
    ** Display Text-016
        v_text16 = text-016.
        CALL METHOD v_html->add_gap
                    EXPORTING
                      width         = 1.
        CALL METHOD v_html->add_text
               EXPORTING
                 text          = v_text16.
        v_text16 = v_sap_recon.
        CALL METHOD v_html->add_gap
                    EXPORTING
                      width         = 1.
        CALL METHOD v_html->add_text
               EXPORTING
                 text          = v_text16.
        CALL METHOD v_html->new_line.
    * Display the data
        CALL METHOD v_html->display_document
          EXPORTING
             parent             = v_contnr_top.
    *   Handle the event
        CALL METHOD o_alvgrid->list_processing_events
                            EXPORTING i_event_name = 'PRINT_TOP_OF_PAGE'.
    IN PBO while populating in the output table
    FORM f9004_display_data TABLES   p_report_tab
                                     p_fieldcat.
      CALL METHOD o_alvgrid->set_table_for_first_display
        EXPORTING
           is_variant                    = w_variant
           i_save                        = c_a
           is_layout                     = w_layout
        CHANGING
           it_outtab                     = p_report_tab[]
           it_fieldcatalog               = p_fieldcat[]
        EXCEPTIONS
           invalid_parameter_combination = 1
           program_error                 = 2
           too_many_lines                = 3
           OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
    * Create object
      IF v_event_receiver IS INITIAL.
        CREATE OBJECT v_event_receiver.
      ENDIF.
      SET HANDLER v_event_receiver->handle_print_top_of_page FOR o_alvgrid.
      SET HANDLER v_event_receiver->handle_top_of_page FOR o_alvgrid.

  • Print out a traingle of asterisks in GUI

    Was wondering if anyone knew how I can get the code below coverted to a GUI, or JOption MEssageDialog, to print a trangle of stars in the GUI wondow?
    This code here needs to be converted:
    for (count = 1; count <= blanks; count++)
    System.out.prinln(" ");               
    for (count = 1; count <= starsInLine; count++)
    System.out.prinln(" *");
    This is the complete code with half of it on the JOptionPane input part, I need the output part.... please?
    import javax.swing.JOptionPane;
    import java.awt.*;
    public class printStars
         public static void main (String[ ] args)
              String input;
    int numberOfLines;
              int counter;
              int numberOfBlanks;
              input = JOptionPane.showInputDialog("Enter the number of star lines " + "(1 to 20) to be printed: ");
              numberOfLines = new Integer(Integer.parseInt(input));     
              while (numberOfLines < 0 || numberOfLines > 20)
                   JOptionPane.showMessageDialog(null,"Please enter a number between 1 and 20","Error",JOptionPane.PLAIN_MESSAGE);
                   numberOfBlanks = 30;
                   for (counter = 1; counter <= numberOfLines; counter++)
                        printStars(numberOfBlanks, counter);
                        numberOfBlanks--;                    
              public static void printStars(int blanks, int starsInLine)
                   int count;
                   for (count = 1; count <= blanks; count++)
                   System.out.prinln(" ");               
    for (count = 1; count <= starsInLine; count++)
                   System.out.prinln(" *");
         System.exit(0);          
              }

    I'll have your code for you in a jiffy. Just wait there while I whip this together....

  • Help with printing out the # of quarters, nickels, dimes, and etc... using

    Hi, im new to java and im using a program called blue j.
    anyway heres my question.
    , I recommend you dont do the program for me, but rather help gear me in the right direction of things.
    In this program they want me to have it print out the # of dollars,quarters,nickels,dimes, and pennies.
    They have provided me with a base program to start off with which is this.
    import chn.util.*;
    public class ComputeChange
       *  The main program for the Change class
       * @param  args  The command line arguments - not used
      public static void main(String[] args)
        double purchase, cashPaid, temp;
        int change, remainder, dollars, quarters, dimes, nickels, pennies;
        ConsoleIO keyboard = new ConsoleIO();
        System.out.print("Enter amount of purchase --> ");
        purchase = keyboard.readDouble();
        System.out.print("Enter amount of cash paid --> ");
        cashPaid = keyboard.readDouble();
        temp = cashPaid - purchase;
        dollars = (int) temp;
        temp = temp - (int)temp + 0.0000001;
        change = (int)(temp * 100);
        System.out.println();
        System.out.println("$" + dollars + "." + change);
    }Ive been given the amounts 23.06 for amount of purchase
    and 30.00 for the amount paid. that should give me the difference of $6.94
    It should print out the amount of change as the following
    6 dollars
    3 quarters
    1 dime
    1 nickel
    1 penny.
    IVe tried a few methods for printing out the # of each coin type, but i simply dont get how they are using temp or what type of funciton i need to follow. Any hints or pointings in the right direction would help. Since i need to learn this.
    Thanks a lot and i hope i can get some tips. !
    ~Jbinks

    And here's my contribution to the scratch batch... :o)
    class Coins {
        private java.util.Map<Coin, Integer> count = new java.util.HashMap<Coin, Integer>();
        enum Coin {
            DOLLAR(100), QUARTER(25), DIME(10), NICKEL(5), PENNY(1);
            private final int value;   
            Coin(int value) { this.value = value; }
            public int value() { return value; }
        public Coins(int centsValue) {
            for (Coin c : Coin.values()) {
                count.put(c, centsValue / c.value());
                centsValue %= c.value();
        public void display() {
            for (Coin c : Coin.values()) {
                System.out.println(c + ": " + count.get(c));
    public class CoinsDemo {
        private static java.util.Scanner keyboard = new java.util.Scanner(System.in);
        public static void main(String[] args) {
            int price = getPennies("Enter amount of purchase --> ");
            int paid = getPennies("Enter amount of cash paid --> ");
            new Coins(price - paid).display();
        private static int getPennies(String prompt) {
            System.out.print(prompt);
            double d = keyboard.nextDouble();
            System.out.println();
            return (int)(d * 100);
    }

  • This is about recursion and the print out

    Please give me a "HINT" on how to;
    1- Control the way I print the file out, like instead of printing "A, B, C, D, E, F", printthe alphabets in two lines of three alphabets, like;
    "A, B, C"
    "D, E, F"
    2- A hint on writing a recursion method so I can print out from more than one inFile.
    This is what I have so far.import Alphabets;
    import java.util.StringTokenizer;
    import java.io.*;
    public class PrintAlphabets
       public static void main (String[] args) throws IOException
         int n= 100;
          Alphabets[] letters= new Alphabets[n];   //array of numbers
          StringTokenizer tokenizer;
          String line, name;
          String units;     //number of Alphabets available in the file.
              int count = 0;
          String fileout = "c:\\Alpha.txt";
         File file = new File(args[0]);
          FileWriter fw = new FileWriter (fileout);
          BufferedWriter bw = new BufferedWriter (fw);
          PrintWriter outFile = new PrintWriter (bw);
          try
               FileReader fr = new FileReader (file);
               BufferedReader inFile = new BufferedReader (fr);
               line = inFile.readLine();
               while (line != null)
                   tokenizer = new StringTokenizer (line);
                     while (tokenizer.hasMoreTokens())
                       try
                          units = tokenizer.nextToken();
                           if ( units.equals("#include") )
                              tokenizer.nextToken();
                           else
                          letters[count++] = new Alphabets (units);
                       catch (Exception e)
                          System.out.println ("Error in input. Line ignored:");
                          System.out.println (line);
                 line = inFile.readLine();
             inFile.close();
              for (int scan = 0; scan < count; scan++)
                            outFile.print (letters[scan] + " " );
          catch (FileNotFoundException exception)
             System.out.println ("The file " + file + " was not found.");
          catch (IOException exception)
            System.out.println (exception);
                System.exit(0);
               outFile.close();

    I thought I send you te whole code again because I still get the "null" thing.
    import Alphabets;
    import java.util.StringTokenizer;
    import java.io.*;
    public class PrintAlphabets
       public static void main (String[] args) throws IOException
         int n= 100;
          Alphabets[] letters= new Alphabets[n]; ;  //array of numbers
          StringTokenizer tokenizer;
          String line, name;
          String units;    
              int count = 0, printCount=0, scan=0;
          String fileout = "c:\\AlphaResult.txt";
         File file = new File(args[0]);
          FileWriter fw = new FileWriter (fileout);
          BufferedWriter bw = new BufferedWriter (fw);
          PrintWriter outFile = new PrintWriter (bw);
          try
               FileReader fr = new FileReader (file);
               BufferedReader inFile = new BufferedReader (fr);
               line = inFile.readLine();
               while (line != null)
                   tokenizer = new StringTokenizer (line);
                     while (tokenizer.hasMoreTokens())
                       try
                          units = tokenizer.nextToken();
                           if ( units.equals("#include") )
                              tokenizer.nextToken();
                           else
                          letters[count++] = new Alphabets (units);
                       catch (Exception e)
                          System.out.println ("Error in input. Line ignored:");
                          System.out.println (line);
                 line = inFile.readLine();
             inFile.close();
              for (scan = 0; scan < count; scan++)
                            if (printCount == 3)
                               {   outFile.println(); 
                                    printCount = 0;
                             String newLine = System.getProperty("line.separator");
                             outFile.print(newLine + letters[scan] + " " );
                            printCount++;
                            //System.out.println(letters[scan] + " "  );
                            //outFile.print (letters[scan] + " " );
          catch (FileNotFoundException exception)
             System.out.println ("The file " + file + " was not found.");
          catch (IOException exception)
            System.out.println (exception);
                System.exit(0);
               outFile.close();
    }

  • How to use Applescript to print out a certain calendar at 7am every morning?

    Hey guys,
    I am trying to use AppleScript to print out one of my calendars each day at 7am every morning.
    I have come up with this so far:
    tell application "Calendar"
           view calendar "My Appointments" at (my (current date))
           switch view to day view
           activate
                        tell application "System Events"
                     keystroke "p" using command down
                     delay 1 -- (seconds)
                     tell process "Calendar"
                                                      tell window "Print"
                                                                     if value of checkbox "Calendar Keys" is not 0 then
                                      click checkbox "Calendar Keys"
                               end if
                                                      end tell
                                       end tell
                        end tell
    end tell
    The problem with this is that it will print out whatever calendars are currently viewable. I can't figure out how to tell it to deselect other calendars and just select the one I want. I also want to tell it to print this out at 7am every morning.
    Any help would be very appreciated!

    If you wanted to do the printout over multiple days, you would be best to loop through each day's events in the way the current script does, but to put a new loop around it that gets each new day's data:
    --opens a temporary file
    set fileRef to open for access ((path to desktop) as string) & "meetings.txt" with write permission
    --effectively empties the file
    set eof fileRef to 0
    tell application "Calendar"
              set dayCount to 9 --this will be the number of days to look forward (not including today)
              repeat with currentDay from 0 to dayCount
                        set startList to {}
      --get's today's date
      --set startRange to ((current date) + 12 * days) -- I used this for testing, to point to a day that had many appointments.  I've left it so you can use it, too.
                        set startRange to ((current date) + (currentDay * days))
      --set the start of the range to previous midnight
                        set hours of startRange to 0
                        set minutes of startRange to 0
                        set seconds of startRange to 0
      --set end of the range to next midnight
                        set endRange to (startRange + 1 * days)
      --get today's events
                        set todaysEvents to get (events of calendar "My Appointments" whose (start date is greater than startRange) and (end date is less than endRange))
      --make a new list with start time of the event for sort purposes
                        repeat with theEvent in todaysEvents
                                  set end of startList to {startdate:start date of theEvent, eventID:theEvent}
                        end repeat
      --sort using a bubble sort (suitable for short lists)
                        repeat with i from 1 to (count of startList) - 1
                                  repeat with j from i + 1 to count of startList
                                            if startdate of item j of startList < startdate of item i of startList then
                                                      set temp to item i of startList
                                                      set item i of startList to item j of startList
                                                      set item j of startList to temp
                                            end if
                                  end repeat
                        end repeat
      --empty the original list
                        set todaysEvents to {}
      --repopulate the list in correct chronological order
                        repeat with theEvent in startList
                                  set end of todaysEvents to eventID of theEvent
                        end repeat
      --write today's date to the file
      write (date string of startRange & return & return) to fileRef
      --if there are no events, write this to the file as well
                        if length of todaysEvents is 0 then
                                  write "No events" & return & return to fileRef
                        else
      --process each event into format: hh:mm-hh:mm/new line/event summary
                                  repeat with theEvent in todaysEvents
                                            set startdate to start date of theEvent
                                            set enddate to end date of theEvent
                                            set startHours to hours of startdate as string
                                            if length of startHours is 1 then set startHours to "0" & startHours
                                            set startMins to minutes of startdate as string
                                            if length of startMins is 1 then set startMins to "0" & startMins
                                            set starttime to startHours & ":" & startMins
                                            set endHours to hours of enddate as string
                                            if length of endHours is 1 then set endHours to "0" & endHours
                                            set endMins to minutes of enddate as string
                                            if length of endMins is 1 then set endMins to "0" & endMins
                                            set endTime to endHours & ":" & endMins
      --write the event to the file
                                            set theSummary to (starttime & "-" & endTime & return & summary of theEvent & return & return) as string
      write theSummary to fileRef
                                  end repeat
                        end if
      write return to fileRef
              end repeat
    end tell
    --close the file
    close access fileRef
    --print the file
    set theFile to (((path to desktop) as text) & "meetings.txt") as alias
    tell application "TextEdit"
              print theFile without print dialog
    end tell

  • Help with print out of object

    I have a tutorial class that sets two Rational objects....generates a fraction for them and prints them out., but its only printing out the same object twice.
    Why is it not printing out the instance variables for both objects and how do I fix this?
    Tutorial class
    import java.util.Random;
    import java.util.Scanner;
    public class Tutorial {
      public static void main(String[] args) {
        Random randNumGen = new Random();
        Scanner scan = new Scanner(System.in);
        //Generate random fractions
        Rational fraction1, fraction2;
        fraction1 = new Rational(randNumGen.nextInt(101), randNumGen.nextInt(101));
        fraction2 = new Rational(randNumGen.nextInt(101), randNumGen.nextInt(101));
        //Prompt user for the sum of the 2 fractions
        System.out.print("Enter the sum of " + fraction1 + " + " + fraction2 +
            " = ");
        Rational guessFractionSum = Rational.readRational(scan);
        //Start the tutorial
        StartTutorial.displayASession(fraction1,fraction2,guessFractionSum);
        //Generate random rectangles
    //    RectangleOperand rect1, rect2;
    //    rect1 = new RectangleOperand(randNumGen.nextInt(101),randNumGen.nextInt(101));
    //   rect2 = new RectangleOperand(randNumGen.nextInt(101),randNumGen.nextInt(101));
        //Prompt the user for the sum of the rectangles
    //   System.out.print("Enter the sum of " + rect1 + " + " + rect2 +
      //                   " = [x=0.0,y=0.0,w=");
    //   RectangleOperand guessRect = RectangleOperand.readRectangle(scan);
        //Start the tutorial
    //    StartTutorial.displayASession(rect1,rect2,guessRect);
    }Rational Class
    import java.util.*;
    public class Rational implements Addable<Rational> {
      private static int numerator, denominator, gcdNum, count = 0;
       * Default constructor
      public Rational() {
       * Accepts the numerator and denominator
       * @param n int
       * @param d int
      public Rational(int n, int d) {
        numerator = n;
        denominator = d;
        if (denominator == 0)
          denominator = 1;
        gcdNum = gcd(numerator, denominator);
        numerator = numerator / gcdNum;
        denominator = denominator / gcdNum;
       * Adds the two random generated fractions
       * @param opnd2 Rational
       * @return Rational
      public Rational plus(Rational opnd2) { //from Addable interface
        int numerator1, denominator1, gcd, n, d;
        numerator1 = (this.numerator * opnd2.denominator) +
            (this.denominator * opnd2.numerator);
        denominator1 = this.denominator * opnd2.denominator;
        gcd = gcd(numerator1, denominator);
        n = numerator1 / gcd;
        d = denominator1 / gcd;
        Rational rationalPlus = new Rational(n, d);
        return rationalPlus;
       * Checks the sum of two random fractions with the user guess
       * @param opnd2 Rational
       * @return boolean
      public boolean equalTo(Rational opnd2) { //from Addable interface
        boolean isEqual;
        if (this.numerator == opnd2.numerator &&
            this.denominator == opnd2.denominator) {
          isEqual = true;
        else
          isEqual = false;
        return isEqual;
       * Reads in the guess from the user
       * @param scan Scanner
       * @return Rational
      public static Rational readRational(Scanner scan) {
        int fraction;
        fraction = scan.nextInt();
        String fractionS = String.valueOf(fraction);
        String[] fractionA = fractionS.split("/");
        numerator = Integer.parseInt(fractionA[0]);
        denominator = Integer.parseInt(fractionA[1]);
        Rational rationalScan;
        return rationalScan = new Rational(numerator, denominator);
       * Finds the greatest common factor from the random fractions
       * @param num1 int
       * @param num2 int
       * @return int
      private int gcd(int num1, int num2) {
        while (num1 != num2)
          if (num1 > num2)
            num1 = num1 - num2;
          else
            num2 = num2 - num1;
        return num1;
       * toString
       * @return String
      public String toString() {
        String text;
        text = numerator + "/" + denominator;
        return text;
    }

    numerator and denominator are static, meaning there's only one instance of it that's shared across all objects of that type. So each Rational you create is sharing the same variable.

  • How can I print out the file directory?

    Years ago, I could print out a list of files in a folder from the finder window. Is there now a workaround utility to do that? I don't want to use screen shots, as the directory is too long and would require several screen shots.  thx.

    http://hints.macworld.com/article.php?story=20060720174103802
    or
    http://reviews.cnet.com/8301-13727_7-20026446-263.html

  • How can I print out the graph I need only, without the controls and indicators?

    I'm doing some programming in LABVIEW. I need to print out only the graph, without the buttons, controls, indicators. I tried to look for such a function in LABVIEW, but in vain. How can I achieve the result I expect in my programming?

    Hi Fenny,
    you should use the report generation functions to create a report containing your graph image and print it.
    Take a look at the Sample Test Report.vi you find in the report examples of LV.
    Just look at the part of the diagram where it is used Append Control Image to report.vi (in the center of the report functions chain); a graph reference is wired to the Ctrl reference input ( to create a reference of your graph right click on it and select create reference).
    Let me know if you need more help,
    Alberto

  • How can I print out the contents of my hardrive

    I have a hardrive with about 200 video clips and need to print the titles for cross refrerencing. I was just going to "grab" screenshots but this will take about ten sheets of paper. How can I print out a list of all the files on the drive?

    I tried this Finder drag method & discovered that it is very important to set the blank TextEdit document to plain text before the drag (from the format menu or with Cmd-shift-t). If you don't, TextEdit attempts to load the content of the files!
    Once I discovered this, I tried the method with Find (Cmd-F) results & it works for that, too. This means that by choosing the right combination of search location(s) & search criteria, you can extend the method to filter the list to just about any files you want, which could be very handy.
    For instance, set the "Kind" criteria to "QuickTime Movie" & location to "Computer" & you get a list of every QT movie. Or set the search location to the folder containing the movies of interest & you get all of them, including ones in subfolders. You could also use the 'date created' or other search criteria to filter the list to a specific subset of movies (or whatever).
    If you need to do this often, you could create one or more 'Smart Folders' with the criteria preloaded for each search.
    The only drawback I see for either Finder based method is the full path one. If you are getting results from just one or a few folders, Find & Replace can delete any of the path name fairly easily, but it becomes a chore if there are a lot of different ones. Some other text editor, like TexEdit Pro, that supports grep searches would be handy here, but since I'm not up to speed on grep, someone else will have to explain how to use it for this, if they want.

  • How can i print out the waveform chart?

      hello everybody,
    how can i print out the "waveform chart". can i do it just push the button. ( example; stop button is stop the program etc..)
    i checked the NI examples but i can't understand. i'm new to the Labview.
    pls help me.
    i added the my program
    look forward your reply
    regards from turkey...
    Message Edited by hknmkt on 05-29-2008 04:15 AM
    Attachments:
    29.05.2008_11.vi ‏37 KB

        hi jim,
    i tried the program but it's not running. When i run the program, it's print out without run the program
    i added the printed file.
    look forward your reply
    hakan
    Attachments:
    error8.JPG ‏8 KB

  • PO print out of delivery schedule

    Hi,
    Suppose I am generating a PO , in some cases I will be giving delivery schedule for some items in item details.
    I want this to come in the print out.
    But its not coming .
    Please advise.
    regards,

    Hi
    You can include logic with the help of Developre, If information is there in EKET for Purchase order ask him to include in print.
    regards
    Srinivas

  • How to print out wallet size photos on 6510 e-all-in-one series photosmart printer

    want to print out wallet size photos (size 3 and a half x 2 and a half).  I have windows XP and my printer is the photosmart 6510 e-all-in-one series

    You will have to change the settings in the photo editing software and put 2 wallets on a 4x6 or 9 wallets on a full page.  The photo tray will not take paper smaller than 4x6.
    SandyBob
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP
    1-800-474-6836

Maybe you are looking for

  • Hnadling sql error messages in forms

    Hi there, I have a multi block application. I have a check constraint in the database which checks for value > 0 and not null. Now in the form if i try to insert/update a null into the column, i get FRM-40735 Onerror raised unhandled exception. When

  • Removing views (label) from tab views...

    Hello all, I am again presented with a troubling problem: Take a 3 tabs app based on the tab Bar Application Template. I am creating and displaying a label on tab 2 depending on an input from tab1 (a UIActionSheet with index 0 or 1) if index 0 is sel

  • How do I change MobileMe/iWeb member name?

    We registered the iWeb account on my computer in my husband's name because we thought we would use it for family purposes only. Recently, I have realized that I could better use this account for my work. Is there a way for me to change my MobileMe/iW

  • Manual Journal entry limitations in sap b1

    Hi friends,                We are creating Manual JE in sap b1. We give the access only two users for creating Manual JE. Now we will plan one more thing . Limitation of JE .  it is means, per user we will go to allow only 1000 manual journal entries

  • Adding clip art to the "Extras" in PSE 11

    Is it possible to add more clip art to the "Extras" (to be included "on" slides) in Adobe Photoshop Elements 11? I note that there is a clip art folder in Premiere Elements 11 but can find no such thing for Photoshop Elements 11. Can this be done. Th