150 or 300 MB/s?

Just got BT Infinity and all is fine and dandy with a nice stable 35-ish MB/s connection (touch wood).
Thing is, I have all 54G wireless cards in my PC and laptops (which effectively limit wireless connection to about 18 MB/s), and was thinking of installing 802.11n cards. With a Home Hub 3, is it worth going for 300 MB/s cards, or will 150 MB/s cards be sufficient?
I don't want to spend too much on my old PC and laptops, as they may be replaced in the not too distant future.
Solved!
Go to Solution.

I would imagine the 150MB/s card would be fine because depending on what setting you have on the home hub it limits the wireless throughput to 130mb. I mean if you were to get all your devices on an N card then you could change a setting on the hb to 40Hz N wireless which increases the speed at longer distances and also increases the cap of 130MB/s to 300Mb/s so all the devices would have more bandwidth to share.
Regards Edd
Check your Line
BT Speedtester

Similar Messages

  • Sata 150 or 300

    I have a PowerMac G5 Dual 2ghz, does it make any difference whether you use a SATA 150 or 300 hard drive in this Mac? Does the controller care, or are their compatability and performance issues with going to a 300 if the controller is only 150. I am assuming that the Controller in this model is only a 150 Correct?
    thanks for any feedback..
    NOrm

    Hatter...
    Pondering Seagate, however have noted in reading around since posting that the 7200.10 drives have write issues with the controller in my Mac, if I read it correctly. Do you know if there are issues with 7200.9 and what performance gains do you get with 16mb cache as opposed to the 8mb cache on a drive?
    Also, you mention the Raptor, that is WD correct? Is there a Raptor that is a good performer that does not require a 3rd party controller?
    If you have a recommendation, looking for 250-320gb drive, for more storage and some extra performance as well of course.
    thanks Norm

  • Serial ATA 150 or 300

    According to tech spec of new iMac configuration(s) with Core 2 Duo CPU, as the storage is mentioned Serial ATA 7200-rpm hard drive.
    What I'd like to know is:
    does new iMac configurations support both Serial ATA 150 and 300 standards, or just Serial ATA 300?

    Hello,
    According to their sales page (when you configure the system and click more information on the hard drives), it says "All iMac models include standard 3.5-inch Serial ATA hard drives with data transfers up to 150 megabytes per second".
    So, that would mean that you would only see performance comparable to SATA-150 no matter which drive you use. So, if you use a drive rated at SATA-300, then it would just run at the lower SATA-150 rate when connected to the iMac.
    I hope this helps.
    Let us know if you have other questions.
    P.S., if you'd like, go ahead and click the "Helpful" or "Solved" buttons on any of the posts / replies above if you feel they were helpful or adequately answered your question.

  • Sata 150 or Sata 300

    My hard drive failed yesterday and I bought a new sata drive. Needless to say the drive is a Sata 300 drive that has a jumper to put the drive to a sata 150. My questions are.
    1. does the iMac's motherboard automaticly switch the drive from 150 to 300 without a jumper ever being needed?
    2. Which sata interface does the iMac use?
    Needless to say by the time some one answers this question I will have it figured out. I noticed this topic hasn't been discussed and could be helpful. I will update when I get the process complete and figured out.

    After installing leapord everything has gone smooth. I have removed the jumper on the back of the drive that tells the system wether or not it is a Sata 150 or 300 drive.
    Here is the info from disk utility
    Name : ST3500320AS Media
    Type : Disk
    Partition Map Scheme : GUID Partition Table
    Disk Identifier : disk0
    Media Name : ST3500320AS Media
    Media Type : Generic
    Connection Bus : Serial ATA 2
    Device Tree : /PCI0@0/SATA@1F,2/PRT2@2/PMP@0/@0:0
    Writable : Yes
    Ejectable : No
    Mac OS 9 Drivers Installed : No
    Location : Internal
    Total Capacity : 465.8 GB (500,107,862,016 Bytes)
    S.M.A.R.T. Status : Verified
    Disk Number : 0
    Partition Number : 0
    from what I gather the mid 2006 iMac's do Sata 300 (Sata 2) so if you buy a new drive make sure to check for jumpers on the back of the drive. If you find a jumper remove it as the Mac I have stated can do Sata 300 (Sata 2).

  • Print image file with at least 150 DPI

    Happy NI Week everyone!  I couldn't make it this year, but I am working to encourage the pruchase of lots of NI hardware.
    We know about printing the front panel of a VI as a quick and somewhat dirty way to generate a report.  I know DIAdem would be the superior solution here, but I wonder if there's a middle ground.  Recently, a customer requested some minor changes to an application and one of the requests was to "clean up" the way their logo looks on a printout.  They supplied us with a high resolution version of their logo, and we tried converting it to various formats before pasting it on the front panel, but the printout seems to always be rather blocky and low resolution looking.  My thought is that the front panel is rendered at 72 DPI (dots-per-inch) and the data sent to the printer is at that resolution.  I know we can save an image of a front panel.  So what I would like to do is make an oversized front panel, save it as an image file, and print that image file at 150 or 300 DPI.
    So the question is:  How do I print an image file at a different DPI than what it was originally saved with?  What is a good method to print image files for that matter?
    Thanks,
    Dan Press
    PrimeTest Automation

    Hi Photon Dan,
    Here is a possible solution. It requires some photo editing. You could take a normal screen shot of your front panel and then import it into a photo editor such as IrfanView. From that point you could resize the image and make it very large. This will make the image quality very poor. At this point you could import the high resolution image from your client and paste it over the poor quality image in the screen shot. Then resize it back to its normal size. You should then be able to select what DPI you would like to print it at and will have a high quality logo. Lots of photo editing but it could give you what you want. 
    Regards, 
    Josh Brown
    Applications Engineer
    National Instruments

  • Entering numbers in point.i.e 300.05

    I have an number field i.e quantity.
    it always take an value in kgs like 1000,150,99,300 etc.
    if I want to enter value like 300 kg and 50 grams how would I do that?
    because if i enter 300.05 ,it round it to nearest value i.e 300.

    Hi
    Can you explain where do you get the rounded values when you enter a value with decimals? Do you mean when you leave this field the value is automatically rounded? Or is it saved in the table as rounded? As far as I know Apex, it does not do this automatically. If it is rounding value when you leave the field, it means there is some JavaScript /Dynamic Action which is doing this. If it is saved as rounded value in the table, the Column in the Table may not be allowing decimal values. E.g. It may be Number(10) instead of Number(10,2).
    Zulqarnain
    MaxApex Hosting
    http://www.maxapex.com

  • CPU 300% since Yosemite update iPhoto 9.6

    never had any issues w/ iPhoto on Maverick, but since Yosemite and the "patch" for iPhoto 9.6 my CPU is going crazy... between 150% to 300%
    i have no problems w/ Aperture 3.6 using the SAME "Photo Library.photolibrary"
    i delete iPhoto from my Applications and re downloaded it... SAME problem
    any ideas ?
    Thx
    Denis

    Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete the contents the following folder:
    User/Library/Containers/com.apple.iPhoto
    3 - reboot, launch iPhoto and try again.
    NOTE: For Mavericks and Yosemite,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    where you can check the Show Library Folder checkbox.

  • Calculating and displaying the Length of the side of a triangle

    Hi everyone. I am currently working on Dragging and Stretching a triangle on screen. Ive got it working to a certain extent but the only problem is that whenever I go to the point from which i have to drag my triangle i.e. the Left hand Corner of the BAse at exactly 300,300 it redraws a new triangle below the existing one and then when i stretch it from the top and the right it leaves a trail of triangles everytime. But when i resize my window it clears the trail only to start agian when I drag or stretch it...
    All my code for wahtever I have done is displayed below. I would appreciate all the help that any one can offer.
    Secondly , as I stretch my triangle I would like to calculate My Length of the hypotenuse and the other 2 sides as they change and display it in System.out.println for now...
    PLEASE HELP
    the code is
    This is my Main Form --- Interactive Geometry.java
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import javax.swing.JFrame;
    * InteractiveGeometry.java
    * Created on 30 November 2004, 20:29
    * @author  Kripa Bhojwani
    public class InteractiveGeometry extends javax.swing.JFrame {
        public EastPanel eastpanel;
        public Container container;
        public GeomPanel gp;
        public boolean pressed = false;
        public boolean pressT = false;
        public boolean pressR = false;
        /** Creates new form InteractiveGeometry */
        public InteractiveGeometry() {
            initComponents();
            eastpanel = new EastPanel();
            container = new Container();
            Model model = new Model(300,150,450,300,300,300);
            gp = new GeomPanel(model);
            container = getContentPane();
            container.add(eastpanel,BorderLayout.EAST);
            container.add(gp,BorderLayout.CENTER);
            setSize(1400,9950);
            gp.addMouseMotionListener(
            new MouseMotionListener() { //anonymous inner class
                //handle mouse drag event
                public void mouseDragged(MouseEvent me) {
                    setTitle("Dragging: x=" + me.getX() + "; y=" + me.getY());
                public void mouseMoved(MouseEvent me) {
                    setTitle("Moving: x=" + me.getX() + "; y=" + me.getY());
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jMenuBar2 = new javax.swing.JMenuBar();
            jMenu2 = new javax.swing.JMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            jMenu1 = new javax.swing.JMenu();
            jMenuItem2 = new javax.swing.JMenuItem();
            addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                public void mouseDragged(java.awt.event.MouseEvent evt) {
                    formMouseDragged(evt);
                public void mouseMoved(java.awt.event.MouseEvent evt) {
                    formMouseMoved(evt);
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jMenuBar2.setBackground(new java.awt.Color(0, 102, 204));
            jMenu2.setBackground(new java.awt.Color(222, 222, 238));
            jMenu2.setText("File");
            jMenu2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenu2ActionPerformed(evt);
            jMenuItem1.setBackground(new java.awt.Color(204, 255, 255));
            jMenuItem1.setText("Exit");
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
            jMenu2.add(jMenuItem1);
            jMenuBar2.add(jMenu2);
            jMenu1.setBackground(new java.awt.Color(199, 215, 255));
            jMenu1.setText("Theorem ");
            jMenuItem2.setText("Pythagoras Theorem");
            jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem2ActionPerformed(evt);
            jMenu1.add(jMenuItem2);
            jMenuBar2.add(jMenu1);
            setJMenuBar(jMenuBar2);
            pack();
        private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:
        private void formMouseDragged(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
        private void formMouseMoved(java.awt.event.MouseEvent evt) {
            // TODO add your handling code here:
        public void mouseDragged(MouseEvent me) {
            setTitle("Dragging: x=" + me.getX() + "; y=" + me.getY());
        private void jMenu2ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:
            System.exit(0);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            InteractiveGeometry ig = new InteractiveGeometry();
            ig.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            ig.show();
            // new InteractiveGeometry().show();
        // Variables declaration - do not modify
        private javax.swing.JMenu jMenu1;
        private javax.swing.JMenu jMenu2;
        private javax.swing.JMenuBar jMenuBar2;
        private javax.swing.JMenuItem jMenuItem1;
        private javax.swing.JMenuItem jMenuItem2;
        // End of variables declaration
    This is my Panel -- GeomPanel.java which draws everything -- /*
    * GeomPanel.java
    * Created on 30 November 2004, 20:29
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.Graphics.*;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.Line2D;
    import java.awt.geom.Point2D;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.awt.geom.Ellipse2D;
    import javax.swing.event.TableModelListener;
    import javax.swing.JScrollPane;
    import javax.swing.event.*;
    import java.awt.Dimension;
    import java.awt.Container.*;
    * @author Kripa Bhojwani
    public class GeomPanel extends javax.swing.JPanel implements Observer, MouseMotionListener, MouseListener {
    private Model model;
    private boolean pressed = false;
    private boolean pressT = false;
    private boolean pressR = false;
    /** Creates new form GeomPanel */
    public GeomPanel(Model model) {
    this.model = model;
    model.addObserver(this);
    addMouseListener(this);
    addMouseMotionListener(this);
    initComponents();
    setBackground(Color.getHSBColor(6,600,660));
    public void paintComponent(Graphics gfx) {
    Graphics2D g = (Graphics2D) gfx;
    Point tc = model.getTop();
    Point lc = model.getLeft();
    Point rc = model.getRight();
    Point2D.Double p1 = new Point2D.Double(tc.getX(),tc.getY());
    Point2D.Double p2 = new Point2D.Double(lc.getX(),lc.getY());
    Point2D.Double p3 = new Point2D.Double(rc.getX(),rc.getY());
    Line2D.Double line = new Line2D.Double(p1, p2);
    Line2D.Double line1 = new Line2D.Double(p2, p3);
    Line2D.Double line2 = new Line2D.Double(p1, p3);
    g.setColor(Color.BLACK);
    g.draw(line);
    g.draw(line2);
    g.draw(line1);
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    setLayout(new java.awt.BorderLayout());
    addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
    public void mouseDragged(java.awt.event.MouseEvent evt) {
    formMouseDragged(evt);
    private void formMouseDragged(java.awt.event.MouseEvent evt) {
    // TODO add your handling code here:
    public void mouseClicked(MouseEvent e) {
    public void mouseDragged(MouseEvent e) {
    System.out.println("Dragged at "+ e.getX()+ "," + e.getY());
    if(pressed == true){
    model.setLeft(e.getX() , e.getY());
    else if(pressT == true){
    model.setTop(e.getX() , e.getY());
    else if (pressR == true){
    model.setRight(e.getX(), e.getY());
    else{
    pressed = false;
    pressT= false;
    pressR=false;
    repaint();
    public void mouseEntered(MouseEvent e) {
    public void mouseExited(MouseEvent e) {
    public void mouseMoved(MouseEvent e) {
    System.out.println("Mouse at " + e.getX() +"," + e.getY());
    public void mousePressed(MouseEvent e) {
    if (model.getLeft().getX()== e.getX() && model.getLeft().getY()== e.getY()){
    pressed = true;
    else if (model.getTop().getX()==e.getX() && model.getTop().getY()==e.getY()){
    pressT = true;
    else if(model.getRight().getX() == e.getX() && model.getRight().getY()==e.getY()){
    pressR = true;
    // else if(model.getCircle().getX() == e.getX() && model.getCircle().getY() == e.getY()){
    // inoval = true;
    else {
    pressed =false;
    pressT = false;
    pressR = false;
    } repaint();
    public void mouseReleased(MouseEvent e) {
    if(pressed == true){
    model.setLeft(e.getX(),e.getY());
    else if (pressT ==true ){
    model.setTop(e.getX(), e.getY());
    else if(pressR ==true){
    model.setRight(e.getX(),e.getY());
    else {
    pressed = false;
    pressT = false;
    pressR = false;
    repaint();
    public void update(Observable o, Object arg) {
    repaint();
    // Variables declaration - do not modify
    // End of variables declaration
    This is my Model class called Model.java which Holds all teh data for my triangle
    import java.awt.Point;
    import java.util.Observable;
    * Model.java
    * Created on 05 December 2004, 14:11
    * @author  Kripa Bhojwani
    public class Model extends Observable{
        private int  x1,x2,x3, y1,y2,y3;
        private int _transx;
        private int _transy;
        private int _c;
        private int _d;
        /** Creates a new instance of Model */
        public Model(int x1, int y1, int x2, int y2, int x3, int y3) {
            this.x1 = x1;
            this.y1 = y1;
            this.x2 = x2;
            this.y2 = y2;
            this.x3 = x3;
            this.y3 = y3;
            setChanged();
            notifyObservers();
        public void setTop(int x1, int y1){
            //this.x1 =x1;
            this.y1= y1;
            setChanged();
            notifyObservers();
        public void setRight(int x2, int y2){
            this.x2 = x2;
            // this.y2 =y2;
            setChanged();
            notifyObservers();
        public void setLeft(int x3, int y3){
            _transx = x3 - this.x3;
            _transy = y3 - this.y3;
            this.x3 += _transx;
            this.y3 += _transy;
            this.y2 += _transy;
            this.x2 += _transx;
            this.x1 += _transx;
            this.y1 += _transy;
            setChanged();
            notifyObservers();
        public Point getTop(){
            Point p = new Point(x1,y1);
            return p;
        public Point getRight(){
            Point p1 = new Point(x2,y2);
            return p1;
        public Point getLeft(){
            Point p3 = new Point(x3,y3);
            return p3;
        public void update() {
            setChanged();
            notifyObservers();
    This is my TableModel which is the JTable to display all the Cordinates and Lengths and other Measurements like angles etc./*
    * TableModel.java
    * Created on 03 December 2004, 15:08
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Observer;
    import javax.swing.event.TableModelEvent;
    import javax.swing.table.AbstractTableModel;
    * @author Kripa Bhojwani
    public class TableModel extends AbstractTableModel implements Observer{
    private String[] columnNames = {"Point", "X Coordinate", "Y Coordinate"};
    private Object[][] data = {};
    private int rowCount;
    private int columnCount;
    /** Creates a new instance of TableModel */
    public TableModel() {
    rowCount = 0;
    columnCount = 3;
    public int getColumnCount() {
    return columnCount;
    public int getRowCount() {
    return rowCount;
    public String getColumnName(int col) {
    return columnNames[col];
    public void setColumnName (String[] name){
    columnNames = name;
    public void setValueAt(Object obj, int row, int col) {
    data[row][col] = obj;
    fireTableCellUpdated(row, col);
    TableModelEvent tme = new TableModelEvent(this);
    fireTableChanged(tme);
    public Object getValueAt(int row, int col) {
    return data[row][col];
    public void update(java.util.Observable o, Object arg) {
    This is the Panel on the east side of My Main application form which will display all the measurements and Cordinates ---EastPanel.java
    import java.awt.BorderLayout;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.TableModelListener;
    import java.awt.Dimension;
    * EastPanel.java
    * Created on 04 December 2004, 23:07
    * @author  Kripa Bhojwani
    public class EastPanel extends javax.swing.JPanel implements TableModelListener{
        private TableModel tm;
        /** Creates new form EastPanel */
        public EastPanel() {   
          initComponents();
            tm = new TableModel();
            JTable table1 = new JTable(tm);
            table1.setPreferredScrollableViewportSize(new Dimension(250,264));
            table1.getModel().addTableModelListener(this);
            JScrollPane sp = new JScrollPane(table1);
            add(sp,BorderLayout.EAST);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            setLayout(new java.awt.BorderLayout());
        public void tableChanged(javax.swing.event.TableModelEvent e) {
        // Variables declaration - do not modify
        // End of variables declaration
    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.text.NumberFormat;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.DefaultTableCellRenderer;
    public class G
    public G()
    TriangleModel tri = new
    ri = new TriangleModel(175,100,175,250,325,250);
    TriangleView view = new TriangleView(tri);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(view.getUIPanel(),
    Panel(), "North");
    f.getContentPane().add(view);
    f.getContentPane().add(view.getTablePanel(),
    Panel(), "South");
    f.setSize(500,500);
    f.setLocation(200,200);
    f.setVisible(true);
    public static void main(String[] args)
    new G();
    class TriangleModel // (x1,
    y1)
    {                                         //      |\
    static final int SIDES = 3; // | \
    private int cx, cy; // |
    | \
    Polygon triangle; // |_
    |_ _\ (x3, y3)
    int selectedIndex; // (x2,
    (x2, y2)
    NumberFormat nf;
    Line2D[] medians;
    Point2D centroid;
    public TriangleModel(int x1, int y1, int x2, int
    int y2, int x3, int y3)
    int[] x = new int[] { x1, x2, x3 };
    int[] y = new int[] { y1, y2, y3 };
    triangle = new Polygon(x, y, SIDES);
    nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(1);
    public boolean contains(Point p)
    // Polygon.contains doesn't work well enough
    return (new Area(triangle)).contains(p);
    public boolean isLineSelected(Rectangle r)
    Line2D line = new Line2D.Double();
    for(int j = 0; j < SIDES; j++)
    int[] x = triangle.xpoints;
    int[] y = triangle.ypoints;
    int x1 = x[j];
    int y1 = y[j];
    int x2 = x[(j + 1) % SIDES];
    int y2 = y[(j + 1) % SIDES];
    line.setLine(x1, y1, x2, y2);
    if(line.intersects(r))
    selectedIndex = j;
    return true;
    selectedIndex = -1;
    return false;
    * Only works for right triangle with right angle
    angle at (x2, y2)
    public void moveSide(int dx, int dy, Point p)
    int[] x = triangle.xpoints;
    int[] y = triangle.ypoints;
    switch(selectedIndex)
    case 0:
    x[0] += dx;
    x[1] += dx;
    break;
    case 1:
    y[1] += dy;
    y[2] += dy;
    break;
    case 2:
    double rise = y[2] - y[0];
    double run = x[2] - x[0];
    double slope = rise/run;
    // rise / run == (y[2] - p.y) / (x[2]
    ] - p.y) / (x[2] - p.x)
    x[2] = p.x + (int)((y[2] - p.y) /
    )((y[2] - p.y) / slope);
    // rise / run == (p.y - y[0]) / (p.x
    y - y[0]) / (p.x - x[0])
    y[0] = p.y - (int)((p.x - x[0]) *
    )((p.x - x[0]) * slope);
    public void translate(int dx, int dy)
    triangle.translate(dx, dy);
    public Polygon getTriangle()
    return triangle;
    public String findCentroid()
    int[] x = triangle.xpoints;
    int[] y = triangle.ypoints;
    // construct the medians defined as the line
    the line from
    // any vertex to the midpoint of the opposite
    opposite line
    medians = new Line2D[x.length];
    for(int j = 0; j < x.length; j++)
    int next = (j + 1) % x.length;
    int last = (j + 2) % x.length;
    Point2D vertex = new Point2D.Double(x[j],
    Double(x[j], y[j]);
    // get midpoint of line opposite vertex
    double dx = ((double)x[last] -
    le)x[last] - x[next])/2;
    double dy = ((double)y[last] -
    le)y[last] - y[next])/2;
    Point2D oppLineCenter = new
    Center = new Point2D.Double(x[next] + dx,
    y[next]
    y[next] + dy);
    medians[j] = new Line2D.Double(vertex,
    uble(vertex, oppLineCenter);
    // centroid is located on any median 2/3 the
    2/3 the way from the
    // vertex (P1) to the midpoint (P2) on the
    ) on the opposite side
    double[] lengths = getSideLengths();
    double dx = (medians[0].getX2() -
    etX2() - medians[0].getX1())*2/3;
    double dy = (medians[0].getY2() -
    etY2() - medians[0].getY1())*2/3;
    double px = medians[0].getX1() + dx;
    double py = medians[0].getY1() + dy;
    //System.out.println("px = " + nf.format(px)
    rmat(px) +
    // "\tpy = " +
    py = " + nf.format(py));
    centroid = new Point2D.Double(px, py);
    return "(" + nf.format(px) + ", " +
    ", " + nf.format(py) + ")";
    public String[] getAngles()
    double[] lengths = getSideLengths();
    String[] vertices = new
    es = new String[lengths.length];
    for(int j = 0; j < lengths.length; j++)
    int opp = (j + 1) % lengths.length;
    int last = (j + 2) % lengths.length;
    double top = lengths[j] * lengths[j] +
    lengths[last] *
    lengths[last] * lengths[last] -
    lengths[opp] *
    lengths[opp] * lengths[opp];
    double divisor = 2 * lengths[j] *
    lengths[j] * lengths[last];
    double vertex = Math.acos(top /
    h.acos(top / divisor);
    vertices[j] =
    ertices[j] = nf.format(Math.toDegrees(vertex));
    return vertices;
    public String[] getLengths()
    double[] lengths = getSideLengths();
    String[] lengthStrs = new
    rs = new String[lengths.length];
    for(int j = 0; j < lengthStrs.length; j++)
    lengthStrs[j] = nf.format(lengths[j]);
    return lengthStrs;
    public String[] getSquares()
    double[] lengths = getSideLengths();
    String[] squareStrs = new
    rs = new String[lengths.length];
    for(int j = 0; j < squareStrs.length; j++)
    squareStrs[j] = nf.format(lengths[j] *
    lengths[j] * lengths[j]);
    return squareStrs;
    private double[] getSideLengths()
    int[] x = triangle.xpoints;
    int[] y = triangle.ypoints;
    double[] lengths = new double[SIDES];
    for(int j = 0; j < SIDES; j++)
    int next = (j + 1) % SIDES;
    lengths[j] = Point.distance(x[j], y[j],
    (x[j], y[j], x[next], y[next]);
    return lengths;
    class TriangleView extends JPanel
    private TriangleModel model;
    private Polygon triangle;
    private JTable table;
    private JLabel centroidLabel;
    private boolean showConstruction;
    TriangleControl control;
    public TriangleView(TriangleModel model)
    this.model = model;
    triangle = model.getTriangle();
    showConstruction = false;
    control = new TriangleControl(this);
    addMouseListener(control);
    addMouseMotionListener(control);
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    g2.draw(triangle);
    if(model.medians == null)
    centroidLabel.setText("centroid location:
    id location: " + model.findCentroid());
    // draw medians and centroid point
    if(showConstruction && !control.dragging)
    g2.setPaint(Color.red);
    for(int j = 0; j < 3; j++)
    g2.draw(model.medians[j]);
    g2.setPaint(Color.blue);
    g2.fill(new
    g2.fill(new Ellipse2D.Double(model.centroid.getX() -
    2,
    model.centroid.getY()
    model.centroid.getY() - 2, 4, 4));
    public TriangleModel getModel()
    return model;
    public JTable getTable()
    return table;
    public JLabel getCentroidLabel()
    return centroidLabel;
    public JPanel getUIPanel()
    JCheckBox showCon = new JCheckBox("show
    ox("show construction");
    showCon.addActionListener(new
    ener(new ActionListener()
    public void actionPerformed(ActionEvent
    (ActionEvent e)
    boolean state =
    boolean state =
    ((JCheckBox)e.getSource()).isSelected();
    showConstruction = state;
    repaint();
    JPanel panel = new JPanel();
    panel.add(showCon);
    return panel;
    public JPanel getTablePanel()
    String[] headers = new String[] { "", "", "",
    // row and column data labels
    String[] rowHeaders = {
    "sides", "lengths", "squares", "angles",
    ", "angles", "degrees"
    String[] sidesRow = { "vertical",
    rtical", "horizontal", "hypotenuse" };
    String[] anglesRow = { "hyp to ver", "ver to
    "ver to hor", "hor to hyp" };
    // collect data from model
    String[] angles = model.getAngles();
    String[] lengths = model.getLengths();
    String[] squares = model.getSquares();
    String[][] allData = { sidesRow, lengths,
    lengths, squares, anglesRow, angles };
    int rows = 5;
    int cols = 4;
    Object[][] data = new Object[rows][cols];
    for(int row = 0; row < rows; row++)
    data[row][0] = rowHeaders[row];
    for(int col = 1; col < cols; col++)
    data[row][col] = allData[row][col -
    lData[row][col - 1];
    table = new JTable(data, headers)
    public boolean isCellEditable(int row,
    ble(int row, int col)
    return false;
    DefaultTableCellRenderer renderer =
    (DefaultTableCellRenderer)table.getDefaultRenderer(St
    ring.class);
    renderer.setHorizontalAlignment(JLabel.CENTER);
    centroidLabel = new JLabel("centroid
    centroid location: ", JLabel.CENTER);
    Dimension d =
    sion d = centroidLabel.getPreferredSize();
    d.height = table.getRowHeight();
    centroidLabel.setPreferredSize(d);
    JPanel panel = new JPanel(new
    anel(new BorderLayout());
    panel.setBorder(BorderFactory.createTitledBorder("tri
    angle data"));
    panel.add(table);
    panel.add(centroidLabel, "South");
    return panel;
    class TriangleControl extends MouseInputAdapter
    TriangleView view;
    TriangleModel model;
    Point start;
    boolean dragging, altering;
    Rectangle lineLens; // used for line
    line selection
    public TriangleControl(TriangleView tv)
    view = tv;
    model = view.getModel();
    dragging = altering = false;
    lineLens = new Rectangle(0, 0, 6, 6);
    public void mousePressed(MouseEvent e)
    Point p = e.getPoint();
    lineLens.setLocation(p.x - 3, p.y - 3);
    // are we over a line
    if(model.isLineSelected(lineLens))
    start = p;
    altering = true;
    // or are we within the triangle
    else if(model.contains(p))
    start = p;
    dragging = true;
    public void mouseReleased(MouseEvent e)
    altering = false;
    dragging = false;
    view.getCentroidLabel().setText("centroid
    centroid location: " +
    model.findCentroid());
    view.repaint(); // for the construction
    truction lines
    public void mouseDragged(MouseEvent e)
    Point p = e.getPoint();
    if(altering)
    int x = p.x - start.x;
    int y = p.y - start.y;
    model.moveSide(x, y, p);
    updateTable();
    view.repaint();
    start = p;
    else if(dragging)
    int x = p.x - start.x;
    int y = p.y - start.y;
    model.translate(x, y);
    view.repaint();
    start = p;
    private void updateTable()
    String[] lengths = model.getLengths();
    String[] squares = model.getSquares();
    String[] angles = model.getAngles();
    JTable table = view.getTable();
    for(int j = 0; j < angles.length; j++)
    table.setValueAt(lengths[j], 1, j + 1);
    table.setValueAt(squares[j], 2, j + 1);
    table.setValueAt(angles[j], 4, j + 1);
    view.getCentroidLabel().setText("centroid
    centroid location: " +
    model.findCentroid());
    Hey sorry mate.. ive got a nother problem.
    I need to add loads of theorems to this tool. so i need a JMenu Bar called File with all the normal things. then another Menu called Theorems where i can have a list of JMenuItems with the theorem names --- Like when they click on Pythagoras Theorem it opens up all the triangle and the traingle data that u helped me with.
    The thing is im using netbeans and in netbeans i can do it coz its there and all you got to do is put the components together.
    Please Help
    Thanks...
    Sharan

  • Can I print photos at different resolutions in one PS5 file?

    I am printing photos on fabric. I'd like compare one printed at 300dpi and the same photo at 150 dpi. I was going to set them  side by side on a piece of fabric and realized I had to specify the resolution of the file I'm placing them in. Can I have two files at different resolution in one file? If the new file is of 300dpi resolution how does this affect the image at 150dpi? Thanks!
    Mary

    Hello again,
    thanks so much for helping a newbie sort things out. I'm still confused. I  know that a higher resolution like 300dpi, has more dots per inch and has the potential to give me more detail in print than a lower dpi.
    If I crop a raw file as an 18" square-  I will make it either 150 or 300 dpi.  I'm trying to place two images ( the same images) side by side in a photoshop file to compare the results when they print- (I'm printing with an online vendor). Can I do that? that is, place a 150 dpi image next to a 300 dpi image in one PS file, identified ast  300dpi ? What are the print results? Will both images look the same, or will the 150 dpi be converted to 300 and I won't see any difference anyway?
    Or, do I need to set up two separate files-one at 150 and one at 300, and print them separately, to compare them?
    Can you help me understand this? Thanks!

  • What is the best way to import a graphic? & How do I create a text frame for a figure caption?

    Hello all! I've been working from the FM book for almost 2 hrs trying to figure this out, so now I need your help. I am almost to this point:
    Problem I: Importing a graphic
    First of all, which is the best way?
    -Insert an anchor frame and then import the graphic into the frame OR
    -Just insert the graphic and get the anchor frame by default
    Here’s my importing and sizing problem:
    I hit ENTER to make a new paragraph line (side note: the book says make a new paragraph by hitting ENTER, import the graphic, and then ESC m+p to shrink wrap so that you can avoid the graphic overlapping the above text. I do exactly this (I believe), but my graphic still overlaps the above text when I shrink wrap. What the...?)
    I insert an anchored frame with position Below Current Line and alignment CENTER (I chose to the insert anchor frame, since this way I have control over its alignment, correct?)
    Anchor frame is selected when I import my image file
    In the Imported Graphic Scaling box, what do I select if my file is HUGE (3072x2304)?
    -Fit in selected rectangle (when I choose this the image imports small and fits in the anchored frame with lots of white space around it)
    -72 dpi
    -75 dpi
    -150 dpi
    -300 dpi
    -Custom dpi: 96 (I’ve tried changing this to a smaller number (20) and I get a message that says “cannot handle a bitmap of that size.”)
    I’ve had the best luck with selecting FIT IN SELECTED RECTANGLE, and then I just scale the image with my shift+click. If I choose 72 dpi or Custom, my image imports HUGE, and I just can’t manage it. I don’t have a method for resizing these images outside of FM.
    Problem II: Creating a text frame for a caption
    Once I have chosen FIT IN SELECTED RECTANGLE, I try to insert a text box underneath the image (and inside the anchor frame) to type a caption in it.
    In Create New Text Frame box, the default is Number 1 and Gap 0.25. I click SET.
    Next, I double-click inside the text frame to begin typing, but the cursor is OUTSIDE and UNDERNEATH the text frame! What the heck??? I’ve done this before and it has worked just fine. Then I had another problem where when I did get the text inside the text frame, I would select the text frame to move it, and it left the text behind! (I moved the frame but the text was separated from it and left behind.)
    THANK YOU in advance for your help. I hope I wrote this out clearly enough. I appreciate those who respond. P.S. I'm in FM 10.

    My favorite method is to use a one-cell table for graphics and captions.
    Import the graphic by reference into the table cell. Create a "Caption"
    paragraph tag and assign it to the table title. (The title can be set
    for above or below the table cell. I prefer below.) Now, whenever you
    insert this table, it will be ready for graphic and caption. Another
    advantage of this method is that graphic and caption always stay
    together at page/column breaks.
    When you create the table format above, assign it to have a -2.0 space
    above. Then, create a paragraph tag, such as "TableAnchor" and assign it
    -2.0 pt font size and -2.0 space below. (You can substitute a different
    point size, but it must be the same in all three places. The TableAnchor
    paragraph will hold the table and these settings let tables fit against
    the top margin where necessary. Otherwise, they dip down a bit.
    I wrote this from memory, so I hope I remembered all the steps!

  • Last Straw

    I am so frustrated and it is unnecessary stress.
    I could write 5-6 pages (easy) and already wrote to another executive who promised I would be “happy.”
    In the past 3-4 months I have spent 12+ hours on the phone with Verizon, hooking up equipment, spending money and waiting on hold.
    Here is a brief summary of the issues because I do not have the time to once again repeat the story.
    Tower was adjusted…
    In my area a tower was realigned. That mean we have basically no service in my home. It took us almost 2 months to discover this fact. I was told we needed new phones or to buy a booster. Finally someone came to our area and verified what I just shared with you.
    Keep in mind for over 2 months – close to three – our phones were useless. I had to get a landline installed and I missed many important calls. Often I would have to drive up the street to complete a business call. It is not always easy to “call back” when it is a group business call. We missed a critical call from my daughter (who was in an accident) and before we got the landline we once had to call the police - - and could not reach them.
    Extra note – last week I was told verbatim, “we do not adjust towers”  >> I said to the CSR – do you think I am lying? He said, “well do not adjust towers.” 
    I was not happy!
    Because Verizon moved the tower, I had to buy the booster – which was $150. Then my home network could not support it – so I had to buy a new router from Comcast – which was about another $150.
    $300 – plus many hours of call to be able to use Verizon (again - - sometimes).
    The executive I mentioned above stated someone would reach out to me about a credit for the 2-3 months we could not use the phone. I think all these calls are in your CRM.
    I have called 5-7+ (?) times – and each time – was told someone would call back. To date – no one has. PLUS I was even told by one CSR “I only had 2 dropped calls since December 20th (this was last week).
    She said Verizon would not approve of any credit. I asked to speak to a supervisor and I was told it really will not help – I would not get a credit.
    So – I was called a liar by one CSR and by another was told I am due nothing – even though it is all over my records.
    This had been going on for months and the booster really does not work well – but I suspect it is still on the old wireless home network - - with the new Comcast router we now have two.
    Just as my contract was to expire I called and explained this whole story AGAIN. I said I bought a booster that is really not working and I should return it. Now I said I have been waiting 7-8 weeks for a call about my credit. I was told I could not return the booster because I went past the return period. That makes sense – but what bothered me was the CSR said “you should have know better” meaning that just because no one from Verizon called me back to fix the booster NOR to discuss the credit I still should have returned the booster immediately.
    As you can tell I want to be a good customer – but things are not looking so good at this point.
    Finally on Wednesday I was in the parking lot of ATT wireless in Marlton NJ. I could get FIVE lines for the price I am paying for 3 with you and get 10GB. My contract with Verizon was ending!
    However, the CSR I called was great. She was professional and explained options to get 10GB and get a new galaxy. I was told it was @ $25 / month and after much discussion – including a call back the following day – the day of my contract renewal, I decided to stick it out.
    Yesterday I was waiting for my new phone to be delivered.
    Then today.
    So I just called (about 3:30pm et 2/28) and found out my card was declined for $79. I told the CSR (who was very nice by the way if you are checking records) and she said there was upfront financing.
    This was not disclosed! Why would I pay $79 up front – when I could get the whole phone for $199?
    Here is the summary:
    I believe I am due a credit of 2-3 months of service
    I need someone to make sure I am on the right home wireless network (as I typing this my wife had a dropped call)
    I need to speak with someone about cancelling the order for $79 then $25 / month and just get a $199 phone.
    I am so exhausted by this process. The funny thing is I want to add 2 more lines. Had I gone with ATT, I would have 5 new phone and 5 lines for less than I am spending with Verizon. Their promotions (current) prove that math to be correct.
    What is the next and final step to get this resolved?
    (removed)
    PS – I am a normal – business guy who is fairly patient. I actually operated a call center where I had 500 CSRs (see I know the lingo - - CSR / CRM) but I can tell you – something has happened in the past year at Verizon. Some CSR’s are great, but the overall score for professionalism has dropped.  I even chose not to share above a call that was so bad I actually taped in… I told the CSR what she was telling me was not the correct and helped her understand your monthly billing. She offered me 10 lines – 10GB for $100 per month total! - - NO OTHER FEES (and I have it on tape) – I explained to her she was forgetting about the month access and I actually had to convince her I was right.
    HELP!!!
    >>Personal information removed to comply with the Verizon Wireless Terms of Service<<
    Message was edited by: Verizon Moderator

    With your line length, it is unlikely that changing to another supplier will make any difference, especially with the line in its current condition. Any alternative supplier will "talk up" the possible speed on your line to get the business. Once they have got you they may not show any real interest in your problems!
    What is significant in your post is that you mention "Listening to the dial tone on our phone during these times, you can hear an exceptional amount of crackling and popping".  In effect, you have solved your own problem.
    The audible noise and high indicated noise margin indicates that the line is in poor condition which is causing the BB to drop out from time to time, which in turn lowers the speed of the BB service, etc.
    Report a intermittently noisy line as a VOICE fault to BT on 151. Don't mention Broadband at this stage, just make it clear that you experience a bad noise on the line intermittently. Openreach should then be despatched to fix this. Be persistent, if the noise returns after the engineer has worked on the line, report it again.
    Sometimes there are multiple bad joints or other issues on a line which need to tracked down one by one. I experienced a problem some while ago which needed three visits and ultimately resulted in the pavement being dug up and around 25 metres of cable being replaced.
    Once the noise has gone, your BB should speed up to the maximum for your line after about three days, which should be about 1725 kbps give or take a little.

  • Looking for a replacement m2010us hard drive adapter

    Hello all,
    I have a mostly intact Compaq m2010us, sans HDD caddy/adapter. I searched a little online, and found a few different adapters being described as the proper one. Is there still a way to purchase one through HP or equivelent source? Just trying to fix and polish this up and donate it to a student in need. 
    Thank you,
    -J

    Seagate is recommended due to the 5 year warranty, though other manufacturer's are good and work well and usually offers 3 year warranties. As was said above, any SATA drive will work, whether it's 150 or 300, though the laptop only will run at 150 speed.
    I recommend getting a 7200rpm drive with as much cache as possible. A lot of newer drives are offering 16MB caches which show a strong lead in performance over other 7200rpm drives.
    For instance:
    * The Seagate ST9200420AS (200GB, 7200 rpm, 16MB, SATA 300, 5 yr warranty)
    * The Hitachi Travelstar 7k200 (200GM, 7200 rpm, 16MB, SATA 150, 3 yr warranty)
    The difference between these two is the SATA version, with the Seagate running a faster version of SATA which will not be taken advantage of by the MacBook, however future models or purchases by you may in fact use SATA 300 so it may be a good purchase if you plan to swap it during future upgrades. Further the 5 year warranty over 3 years is nice.
    The recommendations above are if you're looking for a lot of storage with maximum performance. If you simply want a large drive with average or stock performance consider the HITACHI Travelstar 5K250 (250GB).

  • Satellite A660-13T - I can't go from 65 Mbps with the wireless connection.

    +Sorry for my English, is not my native language.+
    Hi,
    I expose my problem:
    I can't go from 65 Mbps with the wireless connection. I can't move from that connection speed.
    Laptop configuration:
    * Windows 7 Ultimate 64 bits (with all updates installed).
    * All drivers updated properly.
    * With the latest version of BIOS.
    Router:
    * Tp-link TL-WR1043ND, installed 3 meters above the laptop (without obstacles).
    Configuration of router:
    * WPA2-PSK AES.
    * 802.11n
    * Maximum output power.
    * Channel: 11 (not automatic, this channel is relatively free).
    * Channel width: 40 Mhz.
    * Maximum tx rate: 300 Mbps.
    Other information:
    * The wireless card drivers are correctly then updated (ver. 5.60.48.35).
    * The router has updated firmware.
    * I have tried all settings of the wireless card.
    * Bluetooth off (without interferences).
    * {color:#ff0000}There are other computers on the network that connects 150 and 300 Mbps (with the same network configuration).{color}
    Thanks in advance,
    Greetings.
    Message was edited by: Xibalba

    Hi buddy,
    > I kept O.S. original for a week and the problem was the same
    If you had the same problem with factory settings you should test another router. Maybe its a malfunction of router or something else (not compatible to your WLAN card).
    Furthermore ask the manufacture of your router if they know something about this.
    In worst case its a hardware malfunction of your notebook. You should contact nearest service centre. I believe they can fix it under warranty, because A660 is pretty new notebook.
    Good luck! :)

  • How do I add a keybinder to an applet

    Hello everybody!
    this is a project that i have been working on for the past week or soo! it has been going pretty well, until i tried to add in the keybinder to look for the up, down, left , and right direction keys to make an object on the screen move! I am trying to make the BLUE box move. the point of the game is to have a square that you control, that is to avoid the 2 bouncing balls.
    (the code I added with this doesn't have any sort of keybinder yet)
    - could someone please add the keybinder so I can understand more how they work!?
    thanks in advance to everybody!
    post anything please, any help is appreciated
    Code:
    //brandon witt
    //paddle game
    //dec 6 2010
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class paddlegame extends Applet implements Runnable {
    Graphics g;
    //font declaration
    Font font1 = new Font("Helvetica", Font.BOLD, 90);
    Font font2 = new Font("Helvetica", Font.PLAIN, 30);
    //speed/trajectory
    int x_shift = 1;
    int y_shift = 1;
    int x1_shift = 2;
    int y1_shift = 2;
    int x1 = 500;
    int y1 = 500;
    //scorer
    double counter = 0;
    //etc.
    boolean bouncing;
    boolean testOutput = true;
    public void init() {
    r = new Rectangle(30,50,20,20);
    b = new Rectangle (40, 60, 20, 20);
    Thread t = new Thread(this);
    t.start();// behaviour of thread controlled by run method
    bouncing = true;
    public void paint(Graphics g) {
    //square
         g.setColor(Color.BLUE);
         g.fillRect(x1, y1, 80, 80);
    //score display
         g.setColor(Color.BLACK);
    g.setFont(font2);
    g.drawString("Score:" + counter, 500, 25 );
    //bouncing balls
    if (bouncing) g.setColor(Color.RED);
    g.fillOval(r.x,r.y,r.width,r.height);
    if (bouncing) g.setColor(Color.BLUE);
    g.fillOval(b.x,b.y,b.width,b.height);
    if (testOutput)
    System.out.println ("x = " + r.x + " y = " + r.y + " bouncing = " + bouncing);
    if (r.x > x1 && r.x < x1 + 80 && r.y > y1 && r.y < y1 + 80 ){
    //explosion scene
    g.setColor(Color.BLACK);
    g.fillOval(r.x - 100,r.y - 100,100, 100);
    g.setColor(Color.YELLOW);
    g.fillOval(r.x - 20,r.y - 40,100, 100);
    g.setColor(Color.RED);
    g.fillOval(r.x - 30,r.y - 15,100, 100);
    g.setColor(Color.ORANGE);
    g.fillOval(r.x - 100,r.y - 55,100, 100);
    g.setColor(Color.BLUE);
    g.fillOval(r.x - 5,r.y - 30,100, 100);
    g.setColor(Color.PINK);
    g.fillOval(r.x - 10,r.y - 40,100, 100);
    g.setColor(Color.GREEN);
    g.fillOval(r.x - 50,r.y - 50,100, 100);
    g.setColor(Color.RED);
    g.fillOval(r.x - 150,r.y - 150,250, 300);
    g.setColor(Color.orange);
    g.fillOval(r.x - 50,r.y - 50,40, 100);
    g.setColor(Color.orange);
    g.fillOval(r.x - 100,r.y - 80,100, 200);
    g.setColor(Color.yellow);
    g.fillOval(r.x - 50,r.y - 50,50, 100);
    g.setColor(Color.red);
    g.fillOval(r.x - 100,r.y - 40,40, 10);
    g.setColor(Color.ORANGE);
    g.fillOval(r.x - 10,r.y - 30,100, 100);
    g.setColor(Color.ORANGE);
    g.fillOval(r.x - 60,r.y - 80,20, 10);
    g.setColor(Color.BLUE);
    g.setFont(font1);
    g.drawString("YOU LOSE!!!", 300, 300);
    g.setColor(Color.BLACK);
    g.setFont(font2);
    g.drawString("Your Final Score:" + counter, 300, 400 );
    if (b.x > x1 && b.x < x1 + 80 && b.y > y1 && b.y < y1 + 80){
    //explosion scene 2
    g.setColor(Color.BLACK);
    g.fillOval(b.x - 100,b.y - 100,100, 100);
    g.setColor(Color.YELLOW);
    g.fillOval(b.x - 20,b.y - 40,100, 100);
    g.setColor(Color.RED);
    g.fillOval(b.x - 30,b.y - 15,100, 100);
    g.setColor(Color.ORANGE);
    g.fillOval(b.x - 100,b.y - 55,100, 100);
    g.setColor(Color.BLUE);
    g.fillOval(b.x - 5,b.y - 30,100, 100);
    g.setColor(Color.PINK);
    g.fillOval(b.x - 10,b.y - 40,100, 100);
    g.setColor(Color.GREEN);
    g.fillOval(b.x - 50,b.y - 50,100, 100);
    g.setColor(Color.RED);
    g.fillOval(b.x - 150,b.y - 150,250, 300);
    g.setColor(Color.orange);
    g.fillOval(b.x - 50,b.y - 50,40, 100);
    g.setColor(Color.orange);
    g.fillOval(b.x - 100,b.y - 80,100, 200);
    g.setColor(Color.yellow);
    g.fillOval(b.x - 50,b.y - 50,50, 100);
    g.setColor(Color.red);
    g.fillOval(b.x - 100,b.y - 40,40, 10);
    g.setColor(Color.ORANGE);
    g.fillOval(b.x - 10,b.y - 30,100, 100);
    g.setColor(Color.ORANGE);
    g.fillOval(b.x - 60,b.y - 80,20, 10);
    g.setColor(Color.BLUE);
    g.setFont(font1);
    //final score text
    g.drawString("YOU LOSE!!!", 300, 300);
    g.setColor(Color.BLACK);
    g.setFont(font2);
    g.drawString("Your Final Score:" + counter, 300, 400 );
    public void update(Graphics g) {
    Image offScreenImage = createImage(getSize().width, getSize().height);
    paint(offScreenImage.getGraphics());
    g.drawImage(offScreenImage,0,0, null);
    public void run() {
    while (true) {
         // Thread performs endless loop
    r.x += x_shift;
    r.y += y_shift;
    if (r.x>= getSize().width || r.x < 0) {
    x_shift *= -1;
    if (r.y>= getSize().height || r.y < 40) {
    y_shift *= -1;
    b.x += x1_shift;
    b.y += y1_shift;
    if (b.x>= getSize().width || b.x < 0) {
    x1_shift *= -1;
    if (b.y>= getSize().height || b.y < 40) { // Why 40?
    y1_shift *= -1;
    try {
         //speed of balls (long)
    Thread.currentThread().sleep((long) 0.9 );
    catch (Exception ke) {
    //loop break if ball 1 or 2 hits square
    if (r.x > x1 && r.x < x1 + 80 && r.y > y1 && r.y < y1 + 80 ){
    break;
    if (b.x > x1 && b.x < x1 + 80 && b.y > y1 && b.y < y1 + 80 ){
         break;
    //repaints the balls at their current location
    repaint();
    //increases the score
    counter += 0.01;
    private Rectangle r;
    private Rectangle b;
    public boolean mouseDown(Event e) {
    return true;
    public boolean mouseDrag(Event e ) {
    return true;
    public KeyEvent events(KeyEvent ke){
    return ke;
    public boolean mouseUp(Event e) {
    return true;
    }

    Add a KeyAdapter like this:
    addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent ke) {
        int key = ke.getKeyCode();
        if (key == KeyEvent.VK_LEFT) x1--;
        if (key == KeyEvent.VK_RIGHT) x1++;
    });*Note that I added this just after the bouncing = true; ... which is on about line 33.
    **Note that you will need to click in the Applet before the keys will function.
    ***Note that you will also likely want to slow down the balls.
    ~Bill

  • Custom formula in cross-tab?

    I have a cross-tab like this
                      JAN    FEB    MAR ....... DEC (the 12 months as columns)
    year 2006
       item 01     150    205      300 .......    550
       item 02       80    190      284 ........   620
    year 2007
       item 01      458    235      224 .......... 781
       item 02      154    254      134..........  254  
    year 2008
       item 01       245    154      544           1243
       item 02       524    254      124 .........   924     
    I want to know if is possible to have a formula that take the value of each month and compare with the previous and make a calcule like this...
                      JAN    FEB    MAR ....... DEC (the 12 months as columns)
    year 2006
       item 01     150    205      300 .......    550
       item 02       80    190      284 ........   620
    year 2007
       item 01      458    235      224 .......... 781
                       (205)   (14)
       item 02      154    254      134..........  254  
    year 2008
       item 01       245    154      544           1243
       item 02       524    254      124 .........   924 
    where (205) and   (14) are calculate from:
    (205) = (150 - 458) * 100 / 150 I have to  make this operation for each month takin the values from item 01 from 2006 with the values from item 01 from 2007 and so on
    Edited by: j jara on Jul 22, 2008 2:01 AM

    Yes it is possible.
    It would be easier in CR2008  where you have the ability to add Calculated Members.
    In previous versions you would need to create a variable for each year and using the GridRowColumnValue function assign the current value to a variable. You would then need to add a second summary field as a "dummy" summary and in the Display string formula declare the variables and manipulate the values as you like and finally convert the output to string.

Maybe you are looking for