Another Newb Question

When using doubles I get like 140.000001 one or so when I put it into an equation. My question is how would I just just drop it off to a certain amount of decimal points that I choose?

http://java.sun.com/j2se/1.4.1/docs/api/java/text/DecimalFormat.html

Similar Messages

  • Another newb question: multiple virtual servers

    Hi, I have yet another ignorant question. I have several unrelated web projects that I am working on, and I would like to be able to set up a virtual server for each one for testing purposes, such as: http://project1, http://project2, http://project3. Can someone tell me if this is doable, and if there are any tutorials/resources on this for someone who has 0 experience running a web serer? Sorry for being so ignorant!

    Yes, it is doable.
    You can setup virtual server either by IP or by name.
    If you have one IP, and want to set them up by name (ex. http://project1, http://project2, http://project3) you can do so easily with this type of configuration:
    <virtual-server>
        <name>mydomain</name>
        <http-listener-name>http-listener-1</http-listener-name>
        <host>*.mydomain.com</host>
        <document-root>/www/domain</document-root>
      </virtual-server>
      <virtual-server>
        <name>myotherdomain</name>
        <http-listener-name>http-listener-1</http-listener-name>
        <host>*.myotherdomain.com</host>
        <document-root>/www/myotherdomain</document-root>
      </virtual-server>
    ....The important part here is that
    a) all virtual servers share the same HTTP listener
    b) which virtual server serves the request depends on the $HOST request header send by the client. Sun Web Server does the matching for you. It will match $HOST vs. the virtual server's host attribute. Depending on which site you connect to the right virtual server will be used.
    c) if the $HOST request header does not match any of the virtual servers, then the default virtual server defined in the HTTP listener will be used.
    To create a virtual server, use the Admin GUI, access the configuration, and then add new virtual server. Or use the following CLI command.
    wadm> create-virtual-server --config=myconfig --http-listener-name=http-listener-1 --document-root=/www/docs/myserver.com --host-pattern=myserver.com --log-file=../logs/myserver.com-error_logs myserverHost pattern will be used for matching. Some of this elements might be optional.
    Hope that helps. And keep the questions coming :D
    Edit: Also check the documentation
    Using Virtual Servers in SJS Web Server 7.0

  • What am I doing wrong with this filter (counter/frequency issue), probably another newb question.

    I extracted the part of my VI that applies here.  I have a 6602 DAQ board reading a counter for frequency, using a Cherry Corp proximity sensor.  Getting a lot of noise and errant ridiculously high readings.  Speed of shaft which it's measuring is currently 2400rpm with one pulse per revolution so 40hz. 
    Trying to use the express filter VI to clean up the signal and ignore anything over, say, 45hz and under 35hz.  No matter what setting I choose I continually get the  20020 error, Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.  I know this relates to sample period somehow, but for the life of me I can't understand what I'm doing wrong. 
    I used this VI without filtering on bench tests with a hand-drill and got perfect output every time.  Now it's on the machine and being erratic.  Any help here will ease my stress level significantly, thanks.
    VI attached
    Still confused after 8 years.
    Attachments:
    RPM.vi ‏92 KB

    Hello Ralph,
    I'm not sure about mounting your sensor to your rig, but I can provide a couple ideas about the filtering. Depending on the type of noise, the digital filters on the PCI-6602 could help eliminate the behavior you are seeing. If the noise manifests as a "glitches" or a bouncing signal, you could use another counter with a minimum period to help eliminate the noise. This concept is discussed in greater detail in this KnowledgeBase. I noticed that you are using NI-DAQmx; the practical application of the digital filters on the PCI-6602 in NI-DAQmx is discussed in this KnowledgeBase. A more detailed description of the behavior of these filters is provided in the NI-DAQmx Help (Start>>All Programs>>National Instruments>>NI-DAQ) in the book entitled "Digital Filtering Considerations for TIO-Based Devices".
    I also wanted to comment on your original post and explain why you were receiving error -20020. For convenience, I have copied the text of the error code below.
    Error -20020 occurred at an unidentified location
    Possible reason(s):
    Analysis:  The cut-off frequency, fc, must meet:  0 <= fc <= fs/2.
    I think you may have misunderstood exactly what the Filter express VI does. The Filter express VI takes a series of values in a waveform and performs filtering on those signals. So, it will look at a waveform made up of X and Y values and apply the defined filter to this waveform. Specifically in your application, the cut-off frequency (fc) is the Upper Cut-Off level that you specified in the Filter express VI; any frequency components of the waveform outside of the range you have defined will be filtered. The fs is the sample rate based on the data that you wire to the Signal input of the Filter express VI. In your VI, this data is coming from the DAQ Assistant. So, fs will be the sample rate of the DAQ Assistant and is associated with the rate at which points are acquired. The sample rate does NOT relate to the bandwidth of the signal, except that the Nyquist theorem tells us that the sample rate must be at least twice the signal bandwidth in order to determine periodicity of the signal. So, in this case, the sample rate of the DAQ Assistant would need to be at least double the high cut-off frequency.
    However, you are performing a frequency measurement using a counter. I think this is where the confusion comes in. For the frequency measurement using a counter, the DAQ Assistant returns a decimal value which represents the rate of the pulse train being measured by the counter. It does not return the actual waveform that is being read by the counter. It is this waveform that would be band-pass filtered to eliminate frequency content outside of the filter's bandwidth. Instead of the Filter express VI, I would recommend that you simply discard values that are outside the range you specify. I have modified the code you posted earlier to perform this operation. The image below shows the changes that I made; rather than using the Filter express VI, I simply compare the frequency to the "Low Threshold" and "High Threshold". I use a Case structure to display the value on if it is within the limits. Otherwise, I display a "NaN" value. I have also attached the modified VI to this post.
    Message Edited by Matt A on 09-04-2007 07:58 PM
    Matt Anderson
    Hardware Services Marketing Manager
    National Instruments
    Attachments:
    RPM (Modified).JPG ‏17 KB
    RPM (modified).vi ‏72 KB

  • Another Newbie Question, (Sigh) G5 how to open the Dvd Drive, Without an os

    Hi all as some of you will know!
    I'm pretty new to PM, and osx. Not sure what keyboard buttons to press when first booting up my system,
    Ok so heres the Deal bought a 2.0ghz and 2.5ghz powermac G5's from my work, No hard Drives so ive used a couple of 1Tb sata drives out of a couple of old pc's i have knocking about,
    1. with no opearating system on the drives how do i get the cd tray to open is their a button or key I press at startup.
    2. powered the 2.5 up and got this info (not sure what keys i hit to get this)
    User abort
    Apple Powermac 7,35.2.4.f1
    Boot Rom built on 03/25/05 at 16:41:34
    Then some other blurb about shutdown and macboot etc I typed shutdown? I take it that this is it's birthday date!
    So Guys what are the short cut keys and what do I need to know.
    These are my first ever macs and osx is totally alien to me! So while most of you guys will know this stuff off by heart  to me it's another world!
    Bye the way luving all of this! Just like my first days with the pc! Only better
    ps blasted the inside of the case's with compressed air! Man I cant believe the crap and crud that came out of them.

    OK, one of the easiest ways and probably, in a sense, the best way if you are going to install OS fresh, is to boot into Open Firmware (which you actually did as described in your post).  You can do this intentionally by holding down the cmd-option-O-F key combination until you get to the open firmware white screen.
    Then, type the following command:
    eject cd <enter>
    which will cause the optical drive tray to come out.  Drop the install disc into the tray.  Then type
    eject cd <enter>
    which will cause the tray to close.
    Then, type the next three commands to initialize NVRAM and reboot the computer.
    reset-nvram <enter>
    set-defaults <enter>
    reset-all <enter>
    Then, as it does the reboot, hold down the 'C' key which will cause the machine to try to boot from the install disc.

  • Another NewB question about Cubase LE / monitoring and click

    I am using Tascam 1804 and Cubase LE on windows XP.
    I want to record analog signal on Cubase LE, but hear monitoring from Tascam. That goes well as long I want to hear CLICK as well through Tascam. Is this possible? How?
    I have tried to utilize ASIO, no result. I can see that Tascam received click by MIDI (green light blinks according to click), but no click sound from headphones.
    Please advice, how to make clicking to Tascam in a simple way.
    Thanks,
    Jani

    What you need to do to monitor VST effects in Cubase in real time whilst recording.
    This is Applicable to all EMU patchmix soundcards eg. EMU 0404, 1212.
    1. Switch off Direct monitoring in Cubase.
    2. Switch off Direct monitoring in patchmix: Mute the input channel(s) you are using in patchmix.
    Q. Why does this work?
    A. You currently can not hear the effects whilst recording because Cubase is using the unprocessed signal as the monitor signal. What you want it to do is to hear the processed signal. Therefore Switch Off Direct Monitoring.
    HOW-TO
    = Switch off Direct Monitoring in Cubase =
    1. On the toolbar Click on Devices=>Device Setup
    2. In Device Setup Click on VST multitrack
    3. Untick Direct Monitoring
    4. Click on Control Panel Button
    5. Set ASIO Buffer Latency to a low figure. Say 5ms
    (The lower the Buffer Latency the more the 'responsive' the computer.)
    6. Press OK (Your Back in Device Setup)
    7. Press OK
    HOW-TO
    = Mute Input channel(s) you are using in patchmix =
    1. Run the patchmix software
    2. Click on the M button@ bottem of fader to mute the input channels.
    Done :-)
    dG

  • Another newbie question (sorry)---Please recommend a good training book?

    And where to order?
    Thanks.

    All these books are great - and I've read them all and done the exercises. But I have to put in my 2 cents and recommend Larry Jordan's book and web site. The book is well written and understandable. His web site is full of great tips, and his free monthly e-mail newsletter is great. Now, he has a new newsletter called Edit Well published in conjunction with Peachpit Press.
    Details on all this at: http://www.larryjordan.biz/
    Good Luck! And welcome to Final Cut!

  • Another newbie question... regarding 7.2.1, 7.2.2, and 7.2.3

    Kind of silly that I'm asking this when i havent even gotten my 7.2 yet. But I just want to know beforehand. Which of these, according to general consensus is the least buggy update? From what i've read around, it seems that with each new update, new bugs arise!!! amazing!!!!
    According to my specs (macbook pro 2.16 ghz, 2 gb ram) which version do you guys think would be most stable? From what I've gathered 7.2.3 only offers performance improvements for G5's and Mac Pro's so in order to avoid introducing any further bugs, I'm thinking 7.2.2 would be appropriate?
    Macbook Pro 15" :: 2.16 Intel Core Duo, 100 GB 7200 rpm HD, 2 GB ram   Mac OS X (10.4.7)  

    7.2 for me

  • Variable accessibility: newbie question

    My next newbie question:
    The following two classes are in two separate files in the same a folder testClass2:
    package JavaDemos.testClass2;
    import java.awt.*;
    public class Sketcher {
        static SketchFrame window;
        static int widthXXX;
        public static int getwidthXXX() {
            return widthXXX;
        public static void main(String[] args) {
            window = new SketchFrame("Sketcher");
            widthXXX=1000;
            System.out.println("output: width = " + widthXXX);
            window.setVisible(true);
            window.specialReport();
    package JavaDemos.testClass2;
    import javax.swing.*;
    public class SketchFrame extends JFrame {
        public SketchFrame(String title) {
            setTitle(title);
            setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        public void specialReport(){
            System.out.println("number " + widthXXX);
            //     System.out.println("number " + Sketcher.getwidthXXX());
    }They don't compile.
    I get the following error message:
    JavaDemos/testClass2/SketchFrame.java [23:1] cannot resolve symbol
    symbol : variable widthXXX
    location: class JavaDemos.testClass2.SketchFrame
    System.out.println("number " + widthXXX);
    ^
    1 error
    Why isn't widthXXX directly accessible from SketchFrame?
    Thank you again in advance for any help.

    Why isn't widthXXX directly accessible from
    SketchFrame?Because it's a class variable of another class. You have to refer to it as Sketcher.widthXXX.

  • Newb Question for burning DVD/CDs

    I have an external DVD writer on my iMac.
    I got the thing last month and an completely new to Apple (sorta)
    Now how do I make a data CD and DVD?
    On Winblows XP all I need to do is select the files, right click and click on SEND FILES TO CD for making data CDs.
    However for DVD I need 3rd party software.
    Will iDVD do the trick?
    Thanks for the looking at this simple newb question.
    GeekyBoy

    Now how do I make a data CD and
    DVD?Drag the files to the icon of the
    blank CD/DVD that appears in the
    Finder.However for DVD I need 3rd party
    software.You might want to try Patc
    hBurn.Will iDVD do the
    trick?No, iDVD is only for making video
    DVDs and it requires a G4 processor.
    Thanks for the tip Duane.
    I was just reading abotu burning CD on another site. It mentions about what you said, drag the files to the CD.
    However I am reading in my profiler that burning is NOT supported by OS X on this CD/DVD writer.
    Will Patchburn or any other software overcome this?
    Thanks

  • InDesign or Acrobat (newbie question)

    Hi,
    I tried posting this in the LiveCycle Designer forum, but I think it's a bit too much of a newbie question:
    Once in a blue moon when I'm at work, someone will ask me if I can add text fields to a PDF form so that they can easily type onto it and print it out. I've always done that directly in Acrobat (on the few occasions that it's been requested from me). But I was curious about Adobe LiveCycle since it came with CS3, so I played around with it a couple of days ago. I added the text fields in LiveCycle this time, and it seems to have worked fine. Which is the better program for this kind of task? I'm not 100% clear on the *main* purposes of either program or how they compare. If anyone wanted to give me a clue about it, I'd appreciate it!
    Thanks,
    Phyllis

    > I thought perhaps you could add that capability
    You can (I said I was oversimplifying). However there are contractual
    limits - to oversimplify (!) 500 users per form.
    >Which would be preferable -- receiving form data from LiveCycle or Acrobat?
    It depends what you want to do.
    >
    >I wish I knew what the difference was between these two programs. Is it purely a matter of emphasis on one task or another?
    They come to the same problem in different ways. For a simple task
    they may seem pretty much the same. Some differences:
    * A form made in Acrobat is a PDF with form fields stuck on top; it
    remains a normal PDF in every other way. Forms are almost always made
    by preparing an existing PDF, then adding form fields.
    * A form made in Designer is barely a PDF. It's a wrapper round an XML
    file. You can no longer edit it in Acrobat, ever, even for the most
    simple things. PDF files are imported and converted (sometimes with
    loss of quality or features), or forms are made from scratch.
    * Acrobat form fields are fixed size.
    * Designer form layout can be dynamic.
    Aandi Inston

  • Another Newbie

    Hey guys
    As you can see of the subject im just another newbie who needs help +)
    Well...here i am newbie to java programming who extremely wants to now it and be able to manage it +)
    My understanding that all that i need i can get from books. So is there any of you guys can give me an advise which book is better to start off. There is a huge amount of books on the market and i feel a bit lost.. which one?? +)
    Or there is better option for me to learn Java??
    Cheers

    If you can get the assistance of someone who really knows Java in person, that will be your most valuable resource. After that, the online Java tutorials, and any of the books recommended are good starting points.
    If you've already got some sort of programming background, I'd personally recommend reading "The Java Programming Language" as a way to get a thorough grounding in the fundamentals of the language, then perhaps the Bruce Eckels book "Thinking in Java" (which is available online).
    After that, your most valuable resources will be the JavaDoc APIs which you can access online, or download.
    Finally, if you choose to ask questions here:
    * Remember to search the forums for answers first.
    * Try to include code to illustrate the problem you're encountering
    * Always include all the error messages (including compiler errors).
    Dave.

  • MailServer Newbie Question..

    So my first time i setup a Mail Server with Mac OS X Server.
    Everything works like a charme. I can send and receive emails internally. That means
    i can send and receive emails from mac to pc and vice versa. Now my question.
    How do I setup the Server to catch my external eMail adresses and send it to my internal account.
    And how do I setup to send throw my server to the rest of the world without getting banned and
    blacklisted
    I how someone can write a small tutorial for me or can post a link for this newbie question.
    Thanx in advance..
    mike
    P.S.: Sorry for my bad English. But I am from Germany

    how to configure the server to accept mail for my own domain ?
    Any domain you want to receive mail for goes into the Local Host Aliases pane (in Advanced-> Hosting tab). However, you said that you can already send and receive internally so presumably you have it set up for a domain already? If this is not the same domain as you want to use, just change whatever settings you are using to your real domain. You can then test sending and receiving internally for your own domain but without changing your external (public) mail provider. When you are ready to change your outside mail server for your own one, get the public MX record changed so that all external mail starts getting directed to your own server.
    how to get the public DNS record (MX Record)
    If you have a 'real' domain then someone is hosting your DNS for that domain. THis is probably whoever you bought the domain from. You need to get them to change your MX record (or the IP address for the host name record which the MX points to - see my first post).
    Is it really impossible to catch the external email-accounts with the server via pop.
    my idea behind that is to synchronize the external email accounts with the email accounts on the server..
    I have never really looked into getting a mail server to use a pop download from another external mail server - it may be possible by manual configuration but it never made sense to me. Why have two mail servers in a 'chain'? Basically, the public will see only one server responsible for your mail (via MX record) - you have to decide whether you want to leave this with your external provider or take the responsibility yourself.
    Your configuration for the incoming mail seems to me like you would change the
    external email server completely to my internal server.. right ??
    Correct. Once the public MX record is changed then all other mail servers will send to your server and not your current provider. You can always revert back by changing the MX record back to your existing provider (as long as your account is still open).
    -david
    Message was edited by: David_x

  • Starting fluxbox-newbie question

    :? I currently have kde running on my system. I installed fluxbox using pacman. 
         How do I start fluxbox? I couldn't even find it, so I su to root, type fluxbox, and get
         an error message saying that another window system is already running! (kde)
        A  typical newbie question, but I don't know how to start fluxbox. I think I want to
        replace kde with fluxbox, so should I just uninstall kde?? 
                                                           Thanks -- Larry

    lmellen wrote:
    :?  scottro -- This is .xinitrc.
    #!/bin/sh
    # ~/.xinitrc
    # Executed by startx (run your window manager from here)
    exec wmaker
    # exec startkde
    # exec icewm
    # exec blackbox
    exec fluxbox
    The only thing I uncommented was" exec fluxbox". I'm still getting kde at start up.
    I have kdm listed in a start up daemon in rc.conf. is this the problem?
                         thanks for the reply -- Larry
    if you comment out exec wmaker and then put a ! in front of the kdm daemon you should boot to a console at which point you login then type startx. you may also have to change your init level but i dunno i haven't used a graphical login manager for a very long time.

  • RV042G Newbie Questions

    I have the new Cisco RV042G router, and I have just a few "newbie questions" about it as I get started using it:
    The firmware on board is v4.2.1.02. Since this is a brand new router, is that the latest firmware?
    Under Time>DST Dates, what do I need to configure in there? I'm in the US, Central Time.
    I want to use Back to My Mac from iCloud (formerly MobileMe). Under the iCloud preferances pane on my Mac, it's saying: "Back to My Mac may be slow because NAT Port Mapping (NAT-PMP) or Universal Plug and Play (UPnP) is turned off on your router. Turn on NAT-PMP or UPnP." What should I enable on my router in order for Back to My Mac to better function?
    I'm using a VOIP phone on the network (only 1 device with a couple phones). Are there any QoS settings I should tweak for better performance of my VOIP phone? I did change the port the VOIP phone is connected to to High (instead of Normal) under Port Settings. Will this help boost performance?
    I also want to setup a VLAN on a port for guests to access the Internet, but not have any access to my personal network. Here's the steps I've done so far. Is this sufficient or is there anything else I need to do?
    I went to Setup>Network, enabled Multiple Subnets.
    I added 192.168.254.1/255.255.255.0 as a subnet.
    I went to Port Management>Port Setup, set the port I wanted to use (Port 4) to VLAN2.
    I went to Firewall>Access Rules, added two rules:
    Deny All Traffic from 192.168.254.0 to 192.168.1.0.
    Deny All Traffic from 192.168.1.0 to 192.168.1.0.
    Thanks everyone for your help!

    Easy.  just goto the DHCP field and fill in the Static DHCP fields.
    Assigning static IP addresses by adding devices from a list
    Click Show unknown MAC addresses. The IP & MAC binding list appears. If the web browser displays a message about the pop-up window, allow the blocked content.
    The devices are listed by the IP address and the MAC address. (Typically the MAC address appears on a label on the bottom panel or back panel of a device.) If needed, you can clickRefresh to update the data.To select a device, first enter a descriptive Name. Then check the Enable box. Alternatively, select all devices in the list by clicking the check box at the top of the Enable column.
    Click OK to add the devices to the Static IP list, or click Close to close the pop-up window without adding the selected devices. After you click OK, a message appears. The message includes important information. Read it before clicking OK. Keep the browser open and wait until the selected MAC addresses appear in the Static IP list.
    Modify or remove list entries, as needed:
    To modify the settings: Click a device in the list. The information appears in the text fields. Make the changes, and then click Update. If you do not need to make changes, you can click Add New to de-select the entry and clear the text fields.
    To delete an entry from the list: Click the entry that you want to delete, and then clickDelete. To select a block of entries, click the first entry, hold down the Shift key, and then click the final entry in the block. To select individual entries, press the Ctrl key while clicking each entry. To de-select an entry, press the Ctrl key while clicking the entry.
    Assigning static IP addresses by entering devices manuallyIn the Static IP Address section, add or edit entries as needed. Remember that the settings are not saved until you click the Save button.
    To add a new device to the list: Enter the following information, and then click Add to list.
    Static IP Address: Enter the static IP address. You can enter 0.0.0.0 if you want the router to assign a static IP address to the device.
    MAC Address: Enter the MAC address of the device. (Typically the MAC address appears on a label on the bottom panel or the back panel of a device.) Enter the address without punctuation.
    Name: Enter a descriptive name for the device.
    Enable: Check this box to assign the static IP address to this device.
    To add another new entry: Enter the information, and then click Add to list.
    To modify the settings: Click a device in the list. The information appears in the text fields. Make the changes, and then click Update. If you do not need to make changes, you can clickAdd New to de-select the entry and clear the text fields.
    To delete an entry from the list: Click the entry that you want to delete, and then click Delete. To select a block of entries, click the first entry, hold down the Shift key, and then click the final entry in the block. To select individual entries, press the Ctrl key while clicking each entry. To de-select an entry, press the Ctrl key while clicking the entry.
    Using the Static IP List to Block Devices
    You can use the Static IP list to control access to your network. You can block access by devices that are not on the list or do not have the correct IP address.
    Add devices to the Static IP list as described in Static IP Addresses.
    Enable or disable the following features:
    Block MAC address on the list with wrong IP address: Check this box to prevent a computer from accessing your network if its IP address has been changed. For example, if you previously assigned a static IP address of 192.168.1.100 and someone configures the device to use 192.168.149, the device will not be allowed to connect to your network. This feature discourages users from changing their device IP addresses without your permission. Uncheck the box to allow access regardless of the current IP address assignment.
    Block MAC address not on the list: Check this box to block access from devices that are not included in the Static IP list. This feature prevents unknown devices from accessing your network. Uncheck the box to allow access by any connected device that is configured with an IP address in the correct range.
    Hope that helps.
    Regards Simon
    http://www.linksysinfo.org

  • Trouble backing up Macbook (10.4.11) and some newbie questions...

    I am using a MacBook OS X 10.4.11 and do not have Time Machine. I have a couple newbie questions...
    What is the best way to back up everything? I am using Disk Utility's Restore tab but it is taking forever. I first tried to do it though Disk Utility's First Aid tab but it wouldn't let me make a New Image because the "source was in use", I think it is because I don't have the Install Disc to begin with (http://support.apple.com/kb/ht1553).
    Secondly, does this include everything in "Home" (bookmarks, iPhoto library, iTunes library and so forth), Documents, and Desktop? Or must these be archived and transferred to the external hard drive separately from Macintosh HD?
    Thanks in advance for any help!

    I tried restarting the phone and switching to another USB cable and now it is working so never mind.

Maybe you are looking for