Code example of the day, want your advice

Update: I have removed the setRunnable method and all the synchronization stuff, which takes care of question a. Now, on part B, can anyone suggest a better name for this class?
I am posting my class ThreadForMultipleAnytimeRuns, plus my Eyes class which was actually the reason I created it.
ThreadForMultipleAnytimeRuns offers the following:
(a) you can run a runnable outside of the GUI thread - important in this case, because if you try to run an animation in the drawing thread you're not going to see anything
(b) It will queue the blinks so they don't all happen at once.
Questions:
1. Is what I've done thread-safe? I added a method to swap the runnable into the class. I have it so that it waits until the job queue (semaphore) is empty before it swaps in the new runnable. Is this safe now? I would love to hear your thoughts
2. I am unsatisfied with the name of this class. Can anyone think of a better name?
BTW, unfortunately this code isn't compilable as posted. To get it to compile, you need to remove the references to MathUtils - all this takes is replacing distance with the euclidean distance formula, and angle with java.lang.Math.atan2, and references to WindowUtilities, which means replacing WindowUtilities.visualize and just building a JFrame and sticking the eyes in it
Thanks for any comments about how I could make this better!
You are welcome to use and modify this code, but please don't change the package or take credit for it as your own code.
package tjacobs.thread;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.concurrent.Semaphore;
import javax.swing.JFrame;
import tjacobs.ui.Eyes;
import tjacobs.ui.WindowUtilities;
public class ThreadForMultipleAnytimeRuns extends Thread {
     private Runnable mRunnable;
     private Semaphore mSemaphore;
     public ThreadForMultipleAnytimeRuns(Runnable arg0) {
          super();
          init(arg0);
     private void init(Runnable r) {
          mRunnable = r;
          mSemaphore = new Semaphore(0);
          setDaemon(true);
     public ThreadForMultipleAnytimeRuns(Runnable arg0, String arg1) {
          super(arg1);
          init(arg0);
     public ThreadForMultipleAnytimeRuns(ThreadGroup arg0, Runnable arg1, String arg2) {
          super(arg0, arg2);
          init(arg1);
     public void run () {
          try {
               while (!isInterrupted()) {
                    // make a local copy so if mRunnable changes
                    // we have the fresh one
                    mSemaphore.acquire();
                    if (getSemaphoreCount() == 0) {
                         Runnable r = mRunnable;
                         synchronized (this) {
                              notifyAll();
                         r.run();
                    mRunnable.run();
          catch (InterruptedException ex) {}
     public void runAgain() {
          mSemaphore.release();
     public void runAgain(int numTimes) {
          mSemaphore.release(numTimes);
     public void stopThread() {
          interrupt();
     public int getSemaphoreCount() {
          return mSemaphore.availablePermits();
     public Runnable getRunnable() {
          return mRunnable;
     public synchronized void setRunnable(Runnable r) {
          if (getSemaphoreCount() > 0) {
               try {
                    wait();
               catch (InterruptedException ex) {
                    return;
          mRunnable = r;
     public static void main(String[] args) {
          final Eyes eyes = new Eyes(true);
          //eyes.addMouseMotionListener(eyes);
          Runnable r = new Runnable() {
               public void run() {
                    eyes.blink();
                    try {
                         Thread.sleep(100);
                    catch(InterruptedException ex) {}
          final ThreadForMultipleAnytimeRuns ar = new ThreadForMultipleAnytimeRuns(r);
          ar.start();
          eyes.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent me) {
                    ar.runAgain();
          eyes.setPreferredSize(new Dimension(60,20));
          WindowUtilities.visualize(eyes);
//          JFrame jf = new JFrame();
//          jf.add(eyes);
//          jf.pack();
//          jf.setLocation(100,100);
//          jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//          jf.setVisible(true);
================================================
tjacobs.ui.Eyes
============
package tjacobs.ui;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import tjacobs.MathUtils;
public class Eyes extends JComponent implements MouseMotionListener {
     private int mEyeGap = 0;
     private double mEyeDir1 = Double.NaN, mEyeDir2 = Double.NaN;
     private double mEyeRatio = .6;
     private int mBlinkEyesState = 0;
     private Timer mEyeBlinker;
     private long mTimeBetweenBlinks;
     private long mBlinkAnimationSpeed = 100;
     public Eyes() {
          //setBackground(Color.BLACK);
          this(false);
     public Eyes(boolean watchOnEyes) {
          setBackground(Color.PINK);
          setForeground(Color.BLUE);
          if (watchOnEyes) addMouseMotionListener(this);          
     public void setBatAnimationSpeed(long speed) {
          mBlinkAnimationSpeed = speed;
     public long getBatAnimationSpeed() {
          return mBlinkAnimationSpeed;
     public void mouseMoved(MouseEvent me) {
          Point p = SwingUtilities.convertPoint(me.getComponent(), me.getPoint(), this);
          int height = getHeight();
          mEyeDir1 = MathUtils.angle(height / 2, height / 2, p.x, p.y);
          mEyeDir2 = MathUtils.angle((3 * height) / 2 + mEyeGap, height / 2, p.x, p.y);
          repaint();
     public void mouseDragged(MouseEvent me) {
          mouseMoved(me);
     public int getEyeGap() {
          return mEyeGap;
     public void setEyeGap(int gap) {
          mEyeGap = gap;
     public void setBlinkEyes(long timeBetweenBlinks) {
          mTimeBetweenBlinks = timeBetweenBlinks;
          if (mEyeBlinker != null) {
               mEyeBlinker.cancel();
               mEyeBlinker = null;
          if (timeBetweenBlinks < mBlinkAnimationSpeed * 8) {
               return;
          else {
               mEyeBlinker = new Timer(true); //allow it to be a daemon thread
               mEyeBlinker.scheduleAtFixedRate(new BlinkEyesTask(), mTimeBetweenBlinks, mTimeBetweenBlinks);
               //Thread t = new Thread(mEyeBlinkter);
               //t.start();
      * makes the eyes blink
      * this method will not function correctly if it is run in the
      * GUI painter thread, as it handles the whole process and calls
      * repaint() sleep() in between steps.
     public void blink() {
          try {
               //System.out.println("bat");
               Thread t = Thread.currentThread();
               mBlinkEyesState = 1;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 2;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 3;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 4;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 3;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 2;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 1;
               repaint();
               t.sleep(mBlinkAnimationSpeed);
               mBlinkEyesState = 0;
               repaint();
          catch (InterruptedException ex) {
               if (mBlinkEyesState != 0) {
                    mBlinkEyesState = 0;
                    repaint();
     private class BlinkEyesTask extends TimerTask {
          public void run() {
               blink();
      * @param angle Either Double.NaN for center, or a value between 0 and 2 PI
     public void setEye1Direction(double angle) {
          mEyeDir1 = angle;
     public double getEye1Direction() {
          return mEyeDir1;
      * @param angle Either Double.NaN for center, or a value between 0 and 2 PI
     public void setEye2Direction(double angle) {
          mEyeDir1 = angle;
     public double getEye2Direction() {
          return mEyeDir2;
     public void paintComponent(Graphics g) {
          int height = getHeight();
          int r = height / 2;
          g.setColor(Color.WHITE);
          g.fillOval(0, 0, height, height);
          g.fillOval(height + mEyeGap + 0, 0, height, height);
          g.setColor(Color.BLACK);
          g.drawOval(0, 0, height, height);
          g.drawOval(height + mEyeGap + 0, 0, height, height);
          g.setColor(getForeground());
          int irisR = (int) (r * mEyeRatio);
          if (Double.isNaN(mEyeDir1)) {
               int x1 = (r - irisR);
               int y1 = x1;
               g.fillOval(x1, y1, irisR * 2, irisR * 2);
          } else {
               int x1 = (r - irisR);
               int y1 = x1;
               x1 -= Math.cos(mEyeDir1) * (r - irisR);
               y1 -= Math.sin(mEyeDir1) * (r - irisR);
               g.fillOval(x1, y1, irisR * 2, irisR * 2);
          if (Double.isNaN(mEyeDir2)) {
               int x1 = (r - irisR) + height + mEyeGap;
               int y1 = (r - irisR);
               g.fillOval(x1, y1, irisR * 2 , irisR * 2);               
          } else {
               int x1 = (r - irisR) + height + mEyeGap;
               int y1 = r - irisR;
               x1 -= Math.cos(mEyeDir2) * (r - irisR);
               y1 -= Math.sin(mEyeDir2) * (r - irisR);
               g.fillOval(x1, y1, irisR * 2, irisR * 2);
//          OLD
//          if (Double.isNaN(mEyeDir1)) {
//               int x1 = (r - irisR);
//               int y1 = x1;
//               g.fillOval(x1, y1, irisR * 2, irisR * 2);
//               x1 += height + mEyeGap;
//               g.fillOval(x1, y1, irisR * 2 , irisR * 2);               
//          } else {
//               int x1 = (r - irisR);
//               int y1 = x1;
//               x1 -= Math.cos(mEyeDir1) * (r - irisR);
//               y1 -= Math.sin(mEyeDir1) * (r - irisR);
//               g.fillOval(x1, y1, irisR * 2, irisR * 2);
//               x1 = (r - irisR) + height + mEyeGap;
//               y1 = r - irisR;
//               x1 -= Math.cos(mEyeDir2) * (r - irisR);
//               y1 -= Math.sin(mEyeDir2) * (r - irisR);
//               g.fillOval(x1, y1, irisR * 2, irisR * 2);
          //Eye Blinking
          if (mBlinkEyesState != 0) {
               Rectangle rect = new Rectangle(0,0,getWidth(), getHeight() * mBlinkEyesState / 4);
               g.setClip(rect);
               g.setColor(getBackground());
               g.fillOval(0, 0, height, height);
               g.fillOval(height + mEyeGap + 0, 0, height, height);
      * @param args
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          Eyes eyes = new Eyes(true);
          eyes.setBlinkEyes(10000);
          eyes.setPreferredSize(new Dimension(60,25));
          eyes.setEyeGap(5);
          WindowUtilities.visualize(eyes);
}Message was edited by:
tjacobs01

So, if you shake the panel long enough, do the
contents disappear? :Dno but they get a big headache

Similar Messages

  • Code example of the day: ProgressBarForStream.java

    ----ps you can make this even sweeter if you grab my ColorGradient class (http://www.java-index.com/java-technologies-archive/519/cryptography-5196334.shtm) and plug that into the paintComponent method.
    This is a generic way to visualize the progress of the reading from a stream.
    You will need the InfoFetcher
    http://forum.java.sun.com/thread.jspa?threadID=5280590&messageID=10178338
    FetcherListener should be there, but if it's not the two methods that start with fetched in ProgressBarForStream (and which are also common in InfoFetcher) should let you reproduce it. There are also references to WindowUtilities and IOUtils... You can probably find those too searching the web, but otherwise it shouldn't be to hard to modify the code to just instantiate InfoFetcher with a stream directly, and windowUtilities.visualize(..) is just a helper method... create a jframe container and you're good to go
    BTW... If you actually want to USE the data that ProgressBarForStream is loading, add another FetcherListener to the bar's InfoFetcher
    You are welcome to use + modify all of this code (ProgressBarForStream + the other classses like InfoFetcher that I reference) but please don't change the package or take credit for it as your own work (except where you have made changes)
    ProgressBarForStream
    =================
    package tjacobs.ui.ex;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PipedInputStream;
    import java.io.PipedOutputStream;
    import java.io.PrintStream;
    import java.net.URL;
    import javax.swing.BoundedRangeModel;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import tjacobs.io.FetcherListener;
    import tjacobs.io.IOUtils;
    import tjacobs.io.InfoFetcher;
    import tjacobs.ui.util.WindowUtilities;
    public class ProgressBarForStream extends JProgressBar implements Runnable, FetcherListener{
         boolean bounded = false, increasing = true;
         private static final int MIN = 0;
         private static final int UNBOUNDED_MAX = 10;
         private InfoFetcher fetcher;
         public ProgressBarForStream() {
              super();
         public ProgressBarForStream(InputStream in, int max) {
              super(0, max);
              bounded = true;
              init(in);
         public ProgressBarForStream(InputStream in) {
              super(0, UNBOUNDED_MAX);
              bounded = false;
              init(in);
              // TODO Auto-generated constructor stub
         public void setStream(InputStream in, int max) {
              if (fetcher != null) {
                   try {
                        fetcher.in.close();
                   catch (IOException iox) {
                        iox.printStackTrace();
              super.setMaximum(max);
              bounded = true;
              init(in);
         public void setStream(InputStream in) {
              if (fetcher != null) {
                   try {
                        fetcher.in.close();
                   catch (IOException iox) {
                        iox.printStackTrace();
              bounded = false;
              setMaximum(UNBOUNDED_MAX);
              init(in);          
         private void init(InputStream in) {
              fetcher = IOUtils.loadData(in);
              fetcher.addFetcherListener(this);
         public void fetchedMore(byte[] buf, int start, int end) {
              if (bounded) {
                   super.setValue(end);
              else {
                   if ((increasing && getValue() == getMaximum()) || (!increasing && getValue() == getMinimum())) {
                        increasing = !increasing;
                   setValue(getValue() + (increasing ? 1 : -1));
              repaint();
         public void fetchedAll(byte[] buf) {
              setValue(super.getMaximum());
         private InfoFetcher getInfoFetcher() {
              return fetcher;
         public void run() {
              fetcher.run();
          * @param args
         public static void main(String[] args) {
              JPanel p = new JPanel();
              final ProgressBarForStream bar = new ProgressBarForStream();
              p.setLayout(new BorderLayout());
              final JButton b = new JButton("Select File");
              final JButton b2 = new JButton("Select URL");
              final JButton b3 = new JButton("Test");
              JPanel jp = new JPanel();
              jp.add(b2);
              jp.add(b3);
              p.add(b, BorderLayout.WEST);
              p.add(bar, BorderLayout.CENTER);
              p.add(jp, BorderLayout.EAST);
              ActionListener al = new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        if (ae.getSource() == b) {
                             JFileChooser jf = new JFileChooser();
                             int approve = jf.showOpenDialog(b);
                             if (approve != jf.CANCEL_OPTION) {
                                  File f = jf.getSelectedFile();
                                  try {
                                       bar.setStream(new FileInputStream(f), (int) f.length());
                                       Thread t = new Thread(bar);
                                       t.start();
                                  catch (IOException iox) {
                                       iox.printStackTrace();
                        else if (ae.getSource() == b2) {
                             String urlstr = JOptionPane.showInputDialog("URL");
                             if (urlstr != null) {
                                  try {
                                       URL url = new URL(urlstr);
                                       InputStream stream = url.openStream();
                                       bar.setStream(stream);
                                       Thread t = new Thread(bar);
                                       t.start();
                                  catch (Exception ex) {
                                       ex.printStackTrace();
                        else {
                             try {
                                  final PipedOutputStream pos = new PipedOutputStream();
                                  final PipedInputStream pin = new PipedInputStream(pos);
                                  final PrintStream ps = new PrintStream(pos,true);
                                  bar.setStream(pin);
                                  Thread t = new Thread(bar);
                                  t.start();
                                  Thread thr = new Thread() {
                                       public void run() {
                                            try {
                                                 for (int i = 0; i < 6; i++) {
                                                      for (char c = 'a'; c <= 'z'; c++) {
                                                           Thread.sleep(100);
                                                           ps.println(c);
                                                           ps.flush();
                                                 pos.close();
                                            catch (Exception iox) {
                                                 iox.printStackTrace();
                                  thr.start();
                             catch (IOException iox) {
                                  iox.printStackTrace();
              b.addActionListener(al);
              b2.addActionListener(al);
              b3.addActionListener(al);
              WindowUtilities.visualize(p);
    }Edited by: tjacobs01 on Apr 26, 2008 12:01 PM

    So, if you shake the panel long enough, do the
    contents disappear? :Dno but they get a big headache

  • Code example of the day: StandardPrint

    It's been a few years since I posted StandardPrint, so I figured I post it again
    You are welcome to use and modify this class, but please don't change the package or erase the attribution, especially if you are in school
    package tjacobs.print;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.image.BufferedImage;
    import java.awt.print.*;
    import java.io.File;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import tjacobs.ui.menus.FileMenu;
    import tjacobs.ui.util.WindowUtilities;
    * This implements the Printable and Pageable java.awt.print interfaces
    * Allows you to very easily and quickly generate a printout from a component or a SpecialPrint.
    * @author Tom Jacobs
    public class StandardPrint implements Printable, Pageable {
         //standard print variables
         Component c;
        SpecialPrint sp;
        PageFormat mFormat;
         boolean mScale = false;
         boolean mMaintainRatio = true;
         //page number print
        public static final int LEFT = 0;
        public static final int RIGHT = 1;
        public static final int CENTER = 4;
        public static final int TOP = 2;
        public static final int BOTTOM = 3;
        private boolean mPrintPageNumber = false;
        private Font mPageNumberFont;
        private int hAlign = CENTER;
        private int vAlign = BOTTOM;
        //title vars     
        private String mTitle;
        private Font mTitleFont;
        public StandardPrint(Component c) {
            this.c = c;
            if (c instanceof SpecialPrint) {
                sp = (SpecialPrint)c;
        public StandardPrint(SpecialPrint sp) {
            this.sp = sp;
        public void setNumberFont(Font f) {
            mPageNumberFont = f;
        public Font getNumberFont () {
            return mPageNumberFont;
        public int getPageNumberHAlignment () {
            return hAlign;
        public int getPageNumberVAlignment() {
            return vAlign;
        public void setPageNumberHAlignment(int num) {
            hAlign = num;
        public void setPageNumberVAlignment(int num) {
            vAlign = num;
        public void setPrintPageNumber(boolean b) {
             mPrintPageNumber = b;
        public boolean getPrintPageNumber() {
             return mPrintPageNumber;
        protected void printPageNumber(Graphics g, PageFormat format, int pageNo) {
             if (!getPrintPageNumber()) return;
             Shape clip = g.getClip();
            g.setClip(null);
            if (mPageNumberFont != null) {
                g.setFont(mPageNumberFont);
            FontMetrics fm = g.getFontMetrics();
            int height = fm.getHeight();
            String pageStr = "" + (pageNo + 1);
            int width = fm.stringWidth(pageStr);
            int xspot = (int) (format.getWidth() - width) / 2;
            if (getPageNumberHAlignment() == LEFT) {
                xspot = (int) format.getImageableX();
            } else if (getPageNumberHAlignment() == RIGHT) {
                xspot = (int) (format.getWidth() - format.getImageableX() - format.getImageableWidth());
            int yspot = (int) (format.getImageableY() + format.getImageableHeight() + 2 * height);
            if (getPageNumberVAlignment() == TOP) {
                yspot = (int) format.getImageableY() / 2 - height;
                //yspot = (int) (format.getImageableY() + format.getImageableHeight() + 2 * height);
            g.drawString(pageStr, xspot, yspot);
            g.setClip(clip);
        public String getTitle() {
            return mTitle;
        public Font getTitleFont () {
            return mTitleFont;
        public void setTitleFont(Font f) {
            mTitleFont = f;
        public void setTitle(String s) {
            mTitle = s;
        protected void printTitle(Graphics g, PageFormat format) {
            if (mTitle == null) return;
             Shape clip = g.getClip();
            g.setClip(null);
            if (mTitleFont != null) {
                g.setFont(mTitleFont);
            FontMetrics fm = g.getFontMetrics();
            int height = fm.getHeight();
            int width = fm.stringWidth(mTitle);
            int xspot = (int) (format.getWidth() - width) / 2;
            int yspot = (int) format.getImageableY() / 2 + height;
            g.drawString(mTitle, xspot, yspot);
            g.setClip(clip);
         public boolean isPrintScaled () {
              return mScale;
         public void setPrintScaled(boolean b) {
              mScale = b;
         public boolean getMaintainsAspect() {
              return mMaintainRatio;
         public void setMaintainsAspect(boolean b) {
              mMaintainRatio = b;
        public void start() throws PrinterException {
            PrinterJob job = PrinterJob.getPrinterJob();
            if (mFormat == null) {
                mFormat = job.defaultPage();
            job.setPageable(this);
            if (job.printDialog()) {
                job.print();
        public void setPageFormat (PageFormat pf) {
            mFormat = pf;
        public static void printStandardComponent (Pageable p) throws PrinterException {
            PrinterJob job = PrinterJob.getPrinterJob();
            job.setPageable(p);
            job.print();
        private Dimension getJobSize() {
            if (sp != null) {
                return sp.getPrintSize();
            else {
                return c.getSize();
        public static Image preview (int width, int height, Printable sp, PageFormat pf, int pageNo) {
            BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            return preview (im, sp, pf, pageNo);
        public static Image preview (Image im, Printable sp, PageFormat pf, int pageNo) {
             return preview(im, sp, pf, pageNo, true);
        public static Image preview (Image im, Printable sp, PageFormat pf, int pageNo, boolean doClipping) {
            Graphics2D g = (Graphics2D) im.getGraphics();
            int width = im.getWidth(null);
            int height = im.getHeight(null);
            double hratio = height / pf.getHeight();
            double wratio = width / pf.getWidth();
            if (doClipping) {
                 Rectangle rect = new Rectangle();
                 rect.x = (int) (pf.getImageableX() * (wratio));
                 rect.y = (int) (pf.getImageableY() * (hratio));
                 rect.width = (int) (pf.getImageableWidth() * (wratio));
                 rect.height = (int) (pf.getImageableHeight() * (hratio));
                 g.setColor(Color.GRAY);
                 g.fillRect(0, 0, width, height);
                 g.setClip(rect);
            g.scale(wratio, hratio);
            g.setColor(Color.WHITE);
            g.fillRect(0, 0, (int) (width * 1 / wratio), (int) (height * 1 / hratio));
            //g.fillRect(0, 0, (int) (width * wratio), (int) (height * hratio));
            try {
                   sp.print(g, pf, pageNo);
              catch(PrinterException pe) {
                   pe.printStackTrace();
            g.dispose();
            return im;
        public int print(Graphics gr, PageFormat format, int pageNo) {
            mFormat = format;
            if (pageNo > getNumberOfPages()) {
                return Printable.NO_SUCH_PAGE;
            Graphics2D g = (Graphics2D) gr;
              //wha?? don't know what this was doing in the code
            //g.drawRect(0, 0, (int)format.getWidth(), (int)format.getHeight());
            if (getTitle() != null) {
                   printTitle(g, format);
              if (getPrintPageNumber()) {
                   printPageNumber(g, format, pageNo);
            g.translate((int)format.getImageableX(), (int)format.getImageableY());
            //Dimension size = getJobSize();
              if (!isPrintScaled()) {
                 int horizontal = getNumHorizontalPages();
                 //don't need this I don't think
                 //int vertical = getNumVerticalPages();
                 int horizontalOffset = (int) ((pageNo % horizontal) * format.getImageableWidth());
                 int verticalOffset = (int) ((pageNo / horizontal) * format.getImageableHeight());
                 double ratio = getScreenRatio();
                 g.scale(1 / ratio, 1 / ratio);
                 g.translate(-horizontalOffset, -verticalOffset);
                 if (sp != null) {
                     sp.printerPaint(g);
                 else {
                     c.paint(g);
                 g.translate(horizontalOffset, verticalOffset);
                 g.scale(ratio, ratio);
              else {
                 double ratio = getScreenRatio();
                 g.scale(1 / ratio, 1 / ratio);
                   double xScale = 1.0;
                   double yScale = 1.0;
                   double wid;
                   double ht;
                   if (sp != null) {
                        wid = sp.getPrintSize().width;
                        ht = sp.getPrintSize().height;
                   else {
                        wid = c.getWidth();
                        ht = c.getHeight();
                   xScale = format.getImageableWidth() / wid;
                   yScale = format.getImageableHeight() / ht;
                   if (getMaintainsAspect()) {
                        xScale = yScale = Math.min(xScale, yScale);
                   g.scale(xScale, yScale);
                   if (sp != null) {
                        sp.printerPaint(g);
                   else {
                        c.paint(g);
                   g.scale(1 / xScale, 1 / yScale);
                   g.scale(ratio, ratio);
             g.translate((int)-format.getImageableX(), (int)-format.getImageableY());     
            return Printable.PAGE_EXISTS;
        public int getNumHorizontalPages() {
            Dimension size = getJobSize();
            if (mFormat == null) mFormat = getPageFormat(0);
            int imWidth = (int)mFormat.getImageableWidth();
            int pWidth = 1 + (int)(size.width / getScreenRatio() / imWidth) - (imWidth / getScreenRatio() == size.width ? 1 : 0);
            return pWidth;
        private double getScreenRatio () {
            double res = Toolkit.getDefaultToolkit().getScreenResolution();
            double ratio = res / 72.0;
            return ratio;
        public int getNumVerticalPages() {
            Dimension size = getJobSize();
            int imHeight = (int)mFormat.getImageableHeight();
            int pHeight = (int) (1 + (size.height / getScreenRatio() / imHeight)) - (imHeight == size.height ? 1 : 0);
            return pHeight;
        public int getNumberOfPages() {
              if (isPrintScaled()) return 1;
            return getNumHorizontalPages() * getNumVerticalPages();
        public Printable getPrintable(int i) {
            return this;
        public PageFormat getPageFormat(int page) {
            if (mFormat == null) {
                PrinterJob job = PrinterJob.getPrinterJob();
                mFormat = job.defaultPage();
            return mFormat;
        public static void main(String args[]) {
             //final GradientPane gp = new GradientPane(400,400);
             //JFrame jf = new JFrame("Standard Print Test");
             //jf.add(gp);
             JFrame jf = new JFrame("StandardPrint Test");
             final JTextArea area = new JTextArea();
             area.append("hello\n");
             for (int i = 0; i < 50; i++) {
                  area.append("\n");
             area.append("world\n");
             JScrollPane sp = new JScrollPane(area);
             jf.add(sp);
             JMenuBar bar = new JMenuBar();
             FileMenu fm = new FileMenu() {
                   private static final long serialVersionUID = 1L;
                   public void load(File f) {}
                  public void save(File f) {}
                  public Pageable getPageable() {
                       //return new StandardPrint(gp);
                       return new StandardPrint(area);
             JMenu printMenu = new JMenu("Print");
             JMenuItem print = new JMenuItem("Print");
             printMenu.add(print);
             ActionListener al = new ActionListener() {
                  public void actionPerformed(ActionEvent ae) {
                       StandardPrint sp = new StandardPrint(area);
                       sp.setTitle("Hello World");
                       sp.setPrintPageNumber(true);
                       sp.setPageNumberVAlignment(BOTTOM);
                       sp.setPageNumberHAlignment(CENTER);
                       System.out.println(sp.getNumberOfPages());
                       Image im1 = preview(300,300, sp, sp.getPageFormat(0), 0);
                       Image im2 = preview(300,300, sp, sp.getPageFormat(1), 1);
                       JLabel l = new JLabel(new ImageIcon(im1));
                       WindowUtilities.visualize(l, false);
                       l = new JLabel(new ImageIcon(im2));
                       WindowUtilities.visualize(l, false);
             print.addActionListener(al);
             jf.setJMenuBar(bar);
             bar.add(fm);
             bar.add(printMenu);
             jf.setBounds(100,100,400,400);
             jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             jf.setVisible(true);
         * Interface for using StandardPrint with something other than a Component or something
         * that needs special printing
        public static interface SpecialPrint {
            public Dimension getPrintSize();
            public void printerPaint(Graphics g);
    }

    And SpecialPrint
    * Interface for using StandardPrint with something other than a Component or something
    * that needs special printing
    * @author tjacobs
    public interface SpecialPrint {
    public Dimension getPrintSize();
    public void printerPaint(Graphics g);
    }

  • Phone reboots several times during the day.  Any advice?

    Phone reboots several times during the day.  Any advice?

    Try hopmedic suggestion and see if they helps, https://community.verizonwireless.com/message/923959#923959

  • Hi, I recently got an iPad. I want to purchase software but I was prompted for a security code due to the fact that I am purchasing on a new device. I entered all my credit card details but can't even recall having a security code.

    Please help. Because I wanted to purchase apps on my iPad after I have only used my credit card detail on my iPhone, I was requested to also enter some security code. I cannot recall what it is and now I cannot purchase any apps. I entered anything in the hope that some assistance to choose a new one will pop up but nothing. What can I do?

    the security code is on the back of your card underneath your signature

  • Scripting a "Tip of the day" Text Box, Requesting Help!!

    Hi there folks,
    I need the help of an experienced scripter, I'm in the
    process of creating a website and I need help with the Flash SWF
    that will be on the Title Page.
    When someone arrives on my site I want a small Text Box to show
    a "Tip of the Day" or a Random Phrase in the swf on the homepage of
    the website.
    Unfortunately I can't figure out how to do this and I cannot
    find anything to help me in the Flash Support File either. Ideally
    I'm looking for someone to post a sample script on this thread so I
    can have a look at it and learn from it.
    Any Help would be much appreciated!!

    A quick and dirty way:
    - In a new Flash document, make a Dynamic Text box (Text Tool
    -> Properties -> Dynamic Text) on your stage
    - Name it something you'll remember (example: 'my_text')
    - Add the following actionscript (preferably in a new layer):
    And that's it. This isn't the prettiest code, and hardly the
    best. Your SWF will be slightly bloated because of the use of a
    Button Component . Also, putting all your quotes inside the Flash
    movie makes it difficult to add new ones (you'll have to recompile
    every time you do) and will increase the movie's size. But it's a
    start.

  • When setting the split-days to "every 15 minutes," the week and comparison views show incorrect time ranges for the day

    When I change the "split-days" interval time, under Options > Settings, to
    15, or every 15 minutes, the week and comparison views don't show the correct
    time range for the day.
    <P>
    For example, if I click View to display the calendar and then click Week to get
    a weekly view, the time range displayed is from 6:00 a.m.
    to 4:00 p.m. If I click Comparison to get a
    comparison view, the time range displayed is from 12 p.m.
    to 6:45 p.m.
    <P>
    In this example, should both of these views show the same time range, from
    9:00 a.m. to 4:00 p.m.?
    No, the two views will not necessarily show the same time range. The time
    range for the comparison view will start at the beginning prefs time only
    if you have something scheduled (on any day of the week) starting at that
    time. For example, on one of the days during your week of comparison, if you
    create an event that starts at 9:00 a.m. and then open the comparison view, the
    time range displayed will start with 9:00 a.m.
    <P>
    Additionally, view times will expand past the configured settings if events
    span past the time range. That is, if you have an event that spans from
    5:00 p.m. to 8:00 p.m., the event will be reflected in the view, even though
    your time range may be set to go only to 6:00 p.m.

    Umm yes.
    The settings are stored in ''prefs.js'', so you could swap various copies of this file in and out.
    However, the system will load ''prefs.js'', then, if present, ''user.js'' , so you can set up just your changes in ''user.js'' .
    The sort of line you need to look for is like this:
    <code>user_pref("mail.server.server14.check_time", 10);</code>
    You'll need to do some research to identify which of your accounts is which.
    Search for the account's email address:
    <code>user_pref("mail.identity.id10.useremail", "xenos&#64;example.com");</code>
    Use the id number to locate the account number:
    <code>user_pref("mail.account.account29.identities", "id10");</code>
    Use the account number to find the server number:
    <code>user_pref("mail.account.account29.server", "server14");</code>
    Finally, you can then use the server number find the account's time setting:
    <code>user_pref("mail.server.server14.check_time", 10);</code>
    This last entry may not exist, if you have never changed the setting from the default 10 minutes.
    Do be careful with your typing and copy/pasting; if the file fails the syntax parser it will silently fail.
    And make sure Thunderbird is shut down when you do the swap. If it's open, it may overwrite changes, and in any case, it only reads the settings file when it starts up.

  • How to find the Day on a Week for any given Date

    Hi..... I need your help to find out the Day on a Week for any given Date .
    Say if the Date is 31/12/2009 , what would be the Day on a Week for this Date.
    Are there any fucntions available to determine the same?
    Please let me know....Thanks in Advance
    Regards
    Smita

    Hi ,
    You can using the following peice of code to get the Day of a Week for the given date :
    Calendar now = Calendar.getInstance();   
    System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1)  
         + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR));
    //create an array of days  
    //Day_OF_WEEK starts from 1 while array index starts from 0        
    String[] strDays = new String[]{"Sunday",  "Monday", "Tuesday", "Wednesday",  "Thusday",   "Friday",  "Saturday" };   
    String day_of_week = strDays[now.get(Calendar.DAY_OF_WEEK) - 1];     
    System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]  );
    Edited by: Ritushree Saha on Jun 4, 2009 1:09 PM

  • Calculate quantity based on the day

    Hi All,
    I have a requirement to calculate average quantities/day  based on variable entry.
    Date : variable ( range, mandatory)
    Based on the user entry , the report should display quantity
    average quantity on mondays ,
    average quantity on Tuesday ,
    average quantity on Wednesday ,
    average quantity on Thursday ,
    average quantity on Friday ,
    for ex : march 01,2010 - march 15,2010 ( user entry)
    in that date period we have three mondays (1,8,15)
    the report should display average quantity for mondays and so on for otherdays..
    any suggestions on how to proceed...
    srinivas
    Edited by: srinivas reddy on Mar 15, 2010 10:02 AM

    Hi,
    I dont know if others have a better solution, but if I were to suggest something, it would be to create a an infoobject to store the days, include it in your infocube.
    The based on the date, it will populate the day in your infocube. Include this new infoobject into the report, then create restricted key figures using the new day infoobject to restrict.
    Hope you could follow what I suggested and its useful for you.
    regards,
    Gary.

  • A code example

    Hi,
    I'm quite new at Java (and at programming on the whole). Can someone explain this to me (saw it in an code example on the internet):
    final private char PI_NAME = 0xFF01;
    /M

    Hi,
    a char is a variable that is supposed to contain a
    character. However, not all characters exist on the
    keyboard, so you define them using their hex value.
    final private char PI_NAME = 0xFF01;final = no one can change it
    private = no one can see it
    char = see above
    PI_NAME = the name of the variable
    0xFF01 = the value of the variable in hexadecimal
    Generally, in Java you can define any number using
    octal, decimal or hexadecimal numbers
    Octals (based on the number 8, which means it has
    digits from 0 to 7) ALWAYS start with a leading 0,
    decimals are entered as you know them (for example
    17) and hexadecimal numbers are entered with a
    leading 0x.
    So in this case 0x means "hexadecimal number ahead",
    FF01 is its value.
    To know its value in decimal, do the following:
    1 x 1 (value of last digit)
    0 x 16 (value of second from last)
    15 x 16 x 16 (F in hex represents the decimal 15)
    15 x 16 x 16
    All in all, this results in the decimal number
    65281.

  • Notified washer was on backorder on the day of deliver!!!

    We ordered a Whirlpool front loading washer online on Wed. December 31. It told us the delivery date would be today Fri Jan 2.  The email confirmation stated "confirmed appointment date January 2". It said someone would contact us by 9PM the night before the appointment to schedule delivery time.  No one called that night, although that didn't surprise me since it was New Years Day.  The delivery person called around 8:30 AM today to advise the deliery time would be sometime this afternoon.  He then called back about 30 minutes later to say that the washer was on backorder. I called customer service to complain on why i wasn't notified of the backorder status when the order was placed, and I was advised "it never tells you when the item is on backorder".
    They are now telling me the washer can not be available untill Wednesday January 7, but the system won't let them even enter a delivery date, so we still have no idea when it will be here.
    This is a huge problem as our washer has been broken since December 15.  We have been fighting with Lowes over an extended warranty claim for 2 weeks - they could not get any one to make the repair and ultimately agreed to reimburse us for the cost of the old one.  So now after a horrendous customer service situation with Lowes we are running into another one with Best Buy. 

    Good afternoon wolfie72, 
    Having been out of a washer since December 15th, I can imagine how relieved you must have been to finally be receiving a working washer. It is truly regrettable to hear of your troubles with Lowe's, as well as the backorder issue you encountered when you ordered your replacement washer from us. 
    I am sorry that you were not made aware of the backorder until the day of your delivery. I'm sure this was not only greatly disappointing, but also frustrating. It is disheartening that this ultimately led to you canceling your order with us. 
    While I'm glad to hear you should have received your replacement washer by now, I'm discouraged to find it wasn't with us. I hope that in the future you will trust us with an appliance purchase should one need replacing or you feel like upgrading. Thank you for taking the time to share this experience with us. I can assure you that it has not gone unnoticed. 
    Please let me know if you should have any questions! 
    Sincerely,
    Tasha|Social Media Specialist | Best Buy® Corporate
     Private Message

  • I have recently bought my Mac mini ( July 12) and have already requested my free update code for mountain lion, got a reference nr, but I still haven't received a code via email to update? Its been 12 days. Any advice?

    I have recently bought my Mac mini ( July 12) and have already requested my free update code for mountain lion, got a reference nr, but I still haven't received a code via email to update with? Its been 12 days. Any advice?

    I am still in the return window but i really do not want to return my mac as i know it has the ability to do what i want, my problem is just finding the software that will work as i know there has been a lot of complications with OS X Mountain Lion with softwares that caim to be compatible but then later turn out not to be.
    I have been a windows user for years and this is really my first mac but apart from the hole software issue i find the mac 10x better than any windows computer i have ever used. For example i bought a HP laptop 4 weeks ago and has nothing but problems. At first the fans stopped working and making weird noises and then it began switching off when ever it felt like it and freezing like mad when i was trying to access the smallest program. I have found that now a days you dont get what you pay for with Windows especially since Windows 8 was released. Also Laptops such as HP now are just crammed with cheap parts, they dont take pride in their systems like they once used to unlike Apple. I know i will get more than a year or 2 out my mac (hopefully a lot more) but with windows systems it just seems to break all the time costing more money on extending warrantys. Also i like mac because i dont need to send it away if i ever get a problem, i can just take it into the apple shop half a mile down the road and they will fix it in store. Where as with windows i am waiting 2 weeks+ to just hear back from them.

  • Safari crashes when I want to open it the 1st time of the day!!!!

    Hello,
    Since about 3 months, everytime I want to open Safari the 1st time of the day, it crashes! Then I have to retry it and then it works. Can you help me? I get the following message:
    Process: Safari [843]
    Path: /Applications/Safari.app/Contents/MacOS/Safari
    Identifier: com.apple.Safari
    Version: 5.0.3 (6533.19.4)
    Build Info: WebBrowser-75331904~2
    Code Type: X86-64 (Native)
    Parent Process: launchd [171]
    PlugIn Path: /Users/natachagraf/Library/MTWB/Plugins/FastBrowserSearchPlugin.bundle/Contents /MacOS/FastBrowserSearchPlugin
    PlugIn Identifier: com.MakeWebBetter.FastBrowserSearch
    PlugIn Version: ??? (1.0)
    Date/Time: 2010-12-16 16:31:08.996 +0100
    OS Version: Mac OS X 10.6.5 (10H574)
    Report Version: 6
    Interval Since Last Report: 64154 sec
    Crashes Since Last Report: 11
    Per-App Interval Since Last Report: 44177 sec
    Per-App Crashes Since Last Report: 10
    Anonymous UUID: 9C21889C-D9CC-4D40-9268-D5543C3E5F07
    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Crashed Thread: 0 Dispatch queue: com.apple.main-thread
    Application Specific Information:
    abort() called
    * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BrowserWindowController currentWebView]: unrecognized selector sent to instance 0x1008afa90'
    * Call stack at first throw:
    0 CoreFoundation 0x00007fff872807b4 __exceptionPreprocess + 180
    1 libobjc.A.dylib 0x00007fff88c560f3 objcexceptionthrow + 45
    2 CoreFoundation 0x00007fff872da110 +[NSObject(NSObject) doesNotRecognizeSelector:] + 0
    3 CoreFoundation 0x00007fff8725291f __forwarding__ + 751
    4 CoreFoundation 0x00007fff8724ea68 CF_forwarding_prep0 + 232
    5 FastBrowserSearchPlugin 0x00000001143496e5 +[FastBrowserSearchPlugin load] + 2352
    6 libobjc.A.dylib 0x00007fff88c501fb callloadmethods + 162
    7 libobjc.A.dylib 0x00007fff88c4ff40 load_images + 220
    8 ??? 0x00007fff5fc0315a 0x0 + 140734799819098
    9 ??? 0x00007fff5fc0bcdd 0x0 + 140734799854813
    10 ??? 0x00007fff5fc0bda6 0x0 + 140734799855014
    11 ??? 0x00007fff5fc08fbb 0x0 + 140734799843259
    12 libSystem.B.dylib 0x00007fff8734e3a0 dlopen + 61
    13 CoreFoundation 0x00007fff87219f27 _CFBundleDlfcnLoadBundle + 231
    14 CoreFoundation 0x00007fff87218ec7 _CFBundleLoadExecutableAndReturnError + 1191
    15 Foundation 0x00007fff82fc40c6 _NSBundleLoadCode + 638
    16 Foundation 0x00007fff82fc39e9 -[NSBundle loadAndReturnError:] + 742
    17 Foundation 0x00007fff82fd5378 -[NSBundle principalClass] + 38
    18 MTWB 0x00000001130fa13b -[MTWB_Handler loadBundle:] + 50
    19 MTWB 0x00000001130f9da9 -[MTWB_Handler installPlugins] + 338
    20 MTWB 0x00000001130f9179 SafariAddonHandler + 71
    21 OpenScripting 0x00007fff88a23a2e ZL17EventHandlerThunkPK6AEDescPSPv + 149
    22 AE 0x00007fff80b3c323 Z20aeDispatchAppleEventPK6AEDescPSjPh + 162
    23 AE 0x00007fff80b3c21c ZL25dispatchEventAndSendReplyPK6AEDescPS + 32
    24 AE 0x00007fff80b3c123 aeProcessAppleEvent + 210
    25 HIToolbox 0x00007fff86be9741 AEProcessAppleEvent + 48
    26 AppKit 0x00007fff817af04b _DPSNextEvent + 1205
    27 AppKit 0x00007fff817ae7a9 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    28 Safari 0x00000001000162f4 0x0 + 4295058164
    29 AppKit 0x00007fff8177448b -[NSApplication run] + 395
    30 AppKit 0x00007fff8176d1a8 NSApplicationMain + 364
    31 Safari 0x000000010000a1c0 0x0 + 4295008704
    Thread 0 Crashed: Dispatch queue: com.apple.main-thread
    0 libSystem.B.dylib 0x00007fff87396616 __kill + 10
    1 libSystem.B.dylib 0x00007fff87436cca abort + 83
    2 libstdc++.6.dylib 0x00007fff881a85d2 _tcf0 + 0
    3 libobjc.A.dylib 0x00007fff88c59d29 objcterminate + 100
    4 libstdc++.6.dylib 0x00007fff881a6ae1 _cxxabiv1::_terminate(void (*)()) + 11
    5 libstdc++.6.dylib 0x00007fff881a6b16 _cxxabiv1::_unexpected(void (*)()) + 0
    6 libstdc++.6.dylib 0x00007fff881a6bfc _gxx_exception_cleanup(_Unwind_ReasonCode, UnwindException*) + 0
    7 libobjc.A.dylib 0x00007fff88c56192 object_getIvar + 0
    8 com.apple.CoreFoundation 0x00007fff872da110 +[NSObject(NSObject) doesNotRecognizeSelector:] + 0
    9 com.apple.CoreFoundation 0x00007fff8725291f __forwarding__ + 751
    10 com.apple.CoreFoundation 0x00007fff8724ea68 CF_forwarding_prep0 + 232
    11 ...WebBetter.FastBrowserSearch 0x00000001143496e5 +[FastBrowserSearchPlugin load] + 2352
    12 libobjc.A.dylib 0x00007fff88c501fb callloadmethods + 162
    13 libobjc.A.dylib 0x00007fff88c4ff40 load_images + 220
    14 dyld 0x00007fff5fc0315a dyld::notifySingle(dyldimagestates, ImageLoader const*) + 344
    15 dyld 0x00007fff5fc0bcdd ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int) + 221
    16 dyld 0x00007fff5fc0bda6 ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 58
    17 dyld 0x00007fff5fc08fbb dlopen + 573
    18 libSystem.B.dylib 0x00007fff8734e3a0 dlopen + 61
    19 com.apple.CoreFoundation 0x00007fff87219f27 _CFBundleDlfcnLoadBundle + 231
    20 com.apple.CoreFoundation 0x00007fff87218ec7 _CFBundleLoadExecutableAndReturnError + 1191
    21 com.apple.Foundation 0x00007fff82fc40c6 _NSBundleLoadCode + 638
    22 com.apple.Foundation 0x00007fff82fc39e9 -[NSBundle loadAndReturnError:] + 742
    23 com.apple.Foundation 0x00007fff82fd5378 -[NSBundle principalClass] + 38
    24 com.MTWB.SafariAddon.osax 0x00000001130fa13b -[MTWB_Handler loadBundle:] + 50
    25 com.MTWB.SafariAddon.osax 0x00000001130f9da9 -[MTWB_Handler installPlugins] + 338
    26 com.MTWB.SafariAddon.osax 0x00000001130f9179 SafariAddonHandler + 71
    27 com.apple.openscripting 0x00007fff88a23a2e EventHandlerThunk(AEDesc const*, AEDesc*, void*) + 149
    28 com.apple.AE 0x00007fff80b3c323 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 162
    29 com.apple.AE 0x00007fff80b3c21c dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 32
    30 com.apple.AE 0x00007fff80b3c123 aeProcessAppleEvent + 210
    31 com.apple.HIToolbox 0x00007fff86be9741 AEProcessAppleEvent + 48
    32 com.apple.AppKit 0x00007fff817af04b _DPSNextEvent + 1205
    33 com.apple.AppKit 0x00007fff817ae7a9 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    34 com.apple.Safari 0x00000001000162f4 0x100000000 + 90868
    35 com.apple.AppKit 0x00007fff8177448b -[NSApplication run] + 395
    36 com.apple.AppKit 0x00007fff8176d1a8 NSApplicationMain + 364
    37 com.apple.Safari 0x000000010000a1c0 0x100000000 + 41408
    Thread 1: Dispatch queue: com.apple.libdispatch-manager
    0 libSystem.B.dylib 0x00007fff8736116a kevent + 10
    1 libSystem.B.dylib 0x00007fff8736303d dispatch_mgrinvoke + 154
    2 libSystem.B.dylib 0x00007fff87362d14 dispatch_queueinvoke + 185
    3 libSystem.B.dylib 0x00007fff8736283e dispatch_workerthread2 + 252
    4 libSystem.B.dylib 0x00007fff87362168 pthreadwqthread + 353
    5 libSystem.B.dylib 0x00007fff87362005 start_wqthread + 13
    Thread 2:
    0 libSystem.B.dylib 0x00007fff87361f8a _workqkernreturn + 10
    1 libSystem.B.dylib 0x00007fff8736239c pthreadwqthread + 917
    2 libSystem.B.dylib 0x00007fff87362005 start_wqthread + 13
    Thread 3: WebCore: IconDatabase
    0 libSystem.B.dylib 0x00007fff87382fca _semwaitsignal + 10
    1 libSystem.B.dylib 0x00007fff87386de1 pthread_condwait + 1286
    2 com.apple.WebCore 0x00007fff832a41b9 WebCore::IconDatabase::syncThreadMainLoop() + 249
    3 com.apple.WebCore 0x00007fff832a02bc WebCore::IconDatabase::iconDatabaseSyncThread() + 172
    4 libSystem.B.dylib 0x00007fff87381536 pthreadstart + 331
    5 libSystem.B.dylib 0x00007fff873813e9 thread_start + 13
    Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x0000000000000000 rbx: 0x00007fff70d882d8 rcx: 0x00007fff5fbfe358 rdx: 0x0000000000000000
    rdi: 0x000000000000034b rsi: 0x0000000000000006 rbp: 0x00007fff5fbfe370 rsp: 0x00007fff5fbfe358
    r8: 0x00007fff70d8ba40 r9: 0x0000000000000063 r10: 0x00007fff87392656 r11: 0x0000000000000206
    r12: 0x00007fff87305b09 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x00000001008afa90
    rip: 0x00007fff87396616 rfl: 0x0000000000000206 cr2: 0x00007fff70f67fd0
    Binary Images:
    0x100000000 - 0x1006afff7 com.apple.Safari 5.0.3 (6533.19.4) <B19794C1-5278-9BBE-1505-AB9C9DDA84E0> /Applications/Safari.app/Contents/MacOS/Safari
    0x1130f8000 - 0x1130fafff +com.MTWB.SafariAddon.osax ??? (1.0) <07F89448-3C9B-4893-46B5-D46138999B9F> /Users/natachagraf/Library/ScriptingAdditions/MTWB.osax/Contents/MacOS/MTWB
    0x114348000 - 0x11434dfff +com.MakeWebBetter.FastBrowserSearch ??? (1.0) <2F66120A-A252-0AC5-DD33-C59C78CAC902> /Users/natachagraf/Library/MTWB/Plugins/FastBrowserSearchPlugin.bundle/Contents /MacOS/FastBrowserSearchPlugin
    0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) <B536F2F1-9DF1-3B6C-1C2C-9075EA219A06> /usr/lib/dyld
    0x7fff8006a000 - 0x7fff800a4fff libssl.0.9.8.dylib 0.9.8 (compatibility 0.9.8) <C7153747-50E3-32DA-426F-CC4C505D1D6C> /usr/lib/libssl.0.9.8.dylib
    0x7fff80106000 - 0x7fff8010cff7 IOSurface ??? (???) <04EDCEDE-E36F-15F8-DC67-E61E149D2C9A> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
    0x7fff8010d000 - 0x7fff80917fe7 libBLAS.dylib 219.0.0 (compatibility 1.0.0) <FC941ECB-71D0-FAE3-DCBF-C5A619E594B8> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libBLAS.dylib
    0x7fff80a0a000 - 0x7fff80a2dfff com.apple.opencl 12.3 (12.3) <D30A45FC-4520-45AF-3CA5-092313DB5D54> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
    0x7fff80a86000 - 0x7fff80ac3ff7 libFontRegistry.dylib ??? (???) <8C69F685-3507-1B8F-51AD-6183D5E88979> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/Resources/libFontRegistry.dylib
    0x7fff80b39000 - 0x7fff80b74fff com.apple.AE 496.4 (496.4) <CBEDB6A1-FD85-F842-4EB8-CC289FAE0F24> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.fram ework/Versions/A/AE
    0x7fff80b75000 - 0x7fff80c96fe7 libcrypto.0.9.8.dylib 0.9.8 (compatibility 0.9.8) <48AEAFE1-21F4-B3C8-4199-35AD5E8D0613> /usr/lib/libcrypto.0.9.8.dylib
    0x7fff80cca000 - 0x7fff80cd1fff com.apple.OpenDirectory 10.6 (10.6) <4200CFB0-DBA1-62B8-7C7C-91446D89551F> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
    0x7fff80d74000 - 0x7fff80e03fff com.apple.PDFKit 2.5.1 (2.5.1) <7B8A187A-F0BB-44E7-FBD4-9E1C5F9D5E85> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framew ork/Versions/A/PDFKit
    0x7fff80e04000 - 0x7fff81247fef libLAPACK.dylib 219.0.0 (compatibility 1.0.0) <0CC61C98-FF51-67B3-F3D8-C5E430C201A9> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libLAPACK.dylib
    0x7fff81248000 - 0x7fff81265ff7 libPng.dylib ??? (???) <14043CBC-329F-4009-299E-DEE411E16134> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libPng.dylib
    0x7fff81266000 - 0x7fff812bbfef com.apple.framework.familycontrols 2.0.1 (2010) <239940AC-2427-44C6-9E29-998D0ABECDF3> /System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/FamilyCon trols
    0x7fff81343000 - 0x7fff81384fef com.apple.QD 3.36 (???) <5DC41E81-32C9-65B2-5528-B33E934D5BB4> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ QD.framework/Versions/A/QD
    0x7fff81385000 - 0x7fff81385ff7 com.apple.Accelerate.vecLib 3.6 (vecLib 3.6) <DA9BFF01-40DF-EBD5-ABB7-787DAF2D77CF> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/vecLib
    0x7fff81386000 - 0x7fff813cffef libGLU.dylib ??? (???) <EB4255DD-A9E5-FAD0-52A4-CCB4E792B86F> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
    0x7fff813d0000 - 0x7fff8147ffff edu.mit.Kerberos 6.5.10 (6.5.10) <F3F76EDF-5660-78F0-FE6E-33B6174F55A4> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x7fff81480000 - 0x7fff814c3ff7 libRIP.A.dylib 545.0.0 (compatibility 64.0.0) <7E30B5F6-99FD-C716-8670-5DD4B4BAED72> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
    0x7fff8166f000 - 0x7fff81697fff com.apple.DictionaryServices 1.1.2 (1.1.2) <E9269069-93FA-2B71-F9BA-FDDD23C4A65E> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Diction aryServices.framework/Versions/A/DictionaryServices
    0x7fff81698000 - 0x7fff8176afe7 com.apple.CFNetwork 454.11.5 (454.11.5) <B3E2BE12-D7AA-5940-632A-1E5E7BF8E6E3> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwo rk.framework/Versions/A/CFNetwork
    0x7fff8176b000 - 0x7fff82161fff com.apple.AppKit 6.6.7 (1038.35) <9F4DF818-9DB9-98DA-490C-EF29EA757A97> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7fff821a6000 - 0x7fff821bcfe7 com.apple.MultitouchSupport.framework 207.10 (207.10) <1828C264-A54A-7FDD-FE1B-49DDE3F50779> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/Multit ouchSupport
    0x7fff821bd000 - 0x7fff8232cfe7 com.apple.QTKit 7.6.6 (1756) <250AB242-816D-9F5D-94FB-18BF2AE9AAE7> /System/Library/Frameworks/QTKit.framework/Versions/A/QTKit
    0x7fff8232d000 - 0x7fff82395fff com.apple.MeshKitRuntime 1.1 (49.2) <1F4C9AB5-9D3F-F91D-DB91-B78610562ECC> /System/Library/PrivateFrameworks/MeshKit.framework/Versions/A/Frameworks/MeshK itRuntime.framework/Versions/A/MeshKitRuntime
    0x7fff82396000 - 0x7fff823ddff7 com.apple.coreui 2 (114) <D7645B59-0431-6283-7322-957D944DAB21> /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
    0x7fff823de000 - 0x7fff8255bff7 com.apple.WebKit 6533.19 (6533.19.4) <3B8D40F4-9B05-82BE-ECA5-7855A77AF700> /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
    0x7fff8255c000 - 0x7fff8255efff com.apple.print.framework.Print 6.1 (237.1) <CA8564FB-B366-7413-B12E-9892DA3C6157> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framewo rk/Versions/A/Print
    0x7fff8255f000 - 0x7fff8255fff7 com.apple.Carbon 150 (152) <19B37B7B-1594-AD0A-7F14-FA2F85AD7241> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    0x7fff82560000 - 0x7fff825a3fef libtidy.A.dylib ??? (???) <2F4273D3-418B-668C-F488-7E659D3A8C23> /usr/lib/libtidy.A.dylib
    0x7fff825a4000 - 0x7fff825d9fef com.apple.framework.Apple80211 6.2.3 (623.1) <E58C0A3A-BA14-9703-F6A3-3951A862570C> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
    0x7fff825da000 - 0x7fff825dcfff libRadiance.dylib ??? (???) <76438F90-DD4B-9941-9367-F2DFDF927876> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libRadiance.dylib
    0x7fff825f6000 - 0x7fff82637ff7 com.apple.CoreMedia 0.484.20 (484.20) <42F3B74A-F886-33A0-40EE-8399B12BD32A> /System/Library/PrivateFrameworks/CoreMedia.framework/Versions/A/CoreMedia
    0x7fff8265c000 - 0x7fff8265cff7 com.apple.quartzframework 1.5 (1.5) <B182B579-BCCE-81BF-8DA2-9E0B7BDF8516> /System/Library/Frameworks/Quartz.framework/Versions/A/Quartz
    0x7fff8265d000 - 0x7fff828c7fef com.apple.QuartzComposer 4.2 ({156.28}) <7586E7BD-D3BD-0EAC-5AC9-0BFA3679017C> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzCompose r.framework/Versions/A/QuartzComposer
    0x7fff828c8000 - 0x7fff828edff7 com.apple.CoreVideo 1.6.2 (45.6) <E138C8E7-3CB6-55A9-0A2C-B73FE63EA288> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x7fff828ee000 - 0x7fff82cc8fff com.apple.RawCamera.bundle 3.4.1 (546) <F7865FD2-4869-AB19-10AA-EFF1B3BC4178> /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
    0x7fff82cc9000 - 0x7fff82deffff com.apple.audio.toolbox.AudioToolbox 1.6.5 (1.6.5) <B51023BB-A5C9-3C65-268B-6B86B901BB2C> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7fff82df0000 - 0x7fff82e80fff com.apple.SearchKit 1.3.0 (1.3.0) <4175DC31-1506-228A-08FD-C704AC9DF642> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchK it.framework/Versions/A/SearchKit
    0x7fff82e81000 - 0x7fff82f1bfff com.apple.ApplicationServices.ATS 4.4 (???) <395849EE-244A-7323-6CBA-E71E3B722984> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/ATS
    0x7fff82f59000 - 0x7fff82f79ff7 com.apple.DirectoryService.Framework 3.6 (621.9) <FF6567B5-56BD-F3EC-E59D-1EC583C3CF73> /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryServi ce
    0x7fff82f7a000 - 0x7fff831fdff7 com.apple.Foundation 6.6.4 (751.42) <9A99D378-E97A-8C0F-3857-D0FAA30FCDD5> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff8321a000 - 0x7fff8321aff7 com.apple.Accelerate 1.6 (Accelerate 1.6) <2BB7D669-4B40-6A52-ADBD-DA4DB3BC0B1B> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x7fff8321b000 - 0x7fff8329dfff com.apple.QuickLookUIFramework 2.3 (327.6) <9093682A-0E2D-7D27-5F22-C96FD00AE970> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.f ramework/Versions/A/QuickLookUI
    0x7fff8329e000 - 0x7fff83f11fef com.apple.WebCore 6533.19 (6533.19.4) <214A0165-E3D0-1F7A-F2D5-5337E00E410A> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.frame work/Versions/A/WebCore
    0x7fff83f12000 - 0x7fff83f57fff com.apple.CoreMediaIOServices 133.0 (1158) <53F7A2A6-78CA-6C34-0BB6-471388019799> /System/Library/PrivateFrameworks/CoreMediaIOServices.framework/Versions/A/Core MediaIOServices
    0x7fff83f58000 - 0x7fff83f59ff7 com.apple.audio.units.AudioUnit 1.6.5 (1.6.5) <14F14B5E-9287-BC36-0C3F-6592E6696CD4> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
    0x7fff83f6b000 - 0x7fff83f6eff7 com.apple.securityhi 4.0 (36638) <38935851-09E4-DDAB-DB1D-30ADC39F7ED0> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.fr amework/Versions/A/SecurityHI
    0x7fff83f9f000 - 0x7fff8401bff7 com.apple.ISSupport 1.9.4 (52) <93A57F16-3BD5-25AD-5CFF-00007A141129> /System/Library/PrivateFrameworks/ISSupport.framework/Versions/A/ISSupport
    0x7fff8401c000 - 0x7fff84120fff com.apple.PubSub 1.0.5 (65.20) <67A088DF-7F4A-DC23-6F96-F9BAA4C238DC> /System/Library/Frameworks/PubSub.framework/Versions/A/PubSub
    0x7fff84121000 - 0x7fff8412efe7 libCSync.A.dylib 545.0.0 (compatibility 64.0.0) <397B9057-5CDF-3B19-4E61-9DFD49369375> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
    0x7fff8412f000 - 0x7fff8418ffe7 com.apple.framework.IOKit 2.0 (???) <D107CB8A-5182-3AC4-35D0-07068A695C05> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff84190000 - 0x7fff8419cfff libbz2.1.0.dylib 1.0.5 (compatibility 1.0.0) <5C876577-ACB7-020C-F7DB-EE0135C3AB8D> /usr/lib/libbz2.1.0.dylib
    0x7fff841b8000 - 0x7fff841c9fff com.apple.DSObjCWrappers.Framework 10.6 (134) <3C08225D-517E-2822-6152-F6EB13A4ADF9> /System/Library/PrivateFrameworks/DSObjCWrappers.framework/Versions/A/DSObjCWra ppers
    0x7fff8428f000 - 0x7fff84446fef com.apple.ImageIO.framework 3.0.4 (3.0.4) <2CB9997A-A28D-80BC-5921-E7D50BBCACA7> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/ImageIO
    0x7fff84447000 - 0x7fff84448ff7 com.apple.TrustEvaluationAgent 1.1 (1) <51867586-1C71-AE37-EAAD-535A58DD3550> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/Tru stEvaluationAgent
    0x7fff84449000 - 0x7fff8444ffff libCGXCoreImage.A.dylib 545.0.0 (compatibility 64.0.0) <4EE16374-A094-D542-5BC5-7E846D0CE56E> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCGXCoreImage.A.dylib
    0x7fff84452000 - 0x7fff84610fff libicucore.A.dylib 40.0.0 (compatibility 1.0.0) <781E7B63-2AD0-E9BA-927C-4521DB616D02> /usr/lib/libicucore.A.dylib
    0x7fff846c7000 - 0x7fff84767fff com.apple.LaunchServices 362.1 (362.1) <2740103A-6C71-D99F-8C6F-FA264546AD8F> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/LaunchServices
    0x7fff84768000 - 0x7fff8476cff7 libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <95718673-FEEE-B6ED-B127-BCDBDB60D4E5> /usr/lib/system/libmathCommon.A.dylib
    0x7fff8476d000 - 0x7fff8477cfff com.apple.opengl 1.6.11 (1.6.11) <43D5BE71-E1F6-6974-210C-17C68919AE08> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff8477d000 - 0x7fff84e7a06f com.apple.CoreGraphics 1.545.0 (???) <356D59D6-1DD1-8BFF-F9B3-1CE51D2F1EC7> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/CoreGraphics
    0x7fff84e7b000 - 0x7fff84eddfe7 com.apple.datadetectorscore 2.0 (80.7) <F9D2332D-0890-2ED2-1AC8-F85CB89D8BD4> /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDe tectorsCore
    0x7fff84ede000 - 0x7fff84f93fe7 com.apple.ink.framework 1.3.3 (107) <FFC46EE0-3544-A459-2AB9-94778A75E3D4> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework /Versions/A/Ink
    0x7fff84f94000 - 0x7fff84fe3fef libTIFF.dylib ??? (???) <AE9DC484-1382-F7AD-FE25-C28082FCB5D9> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libTIFF.dylib
    0x7fff85035000 - 0x7fff8509ffe7 libvMisc.dylib 268.0.1 (compatibility 1.0.0) <75A8D840-4ACE-6560-0889-2AFB6BE08E59> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvMisc.dylib
    0x7fff850a0000 - 0x7fff850a0ff7 com.apple.Cocoa 6.6 (???) <68B0BE46-6E24-C96F-B341-054CF9E8F3B6> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    0x7fff852c3000 - 0x7fff854b2fe7 com.apple.JavaScriptCore 6533.19 (6533.19.1) <233B3E34-CDC4-668A-529A-7E61D510D991> /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
    0x7fff854b3000 - 0x7fff85570ff7 com.apple.CoreServices.OSServices 357 (357) <718F0719-DC9F-E392-7C64-9D7DFE3D02E2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServi ces.framework/Versions/A/OSServices
    0x7fff85571000 - 0x7fff855bbff7 com.apple.Metadata 10.6.3 (507.12) <9231045A-E2E3-B0C2-C81A-92C9EA98A4DF> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadat a.framework/Versions/A/Metadata
    0x7fff855bc000 - 0x7fff855d0ff7 com.apple.speech.synthesis.framework 3.10.35 (3.10.35) <621B7415-A0B9-07A7-F313-36BEEDD7B132> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ SpeechSynthesis.framework/Versions/A/SpeechSynthesis
    0x7fff855d1000 - 0x7fff85650fe7 com.apple.audio.CoreAudio 3.2.6 (3.2.6) <1DD64A62-0DE4-223F-F781-B272FECF80F0> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x7fff85782000 - 0x7fff85786ff7 libCGXType.A.dylib 545.0.0 (compatibility 64.0.0) <63F77AC8-84CB-0C2F-8D2B-190EE5CCDB45> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreGraphics.framework/Versions/A/Resources/libCGXType.A.dylib
    0x7fff85787000 - 0x7fff85798ff7 libz.1.dylib 1.2.3 (compatibility 1.0.0) <FB5EE53A-0534-0FFA-B2ED-486609433717> /usr/lib/libz.1.dylib
    0x7fff8597d000 - 0x7fff859fbfff com.apple.CoreText 3.5.0 (???) <4D5C7932-293B-17FF-7309-B580BB1953EA> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ CoreText.framework/Versions/A/CoreText
    0x7fff859fc000 - 0x7fff859ffff7 libCoreVMClient.dylib ??? (???) <B1F41E5B-8B59-DB81-1654-C1F9B11E885F> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClien t.dylib
    0x7fff85ae2000 - 0x7fff85b53ff7 com.apple.AppleVAFramework 4.10.12 (4.10.12) <1B68BE43-4C54-87F5-0723-0B0A14CD21E8> /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA
    0x7fff85b54000 - 0x7fff85bc0ff7 com.apple.CorePDF 1.3 (1.3) <6770FFB0-DEA0-61E0-3520-4B95CCF5D1CF> /System/Library/PrivateFrameworks/CorePDF.framework/Versions/A/CorePDF
    0x7fff85c64000 - 0x7fff85cacff7 libvDSP.dylib 268.0.1 (compatibility 1.0.0) <170DE04F-89AB-E295-0880-D69CAFBD7979> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.fr amework/Versions/A/libvDSP.dylib
    0x7fff85cad000 - 0x7fff85cbcfff libxar.1.dylib ??? (???) <CBAF862A-3C77-6446-56C2-9C4461631AAF> /usr/lib/libxar.1.dylib
    0x7fff85cbf000 - 0x7fff85ff3fff com.apple.CoreServices.CarbonCore 861.23 (861.23) <08F360FA-1771-4F0B-F356-BEF68BB9D421> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonC ore.framework/Versions/A/CarbonCore
    0x7fff85ff4000 - 0x7fff864f8fe7 com.apple.VideoToolbox 0.484.20 (484.20) <8B6B82D2-350B-E9D3-5433-51453CDA65B4> /System/Library/PrivateFrameworks/VideoToolbox.framework/Versions/A/VideoToolbo x
    0x7fff8666b000 - 0x7fff866b4ff7 com.apple.securityinterface 4.0.1 (37214) <F8F2D8F4-861F-6694-58F6-3DC55C9DBF50> /System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInter face
    0x7fff866b5000 - 0x7fff86706fef com.apple.HIServices 1.8.1 (???) <BE479ABF-3D27-A5C7-800E-3FFC1731767A> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ HIServices.framework/Versions/A/HIServices
    0x7fff86731000 - 0x7fff869b7fef com.apple.security 6.1.1 (37594) <17CF7858-52D9-9665-3AE8-23F07CC8BEA1> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff869b8000 - 0x7fff869bdff7 com.apple.CommonPanels 1.2.4 (91) <4D84803B-BD06-D80E-15AE-EFBE43F93605> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels. framework/Versions/A/CommonPanels
    0x7fff869be000 - 0x7fff869c7ff7 com.apple.DisplayServicesFW 2.3.0 (283) <3D05929C-AB17-B8A4-DC81-87C27C59E664> /System/Library/PrivateFrameworks/DisplayServices.framework/Versions/A/DisplayS ervices
    0x7fff869c8000 - 0x7fff869c9fff liblangid.dylib ??? (???) <EA4D1607-2BD5-2EE2-2A3B-632EEE5A444D> /usr/lib/liblangid.dylib
    0x7fff869ca000 - 0x7fff869ebfff libresolv.9.dylib 41.0.0 (compatibility 1.0.0) <6993F348-428F-C97E-7A84-7BD2EDC46A62> /usr/lib/libresolv.9.dylib
    0x7fff869ec000 - 0x7fff86af6ff7 com.apple.MeshKitIO 1.1 (49.2) <F296E151-80AE-7764-B969-C2050DF26BFE> /System/Library/PrivateFrameworks/MeshKit.framework/Versions/A/Frameworks/MeshK itIO.framework/Versions/A/MeshKitIO
    0x7fff86af7000 - 0x7fff86b30fef libcups.2.dylib 2.8.0 (compatibility 2.0.0) <97F968EB-80ED-36FB-7819-D438B489E46E> /usr/lib/libcups.2.dylib
    0x7fff86b70000 - 0x7fff86bb4fe7 com.apple.ImageCaptureCore 1.0.3 (1.0.3) <913FFA89-0AC8-0A8D-CC2A-364CB0F303BA> /System/Library/Frameworks/ImageCaptureCore.framework/Versions/A/ImageCaptureCo re
    0x7fff86bb5000 - 0x7fff86eb3fe7 com.apple.HIToolbox 1.6.3 (???) <CF0C8524-FA82-3908-ACD0-A9176C704AED> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.fra mework/Versions/A/HIToolbox
    0x7fff86edc000 - 0x7fff86f0bff7 com.apple.quartzfilters 1.6.0 (1.6.0) <9CECB4FC-1CCF-B8A2-B935-5888B21CBEEF> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzFilters .framework/Versions/A/QuartzFilters
    0x7fff86f0c000 - 0x7fff86f25fff com.apple.CFOpenDirectory 10.6 (10.6) <CCF79716-7CC6-2520-C6EB-A4F56AD0A207> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpen Directory.framework/Versions/A/CFOpenDirectory
    0x7fff86f26000 - 0x7fff86f34ff7 libkxld.dylib ??? (???) <4016E9E6-0645-5384-A697-2775B5228113> /usr/lib/system/libkxld.dylib
    0x7fff86f35000 - 0x7fff86f49fff libGL.dylib ??? (???) <1EB1BD0F-C17F-55DF-B8B4-8E9CF99359D4> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
    0x7fff870bd000 - 0x7fff870effff libTrueTypeScaler.dylib ??? (???) <B9ECE1BD-A716-9F65-6466-4444D641F584> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/Resources/libTrueTypeScaler.dylib
    0x7fff8713b000 - 0x7fff87150ff7 com.apple.LangAnalysis 1.6.6 (1.6.6) <DC999B32-BF41-94C8-0583-27D9AB463E8B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ LangAnalysis.framework/Versions/A/LangAnalysis
    0x7fff87151000 - 0x7fff8718efff com.apple.LDAPFramework 2.0 (120.1) <16383FF5-0537-6298-73C9-473AEC9C149C> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
    0x7fff871cf000 - 0x7fff87346fe7 com.apple.CoreFoundation 6.6.4 (550.42) <770C572A-CF70-168F-F43C-242B9114FCB5> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff87347000 - 0x7fff87508fff libSystem.B.dylib 125.2.1 (compatibility 1.0.0) <71E6D4C9-F945-6EC2-998C-D61AD590DAB6> /usr/lib/libSystem.B.dylib
    0x7fff87509000 - 0x7fff8750fff7 com.apple.DiskArbitration 2.3 (2.3) <857F6E43-1EF4-7D53-351B-10DE0A8F992A> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff87510000 - 0x7fff8758dfef com.apple.backup.framework 1.2.2 (1.2.2) <13A0D34C-28B7-2140-ECC9-B08D10CD4AB5> /System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup
    0x7fff875de000 - 0x7fff87604fe7 libJPEG.dylib ??? (???) <6690F15D-E970-2678-430E-590A94F5C8E9> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libJPEG.dylib
    0x7fff87605000 - 0x7fff8772dff7 com.apple.MediaToolbox 0.484.20 (484.20) <628A7245-7ADE-AD47-3368-CF8EDCA6CC1C> /System/Library/PrivateFrameworks/MediaToolbox.framework/Versions/A/MediaToolbo x
    0x7fff8772e000 - 0x7fff87740fe7 libsasl2.2.dylib 3.15.0 (compatibility 3.0.0) <76B83C8D-8EFE-4467-0F75-275648AFED97> /usr/lib/libsasl2.2.dylib
    0x7fff87741000 - 0x7fff87826fef com.apple.DesktopServices 1.5.9 (1.5.9) <27890B2C-0CD2-7C27-9D0C-D5952C5E8438> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/Desk topServicesPriv
    0x7fff87920000 - 0x7fff87a5efff com.apple.CoreData 102.1 (251) <32233D4D-00B7-CE14-C881-6BF19FD05A03> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
    0x7fff87a5f000 - 0x7fff87a64fff libGIF.dylib ??? (???) <9A2723D8-61F9-6D65-D254-4F9273CDA54A> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ImageIO.framework/Versions/A/Resources/libGIF.dylib
    0x7fff87a65000 - 0x7fff87a90ff7 libxslt.1.dylib 3.24.0 (compatibility 3.0.0) <87A0B228-B24A-C426-C3FB-B40D7258DD49> /usr/lib/libxslt.1.dylib
    0x7fff87a91000 - 0x7fff87aa2fff SyndicationUI ??? (???) <91DAD490-897C-E5E9-C30B-161D4F42BF98> /System/Library/PrivateFrameworks/SyndicationUI.framework/Versions/A/Syndicatio nUI
    0x7fff87aa3000 - 0x7fff87e40fe7 com.apple.QuartzCore 1.6.3 (227.34) <215222AF-B30A-7CE5-C46C-1A766C1D1D2E> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x7fff87e41000 - 0x7fff87e4cfff com.apple.CrashReporterSupport 10.6.5 (252) <0895BE37-CC7E-1939-8020-489BFCB3E2C6> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/Cra shReporterSupport
    0x7fff87e4d000 - 0x7fff87e50fff com.apple.help 1.3.1 (41) <54B79BA2-B71B-268E-8752-5C8EE00E49E4> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framewor k/Versions/A/Help
    0x7fff87e51000 - 0x7fff87f68fef libxml2.2.dylib 10.3.0 (compatibility 10.0.0) <EE067D7E-15B3-F043-6FBD-10BA31FE76C7> /usr/lib/libxml2.2.dylib
    0x7fff87f69000 - 0x7fff87f7ffef libbsm.0.dylib ??? (???) <42D3023A-A1F7-4121-6417-FCC6B51B3E90> /usr/lib/libbsm.0.dylib
    0x7fff87f80000 - 0x7fff87fcfff7 com.apple.DirectoryService.PasswordServerFramework 6.0 (6.0) <14FD0978-4BE0-336B-A19E-F388694583EB> /System/Library/PrivateFrameworks/PasswordServer.framework/Versions/A/PasswordS erver
    0x7fff87fd0000 - 0x7fff87fdffff com.apple.NetFS 3.2.1 (3.2.1) <FF21DB1E-F425-1005-FB70-BC19CAF4006E> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
    0x7fff87fe0000 - 0x7fff88099fff libsqlite3.dylib 9.6.0 (compatibility 9.0.0) <2C5ED312-E646-9ADE-73A9-6199A2A43150> /usr/lib/libsqlite3.dylib
    0x7fff8809a000 - 0x7fff8815bfe7 libFontParser.dylib ??? (???) <8B12D37E-3A95-5A73-509C-3AA991E0C546> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/Resources/libFontParser.dylib
    0x7fff8815c000 - 0x7fff881d9fef libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <35ECA411-2C08-FD7D-11B1-1B7A04921A5C> /usr/lib/libstdc++.6.dylib
    0x7fff881da000 - 0x7fff881daff7 com.apple.CoreServices 44 (44) <DC7400FB-851E-7B8A-5BF6-6F50094302FB> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff881db000 - 0x7fff881dbff7 com.apple.ApplicationServices 38 (38) <10A0B9E9-4988-03D4-FC56-DDE231A02C63> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Application Services
    0x7fff881dc000 - 0x7fff88228fff libauto.dylib ??? (???) <F7221B46-DC4F-3153-CE61-7F52C8C293CF> /usr/lib/libauto.dylib
    0x7fff88229000 - 0x7fff88464fef com.apple.imageKit 2.0.3 (1.0) <5D18C246-303A-6580-9DC9-79BE79467C95> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.fram ework/Versions/A/ImageKit
    0x7fff88465000 - 0x7fff886a7fef com.apple.AddressBook.framework 5.0.3 (875) <78FDBCC6-8F4C-C4DF-4A60-BB038572B870> /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook
    0x7fff886a8000 - 0x7fff886befff com.apple.ImageCapture 6.0.1 (6.0.1) <09ABF2E9-D110-71A9-4A6F-8A61B683E936> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture. framework/Versions/A/ImageCapture
    0x7fff88706000 - 0x7fff88706ff7 com.apple.vecLib 3.6 (vecLib 3.6) <08D3D45D-908B-B86A-00BA-0F978D2702A7> /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
    0x7fff88707000 - 0x7fff88712ff7 com.apple.speech.recognition.framework 3.11.1 (3.11.1) <F0DDF27E-DB55-07CE-E548-C62095BE8167> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecogni tion.framework/Versions/A/SpeechRecognition
    0x7fff88729000 - 0x7fff887aeff7 com.apple.print.framework.PrintCore 6.3 (312.7) <CDFE82DD-D811-A091-179F-6E76069B432D> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ PrintCore.framework/Versions/A/PrintCore
    0x7fff887af000 - 0x7fff888c8fef libGLProgrammability.dylib ??? (???) <13E8114C-6E07-A66E-35E6-C185E54840AE> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgramma bility.dylib
    0x7fff888c9000 - 0x7fff88910fff com.apple.QuickLookFramework 2.3 (327.6) <11DFB135-24A6-C0BC-5B97-ECE352A4B488> /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook
    0x7fff88942000 - 0x7fff88943fff com.apple.MonitorPanelFramework 1.3.0 (1.3.0) <5062DACE-FCE7-8E41-F5F6-58821778629C> /System/Library/PrivateFrameworks/MonitorPanel.framework/Versions/A/MonitorPane l
    0x7fff88a11000 - 0x7fff88a2cff7 com.apple.openscripting 1.3.1 (???) <FD46A0FE-AC79-3EF7-AB4F-396D376DDE71> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting .framework/Versions/A/OpenScripting
    0x7fff88a2d000 - 0x7fff88ae2fe7 com.apple.ColorSync 4.6.3 (4.6.3) <AA93AD96-6974-9104-BF55-AF7A813C8A1B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ColorSync.framework/Versions/A/ColorSync
    0x7fff88b25000 - 0x7fff88bb1fef SecurityFoundation ??? (???) <6860DE26-0D42-D1E8-CD7C-5B42D78C1E1D> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoun dation
    0x7fff88bb2000 - 0x7fff88bf3fff com.apple.SystemConfiguration 1.10.5 (1.10.2) <FB39F09C-57BB-D8CC-348D-93E00C602F7D> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfi guration
    0x7fff88c08000 - 0x7fff88c0dfff libGFXShared.dylib ??? (???) <A94DE483-A586-A172-104F-1CFC5F0BFD57> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.d ylib
    0x7fff88c0e000 - 0x7fff88c19fff com.apple.corelocation 12.1 (12.1) <0B15767B-D752-7DA6-A8BB-5A1C9C39C5C8> /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation
    0x7fff88c1a000 - 0x7fff88c4bfff libGLImage.dylib ??? (???) <57DA0064-4581-62B8-37A8-A07ADEF46EE2> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dyl ib
    0x7fff88c4c000 - 0x7fff88d02fff libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <F206BE6D-8777-AE6C-B367-7BEA76C14241> /usr/lib/libobjc.A.dylib
    0x7fff89047000 - 0x7fff89121ff7 com.apple.vImage 4.0 (4.0) <354F34BF-B221-A3C9-2CA7-9BE5E14AD5AD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.fr amework/Versions/A/vImage
    0x7fff89122000 - 0x7fff8915bff7 com.apple.MeshKit 1.1 (49.2) <3795F201-4A5F-3D40-57E0-87AD6B714239> /System/Library/PrivateFrameworks/MeshKit.framework/Versions/A/MeshKit
    0x7fffffe00000 - 0x7fffffe01fff libSystem.B.dylib ??? (???) <71E6D4C9-F945-6EC2-998C-D61AD590DAB6> /usr/lib/libSystem.B.dylib
    Model: iMac9,1, BootROM IM91.008D.B08, 2 processors, Intel Core 2 Duo, 2.66 GHz, 4 GB, SMC 1.44f0
    Graphics: NVIDIA GeForce 9400, NVIDIA GeForce 9400, PCI, 256 MB
    Memory Module: global_name
    AirPort: spairportwireless_card_type_airportextreme (0x14E4, 0x8E), Broadcom BCM43xx 1.0 (5.10.131.36.1)
    Bluetooth: Version 2.3.8f7, 2 service, 19 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: WDC WD3200AAJS-40H3A0, 298.09 GB
    Serial ATA Device: HL-DT-ST DVDRW GA11N
    USB Device: Built-in iSight, 0x05ac (Apple Inc.), 0x8502, 0x24400000
    USB Device: Keyboard Hub, 0x05ac (Apple Inc.), 0x1005, 0x24100000
    USB Device: Apple Keyboard, 0x05ac (Apple Inc.), 0x021e, 0x24120000
    USB Device: USB 2.5"-HDD, 0x0930 (Toshiba Corporation), 0x0b03, 0x26400000
    USB Device: IR Receiver, 0x05ac (Apple Inc.), 0x8242, 0x04500000
    USB Device: BRCM2046 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x06100000
    USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8215, 0x06110000

    Hi,
    /Users/natachagraf/Library/ScriptingAdditions/MTWB.osax/Contents/MacOS/MTWB
    Open a Finder window. Select your Home folder in the Sidebar on the left. Now open the Library folder then the ScriptingAdditions Folder.
    Move these files to the Trash. ScriptingAdditions/MTWB.osax/Contents/MacOS/MTWB
    /Users/natachagraf/Library/MTWB/Plugins/FastBrowserSearchPlugin.bundle/Contents/ MacOS/FastBrowserSearchPlugin
    And in the same Library folder move these files to the Trash: MTWB/Plugins/FastBrowserSearchPlugin.bundle/Contents/MacOS/FastBrowserSearchPlug in
    Restart your Mac and launch Safari.
    The FastBrowser add-on is not compatible with recent versions of Safari.
    Carolyn

  • Is there a LabView example in the use of user defined error codes?

    Specifically, I have a VI that tests four arrays of data against various high/low limits. I have pass/fail outputs for 18 tests. I'd like to combine these into an 'error out' cluster with appropriate error codes and messages, for which I've created an x-errors.txt file.
    My first question must be trival - how do I just set the 'status' bit of the error stream to let the general error handler then look up the error desription from the file?
    Secondly - I can't find an example of this in the technical resourses, amI missing something?
    Thanks,
    Mike
    Mike Evans
    TRW Conekt
    N.I. Alliance Member, UK
    http://www.Conekt.net

    There is no example program. There is extensive help on how to do this. Here's the basics.
    1) There are two ways to define user error codes in LV6.1. If you are using LV6.0 or earlier, only one method is possible.
    2) The 6.0 method involves wiring arrays of error codes and arrays of error code strings to the General Error Handler.vi. These codes will be used to explain any error code which is undefined in LV's internal error code database. Error codes reserved for users which are guaranteed not to be used by NI are from 5000 to 9999.
    3) The 6.1 method allows you to create a specially formatted error code file on disk that will be merged with the LV error code database each time LabVIEW launches. For help on this, go to LV's online help, and in t
    he Index tab, type
    "user-defined error codes, in text files"
    (without the quote marks)
    4) If you want to set an error into the error cluster, use the General Error Handler.vi again. Wire your error code value to the Error Code terminal (the leftmost-topmost corner terminal). Wire the name of your VI to the Error Source terminal, and wire "No Dialog" to the Type of Dialog terminal (left-side, near the bottom). The error code cluster that comes out of this VI will either be the error in (if one was set) or a new error code cluster with your error and the status bit set to TRUE.
    5) The attached demo is written in LV6.0.
    Attachments:
    Error_Demo.vi ‏37 KB

  • Beginner Question | The use of modulus in this simple code example.

    Hello everyone,
    I am just beginning to learn Java and have started reading "Java Programming for the absolute beginner". It is quite a old book but seems to be doing the trick, mainly.
    There is a code example which I follow mostly but the use of the modulus operator in the switch condition doesn't make sense to me, why is it used? Could someone shed some light on this for me?
    import java.util.Random;
    public class FortuneTeller {
      public static void main(String args[]) {
        Random randini = new Random();
        int fortuneIndex;
        String day;
        String[] fortunes = { "The world is going to end :-(.",
          "You will have a HORRIBLE day!",
          "You will stub your toe.",
          "You will find a shiny new nickel.",
          "You will talk to someone who has bad breath.",
          "You will get a hug from someone you love.",
          "You will remember that day for the rest of your life!",
          "You will get an unexpected phone call.",
          "Nothing significant will happen.",
          "You will bump into someone you haven't seen in a while.",
          "You will be publicly humiliated.",
          "You will find forty dollars.",
          "The stars will appear in the sky.",
          "The proper authorities will discover your secret.",
          "You will be mistaken for a god by a small country.",
          "You will win the lottery!",
          "You will change your name to \"Bob\" and move to Alaska.",
          "You will discover first hand that Bigfoot is real.",
          "You will succeed at everything you do.",
          "You will learn something new.",
          "Your friends will treat you to lunch.",
          "You will meet someone famous.",
          "You will be very bored.",
          "You will hear your new favorite song.",
          "Tomorrow... is too difficult to predict" };
        System.out.println("\nYou have awakened the Great Randini...");
        fortuneIndex = randini.nextInt(fortunes.length);
        switch (randini.nextInt(7) % 7) {   
          case 0:
            day = "Sunday";
            break;
          case 1:
            day = "Monday";
            break;
          case 2:
            day = "Tuesday";
            break;
          case 3:
            day = "Wednesday";
            break;
          case 4:
            day = "Thursday";
            break;
          case 5:
            day = "Friday";
            break;
          case 6:
            day = "Saturday";
            break;
          default:
            day = "Tomorrow";
        System.out.println("I, the Great Randini, know all!");
        System.out.println("I see that on " + day);
        System.out.println("\n" + fortunes[fortuneIndex]);
        System.out.println("\nNow, I must sleep...");
    }

    randini.nextInt(7) % 7randini.nextInt(7) returns a value in the range 0 <= x < 7, right? (Check the API!) And:
    0 % 7 == 0
    1 % 7 == 1
    2 % 7 == 2
    3 % 7 == 3
    4 % 7 == 4
    5 % 7 == 5
    6 % 7 == 6Looks like superfluous code to me. Maybe originally they wrote:
    randini.nextInt() % 7Note this code has problems, because, for example -1 % 7 == -1

Maybe you are looking for

  • Read Data from "virtual" Cube with different ConsUnit Hier. Version

    Dear all, I got a odd request. I need to load data from the virutal Reporting-Bapi Cube for a certain Data Version. This Version has been attached to a new consUnit Hierachy a few weeks ago. Now we get a request to read data in the past for units whi

  • How to enable user sets from tools in sales order

    Hi, How to enable user sets from tools in sales order..it is greyed out.. and is there anyway we can do to add shipsets from other place? Thanks

  • Install dreamweaver on new computer with original .dmg?

    Hi, I have Dreamweaver CS3 on a computer (Mac, running OSX Tiger) that I will be replacing with an iMac running Snow Leopard. My license is well within the 3 year limit--actually, less than 2 years. But the link on my order history is nonfunctional,

  • Realtime video stream on the cell Phone

    Hi, I have to develop a prototype to show a cell phone handling a CCTV feed 1. I am trying to figure out how easy or difficult it isn The cell phone should be able to display real-time feed coming from a CCTV and provide the cell phone user the abili

  • Why can i NOT copy from my itunes library to my Nano

    I have a Nano that was being ued on my girlfiend's old mac, but we no longer have it. Instead I want to use my computer at work as my itunes library. I have restored & reformatted the Nano to the PC, but it won't allow me to add any of the music from