Prob in float...
this is my insertion query in the database, my problem is that when i insert decimal values like 15464545454.32, it displays like 1.54645E7..plz do something...i want to display as the same decimal values as i eneterd....
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO GL_MAST VALUES (?, ?, ?, ?, ?, ?)");
float Dr_Amt =Float.parseFloat(request.getParameter("DrAmount" ));
pstmt.setFloat(3,Dr_Amt );
float Cr_Amt =Float.parseFloat(request.getParameter("CrAmount" ));
pstmt.setFloat(4,Cr_Amt);
sql = conn.prepareStatement("SELECT * FROM GL_MAST ");
results = sql.executeQuery();
while(results.next())
db_amt = results.getFloat("db_amt");
cr_amt = results.getFloat("cr_amt");
out.println("<td><INPUT TYPE='TEXT' NAME='db_amt' size='12' value='" + db_amt + "' readonly </td>");
out.println("<td><INPUT TYPE='TEXT' NAME='db_amt' size='12' value='" + cr_amt + "' readonly </td>");
}
Look in API docs for DecimalFormat :)
Similar Messages
-
I am unable to recognize the problem in the following code. My paint() in defined in a class ImagePanel and I am unable to access paint() from outside.
Please Help!
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import javax.media.*;
import javax.media.format.*;
import javax.media.util.*;
import javax.media.control.*;
import javax.media.protocol.*;
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import com.sun.image.codec.jpeg.*;
import javax.media.*;
import javax.media.protocol.*;
import javax.media.control.*;
import javax.media.format.*;
import javax.media.util.BufferToImage;
import java.io.IOException;
import java.net.*;
import java.awt.*;
////////////////////FROM GESTURE
import java.io.*;
import java.awt.*;
import java.awt.image.*;
import java.applet.*;
import java.util.*;
import java.lang.*;
//import Gesture.class;
import com.sun.image.codec.jpeg.*;
import sun.awt.image.BufferedImageGraphics2D;
public class SwingCapture extends Panel implements ActionListener, Runnable {
public static Player player = null;
public CaptureDeviceInfo di = null;
public MediaLocator ml = null;
public JButton capture = null;
public Buffer buf = null;
public Image img = null;
//public VideoFormat vf=null
public BufferToImage btoi = null;
public ImagePanel imgpanel = null;
Thread thr;
String str1=new String();
//from gesture
int xcentre, ycentre,ij;
static int iw = 320;
static int ih = 240;
static int attenH = 400;
static int attenW = 200;
static int PIXCOUNTBB=5;
static int IMIN=40; //approximate location of hand
static int IMAX=239;
static int JMIN=5;
static int JMAX=300;
Image imgprocess;
Image im;
int xmin,xmax,ymin,ymax;
int pix_fill[][]= new int [320][240];
int pixel2[] = new int[76800];
int pixel3[] = new int[76800];
int pixel4[] = new int[76800];
int pixel5[] = new int[76800];
int pixel6[] = new int[attenH * attenW];
double arr[][] = new double[21][2];
int flag = 0;
int ixmean = 0;
int iymean = 0;
//MyThread thread ;
int threadflag = 1;
public SwingCapture() {
setLayout(new BorderLayout());
//setSize(320,550);
//setSize(320,550);
imgpanel = new ImagePanel();
capture = new JButton("Capture");
capture.addActionListener(this);
//String str1 = "vfw:Philips USB PC-Camera:0";
//String str2 = "vfw:Microsoft WDM Image Capture:2";
//String str3 = "vfw:Video Blaster WebCam Go (VFW):0";
String str3 = "vfw:Video Blaster WebCam 3/WebCam Plus (VFW):1";
System.out.println("sur");
String str2= "vfw:Microsoft WDM Image Capture (Win32):0";
di =(CaptureDeviceInfo) CaptureDeviceManager.getDevice(str3);
System.out.println("sur" + di);
ml = di.getLocator();
try {
player = Manager.createRealizedPlayer(ml);
player.start();
Component comp;
if ((comp = player.getVisualComponent()) != null)
{add(comp,BorderLayout.NORTH);
add(capture,BorderLayout.CENTER);
add(imgpanel,BorderLayout.SOUTH);}
catch (Exception e)
e.printStackTrace();
thr = new Thread(this);
public static void main(String[] args) {
Frame f = new Frame("SwingCapture");
SwingCapture cf = new SwingCapture();
f.addWindowListener(new WindowAdapter() { //overriding windowClosing
public void windowClosing(WindowEvent e) {
playerclose();
System.exit(0); }
f.add("Center",cf);
f.pack();
f.setSize(new Dimension(320,550));
f.setVisible(true);
/*for(int i=0;i<=10;i++)
FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
buf = fgc.grabFrame();
// Convert it to an image
btoi = new BufferToImage((VideoFormat)buf.getFormat());
img = btoi.createImage(buf);
// show the image
imgpanel.setImage(img);
Gesture(img);
imgprocess.flush();
img.flush();
try{
Thread.sleep(10000);}
catch(Exception e1){};
public static void playerclose() {
player.close();
player.deallocate();
public synchronized void actionPerformed(ActionEvent e) {
JComponent c = (JComponent) e.getSource();
if (c == capture) {
//thread started
thr.start();
while(ij<=7)
if(threadflag ==1)
try{
System.out.println("Waiting");
wait();
System.out.println("Finished Waiting");
catch(Exception e3)
threadflag =0;
System.out.println("Back");
imgpanel.callPaint("<");
threadflag=1;
notify();
public synchronized void run()
ij = 0;
while(ij<=7)
if(threadflag ==1)
//for( ij = 0; ij<=20;ij++)
// Grab a frame
//this.imgpanel=imgpanel;
System.out.println("ij : " + ij);
FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
System.out.println("After buf1 " + fgc);
buf = fgc.grabFrame();
System.out.println("After buf " + buf);
// Convert it to an image
btoi = new BufferToImage((VideoFormat)buf.getFormat());
System.out.println("After btoi "+ btoi);
img = btoi.createImage(buf);
System.out.println("After img "+ img);
//imgpanel.callpaint(">");
// show the image
//System.out.println("rhododendron");
//imgpanel.setImage(imgprocess);
//System.out.println("cacatua");
//pixel2=Gesture(img);
Gesture(img);
//imgpanel.repaint();
//repaint();
System.out.println("After Gesture");
//String str = new String("C:\\test");
//str = str + ij + ".jpg";
//System.out.println("After ");
// SaveImage(str,imgprocess);
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixel2,0,iw));
//repaint();
/*try{
Thread.sleep(10000);}
catch(Exception e1){};*/
//imgprocess.flush();
//img.flush();
ij++;
System.out.println("ij: " + ij);
threadflag = 0;
notify();
//System.out.println("After Notify");
if(threadflag==0)
try{
wait();
// notify();
//repaint();
catch(Exception e2)
//System.out.flush();
/*flag =1;
int cntleft=0;
int cntright=0;
for(int i=1;i<=7;i++)
if(arr[i-1][0]<arr[0])
cntright++;
else
cntleft++;
if(cntleft>5)
str1 = "Moving right";
System.out.println("Moving right");
imgpanel.callPaint(str1);
else
if(cntright>5)
str1 = "Moving left";
System.out.println("Moving left");
imgpanel.callPaint(str1);
else
str1 = "No Movement";
System.out.println("No Movement");
imgpanel.callPaint(str1);
/*class MyThread extends Thread
MyThread()
if(threadflag ==1)
wait();
else
threadflag =0;
imgpanel.callPaint();
threadflag=1;
notify();
class ImagePanel extends Panel {
public Image myimg = null;
String str2 = new String();
public ImagePanel() {
setLayout(null);
setSize(320,240);
public void setImage(Image img) {
//System.out.println("cacatua");
//this.myimg = img;
//repaint();
public void callPaint(String st)
//this.str2 = st;
System.out.println("in callPaint");
System.out.println("xmean: "+ixmean);
imgpanel.repaint();
System.out.println("in out callPaint");
public void paint(Graphics g) {
//if (myimg != null) {
//g.drawImage(imgprocess, 0, 0, null);
System.out.println("xmean: "+ixmean);
//System.out.println("in Paint of imgpanel");
//g.drawImage(imgprocess,0,0,null);
//if(flag==1)
//g.drawString(str2, 20,20);
// else
//repaint();
g.drawString(">",ixmean,iymean);
//repaint();
//g.drawImage(imgprocess,0,0,null);
//class Gesture //extends Applet
/*int xcentre, ycentre;
static int iw = 320;
static int ih = 240;
static int attenH = 400;
static int attenW = 200;
static int PIXCOUNTBB=5;
static int IMIN=40; //approximate location of hand
static int IMAX=239;
static int JMIN=5;
static int JMAX=300;
Image imgprocess;
Image im;
int xmin,xmax,ymin,ymax;
int pix_fill[][]= new int [320][240];
int pixel2[] = new int[76800];
int pixel3[] = new int[76800];
int pixel4[] = new int[76800];
int pixel5[] = new int[76800];
int pixel6[] = new int[attenH * attenW];
//public int intensity(int pix[][], int x, int y)*/
public int intensity(int pix[][], int x, int y)
int p, r, g, b, inten;
//p=pix[x][y];
p=pix[x][y];
r = 0xff & p>>16 ;
g = 0xff & p>>8;
b = 0xff & p;
//inten = (int)(0.33 * r + 0.56 g + 0.11b);
inten = (int)(0 * r + 0 g + 0.11b);
//inten = (int)( 0.11*b);
return(int)(inten);
public int min(int x, int y)
if(x<y)
return(x);
else
return(y);
//public void init()
public void Gesture(Image im)
//int pixel3[] = new int[80000];
//int pixel2[] = new int[76800];
int whitepix=0;
int coord[][] = new int[2][256];
//int ymin, xmax,ymax,xmin;
int no_elem_comp[] = new int[76800];
int count = 0;
float pskin[][] = new float[241][241];
float pnoskin[][] = new float[241][241];
int num = 0;
String imname;
//Image im;
for(int i=0;i<2;i++)
for(int j=0;j<256;j++)
coord[i][j] = 0;
//imname = getParameter("img");
//im = getImage(getDocumentBase(),imname);
int pixels[] = new int [iw * ih];
int pix[][] = new int[iw][ih]; //changed iw and ih
FileReader fr;
BufferedReader br ;
String s = new String();
int l;
int total;
PixelGrabber pg = new PixelGrabber(im,0,0,iw,ih,pixels,0,iw);
try
pg.grabPixels();
catch(InterruptedException e) {}
int size = iw * ih;
for(int m=240; m<480;m++)
//System.out.println(m + " : " + pixels[m] );
int p = pixels[m];
int r = 0xff & (p>>16);
int g = 0xff & (p>>8);
int b = 0xff & (p);
//System.out.println("r : " + r + " g : " + g + " b : " + b);
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixels,0,iw));
//repaint();
///////controller
float C[][] = new float[16][size];
for(int i=0;i<16;i++)
for ( int j=0;j<size;j++ )
C[i][j]=0;
//System.out.println("End Controller");
////////fingerinit
try{
fr = new FileReader("skin");
br = new BufferedReader(fr);
//String s;
s=br.readLine();
l = Integer.parseInt(s);
System.out.println("l : " + l);
s=br.readLine();
total = Integer.parseInt(s);
System.out.println("total : " + total);
String val = new String();
for(int i=0; i<241; i++)
for(int j=0; j<241; j++)
s=br.readLine();
int intval = Integer.parseInt(s);
//pskin[i][j] = ((float)intval)/total;
pskin[i][j] = (float)intval;
fr.close();
catch(Exception e)
{System.out.println("Hello");
try{
fr = new FileReader("noskin");
br = new BufferedReader(fr);
s=br.readLine();
l = Integer.parseInt(s);
s=br.readLine();
total = Integer.parseInt(s);
for(int i=0; i<241; i++)
for(int j=0; j<241; j++)
s=br.readLine();
int intval = Integer.parseInt(s);
//pskin[i][j] = ((float)intval)/total;
pnoskin[i][j] = (float)intval;
fr.close();
catch(Exception e)
System.out.println("Here:");
System.out.println("after noskin");
float A[][] = new float[size+1][20];
try{
System.out.println("in try");
fr = new FileReader("svdnewdata");
if(fr==null)
System.out.println("Could not open svdnewdata ");
System.exit(0);
br = new BufferedReader(fr);
for(int i1=0;i1<size;i1++)
s=br.readLine();
StringTokenizer st =new StringTokenizer(s,"\t");
//System.out.println("svd :" + s);
for(int j1=0;j1<20;j1++)
String val = st.nextToken();
// System.out.println("val : " + val);
int intval=Integer.parseInt(val);
A[i1][j1]=intval;
fr.close();
catch(Exception e)
System.out.println("surbhi");
System.out.println("after svdnewdata");
////////Process
int points[][] = new int[2][size];
int colors[][] = new int[3][size];
int data[][] = new int[2][size];
float prob[] = new float[size];
////////fingerpoint
for(int i=0;i<size;i++)
int p = pixels[i];
int r=0xff & (p>>16);
int g=0xff & (p>>8);
int b=0xff & (p);
colors[0][i] = r;
colors[1][i] = g;
colors[2][i] = b;
data[0][i] = (int)(i/iw)-1;
data[1][i] = (int)(i%iw)-1;
float Cb_f = (float)(((-4818.0*r - 9527.0*g + 14345.0*b)/32768.0)+128.5);
float Cr_f = (float)(((14345.0*r - 12045.0*g - 2300.0*b)/32768.0)+128.5);
int Cb = (int)Cb_f;
int Cr = (int)Cr_f;
//System.out.println("Cb :" + Cb);
//System.out.println("Cr :" + Cr);
if(pnoskin[Cb][Cr] ==0)
//System.out.println("sur :" );
prob[i]=1;
else
prob[i]=pskin[Cb][Cr]/pnoskin[Cb][Cr];
//System.out.println("anui");
for(int a=0;a<size ;a++)
if( prob[a]>0.05)
// { System.out.println("Ishsani");
pixel2[a]=0xff000000 | 0x000000ff;//}
else
// {System.out.println("Ishsani11");
pixel2[a]=0xff000000 | 0x00ff0000;
int k=0;
int buffer[] = new int[3];
//int pix[][] = new int[ih][iw];
for(int i=0;i<ih;i++)
for(int j=0;j<iw;j++)
pix[j][i]= pixel2[k++];
//System.out.println("out k:" + k);
for(int i=1;i<ih-1;i++)
for(int j=1;j<iw-1;j++)
whitepix = 0;
for(int i1=i-1;i1<=i+1;i1++)
for(int j1=j-1;j1<j+1;j1++)
buffer[0]= 0x000000ff & (pix[j1][i1]>>16);
buffer[1]= 0x000000ff & (pix[j1][i1]>>8);
buffer[2]= 0x000000ff & (pix[j1][i1]);
//if(((buffer[0]==-1)&&(buffer[1]==-1))||((buffer[2]==-1)&&(buffer[1]==-1))||((buffer[0]==-1)&&(buffer[2]==-1)))
if(buffer[2]==255)
whitepix++;
if(whitepix>=3)
//pix[j][i] = (255<<24) | (255 << 16) | (255<<8) | (255);
pix[j][i] = 0xff000000 | 0x000000ff;
// System.out.println("if : " + pix[j][i]);
else
//pix[j][i] = 0xff|(0<<16)|(0<<8)|0;
pix[j][i] = 0xff000000 | 0x00ff0000;
// System.out.println("else : " + pix[j][i]);
}//end for
int b=0;
for(int i=0;i<ih;i++)
for(int j=0;j<iw;j++)
pixel2[b++] = pix[j][i];
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixel3,0,iw));
//repaint();
IdenOutline(pix);
IdenOutline(pix_fill);
IdenOutline(pix_fill);
IdenOutline(pix_fill);
IdenOutline(pix_fill);
IdenOutline(pix_fill);
//IdenOutline(pix_fill);
calcBoundary();
System.out.println("xmax : " + xmax + " xmin : " + xmin);
System.out.println("ymax : " + ymax + " ymin : " + ymin);
BBox();
CalcMvt();
b=0;
for(int i=0;i<ih;i++)
for(int j=0;j<iw;j++)
pixel2[b++] = pix_fill[j][i];
//imgpanel.callPaint(">");
//imgpanel.repaint();
// imgprocess.flush();
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixel2,0,iw));
//repaint();
//thread.start();
//try{
//wait();
//catch(Exception e)
//imgpanel.callPaint(">");
//repaint();
//imgprocess.flush();
/* public void run()
imgpanel.callPaint(">");
notify();
/*public void paint(Graphics g)
g.drawString(str1, 310,300);
System.out.println("Came in paint");
//g.drawString("Coordinates of the Centroid is "+ xcentre + " , " + ycentre , 10,40);
//g.drawImage(imgprocess,0,0,null);
//System.out.println("Came in paint out");
//g.drawImage(im,0,0,this);
//if(imgprocess==null){
System.out.println("ishani1");
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixel2,0,iw));
//repaint();
System.out.println("ishani2");
//g.drawImage(imgprocess,0,0,null);
//g.drawImage(imgprocess,0,400,null);
System.out.println("ishani3");
//repaint();
void BBox()
for(int i=xmin ; i<=xmax;i++)
pix_fill[i][ymax] = 0xff0000ff;
pix_fill[i][ymin] = 0xff0000ff;
System.out.println("Came here");
for(int j=ymin;j<=ymax;j++)
pix_fill[xmax][j] = 0xff0000ff;
pix_fill[xmin][j] = 0xff0000ff;
System.out.println("Came here2");
void calcBoundary()
int minrow,maxrow,mincol,maxcol,flag=0;
minrow=maxrow=mincol=maxcol=0;
for(int i=0;i<ih;i++)
for(int j=0;j<iw;j++)
if(pix_fill[j][i] == 0xff0000ff)
flag = 1;
minrow = i;
break;
if(flag==1)
break;
flag=0;
for(int i=(ih-1);i>=0;i--)
for(int j=0;j<iw;j++)
if(pix_fill[j][i] == 0xff0000ff)
flag =1;
maxrow=i;
break;
if(flag==1)
break;
flag =0;
for(int j=0;j<iw;j++)
for(int i=0;i<ih;i++)
if(pix_fill[j][i] == 0xff0000ff)
flag=1;
mincol = j;
//System.out.println("row : " + i + " Col : " + mincol);
break;
if(flag==1)
break;
flag =0;
for(int j=(iw-1);j>=0;j--)
for(int i=0;i<ih;i++)
if(pix_fill[j][i] == 0xff0000ff)
flag =1;
maxcol = j;
System.out.println("row : " + i + " Col : " + maxcol);
break;
if(flag==1)
break;
xmax = maxcol;
xmin = mincol;
ymax = maxrow;
ymin = minrow;
return;
void IdenOutline(int pix_temp[][])
int n,k,l,i,j;
for(i=0;i<ih;i++)
for(j=0;j<iw;j++)
if(pix_temp[j][i]==0xffff0000)
continue;
else
for(k=1;(j+k)<320;k++)
if(pix_temp[j+k][i]!=0xffff0000)
continue;
else
break;
for(l=1;(i-l)>0;l++)
if(pix_temp[j][i-l]!=0xffff0000)
continue;
else
break;
/*for(m=1;j-m>0;m++)
if(pix_fill[j-m][i])!=0xff0000ff)
continue;
else*/
for(n=1;(i+n)<240;n++)
if(pix_temp[j][i+n]!=0xffff0000)
continue;
else
break;
if((k<15)&&(n<20)&&(l<20))
pix_temp[j][i]=0xffff0000;
else
if((k<15)&&(l<10)&&(n>10))
pix_temp[j][i]=0xff0000ff;
else
if((n<10)&&(k<15)&&(l>10))
pix_temp[j][i]=0xff0000ff;
else
if((n<10)&&(l<10)&&(k>15))
pix_temp[j][i]=0xff0000ff;
int b1=0;
for(int a=0;a<ih;a++)
for(int d=0;d<iw;d++)
pixel2[b1++] = pix_temp[d][a];
pix_fill[d][a] = pix_temp[d][a];
//imgprocess=createImage(new MemoryImageSource(iw,ih,pixel4,0,iw));
//repaint();
public void SaveImage(String s,Image im)
System.out.println("i m here" + im);
/* try{
Thread.sleep(1000);
catch(Exception e)
//BufferedImage bi = new BufferedImage(im.getWidth(null, im.getHeight(null), BufferedImage.TYPE_INT_RGB);
BufferedImage bi = new BufferedImage(320, 240, BufferedImage.TYPE_INT_RGB);
System.out.println("i m here" + bi);
Graphics2D g2 = bi.createGraphics();
g2.drawImage(im, null, null);
System.out.println("i m here" + g2);
FileOutputStream out = null;
try {
out = new FileOutputStream(s);
catch (java.io.FileNotFoundException io)
System.out.println("File Not Found");
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
param.setQuality(0.5f,false);
encoder.setJPEGEncodeParam(param);
try
encoder.encode(bi);
out.close();
catch (java.io.IOException io)
System.out.println("IOException");
public void CalcMvt()
double xmean=(xmax+xmin)/2;
double ymean=(ymax+ymin)/2;
ixmean = (int) xmean;
iymean = (int)ymean;
arr[ij][0]= xmean;
arr[ij][1]=ymean;
}//end of class
/*public class SCapture
public static void main(String[] args) {
Frame f = new Frame("SwingCapture");
SwingCapture cf = new SwingCapture();
f.addWindowListener(new WindowAdapter() { //overriding windowClosing
public void windowClosing(WindowEvent e) {
playerclose();
System.exit(0); }
f.add("Center",cf);
f.pack();
f.setSize(new Dimension(320,550));
f.setVisible(true);*/
/*for(int i=0;i<=10;i++)
FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
buf = fgc.grabFrame();
// Convert it to an image
btoi = new BufferToImage((VideoFormat)buf.getFormat());
img = btoi.createImage(buf);
// show the image
imgpanel.setImage(img);
Gesture(img);
imgprocess.flush();
img.flush();
try{
Thread.sleep(10000);}
catch(Exception e1){};Not sure exactly what you mean...
Here, try this sample, use your ImagePanel with a standard frame. Just add the panel to the frame, make the frame visible, shrink and restore it a few time, see if your paint method gets called...
If it works correctly, good, you know the ImagePanel is fine, and yout problem is with your other class. If it doesn't work, then concentrate on your ImagePanel and explain exactly HOW it doesn't work... (like any errors, what gets shown/printed to the command line, exactly how it misbehaves...
public void ImagePanelTest extends Frame {
public ImagePanelTest (String title) {
super(title);
public void main(String[] args) {
ImagePanel ip = new ImagePanel();
ImagePanelTest ipt = new ImagePanelTest("ImagePanel Test");
ipt.add(ip);
ipt.setSize(new Dimension(300,300));
ipt.addWindowListener(new WindowAdapter() {
public void windowClosing(windowEvent we) {
dispose();
System.exit(0);
ipt.show();
} -
Does iBook Hard Drive: Toshiba MK4025GAS have shock protection?
does the Toshiba MK4025GAS hard drive have the thing where, if you move the computer, the drive mounts and stops spinning to prevent damage?
oh yeah, this is the drive in my ibook g4.Hey LLL&D and Welcome to Apple Discussions,
does the Toshiba MK4025GAS hard drive have the thing where, if you move the computer, the drive mounts and stops spinning to prevent damage
This is from a post by simie in macrumors.com:
"SMS only exists on iBooks built after July 26, 2005. These iBooks are either 1.33GHz or 1.42GHz. All 1.42GHz iBooks have SMS. Only 1.33 GHz iBooks with a scrolling trackpad, 512MB RAM (stock), and 40GB HDD (stock) have SMS."
And an explanation of how it works by mkrishnan Demi-God (Moderator) in mac-forums.com:
"Well...there are two things. There's the motion sensor. But the hard drive itself is just a normal hard drive. All hard drives can be commanded to "park" their read/write heads. A hard disk works by a magnetic probe/sensor floating over the disk as the disk spins. It can read the HD by reading the magnetic state of the block underneath it, and when a potential is applied, it can change the magnetic state.
Anyway, hard drives often get damaged because this head crashes into the disk and causes physical damage and/or misaligns itself. Parking essentially pulls the head out of the way so this can't happen as easily.
When the motion sensor detects the motion, the software or motherboard or whatever commands the disk to park, and it does. But the hard disk unit itself is identical to any other 2.5" hard disk, and it's mounted in the same way"
I also wondered about this and knew it was in the later iBooks but wasn't sure which ones.
Richard -
Hi
I am currentlytrying to communicate with the HP34401A Multimeter.
I cant seem to talk with the device with out any errors.
I have downloaded the HP34401 instrument on the NI website and have got the connection going.
hp34401_init (Description, VI_FALSE, VI_FALSE,&viSession);
if (viSession==VI_NULL)
ErrorCheck(Status);
else
hp34401_reset (viSession);
hp34401_func (viSession,hp34401_FUNC_VOLT_DC);
hp34401_voltDcNplc (viSession, hp34401_NPLC_100_0);
hp34401_autoZero (viSession, VI_TRUE);
Can someone please help me out by showing how to start communication, any source code will be very helpful ?
Thanks.
Help share your knowlegdeShako,
You told that you were not able to make a measurement. Where is the problem exactly?
Do you get an unexpected error from one of the functions (if yes what are the error codes/messages), or the reading result is not what you expected?
Here is what I see from the code that can be corrected:
1- The descriptor should be "ASRL2::INSTR"
2- I recommend setting the 2nd and 3rd parameters of hp34401_init to VI_TRUE
3- You do not set the value of Status during initialization, but you use it to retrieve error information, maybe you should say:
Status = hp34401_init (...)
4- Is your probes connected to the point you want to measure during hp34401_autoZero? If yes, are you sure that is your intention?
You will measure almost 0 (zero) from that point and you get a 'shifted' reading from other points until you reset the device. You probably should auto-zero when your probes are floating, or better shorted to each other.
S. Eren BALCI
www.aselsan.com.tr -
How can I make floating options windows behave like probe windows in LV 5.0?
Hello all,
I'm trying to use subVI's as small floating windows that appear and disappear on command. These windows provide access to controls that trigger functions in the calling VI.
I've already achieved this by calling the subVI's (which are set to be front most) continuously in the main loop when I want to see their front panels and then closing them when I don't want to see them using the close function in victl.llb.
This works, but there are some problems. The title bars of the floating front panels flash continuously when there is more than one panel open and if two panels overlap then the overlapping regions flash. Also, when I operate controls on the calling V
I (window maximized), the floating panels disapear. I also tried using invoke and property nodes with the same results.
I realize that this is because only one panel can be in front at any one time, so while calling them in a loop keeps them visible it also makes them flash and disappear behind the calling VI when I click on it.
Is there any solution to this? Is this addressed in LV 6i?
What I really need is for those floating windows to act like probe indicators. Is this possible?
I would greatly appreciate any help.
thank you,
LouisThere's an utility called LVWUTIL32 at http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/ebf11dd1f0feaef3862566790072a983/ that has a vi to make a window topmost, with one difference, if you execute it once, the window will be topmost even if you click in the window under it, and it will be so until you revoke this option with another VI. In my system, no flashes were detected.
Hope this helps -
Hi!
I have some problems with my quotas shown in Server Admin (MacOSX Server 10.5.7).
You can see the prob in this screenshot:
http://www.ewetel.net/~peter.borbonus/Images/quota1a
(Link to screenshot)
_What I did to fix it:_
I deleted inactive mailuserdirectories via cyradm (dm 'Other Users/name')
No problem with that.
I rebuilt maildatabase with "mailbfr -f" (because of probs with it after user deletion)
I tried to fix quotas with "mailbfr -q" (seemed to work)
In Workgroup-manager I tried to give new quotas to some of the users: failed!
So I gave new quotas with cyradm (sq 'Other Users/name' 102400): worked!
I tried to fix quotas with "mailbfr -q" again (seemed to work)
But my problem is still the same (see screenshot).
In mailaccess.log are no problems announced.
What can I do else to fix this problem.
Apart from this problem the mailsystem seems to run fine.
Thank you for your assistance,
Peter.I found that cyrus-quota crashes every day.
The system.log says at that point:
May 30 19:45:34 xserver ReportCrash[10889]: Formulating crash report for process cyrus-quota[10869]
May 30 19:45:34 xserver com.apple.launchd[1] (edu.cmu.andrew.cyrus.cyrus-quota[10869]): Exited abnormally: Floating point exception
May 30 19:45:34 xserver ReportCrash[10889]: Saved crashreport to /Library/Logs/CrashReporter/cyrus-quota2009-05-30-194533xserver.crash using uid: 0 gid: 0, euid: 0 egid: 0
May 30 19:46:05 xserver ctl_cyrusdb[10899]: checkpointing cyrus databases
May 30 19:46:05 xserver ctl_cyrusdb[10899]: done checkpointing cyrus databases
The beginning of crash-report is (if more is needed I can give it to you):
Process: cyrus-quota [10869]
Path: /usr/bin/cyrus/bin/cyrus-quota
Identifier: cyrus-quota
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [1]
Date/Time: 2009-05-30 19:45:33.454 +0200
OS Version: Mac OS X Server 10.5.7 (9J61)
Report Version: 6
Anonymous UUID: 76D1EBD5-8B8B-4123-B049-4F98D20EA400
Exception Type: EXC_ARITHMETIC (SIGFPE)
Exception Codes: EXCI386DIV (divide by zero)
Crashed Thread: 0
Thread 0 Crashed:
0 cyrus-quota 0x000032c8 doquotacheck + 319
1 cyrus-quota 0x000037cd main + 714
2 cyrus-quota 0x00001ee6 start + 54
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x00003194 ecx: 0x00000000 edx: 0x00000000
edi: 0x000001b0 esi: 0x00000000 ebp: 0xbffffd88 esp: 0xbfffed20
ss: 0x0000001f efl: 0x00010246 eip: 0x000032c8 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x561ffd6c
I hope somebody here can help me.
Regards,
Peter -
Phone continually locking up, floating between att...
This has now happened about 6 or 7 times. I have had the phone brick completley and stay inoperational for several hours, randomly start floating back and forth between the ATT and Nokia screens as if in a continual restart, etc. I dearly hope an update of somekind is coming out soon. This is beyond annoying.
http://forums.wpcentral.com/nokia-lumia-920/202130-920-locked-up-not-responding-all.html
http://forums.wpcentral.com/nokia-lumia-920/204872-lumia-920-bricked-not-responding-all.html
I started the above threads on WP Central about the issue.http://news.cnet.com/8301-10805_3-57551972-75/microsoft-probes-windows-phone-8-reboot-weirdness/
http://wmpoweruser.com/microsoft-looking-into-wp8-reboot-issue-pollare-you-affected/
http://wmpoweruser.com/how-to-soft-reset-the-nokia-lumia-920/
I appreciate the suggestion, but this seems far too widespread to be a defect in one unit. There must be a firmwear issue or some other widespread problem. -
Multiply floating point rounds
Why is it that when I use the Multiply function with two floating point numbers, that it rounds off the result?
I have the Format/Precision set to 3 decimals on the indicator.
The inputs are both doubles.
Using a probe before the indicator shows that the result is rounded by the mulitply function itself.
Attachments:
Multiply Rounding.vi 7 KBWes_OH wrote:
I have the Format/Precision set to 3 decimals on the indicator.
NO!
Your indicator is set to six digits of precision, thus shows only six significant digits and that's exactly what you get (324975). If you would set ot to 3 signiificant digits, it would display as (325000).
If you want to show a certain number of digits after the decimal point, you need to set the "precision type" to "Digits of Precision", not "significant digits", as you have it set now. Try it!
Also don't trust any probes or indicators, they never "round", i.e. never change the data. The displayed precision is just cosmetic and does NOT change the underlying data that is carried in the wire, which is always full precision. If you want a probe with 10 decimal digits, create a custom probe.
If you want to round, you need to do it in code.
Message Edited by altenbach on 02-05-2007 08:37 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
digits.png 25 KB -
I got the charger flex or pin changed and now the apps dance on the screen, photos open and zoom in, then out, the other apps open and close. I have already restored the device with Itunes and prob is still there. What can be the problem? Any suggestion will be welcome. Thank you
THANKS for your prompt reply Bluetooth is off in my laptop and IPhone.. and in fact the reset is the only thing that can make it back to normal. But for a lil while. I wonder if it is the touch, or the home botton... both things are very expensive to replace, so I wouldn't like to spend $$ and continue having the prob.....
-
Hi all,
To quote JLS in verbatim ..."Java floating-point
operators produce no exceptions (�11). An operation
that overflows produces a signed infinity, an
operation that underflows produces a signed zero, and
an operation that has no mathematically definite
result produces NaN."
But I am facing a problem here. The highest value
that can be held by a Double variable is
1.79769313486231570e+308. Any operation resulting in
an overflow of this variable should produce 'infinity'
accodring to the JLS but I am getting a
"EXCEPTION_FLT_OVERFLOW". Does this have something to
do with the OS or the processor?
Here's a simple test program:
public class FloatingPointInexactRulesTest {
public static void main(String[] args) {
// An example of overflow:
double d = 1.79769313486231570e+308;
System.out.print("overflow produces infinity: ");
System.out.println(d + "*1.1==" + d*1.1);
The program's output should have been:
overflow produces infinity: 1.0e+308*1.1==Infinity
but I get a EXCEPTION_FLT_OVERFLOW! Since the JVM cant
violate the semantics of the JLS I think the problem
lies somewhere else(either the OS or the processor). I
am using WIndows2000 as the OS and Intel PIV as the
processor.
Please help me...
--------------EXCEPTION!---------------------
Unexpected Signal : EXCEPTION_FLT_OVERFLOW
(0xc0000091) occurred at PC=0xEFA6C3
Function=[Unknown.]
Library=(N/A)
NOTE: We are unable to locate the function name symbol
for the error
just occurred. Please refer to release
documentation for possible
reason and solutions.
Current Java thread:
Dynamic libraries:
0x00400000 - 0x00407000
C:\j2sdk1.4.2_04\bin\java.exe
0x77F80000 - 0x77FFD000
C:\WINNT\system32\ntdll.dll
0x7C2D0000 - 0x7C332000
C:\WINNT\system32\ADVAPI32.dll
0x7C570000 - 0x7C628000
C:\WINNT\system32\KERNEL32.DLL
0x77D30000 - 0x77D9E000
C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78045000
C:\WINNT\system32\MSVCRT.dll
0x00250000 - 0x002C3000
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\uga1.tmp
0x71710000 - 0x71794000
C:\WINNT\system32\COMCTL32.DLL
0x77F40000 - 0x77F7E000
C:\WINNT\system32\GDI32.dll
0x77E10000 - 0x77E75000
C:\WINNT\system32\USER32.DLL
0x76620000 - 0x76630000
C:\WINNT\system32\MPR.DLL
0x77A50000 - 0x77B3C000
C:\WINNT\system32\OLE32.DLL
0x779B0000 - 0x77A4B000
C:\WINNT\system32\OLEAUT32.DLL
0x75050000 - 0x75058000
C:\WINNT\system32\WSOCK32.DLL
0x75030000 - 0x75044000
C:\WINNT\system32\WS2_32.DLL
0x75020000 - 0x75028000
C:\WINNT\system32\WS2HELP.DLL
0x08000000 - 0x08138000
C:\j2sdk1.4.2_04\jre\bin\client\jvm.dll
0x77570000 - 0x775A0000
C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000
C:\j2sdk1.4.2_04\jre\bin\hpi.dll
0x00CE0000 - 0x00CEE000
C:\j2sdk1.4.2_04\jre\bin\verify.dll
0x00CF0000 - 0x00D09000
C:\j2sdk1.4.2_04\jre\bin\java.dll
0x00D10000 - 0x00D1D000
C:\j2sdk1.4.2_04\jre\bin\zip.dll
0x77920000 - 0x77943000
C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000
C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000
C:\WINNT\system32\PSAPI.DLL
Heap at VM Abort:
Heap
def new generation total 576K, used 197K
[0x10010000, 0x100b0000, 0x104f0000)
eden
Another exception has been detected while we were
handling last error.
Dumping information about last error:
ERROR REPORT FILE = (N/A)
PC = 0x00efa6c3
SIGNAL = -1073741679
FUNCTION NAME = (N/A)
OFFSET = 0xFFFFFFFF
LIBRARY NAME = (N/A)
Please check ERROR REPORT FILE for further
information, if there is any.
Good bye.
--------------EXCEPTION!---------------------
Thanks a lot.Yeah switching to Linux is a good idea. The firsttime I tried that,
GRUB crashed and I screwed everything else tryingto copy the
bootloader. Before this I had problems accessingthe file system on
Windows via LAN, Samba server is not really theeasiest to use.
Before that I had display problems with wierdmessages like sync out
of range, Init respawning too fast so disabling.......I guess this is just
the tip of an iceberg when it comes to problemswith Linux. It is
sometimes really frustrating.Really? The only problems I recognise are the
automatic chip set
detection for the graphics card. I always let it boot
in 'mode 3', figure
out the exact chip set present in the computer and
only then switch
to 'mode 5' ...Yeah I had all these problems with RH Linux within a span of 2 months.
I solved most of them though(Google is my best friend ;). The problem with the display was coz of horizontal and vertical sync values.
btw, Samba has a nice webbrowser interface; I simply
follow the docs
step by step (I know next to nothing about Samba) and
I'm in business
after typing in all the required stuff ...I had problems with Samba bcoz of the firewall settings and the firewall interface was not comin on properly on the display.
And now there are viruses for Linux too!Never do anything online when logged in as root and
keep your FS
permissions sensible.Yeah. I dont log in to root untill it is really really needed.
An offtopic question (hope no one minds) Is there any book for Linux which is on the same lines of "The Design of the Unix Operating System" by Maurice.J.Bach?. If yes, then pls pls lemme know. I am a big Fan of "The Design of the Unix Operating System".
kind regards,
JosThanks and regards. -
Hi all,
Am wanting to convert a char value (the infoobject is defined as NUMC) into float in order to perform a calculation in the FOX formula. It would not allow the char value to be stored into a float variable...comes back wz an error message - Types of operands F and <infoobject_numc> do not agree.
Any ways of doing this? I thought about using a function to perform the conversion from char to float format but dont knw if such a function exists on the BI system?
Thanks!Hi,
I sometimes use a local variable of type STRING to pass on values to other data types:
DATA local type STRING.
local = A.
B = local.
But I'm not sure it will work for you. If not, you can do it with an exit function.
D -
Floating fields and fragment subforms in Outlook 2007 do not display correctly
I'm using LCES Forms 8.0 Update 1 to render a non-interactive HTML forms using dynamic content (customer info). The email appears ok in clients except in Outlook 2007.
The Floating text and Text Fields appear multiple times on the form (scattered around their placement point on the form) and the subform fragments are appearing with borders surrounding them.
I have heard that there are issues with Outlook 2007 not displaying HTML correctly. Is there a way to setup the Text Fields/Subforms in Designer so they display correctly in Outlook 2007?
Thanks!Create a new profile as a test to check if your current profile is causing the problems.
See "Basic Troubleshooting: Make a new profile":
*https://support.mozilla.org/kb/Basic+Troubleshooting#w_8-make-a-new-profile
There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
If the new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
See:
*http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox -
hi iam having prob with the following decode function
declare
c varchar2(20);
begin
select decode(deptno,
10, 'accounting',
20,'Research',
30 ,'sales',
40,'operations','UNKNOWN') into c from dept where loc='DALLAS';
dbms_output.put_line('DEPARTMENT in DALLAS'||c);
select decode(deptno,
10, 'accounting',
20,'Research',
30 ,'sales',
40,'operations','UNKNOWN') into c from dept where loc='INDIA';
dbms_output.put_line('DEPARTMENT IN INDIA'||c);
end;
iam getting no_data_found exception which is reasonable..but what happened to 'unknown' clause in decode function.
thank u
rajivDECODE only works on rows returned from the database. If there are no rows, DECODE has nothing to work on.
Consider:
SQL> SELECT DECODE(dummy, 'X', 'Found a row', 'No row')
2 FROM dual;
DECODE(DUMM
Found a row
SQL> SELECT DECODE(dummy, 'X', 'Found a row', 'No row')
2 FROM dual
3 WHERE 1=2;
no rows selectedIf you want to have c contain UNKNOWN when there are no rows returned, you need to do something more like:
DECLARE
c VARCHAR2(20);
BEGIN
BEGIN
SELECT DECODE(deptno, 10, 'accounting',
20,'Research',
30 ,'sales',
40,'operations','UNKNOWN')
INTO c
FROM dept
WHERE loc='DALLAS';
EXCEPTION
c := 'UNKNOWN';
END;
DBMS_OUTPUT.Put_Line('DEPARTMENT in DALLAS'||c);
BEGIN
SELECT DECODE(deptno, 10, 'accounting',
20,'Research',
30 ,'sales',
40,'operations','UNKNOWN')
INTO c
FROM dept
WHERE loc='INDIA';
EXCEPTION
c := 'UNKNOWN';
END;
DBMS_OUTPUT.Put_Line('DEPARTMENT IN INDIA'||c);
END;HTH
John -
ISE 1.2 - Multiple NICs/Load Balancing for DHCP Probe
Hello guys
Just prepping an ISE 1.2 patch 8 setup in our organization. I am going for the virtual appliances with multiple NICs. It will be a distributed deployment with 4 x PSNs behind a load balancer and there is no requirement for wireless or guest user at the moment. I've got 2 points I will like to get some guidance on:
Our DC has a dedicated mgmt network and I plan to IP the gig0 interface of the PANs, MNTs and PSNs from this subnet. All device admin, clustering, config replication, etc will be over this interface. However, RADIUS/probe/other user traffic to the ISE PSNs will be over the gig1 interface which will be addressed from another L3 network. Is this a supported configuration in ISE?
I intend to use the DHCP probe as part of device profiling and will ideally like to have just an additional ip helper to add to our switch SVI config. Also, it will appear that WLCs can only be configured for 2 DHCP servers for a given network so another consideration for when we bringing our WLAN in scope. We however use ACE load balancers within our DC and from what I have read, they do not support DHCP load balancing. Are there any workarounds to using the DHCP probe with multiple PSNs without having to add each node as an ip helper/DHCP server on the NADs?
Thanks in advance
SayreHello Sayre-
For Question #1:
Management is restricted to GigabitEthernet 0 and that cannot be changed so you should be good there
You can configure Radius and Profiling to be enabled on other interfaces
Even though you are not using guest services yet, you can dedicate an interface just for that. As a result, you can separate guest traffic completely from your production network
Take a look at this link for more info:
http://www.cisco.com/c/en/us/td/docs/security/ise/1-2/installation_guide/ise_ig/ise_app_c-ports.html
For Question #2
If you are using a Cisco WLC and running code 7.4 and newer you don't need to mess with the IP helper configurations.
The controller can be configured to act as a collector for client profiling and interact with the DHCP thread along with the RADIUS accounting task that is running on the controller. The controller receives a copy of the DHCP request packet sent from the DHCP thread and parses the DHCP packet for two options:
–Option 12—HostName of the client
–Option 60—The Vendor Class Identifier
After this information is gathered from the DHCP_REQUEST packet, a message is formed by the controller with these option fields and is sent to the RADIUS accounting thread, which is in turn transmitted to the ISE in the form of an interim accounting message.
Both DHCP and HTTP profiling settings are located under the "Advanced" configuration tab in the WLC
On the other hand, you can also use Anycast for profiling. You can check out some of Cisco Live's sessions for more info on that. Here is one that is from a couple of years (There are more recent ones that are available as well):
http://www.alcatron.net/Cisco%20Live%202013%20Melbourne/Cisco%20Live%20Content/Security/BRKSEC-3040%20%20Advanced%20ISE%20and%20Secure%20Access%20Deployment.pdf
I hope this helps!
Thank you for rating helpful posts! -
I have CS3 and I like having my images float without "sticking" to anything over the whole screen. As it is now, they like to grab onto the edge of the application when I move them outside its boundaries. I did this all the time in CS2 and I like it a lot. This new thing is very annoying and I want desperately to TURN IT OFF. Please! I am asking could someone please tell me how to turn the image stickiness to the edge of the app OFF? Thanks so much in advance!
Nothing I've tried thus far has worked and I've lost three days trying to figure it out. Why is this not a clickable option to turn off in preferences???You can't.
The Mail.app displays all image/photo and single page PDF attachments inline or viewed in place within the body of the message by default - sending and receiving.
You can control-click on a viewed in place attachment and select View as Icon but the icon for the attached file will remain in the body of the message. Regardless, depending on the recipient's email client and available preference settings, such attachments may appear inline or viewed in place when the message is opened by the recipient (as with the Mail.app when receiving such attachments) or as attached files only which must be opened separately to be viewed for which the sender has no control over.
This was a minor adjustment for me at first but I now prefer such attachments being displayed inline since I have confirmation that I selected the correct file or file names as attachments before the message is sent.
Maybe you are looking for
-
How can I access my App Store now I have changed my apple ID
How can I access my App Store now I have changed to a new apple ID?
-
On my Imac in Illustrator 10 - when I do 'command open' I can get a preview in illo.ai but Not in illo.eps. How come? Thanks.
-
How to convert a string into xml file
Hi, i have a string . the string contain fully formated xml data. i mean my string like below <?xml version="1.0"?> <PARTS> <TITLE>Computer Parts</TITLE> <PART> <ITEM>Motherboard</ITEM> <MANUFACTURER>ASUS</MANUFACTURER> <MODEL
-
Battery discharging very quickly
Battery discharges very quickly, even after reset. What to do?
-
Printer selection shuts down...
I have 2 HP printers connected to my G4 laptop. First one is as PSP2355. The most recent one is D5160. Both worked fine when I added the D5160 about a week ago. When I went to print two days ago, no printers could be found. Did the utility, it saw th