Need help in execution of script

Dear experts,
We have a central database 10g installed on windows server 2008. We have 47 sites and each site has its own database. We created Materialized views in central DB which collect data from all 47 sites. We have a script to refresh these Materialized views. The problem is this when one/ some sites down, the script halts/stop working at that specific point. We want a script which skip that specific (down) site. following is some part of the script.
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_AFLAGDB.SQL"
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password@rrdb @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_SLAYELDB.SQL"
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password@rrdb @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_DWASERDB.SQL"
(note: AFLAG, SLAYEL & DWASER specifying the site name). Please experts help me in this concern.

Probably the wrong forum for this question.
My guess would be that you need to add some sort of check to see if the site is up before running the refresh.
What is meant by having the site down?
What kind of script is this?
If it's a batch script:
Batch script to test if Oracle instance is up on windows 2003
Use that and loop through a text files of entries to try to connect to.
Or you could probably do everything in a PL/SQL stored procedure if links are setup.  Having little idea what is in those SQL scripts I can't say whether or not this would be a good idea.
There it would be a matter of testing the link by querying dual through the link and handling the particular exception(s) of a bad link properly.
It would also reduce dependency on several script files.
Looping through the instances would also probably be easier through a procedure.

Similar Messages

  • Need help making a simple script for my webcam

    Hey everyone, fairly new to applescript programming. I just bought a usb camera for my macbook because I use it for video conferencing/playing around, and it is better quality than the built in isight. However, in order to use this camera I need to use drivers from a program called camTwist. This being said camTwist needs to be opened first and the usb camera must be selected from camTwist Step 1 list in order for any other application to use the camera. I just want to make a simple program that would open camTwist first, then select "webcam" from the list (double click it like I always have to in order to select it) in order to activate the driver, and then open photo booth which would then be using the camTwist driver in order to take pictures.
    I made a crude program but it does not automatically select "webcam" from the Step 1 list in camTwist:
    tell application "CamTwist" to activate
    delay 10
    tell application "Photo Booth" to activate
    that’s basically it. I set the delay to 10 seconds so that when camTwists boots up first I can manually select my webcam. HOWEVER, I would like to make a script that would boot up CamTwist first, select my webcam from the list automatically, and then open Photo Booth with the CamTwist webcam driver already selected.
    Don't know much about applescript so any help to make a working script to solve my problem would be greatly appreciated! Thanks!

    Solved my problem but now I need help with something else! First I used CamTwist user options to create user defined hot keys with the specific purpose to load the webcam. I chose Command+B. I tested it out in CamTwist and it worked. The program follows a logical order from there. First it loads CamTwist, then after a short delay it presses the hot keys in order to load the webcam from the video source list, then another short delay and Photo Booth is opened with the driver loaded from camTwist. Everything works Perfect! Here's the code:
    tell application "System Events"
    tell application "CamTwist" to activate
    delay 0.5
    --Press command+b which is a user defined hot key to load webcam
    key code 11 using command down
    end tell
    delay 0.5
    tell application "Photo Booth" to activate
    My Next question is, would it be possible with this same script to have both applications quit together. For example I always quit Photo Booth first, so when I quit photo booth is there a way to make CamTwist also quit and keep everything within the same script? Please let me know. This forum has been very helpful and lead me to a solution to my problem! Hoping I can solve this next problem as well! Thanks everyone.

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • Need help publishing a php script

    I am reading the book Dreamweaver CS5 with PHP training from the source and I have reached page 247. I want to publish a registration field to my site, but I have encountered a problem I cannot solve. The file path in library works fine on the local testing server since it has access to my user folder. When I am uploading the site to my remote server, i can't seem to find the right file path at the beginning of library.php
    The code looks like this now
    <?php
    $library = '/home/1/r/rentsch/Scripts/php_library/ZendFramework/library';
    When I press the register button on the page I get this message:
    Warning: include_once(Zend/Validate/Stringlength.php) [function.include-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Warning: include_once() [function.include]: Failed opening
    'Zend/Validate/Stringlength.php' for inclusion
    (include_path='.:/usr/local/php5-suphp/lib/php:/home/1/r/rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Fatal error: Class 'Zend_Validate_Stringlength' not found in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/user_registration.php
    on line 16
    Before I had that file path I got this message:
    Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    Fatal error: require_once() [function.require]: Failed opening required
    'Zend/Loader/Autoloader.php'
    (include_path='.:/usr/local/php5-suphp/lib/php:rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    I am renting a server from domainnameshop.com (in norway)
    And the page I am trying to upload to is www.rentsch.no/fredrik/Seterpaintball/registrer.php
    It is on norwegian, but it is the button that sais registrer that triggers the errors.
    I really need help on this, I can't find any solution on my own!

    I am reading the book Dreamweaver CS5 with PHP training from the source and I have reached page 247. I want to publish a registration field to my site, but I have encountered a problem I cannot solve. The file path in library works fine on the local testing server since it has access to my user folder. When I am uploading the site to my remote server, i can't seem to find the right file path at the beginning of library.php
    The code looks like this now
    <?php
    $library = '/home/1/r/rentsch/Scripts/php_library/ZendFramework/library';
    When I press the register button on the page I get this message:
    Warning: include_once(Zend/Validate/Stringlength.php) [function.include-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Warning: include_once() [function.include]: Failed opening
    'Zend/Validate/Stringlength.php' for inclusion
    (include_path='.:/usr/local/php5-suphp/lib/php:/home/1/r/rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/Scripts/php_library/ZendFramework/library/Zend/Loader.php
    on line 146
    Fatal error: Class 'Zend_Validate_Stringlength' not found in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/user_registration.php
    on line 16
    Before I had that file path I got this message:
    Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream:
    No such file or directory in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    Fatal error: require_once() [function.require]: Failed opening required
    'Zend/Loader/Autoloader.php'
    (include_path='.:/usr/local/php5-suphp/lib/php:rentsch/Scripts/php_library/ZendFramework/library')
    in /home/1/r/rentsch/www/fredrik/Seterpaintball/zend_filer/library.php
    on line 4
    I am renting a server from domainnameshop.com (in norway)
    And the page I am trying to upload to is www.rentsch.no/fredrik/Seterpaintball/registrer.php
    It is on norwegian, but it is the button that sais registrer that triggers the errors.
    I really need help on this, I can't find any solution on my own!

  • Need help to modify vb script used in XP for Windows 7

    Can somebody help me in modifying scripts that were used for Windows XP, to run on Windows 7.
    My friend advised me to change it to .ps1, but still some flaws..
    Cscript \\nologo ????  is used for what purpose ?

    Almost all VBScripts written to work in Windows XP will also work for Windows 7, so there's not much to modify (unless you have specific examples of scripts not working).
    Having said that, PowerShell is the future! It takes a bit more than to just change the file extension to .ps1 though (this may be why your scripts aren't working!).
    The VBScript-to-Windows PowerShell Conversion Guide
    http://technet.microsoft.com/en-us/library/ee221101.aspx
    C:\>cscript /?
    Microsoft (R) Windows Script Host Version 5.7
    Copyright (C) Microsoft Corporation. All rights reserved.
    Usage: CScript scriptname.extension [option...] [arguments...]
    Options:
     //B         Batch mode: Suppresses script errors and prompts from displaying
     //D         Enable Active Debugging
     //E:engine  Use engine for executing script
     //H:CScript Changes the default script host to CScript.exe
     //H:WScript Changes the default script host to WScript.exe (default)
     //I         Interactive mode (default, opposite of //B)
     //Job:xxxx  Execute a WSF job
     //Logo      Display logo (default)
     //Nologo    Prevent logo display: No banner will be shown at execution time
     //S         Save current command line options for this user
     //T:nn      Time out in seconds:  Maximum time a script is permitted to run
     //X         Execute script in debugger
     //U         Use Unicode for redirected I/O from the console
    C:\>
    Andreas Hultgren
    MCTS, MCITP
    http://ahultgren.blogspot.com/

  • Need help with PHP mail script [was: Can someone please help me?]

    I'm trying to collect data from a form and email it.  I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
    Here is the HTML code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Contact Us</title>
    <style type="text/css">
    <!--
    .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style2 {
    font-size: 14px;
    color: #000000;
    body {
    background-color: #FFFFFF;
    body,td,th {
    color: #CC3300;
    .style3 {font-size: 14px; font-weight: bold; }
    .style6 {font-size: 18px}
    .style7 {font-size: 16px}
    .style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style10 {color: #000000}
    -->
    </style>
    </head>
    <body>
    <div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
      <map name="Map2" id="Map2">
      <area shape="rect" coords="560,9,684,38" href="accessories.html" />
    <area shape="rect" coords="456,8,548,38" href="contact.html" />
    <area shape="rect" coords="305,8,435,40" href="photog.html" />
    <area shape="rect" coords="187,9,283,39" href="services.html" />
    <area shape="rect" coords="81,10,167,39" href="aboutus.html" />
    <area shape="rect" coords="5,10,68,39" href="index.html" />
    </map>
      <map name="Map" id="Map">
        <area shape="rect" coords="9,9,69,39" href="index.html" />
        <area shape="rect" coords="83,11,165,39" href="aboutus.html" />
        <area shape="rect" coords="182,9,285,38" href="services.html" />
        <area shape="rect" coords="436,14,560,37" href="contact.html" />
        <area shape="rect" coords="563,14,682,38" href="accessories.html" />
      </map>
    </div>
    <p> </p>
    <form id="TheForm" name="TheForm" action="form2mail.php" method="post">
      <p align="center" class="style2">P<span class="style1">lease fill out form below for a &quot;free no obligation quote&quot; then click submit.</span></p>
      <p align="center" class="style3">(*Required Information)</p>
      <div align="center">
        <pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
    <span class="style8"><strong>
    Business Name </strong></span><input name="bn" type="text" id="bn" />
    <span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
        onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
    <strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" />     </strong> </pre>
        <label><span class="style9">*Re-enter to confirm</span>
        <input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
    <label></label>
        </span>
        <p><span class="style9">*Best time to call </span>
          <select name="name1[]" multiple size="1" >
            <option>8am-9am</option>
            <option>9am-10am</option>
            <option>10am-11am</option>
            <option>11am-12pm</option>
            <option>12pm-1pm</option>
            <option>1pm-2pm</option>
            <option>2pm-3pm</option>
            <option>3pm-4pm</option>
            <option>4pm-5pm</option>
            <option>5pm-6pm</option>
            <option>6pm-7pm</option>
            <option>7pm-8pm</option>
          </select>
          <br />
          <br />
          <span class="style9">Type of Location</span>
          <select name="name2[]" multiple size="1" >
            <option>Residential</option>
            <option>Commercial</option>
          </select>
          <br />
          <br />
            <span class="style1"><br />
            <strong><br />
              <span class="style6">*Type of Services Requested:</span></strong><br />
            </span><strong><span class="style10">(check all that apply)</span><br />
                </strong><br />
                <span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
                <input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
                <br />
                </span><strong><br />
                  <span class="style8">Mobile Auto Detailing</span>
                <input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
                <br />
                <br />
                  </strong><span class="style9">Moving/Hauling</span>
          <input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Pressure washing</span>
          <input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window washing</span>
          <input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window Tinting</span>
          <input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Boat cleaning</span>
          <input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">RV cleaning</span>
          <input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Motorcycle cleaning</span>
          <input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
          <br />
          <br />
          <br />
          <br />
          <input name="SB"  type="button" class="style9" value="Submit" onClick="sendOff();">
        </p>
      </div></label>
      <script language="JavaScript1.2">
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    var good;
    function checkEmailAddress(field) {
    // Note: The next expression must be all on one line...
    //       allow no spaces, linefeeds, or carriage returns!
    var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
    if (goodEmail){
       good = true
    } else {
       alert('Please enter a valid e-mail address.')
       field.focus()
       field.select()
       good = false
    function autoTab(startPoint,endPoint){
    if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
    endPoint.focus();
    function checkNumber(phoneNumber){
    var x=phoneNumber;
    var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
    if (phoneNumber.test(x))
    testResult=true
    else{
    alert("Please enter a valid number.")
    phoneNumber.focus();
    phoneNumber.value="";
    testResult=false
    return (testResult)
    function sendOff(){
       namecheck = document.TheForm.name.value   
       if (namecheck.length <1) {
          alert('Please enter your name.')
          return
       good = false
       checkEmailAddress(document.TheForm.email)
       if ((document.TheForm.email.value ==
            document.TheForm.emx.value)&&(good)){
          // This is where you put your action
          // if name and email addresses are good.
          // We show an alert box, here; but you can
          // use a window.location= 'http://address'
          // to call a subsequent html page,
          // or a Perl script, etc.
          window.location= 'form2mail.php';
       if ((document.TheForm.email.value !=
              document.TheForm.emx.value)&&(good)){
              alert('Both e-mail address entries must match.')
    </script>
    </form>
    <p> </p>
    </body>
    </html>
    and here is the form2mail.php:
    <?php
    # You can use this script to submit your forms or to receive orders by email.
    $MailToAddress = "[email protected]"; // your email address
    $redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
    $MailSubject = "[Customer Contact Info]"; // the subject of the email
    $sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
    $serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
    # copyright 2006 Web4Future.com =================== READ THIS ===================================================
    # If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
    # If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
    # To block an IP, simply add it to the blockip.txt text file.
    # CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
    # This is needed because the script tries to block the IP that tried to hack it
    # If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
    # you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
    # you have to do the same with checkboxes
    Web4Future Easiest Form2Mail (GPL).
    Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
    http://www.Web4Future.com/
    This script was written by George L. & Calin S. from Web4Future.com
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
    $w4fver =  "2.2";
    $ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
    //function blockIP
    function blockip($ip) {
    $handle = @fopen("blockip.txt", 'a');
    @fwrite($handle, $ip."\n");
    @fclose($handle);
    $w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
    if ($serverCheck) {
    if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
    } else { $w4fy = TRUE; }
    if (($w4fy === TRUE) && ($w4fx === FALSE)) {
    $w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
    if (count($_GET) >0) {
    reset($_GET);
    while(list($key, $val) = each($_GET)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end if
    else {
    reset($_POST);
    while(list($key, $val) = each($_POST)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }   
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end else
    $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
        $w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
    $name = preg_replace($w4f_what, "", $name);
    $email = preg_replace($w4f_what, "", $email);
    if (!$email) {$email = $MailToAddress;}
    $mailHeader = "From: $name <$email>\r\n";
    $mailHeader .= "Reply-To: $name <$email>\r\n";
    $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
    $mailHeader .= "MIME-Version: 1.0\r\n";
    if ($sendHTML) {
      $mailHeader .= "Content-Type: multipart/alternative;";  
      $mailHeader .= "  boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";    
    $mailHeader .= "X-Priority: 3\r\n";
    $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
    $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
    if ($sendHTML) {
      $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
      $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";  
      $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= "$w4fMessage\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";  
    if ($sendHTML === FALSE) {
      $mailHeader .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
    else { header("Location: ".$redirectURL); }
    } else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
    ?>
    Thanks in advance,
    Glenn
    [Subject line edited by moderator to indicate nature of request]

    Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
    Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
    First of all, create a PHP page called mailtest.php containing the following script:
    <?php
    $to = '[email protected]'; // use your own email address
    $subject = 'PHP mail test';
    $message = 'This is a test of the mail() function.';
    $sent = mail($to, $subject, $message);
    if ($sent) {
      echo 'Mail was sent';
    } else {
      echo 'Problem sending mail';
    ?>
    Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
    $sent = mail($to, $subject, $message, null, '[email protected]');
    Obviously, replace "[email protected]" with your own email address.
    If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
    Change it to this:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
    Again, use your own email address instead of "[email protected]".
    Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
    <form id="form1" name="form1" method="post" action="form2mail.php">
      <p>
        <label for="name">Name:</label>
        <input type="text" name="name" id="name" />
      </p>
      <p>
        <label for="email">Email:</label>
        <input type="text" name="email" id="email" />
      </p>
      <p>
        <label>
          <input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
          Boat cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
          RV cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
          Motorcycle cleaning</label>
      </p>
      <p>
        <input type="submit" name="send" id="send" value="Submit" />
      </p>
    </form>
    If that works, you can start to make the form more complex and add back your JavaScript validation.

  • Need Help With Custom Calculation Script

    Hey everyone.  I'm using Acrobat Pro X and stumbling a bit on the syntax for the following equation.  I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3".  However,the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 & "Cell2".  For example: If the user enters "3" into "Cell3" I need the returned value to be 3% of the sum of "Cell1" + "Cell2".  If the user enters "9" into "Cell3" I need the returned value for "Cell3" to be 9% of the sum of "Cell1 & Cell2" and the end result needs to be the sum of "Cell1+Cell2+Cell3".  In greater detail:
    If "Cell1" = $500, "Cell2" = $500 and "Cell3" = "3" then I need the returned value to be $1030.00.
    I hope this makes sense. Here's what I have so far but alas, it's not working.  Any help would be GREATLY appreciated.
    // Get first field value, as a number
    var v1 = +getField("Cell1").value;
    // Get second field value, as a number
    var v2 = +getField("Cell2").value;
    // Get processing field value, as a number
    //var v3 = +getField("Cell3"/100).value;
    // Calculate and set this field's value to the result
    event.value = v3+(v1+v2);
    Thanks,
    Solan

    I posted an answer but realized it wasn't what you wanted. There is some confusion about what you want for Cell3. On the one hand, you say you want the user to enter a vaule in the field, but them you say you want its value to be calculated based on what the user enters and two other field values. It seems to me Cell3 should be the field that the user enters the percentage and the calculated field's (Cell4) script could then be:
    // Get first field value, as a number
    var v1 = +getField("Cell1").value;
    // Get second field value, as a number
    var v2 = +getField("Cell2").value;// Get processing field value, as a number
    // Get the percentage
    var v3 = +getField("Cell3").value;
    // Calculate and set this field's value to the result
    event.value = (1 + v3 / 100) * (v1 + v2);

  • Need help in writing the script in windows to read the file at runtime

    Hi All,
    I need a help with a Script. I need to read a filename from a directorty based on a specific format. I will be looking for the file in a directory that will have a file added to it each month. The script will need to go out to that directory determine the current month and Year and then grab that file based on the MONTHYEAR contained itn the file name and
    in the same script pass the filename to SQL Loader.
    The filename will consist of three parts VARIABLECONSTANTDATE.ext (example: FUELFILE11262007.txt: FUEL is a VARIABLE, FILE is constant, 11 two digit month, 26 two digit day,2007 four digit year.)
    I am stuck as how to how to read that into a string, find the file name and then pass that to sql loader.
    Any help much appreciated..
    Looking forward for your response.

    Use of External Tables will ease your problem...
    Here's what you can do:
    1. Create External tables (fuelfile.asc)
    2. Use Java code to read all filenames in a particular directory and store them in table
    3. Use PL/SQL block to loop through each filename in the table and write the file to the file of external table (fuelfile.asc)
    3.1 Transfer data from External table to main table
    Aalap Sharma :)

  • Need help with a basic script to resize image then resize the canvas

    I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal)
    I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to implement a script to accomplish this.
    I have the below script so far, but I am not certain of how to input the variables / paramters
    doc = app.activeDocument;
    if (doc.height > doc.width) doc.resizeImage("2400 pixels","3600 pixels", "300", "BICUBIC");
    if (doc.height > doc.width) doc.resizeCanvas("2400 pixels","3000 pixels", "MIDDLECENTER");
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    if (doc.height < doc.width) doc.resizeCanvas(3000,2400,"MIDDLECENTER");
    When I run this script, I get the following error:
    Error 1245: Illegal argument - argument 4
    - Enumerated value expected
    Line: 5
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    The fact that its failing on lien 5 lets nme know that I have the "If" portions of my script correct, I just dont know how to accomplish the functions correctly.
    Any help would be appreciated!
    Thanks,
    Brian

    I know I'm late here but it seems to me your trying to automate a 8"x10 or 10"x8 300DPI  print.
    To do that you must first crop your image to a 4:5 aspect ratio to prevent distortion unless your shooting with a 4" by 5" camera.   I wrote a Plugin script a couple years ago that could help you do a centered crop.  You could do the whole process by recording a simple Photoshop action that uses two  Plugin Scripts only four steps would be needed.
    Step 1 Menu File>Automate>AspectRatioSelection  (My script based of Adobe Fit Image Plugin script) Set 4:5 Aspect ratio, center,  Rectangle, Replace, no feather. Llike Fit Image this script woks on both Landscape and Portrait images. The Selection will be correct for the images orientation.
    Step 2 Menu Image>Crop
    Step 3 Menu File>Automate>Fit Image set 3000 PX height and 3000 PX width the Image will be Resample so its longest side will be 3000 pixels.  Adobe Fit Image Plugin Script always uses BICUBIC resampling.  I have a modified version of Fit Image  that uses Bicubic Sharper whebndownsizing and BicubicSmoother when up sizing.
    Step 4 Menu Image>Size un check resample set resolution to 300 DPI.
    When you play the actions the Script Dialogs will not be displayed and the setting use when you recorded the action will ne used.
    The Plugin Script are included in my crafting actions package:
    http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip
    Contains:
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.
    12 Scripts for actions
    My other free Photoshop downloads cam be found here: http://www.mouseprints.net/Photoshop.html

  • I need help making a backup script

    I'm trying to create this full system backup script that I plan to run manually. I have some commands to compress and extract my root directory and everything in it, but they're not complete because there are a few other features I would like to have. The problem is that I have no idea how to implement these specific features, and my googling of bash scripting documentation only left me confused and at square 1. This is what I have so far (just commands I can run in the terminal):
    To compress:
    sudo tar -cpf ~/archive.tar.gz / --exclude=/proc
    To extract & restore:
    sudo tar -xpf /home/agi/archive.tar.gz -C /
    I want this script to:
    1. allows me to run as
    sh ~/.bin/backup.sh [directory to back up]
    What I mean is there should be some sort of parameter in the script so that when I run it, I can choose whatever directory I want to compress rather than just be limited to just /.
    2. puts finished .tar.gz in my home directory (I plan to transfer the archive to external media or online later; this gives me the freedom to not need to have a specific drive connected to run the script). I already have this in the commands, but I just wanted to point out that this is important.
    3. names finished .tar.gz DD-MM-YY-backup.tar.gz where DD is day, MM is month, YY is year.
    4. the "sudo" part works correctly. That is, the script, when run, asks for a password and can be granted root permissions (or is granted root permissions in some other way) so that I can back up all parts of my system without these sorts of errors.
    5. shows some sort of progress indicator. Either a progress bar, shows the tar program output, or something that gives me an indication that the script is working and perhaps how long it will take. This one is really optional, for as long as the process is working properly then I'm ok. But if it is possible and not ridiculously complicated or difficult, it would be very nice.

    What I mean is there should be some sort of parameter in the script so that when I run it, I can choose whatever directory I want to compress rather than just be limited to just /.
    On my backup script, I specify $* which should accept any arguments passed to the script.. ex: $ ./backup.sh /source/folder /source/folder2.
    in the script:
    #!/bin/sh
    tar -cpf $HOME/$(date +%d%m%Y)-backup.tar.gz $* --exclude=/proc
    2. puts finished .tar.gz in my home directory (I plan to transfer the archive to external media or online later; this gives me the freedom to not need to have a specific drive connected to run the script). I already have this in the commands, but I just wanted to point out that this is important.
    In the above script, that is what the ~ or $HOME should do..
    3. names finished .tar.gz DD-MM-YY-backup.tar.gz where DD is day, MM is month, YY is year.
    Same thing, the above script should do the trick, you might want to modify the date parameters (check the date manual)
    4. the "sudo" part works correctly. That is, the script, when run, asks for a password and can be granted root permissions (or is granted root permissions in some other way) so that I can back up all parts of my system without these sorts of errors.
    You could put something to prevent the script from running unless you are root, or you could have it prompt for a password and use sudo within the script. I would recommend the first. Here is a code snippet:
    #Check for root
    if [ $(whoami) != "root" ]; then
    echo "Error: You cannot perform this operation unless you are root"
    exit 1
    fi
    5. shows some sort of progress indicator. Either a progress bar, shows the tar program output, or something that gives me an indication that the script is working and perhaps how long it will take. This one is really optional, for as long as the process is working properly then I'm ok. But if it is possible and not ridiculously complicated or difficult, it would be very nice.
    You might be able to use a similar program to tar, but with progress. Maybe someone else could shed some light here..
    Hope this helps...

  • Need help with a FormCalc scripting

    I am new to FormCalc and need some help. I am creating an interactive PDF in which I need a FormCalc script code for the following situation. I need to have a check box initate a script in another field. For example; I have one numeric field for quanity ordered (user input) and a check box for an optional add-on. Once the check box for the add-on is selected; I need a third field to reflect the price of the add-on * the numeric value in the quanity field.
    ProductPrice     Product Quanity          Add-On                        Total Cost
    Pd1                    2                              ($300) check box            Product Price * Product Quanity  + Add-On Price (if clicked) * Product Quanity
    Can anyone help?

    That was helpful but I still can't see to get it work. In the form I am creating The field that needs to autocalc. is to be triggered by the user clicking an add-on box. I have the add-on checkbox values set as 1=check and 0=unchecked. The idea is that when the that box is checked, the "ItemTotal" field to be calculated will be triggered to then take the Quanity field and mulitply by 300. Below is the script I tried to use and the error message returned when the Add-on box is checked.
    if (Add-onBoxName == 1) then
         Quantity * 300
    Error message in Adobe Reader when box is checked:
    Script failed (language is formcalc, context is xfa[0].form[0].topmostSubform[0].Page2[0].Add-onCheckBox[0])
    script=if (Add-onCheckBox = = 1) then
    ItemTotal = Quantity * 300
    Error: syntax error near token '300' on line 4, column 0.

  • Need help with PHP mail script

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

  • Need help in a simple script

    I'm basically trying to create a java script that will help me calculate certain values after I input an initial value, in this case, the weight of the car.
    I'm not really sure what's gone wrong, since I'm just a beginner at this. Could you all point me in the right direction?
    import javax.swing.JOptionPane;
    public class ForzaSpringCalculation
         public static void main(String[] args)
    //This script takes the weight and front bias data of the car and outputs the various spring rates
              double weight;
              double bias;
              double frontSpring;
              double rearSpring;
              double frontBump;
              double rearBump;
              double frontRebound;
              double rearRebound;     
         //Collects weight and weight bias data of car
              String weight=JOptionPane.showInputDialog("Weight of car?");
              System.out.println(weight);
              String bias=JOptionPane.showInputDialog("Weight front?");          
              System.out.print("Weight front: ");
              System.out.println(bias);
         //Calculations for suspension
              //Front Spring
              frontSpring=weight*bias/100*0.3828;
              System.out.print("Front Spring: ");
              System.out.println(frontSpring);
              //Rear Spring
              rearSpring=weight*100-bias/100*.3828;
              System.out.print("Rear Spring: ");
              System.out.println(rearSpring);
              //Front Bump Damping
              frontBump=frontSpring*0.00734;
              System.out.print("Front Bump Damping: ");
              System.out.println(frontBump);
              //Rear Bump Damping
              rearBump=rearSpring*0.00718;
              System.out.print("Rear Bump Damping: ");
              System.out.println(rearBump);
              //Front Rebound Damping
              frontRebound=frontBump*1.97;
              System.out.print("Front Rebound Damping: ");
              System.out.println(frontRebound);
              //Rear Rebound Damping
              rearRebound=rearBump*2;
              System.out.print("Rear Rebound Damping: ");
              System.out.println(rearRebound);
              System.exit(0);
         Thanks a lot!

    I see, so it's like double defining? But once I remove the 'double weight' and 'double bias', this is what I get.
    ForzaSpringCalculation.java:26: operator * cannot be applied to java.lang.String,java.lang.String
    frontSpring=weight*bias/100*0.3828;
    ^
    ForzaSpringCalculation.java:31: operator * cannot be applied to java.lang.String,int
    rearSpring=weight*100-bias/100*.3828;
    ^
    ForzaSpringCalculation.java:31: operator / cannot be applied to java.lang.String,int
    rearSpring=weight*100-bias/100*.3828;
    ^
    3 errors
    Is there another String thing I can use?

  • Need help running a Python script when DVD inserted

    We had an intern that created a custom Python script to rip our old event recording DVDs back to a digital format. The script creates a JSON description file and asks a set of questions to create the metadata in the JSON file (e.g. Date of event).
    The way the intern set this up was that you'd click on the Python script which would open a terminal window where you fill in the metadata. It then asks if the DVD is in the computer. At this point you place the DVD in. A few seconds later, the Python script notices the DVD and proceeds to rip the DVD at our specific file size requirements along with the inputted metadata.
    We then upgraded the Mac from Mountain Lion to Lion and the script stopped working. Our intern has since left. I have now moved the Python script onto my Mountain Lion Mac. The intern's last message to me was that he had written an AppleScript that ran when the DVD was inserted which then referred to the Python script. The intern has since stopped replying to emails.
    This is a very important project that I would like to continue. Any help would be greatly appreciated!

    well, oddly, that should never have worked. 
    Try this:  open the applescript editor, copy in the following line:
    tell application "Terminal"
              do script "python /Users/medialab/dvddrip rename"
              activate
    end tell
    Save it, making sure that the 'File Format' pull down says Script (the new file will have a '.scpt' extension). You'll be able to select that file in the cd/dvd preferences.
    I assumed that you wanted this to open in terminal so that you can enter options on the command line. If that's not correct, let me know.

  • Need help setting up measurementLog scripting

    I'm gruadually getting better at creating script but for some reason I can't get my brain around this one.  I'm trying to set up a script to take measurements of a series of 64 marquees created from an equal number of paths then export that log after the 64th marquee dimension is recorded.  So I"m making a selection from path, recording it's width and height, performing some operations, saving a file, making a new selection from the next path, and repeat.  Ideally I'd like to also record the location of the upper lefthand corner of each marquee at the same time.  I figure one challenge at a time.
    Part of the confusion is the Object Model Viewer and support PDF's are saying one part of the process is accessed from the Application and another is accessed from the Document.  I'm not sure how that would look or what should come first.  Also I've not entirely got my brain around using file path locations in script and how to set those up so that they're universal between Mac and Windows.
    All this combined is causing too many possible reasons for the dreaded ESTK "Undefined is not an object" error so I can't narrow down the reason for my test script failing.  I'm certain if I see the correct way once it'll all make sense, the clouds will part, angels will sing and all will be right... until the next hurdle or the conditions change slightly.
    Please help!  Thanks!
    P.S. I can post my script this is going into if it'll help.  It's a mixture of my stuff, with a Frankensteined mish-mash of contributions I've gotten from others along the way.

    Getting an answer at PS-scripts.  Feel free to post anyway if  you desire.  thanks!  Extra info is always good.

Maybe you are looking for

  • My headphones suddenly won't fit into the headphone jack on the 1st generation ipod touch

    Has anyone had the problem where the headphones would only go about 3/4-way into the jack on the ipod touch?  I tried cleaning out the jack but there's no lint or dust that I could get out with a qtip or blowing air.  Any suggestions?

  • How to create report image like artwork demo

    Dear Pakars How to create report image like artwork demo ? Thanks Imansyah

  • Multi mapping and message splitting in BPM

    Hi , I am working with this scenario ... /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure how many message interfaces i have to create . one outbound , one abstract

  • Best practice for RAC RMAN backup

    I have a 10gR2 RAC db that is 3.5TB. It is a 2 node cluster on AIX. Each instance is db1 on node1, and db2 on node2, the "world" database name is db. Currently we are doing our backup from 1 node of the cluster, specifying that it connect to to db2,

  • Disabling "find-as-you-type"

    I love Firefox, and I would even be OK with "find-as-you-type" ordinarily, but here's what happens: it finds the succession of letters as I type, but it cuts off the search as soon as it finds it - when I haven't finished what I wanted to type. For i