Friday, August 19, 2011

The Auto Dish Antenna

Surely there needs to be an automation to delight the consumer.

So a display panel which shows the current orientation to help you find the signal of the right satellite by moving the dish antenna manually.

Better still could be auto detect settings with swivellable and automatic orientation with a small box with buttons.

With number of ip services growing there could be alternate arrangements with other partners to augment the content in that case there could be remote controlled through the home control of the dish antenna to tap these communication signals of some other satellites of the partner or sister concerns.

Technology was made to make human intervention a minimum, but how far are we from such a future

I am sure US and Europe can have the same in one month but what about India?

Friday, August 05, 2011

Using String Tokenizer to Parse a String containing Item Name Price and Quantity to find Bill using netbeans and java

import javax.swing.DefaultListModel;

import java.util.StringTokenizer;

public class ItemEx extends javax.swing.JFrame {

static float amt=0;
/** Creates new form ItemEx */
public ItemEx() {
initComponents();
}


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String str=tf1.getText()+ " " + tf2.getText() + " " + tf3.getText();
DefaultListModel dlm=(DefaultListModel) list.getModel();
dlm.addElement(str);
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String str1,str2,str="",dummy="";
float amt=0;
for(int i=0;i {
str=(String)list.getModel().getElementAt(i);

StringTokenizer st=new StringTokenizer(str," ");
while(st.hasMoreTokens())
{
dummy=st.nextToken();
str1=st.nextToken();
str2=st.nextToken();
amt+=Float.parseFloat(str1) * Float.parseFloat(str2);
}
}
lblmsg.setText("" + amt);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ItemEx().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lblmsg;
private javax.swing.JList list;
private javax.swing.JTextField tf1;
private javax.swing.JTextField tf2;
private javax.swing.JTextField tf3;
// End of variables declaration

}

Search

Google