Performance script (dangerous)

I have posted another topic about a quiet harddisk and better performance.
These settings are part of a script I am using at boot and shutdown.
The script is copying my home directory to a ramdisk, the same is done with /tmp.
This is ofcourse only possible when you have a separate /data directory, and not only a $USER where all your stuff is stored.
The result;
- almost no harddisk writes when browsing, reading mail, editing etc...
- almost quiet system
- better performance because most things are done from ram
Disadvantages:
- when your system is crashing, your changes are lost
- you do need more ram (advice 1G or more)
- your system is not standard anymore.
Before using the script, please try to understand what I am doing!
BTW; it is necessarry that the users are added to the group audio in /etc/group, because I am using that group to find out which users are available.
Here is the script (changes mentioned some posts below are added):
#!/bin/sh
# Performance script
# Maintainer: Lontronics, [email protected]
# Last modified: april 16th, 2007
action_start() {
# Change interval to 10 minutes for pdflush:
echo 60000 > /proc/sys/vm/dirty_expire_centisecs
# Let the harddisk spin down when not used for X * 5 seconds
# For example 12 will give a standby time of 24*5=120 seconds
# Also set read ahead to on
if [ -x /sbin/hdparm ]; then
/sbin/hdparm -S 24 -A 1 /dev/sda
fi
# Clean ramdisk directory and mount ramdisk for writing temporary information
if [ -d /mnt/ramdisk0 ]; then
rm -rf /mnt/ramdisk0/* > /dev/null
else
mkdir /mnt/ramdisk0
fi
mount -t tmpfs tmpfs /mnt/ramdisk0
# Check tmp directory...
if [ ! -d /tmp ]; then
rm -rf /tmp
mkdir /tmp
chmod 777 /tmp
fi
# Find available users and take action...
# We take the audio group in /etc/group, but you can take every group which is containing all normal users
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
count=0
while [ "x${NAME[count]}" != "x" ]
do
# If no user directory then extract the backup when available.
if [ ! -d /home/${NAME[$count]} ]; then
rm -rf /home/${NAME[$count]}
mkdir /home/${NAME[$count]}
chown -R ${NAME[$count]} /home/${NAME[$count]}
if [ -f /home/${NAME[$count]}.tar.gz ]; then
tar zPxvf /home/${NAME[$count]}.tar.gz --directory=/ > /dev/null
if [ -d /home/${NAME[$count]} ]; then
echo ""
echo "WARNING:"
echo "Extracted backup to /home/${NAME[$count]}"
echo "It is possible some data is lost..."
rm -rf /home/${NAME[$count]}.tar.gz
else
echo ""
echo "ERROR:"
echo "Error occured when extracting files from backup."
echo "Check backup with name /home/${NAME[$count]}.tar.gz and try to extract it yourself"
echo "with the command tar zxvf /home/${NAME[$count]}.tar.gz --directory=/"
echo "New but empty user directory for user ${NAME[$count]} made"
fi
else
echo ""
echo "ERROR:"
echo "Unfortunately there seems no backup available."
echo "New but empty user directory for user ${NAME[$count]} made"
fi
fi
# Make backup of user directory for when things are going wrong
tar -cPpz --file=/home/${NAME[$count]}.tar.gz /home/${NAME[$count]} > /dev/null
# Copy home directory information to the ramdisk for usage
mv /home/${NAME[$count]} /mnt/ramdisk0
ln -s /mnt/ramdisk0/${NAME[$count]} /home/${NAME[$count]}
echo "${NAME[$count]}"
count=$(( $count + 1 ))
done
# Copy tmp directory information to the ramdisk for usage
mv /tmp /mnt/ramdisk0/tmp
ln -s /mnt/ramdisk0/tmp /tmp
# Output
echo "Performance script started"
echo "Do not forget to run performance stop before shutdown,"
echo "otherwise it is possible you will loose your data!"
action_stop() {
ERROR=0
# Change interval for pdflush to normal:
echo 500 > /proc/sys/vm/dirty_expire_centisecs
# Disable standby (spindown)
if [ -x /sbin/hdparm ]; then
/sbin/hdparm -S 0 /dev/sda
fi
# Find available users and take action...
# We take the audio group in /etc/group, but you can take every group which is containing all normal users
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
count=0
while [ "x${NAME[count]}" != "x" ]
do
# If temporary user directory available then...
if [ -d /mnt/ramdisk0/${NAME[count]} ]; then
# Copy ramdisk information to real directory
rm -rf /home/${NAME[count]}
mv /mnt/ramdisk0/${NAME[count]} /home/${NAME[count]}
rm -rf /home/${NAME[count]}.tar.gz
else
ERROR=1
echo ""
echo "ERROR:"
echo "The temporary user directory seems not to be available on the ramdisk, probably the performance script was not running"
echo "Therefor the following actions are not performed:"
echo "- /home/${NAME[count]} is not replaced"
echo "- /mnt/ramdisk0 is not unmounted"
echo "Please check if everything is okay"
fi
count=$(( $count + 1 ))
done
# If tmp directory on ramdisk is available then...
if [ -d /mnt/ramdisk0/tmp ]; then
rm -rf /tmp
rm -rf /mnt/ramdisk0/tmp/*
mv /mnt/ramdisk0/tmp /tmp
else
ERROR=1
echo ""
echo "ERROR:"
echo "The tmp directory seems not to be available on the ramdisk, probably the performance script was not running"
echo "Therefor the following actions are not performed:"
echo "- /tmp is not replaced"
echo "- /mnt/ramdisk0 is not unmounted"
echo "Please check if everything is okay"
fi
# If no errors occured unmount the ramdisk to free memory
if [ $ERROR = 0 ]; then
umount -f /mnt/ramdisk0 2> /dev/null
rm -rf /mnt/ramdisk0 2> /dev/null
fi
# Output
echo "Performance script stopped"
case "$1" in
'start')
action_start
'stop')
action_stop
echo "usage $0 start|stop"
esac
To use the script:
in /etc/rc.sysinit find:
stat_busy "Removing Leftover Files"
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
just above add:
# Activate the performance script
if [ -x /data/scripts/performance ]; then
/data/scripts/performance start
fi
Where ofcourse /data/scripts/performance is my path of the performance script, but you have to change this to where you have saved the script
in /etc/rc.shutdown find:
# avoid NIS hanging syslog-ng on shutdown by unsetting the domainname
if [ -x /bin/domainname ]; then
/bin/domainname ""
just above add:
# Stop the performance script
if [ -x /data/scripts/performance ]; then
/data/scripts/performance stop
fi
Where ofcourse /data/scripts/performance is my path of the performance script, but you have to change this to where you have saved the script
Have fun!
Jan
Last edited by Lontronics (2007-04-17 20:30:57)

@drakosha;
Yes I did, but not for getting better performance. The noticable difference is less writing to the disk, especially with the other settings used in the script. But why not trying yourself with a /tmp ramdrive ?
@klixon;
Thanks for the compliment.
And about your line of script; thanks too, although you were forgotten one thing to make an array from it.
Will use cut though, simple indeed
Line is now:
NAME=($(grep ^audio /etc/group | cut -d: -f4 | tr "," " "))
I think it is not wise to run it from rc.conf because I make a new /<ramdrive>/tmp before something is done with it.
But I will see if it is possible; indeed neater.
Jan
Last edited by Lontronics (2007-04-16 19:58:01)

Similar Messages

  • Cannot perform scripting operations on lists

    Hi,
    I'm having trouble performing scripting operations on lists, the only variables I can retrieve from lists are the values @HasLeadSelection, @LeadSelectedIndex and @RowCount. I cannot perform any methods on lists, I have gone through the Complete Help document and have also tried to use Resolve to attempt to access list rows but that doesn't seem to working either. Any help would be greatly appreciated!
    Thanks
    Alexander Ludwig

    Hi Alessandro & Alexander,
    I just tried it and yes we can change the colour trough scripting as well.
    Something like below in the Calculation Rule of the property Background Colour would do the job.
    result = 'STANDARD'  // This is a fallback value in case the if condition below is not satisfied.
    if( $currentrow.xxx == 'xx' )  // Here xxx should be the element within the table
    result = 'BADVALUE_DARK'   // This is one of the value from above screenshot.
    end
    Check this other thread for more details:http://scn.sap.com/thread/3528872
    And yeah the code completion is having serious issues. It shows the attributes which do not belong under is sometimes.
    Binding to another attribute and setting it trough ABSL might decrease the performance as there would be a roundtrip required in this case to change the value if this field is not shown on UI and is only used to decide the colour.
    Regards
    Vinod

  • Performance script?

    Hi,
    i want some performance script about database ?
    which script or how can performance check the database ?
    i have use v$dba_data_files,v$dba_free_space ,v$session_wait ,v$session_event
    but i m confuse how can performance database ..........?

    i want some performance script about database ? This is very vague. What do you really want to see?
    You can use statspack for Oracle 9i and AWR for Oracle 10g Databases.
    If you can go here for database scripts,
    https://metalink.oracle.com/metalink/plsql/f?p=130:14:4609856481415275689::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,131704.1,1,0,0,helvetica
    Adith

  • Interpret results of performance reports

    Are there any white papers to interpret the results of
    the performance reports. The docs included with the performance scripts are not detailed. Any help is appreciated.
    Harish

    there is a discussion of the output at
    http://www.oracle.com/technology/products/ias/portal/html/admin_perf_10g_sizing_faq.htm

  • Performance Documents

    Hi,
    I would require some performance scripts for index rebuild, reduce table defragementation and some performance related scripats and also some techincal Documents for Oracle 8i
    Rgds..

    1. For Table Fragmentation
    http://www.orafaq.com/node/1936
    2.Index Fragmentation
    http://www.dbspecialists.com/scripts.html
    http://oracleact.com/papers/index_leaf_block_frag.html
    http://www.cryer.co.uk/brian/oracle/tuning_iif.htm
    From:http://searchoracle.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid41_gci1255576_mem1,00.html
    Even with LMT, indexes can sometimes become fragmented over time due to inserts and deletes of rows in the index leaf pages. I have found the following useful to identify fragmented indexes.
    (A) Run an analyze index validate structure on your indexes.
    (B) Query the index_stats table. If the percentage of deleted leaf rows to total leaf rows (DEL_LF_ROWS/LF_ROWS) is greater than 20%; then, the index probably should be rebuilt.
    Hth
    Girish Sharma

  • Regading Scripts

    Hi all,
    I have a requirement that i have to get the data from a Dialog Programming screen (user entries in fields) into a Script. Means I have to Print the contents of the screen. So how can i do this. Please help me out in solving the problem.
    Thanks in Advance.
    Murthy

    hi ramana,
    i had done a similar thing...
    module user_command_0100 input.
    v_ucomm = sy-ucomm.
      case v_ucomm.
        when 'BACK' or 'CANCEL'.
          leave to list-processing and return to screen 0.
    when 'PRNT'.
          perform scripts.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    form scripts .
      select marc~matnr
             marc~werks
             t001w~name1
             marc~pstat
             marc~prctr
             marc~minls
             marc~maxls
             into corresponding fields of table it_final
             from marc inner join t001w
             on marcwerks = t001wwerks
             where marc~matnr = itab1-matnr.
      perform call_script.
    endform.                    " SCRIPTS
    form call_script .
      call function 'OPEN_FORM'
       exporting
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      DIALOG                            = 'X'
          form                              = 'ZPTEST'
          language                          = sy-langu
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
      SPONUMIV                          =
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
       exceptions
         canceled                          = 1
         device                            = 2
         form                              = 3
         options                           = 4
         unclosed                          = 5
         mail_options                      = 6
         archive_error                     = 7
         invalid_fax_number                = 8
         more_params_needed_in_batch       = 9
         spool_error                       = 10
         codepage                          = 11
         others                            = 12.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      call function 'WRITE_FORM'
       exporting
          element                        = 'HEADING'
      FUNCTION                       = 'SET'
         type                           = 'BODY'
         window                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
       exceptions
         element                        = 1
         function                       = 2
         type                           = 3
         unopened                       = 4
         unstarted                      = 5
         window                         = 6
         bad_pageformat_for_print       = 7
         spool_error                    = 8
         codepage                       = 9
         others                         = 10.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      loop at it_final.
        call function 'WRITE_FORM'
         exporting
            element                        = 'DETAILS'
      FUNCTION                       = 'SET'
           type                           = 'BODY'
           window                         = 'MAIN'
    IMPORTING
      PENDING_LINES                  =
         exceptions
           element                        = 1
           function                       = 2
           type                           = 3
           unopened                       = 4
           unstarted                      = 5
           window                         = 6
           bad_pageformat_for_print       = 7
           spool_error                    = 8
           codepage                       = 9
           others                         = 10.
        if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endloop.
      call function 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
       exceptions
         unopened                       = 1
         bad_pageformat_for_print       = 2
         send_error                     = 3
         spool_error                    = 4
         codepage                       = 5
         others                         = 6.
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " CALL_SCRIPT
    hope this helps,
    do reward if it helps,
    priya.

  • Gif animations in Mail

    I've read some threads about this problem, and while there is lively debate, there doesn't seem to be an answer. So I thought I would try it again with a new question.
    A friend of mine (he has an old IMac) forwarded me an email with an animated gif. It was funny, and I wanted to forward it on. But I have never been able to do this. If I try to save the file, it saves as a MIME attachment, and I can't even open it. If I Download the file, the Get Info says it is a gif file, but if I open it in Preview, or attach it to a new email, it no longer animates and is just a still picture.
    I tried forwarding the original email with the animated gif back to myself, and when it arrives, it no longer animates. My friend is no help. He's not really in to computing. He told me he just gets them from somebody else, and forwards it to me.
    So why can I see the animated gif in my Mail, but can't save it, download it, cut & paste it, or forward it? I tried the Append Message suggestion from an old post, and that did not work either.
    I noticed in some of the old posts some people seem to really hate gif's. I don't really care one way or the other. I just want to understand why my computer can receive them, but can't do anything else with them.

    Although Jaguar and Panther Mail renders HTML received, they do not support composing HTML which also includes when forwarding a message received that was composed in HTML including animated gifs.
    Although you cannot compose complex HTML within the body of a message with Tiger Mail, RTF with Tiger Mail is HTML and supports forwarding a message received that was composed in HTML including animated gifs.
    Reason for this: if you automatically render all HTML received (with any email client with OS X) and a spammer uses HTML for message composition and includes embedded images or objects that must be rendered from a remote server, if the Mail.app Junk Mail filter does not automatically mark the message as junk and you open the message, this can reveal that your email address is valid to the spammer causing more spam to be received.
    Copied from Why HTML in E-Mail is a Bad Idea:
    "Because it introduces accessibility problems. When you write in plain text, the receiving mail client renders the text in whatever font the reader chooses. When you format email with HTML, the sender controls the formatting. But this is a trap: You only think your message will render the same way to the viewer as it appears to the sender. In reality, the receiver can end up squinting because the font looks so tiny, or vice versa. HTML is not rendered the same way from one viewing client to the next - all guarantee of accessiblity goes out the window. This is especially problematic for visually impaired persons."
    Because it can introduce security issues and trojan horses -- it's a gateway to danger as any Outlook user can tell you. HTML can include any number of scripts, dangerous links, controls, etc.
    Powerbook G4 17"   Mac OS X (10.4.5)  

  • Why are animated GIF's...

    ...Not working when I forward them using Mail? I've tried forwarding them to myself and when opened the GIF's are no longer animated and the size and format of things has changed. This also happens in redirect. Any Ideas?

    Try Thunderbird which is free.
    I'm not a fan of using HTML for email messages and IMO, a big mistake by Microsoft which came back to haunt Microsoft and Windows users with various security issues.
    If you automatically render all HTML received (with any email client with OS X) and a spammer uses HTML for message composition and includes embedded images or objects that must be rendered from a remote server, if the Mail.app Junk Mail filter does not automatically mark the message as junk and you open the message, this can reveal that your email address is valid to the spammer causing more spam to be received.
    Copied from Why HTML in E-Mail is a Bad Idea.
    Because it introduces accessibility problems. When you write in plain text, the receiving mail client renders the text in whatever font the reader chooses. When you format email with HTML, the sender controls the formatting. But this is a trap: You only think your message will render the same way to the viewer as it appears to the sender. In reality, the receiver can end up squinting because the font looks so tiny, or vice versa. HTML is not rendered the same way from one viewing client to the next - all guarantee of accessiblity goes out the window. This is especially problematic for visually impaired persons.
    Because it can introduce security issues and trojan horses -- it's a gateway to danger as any Outlook user can tell you. HTML can include any number of scripts, dangerous links, controls, etc.

  • WLS 5.1 and TX support

              The Weblogic 5.10 documentation states:
              "WebLogic Server Version 5.1 is compliant with the JavaSoft EJB 1.1 specification."
              Yet elsewhere in the documentation it states:
              "The following sections describe EJBs in several transaction scenarios. Note that in all cases EJB transactions should be restricted to a single persistent store, because WebLogic Server does not provide a two-phase commit protocol. EJBs that engage in distributed transactions (transactions that make updates in multiple datastores) cannot guarantee that all branches of the transaction commit or roll back as a logical unit."
              Wait a minute. I thought EJB 1.1 specified that an EJB container must provide a transaction coordinator to support distributed two-phase commit across multiple EJB servers.
              From the spec:
              "Regardless whether an enterprise bean uses bean-managed or container-managed transaction demarcation,
              the burden of implementing transaction management is on the EJB Container and Server Provider.
              The EJB Container and Server implement the necessary low-level transaction protocols, such as the
              two-phase commit protocol between a transaction manager and a database system, transaction context
              propagation, and distributed two-phase commit."
              The spec goes on to show several distributed transaction use cases that must be supported by the EJB container.
              This "single repository" limitation of Weblogic severely limits my options.
              What am I missing?
              Greg
              

    I used Loadrunner's WLS monitor while running some performance scripts on our application. I ended up relying on the WLS Console and some SNMP traps (using HP Openview to review data) in order to acurately guauge utilization of system resources...Regards,Steve

  • Flash compatibility

    Hi,
    Also having problem with Flash since installing OSX Lion. I know Apple don't like Flash, but whether I'm in Firefox or Safari, it just brings up the Accept or Deny box for viewing videos and it won't let me select either of them. Anyone else having problems or is it a setting issue I need to change?
    OMB

    You would think, though, that a QuickTime flash track could be made to be reasonably safe by limiting the scope of the player. We lost some JavaScript capability and some HREF track capability because QuickTime was capable of performing script actions *outside of QuickTime*. While I fail to see why QuickTime launching a web browser and passing a URL is any different than any other application launching a browser and passing a URL...and I fail to see why a MySpace scripting vulnerability would be Apple's problem...the security risks of such a configuration are pretty obvious.
    But with Flash, we're talking about giving an interactive track within the movie the ability to accept user input and exercise control over QuickTime Player and the other tracks within the movie. Perhaps it was possible for Flash to do other things within a QuickTime movie, but for the purposes of movie interactivity, and probably just about every application in which QuickTime has been called on to play back Flash, the scope of Flash scriptability can be limited to the QuickTime player, possibly even to the movie in which the track is actually playing. I would think that limiting the scope of the Flash media handler would solve virtually all of the security problems with Flash within QuickTime without actually disabling the media handler.
    I think what bothers me the most about this is that Apple makes a big deal about the fact that movies created with the very first version of QuickTime will still play in QT 7.4, but they conveniently overlook the fact that many movies created in QuickTime 6 have been rendered unplayable by a "security" update.
    --Dave Althoff, Jr.

  • Internal Disk to Disk Data Transfer Speed Very Slow

    I have a G5 Xserve running Tiger with all updates applied that has recently started experiencing very slow Drive to Drive Data transfer speeds.
    When transferring data from one drive to another ( Internal to Internal, Internal to USB, Internal, Internal to FW, USB to USB or any other combination of the three ) we only are getting about 2GB / hr transfer speeds.
    I initially thought the internal drive was going bad. I tested the drive and found some minor header issues etc... that were able to be repaired so I replace the internal boot drive
    I tested and immediately got the same issue.
    I also tried booting from a FW drive and I got the same issue.
    If I connect to the server over the ethernet network, I get what I would expect to be typical data transfer rates of about 20GB+ / hr. Much higher than the internal rates and I am copying data from the same internal drives so I really don't think the drive is the issue.
    I called AppleCare and discussed the issue with them. They said it sounded like a controller issue so I purchased a replacement MLB from them. After replacing the drive data transfer speeds jumped back to normal for about a day maybe two.
    Now we are back to experiencing slow data transfer speeds internally ( 2GB / hr ) and normal transfer speeds ( 20GB+ / hr ) over the network.
    Any ideas on what might be causing the problem would be appreciated

    As suggested, do check for other I/O load on the spindles. And check for general system load.
    I don't know of a good GUI in-built I/O monitor here (and particularly for Tiger Server), though there is iopending and DTrace and Apple-provided [performance scripts|http://support.apple.com/kb/HT1992] with Leopard and Leopard Server. top would show you busy processes.
    Also look for memory errors and memory constraints and check for anything interesting in the contents of the system logs.
    The next spot after the controllers (and it's usually my first "hardware" stop for these sorts of cases, and usually before swapping the motherboard) are the disks that are involved, and whatever widgets are in the PCI slots. Loose cables, bad cables, and spindle-swaps. Yes, disks can sometimes slow down like this, and that's not usually a Good Thing. I know you think this isn't the disks, but that's one of the remaining common hardware factors. And don't presume any SMART disk monitoring has predictive value; SMART can miss a number of these cases.
    (Sometimes you have to use the classic "field service" technique of swapping parts and of shutting down software pieces until the problem goes away. Then work from there.)
    And the other question is around how much time and effort should be spent on this Xserve G5 box; whether you're now in the market for a replacement G5 box or a newer Intel Xserve box as a more cost-effective solution.
    (How current and how reliable is your disk archive?)

  • How to Intergrate Policy with applet

    hi my name is easan. I created an applet which reads and writes to a file but i had problems accessing the file. I solved that by granting read and write permission to the file by creating a policy. I can run the applet in the appletviewer using this line
    c:\>appletviewer -J-Djava.security.policy=<policyname> applet.html
    I would like to know hw to intergrate this policy with my applet so that i can run my applet from a browser.
    I would appreciated any help from anyone..... thank you in advance.
    Easan

    It's not possible to integrate policy file together with applet. If you want to perform these dangerous operation (read,write) from applet, you have to sign applet's jar file. And in applet's code you have to use AccessController.doPrivileged(PrivilegedAction action) for possibly unsafe parts of code.
    tina

  • Signed applets (are policy files needed!)

    I have experienced on a number of different machines that a signed applet that the client trusts (via clicking on yes to the prompt asking to trust the applet), is able to access the local resources with NO policy file on the client machine. I'm using JRE 1.4.1_02
    Is this the expected behavior?
    I sure hope it is because how in the world can you install applications to many clients and update their policy file? you can't via the web! BUT why am I reading that you have to have a policy file even if you sign an applet. I want to get rid of using Netscape security model but I can not update many client machine policy files... Please help!!! thanks. Is signing an applet all you have to do to access local machines, I sure hope so! Thanks in advance.

    I've done some more research specifically a very good article at http://developer.java.sun.com/developer/technicalArticles/Security/applets/index.html. I'll try to highlight the more interesting comments that I found. At least for the JRE 1.3 there appears to be a new class loader, sun.plugin.security.PluginClassLoader that allows a signed jar file (once trusted by the client) to have access to local resources.
    Code signed using the private key of the signer can be run on client machines once the public key corresponding to the signer is deemed as trusted on the respective machine.
    Applet security in browsers strives to prevent untrusted applets from performing potentially dangerous operations, while simultaneously allowing optimal access to trusted applets.
    There is no simply way to deploy and use customized policy files, a policy will have to be set by files based on the JRE installation. Customized class loaders or security managers cannot be installed easily.
    Policy files are difficult or at least not very straightforward for normal users, which could be thousands of machines where an applet is deployed.
    The java plug-in (I believe its 1.3 and later) provides a workaround although its recommended to use policy files wherever practical and applicable. (This implies to me that using the plug-in, all that is required is to sign the jar file to have access to local resources).
    RSA-signed applets can be deployed using the Java plug-in. (which can run in an identical way for Netscape and IE).
    In order for a plug-in enhanced browser to trust an applet and grant it all privileges or a set of fine-grained permissions (as specified in a J2EE policy file), the user has to preconfigure his or her cache of trusted signer certificates (the .keystore file in JRE 1.3) to add the applet's signer to it. However, this solution does not scale well if the applet needs to be deployed on thousands of client machines, and may not always be feasible because users may not know in advance who signed the applet that they are trying to run. A NEW CLASS LOADER, sun.plugin.security.PluginClassLoader in the Java Plug-in 1.3, OVERCOMES THE LIMITATIONS MENTIONED ABOVE.
    I hope this helps, I've been looking for this solution for quite some time, trying to understand why singed applets work with no policy files for version 1.4... Talk to you later, Jay.

  • Rounding a percent to a whole number

    Hello,
    I'm still fairly new to performing script calculations and with this particular one seems a bit more complex for me.
    I'm trying to determine the percent difference between 2 numbers and display the percentage as a whole number. Logically my calculation looks like
    (numericField1 - numericField2 / numericField1 * 100)
    (ex. 1000 - 850 / 1000 * 100 = 15%)  
    I need assitance with my calculation and especially rounding the % to a whole number. I would not like any answers displayed like 22.66666%
    The code below is somethig I tried
    event.value = roundNumber( ( this.getField(numericField1).value - this.getField(numericField2t).value  )  / this.getField(numericField1).value , 2 ) + '%';
    function roundNumber(num, dec) {
            var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
            return result;
    Any advice would be great!

    Actually Adobe makes this really simple for you.  If you use a numeric field to display the result, the display pattern for the field will control how the number is shown.  You can set a percentage pattern:"num{zzzz9.99%}" to control how many digits will be displayed, and how many digits will be significant past the decimal point.  If there are more digits, Adobe will automatically round the number.  In the attached example I used the pattern
    "num{zzzz9%}" to ensure that only a whole number will be displayed.  Adobe will use normal rounding rules: 0-4 rounds down, 5-9 rounds up.
    Additionally, the percentage pattern will automatically multiply the field value by 100, so you don't need to do that in your script.
    For the example attached, I added your calculation as FormCalc script to the Calculate event of the result field.  The script is now simply:
    (NumericField1 - NumericField2) / NumericField1
    Adobe takes care of the rest.

  • Use of Advanced Page Properties

    Hi,
    I like to know what is the use of the Advanced Page Properties(Right click a Page> Select properties>Click on Advanced).
    There are 5 items there:
    1) A2 Playback
    2) No Merge
    3) Send to Extension Server
    4) Skip in e-Tester
    5) Treat as Direct Navigation
    The last 2 items seams pretty straight forward, but I can't figure out the others. There is no documentation about it in the e-Tester Help.
    If you provide examples would be great.
    Thanks

    Hi Aether,
    Hope this is the kind of info you are looking for. I think this info is in the knowledge base. I had copied it a long time back.
    Explanation of Advanced Options
    Question
    What are the Advanced Page Properties?
    Answer
    A2 PlayBack
    Directs e-Tester to perform an A2 style navigation for this page during script playback. A2 and transforms are how e-Load executes script navigations. e-Tester records and plays back scripts by recording at the browsers object level and capturing all of the events that the user performed to navigate from one page to the next. This may include things like clicks on links, images, buttons, other form elements, etc. You can see these events or actions by looking in the Properties of the Address node for each script page. At the same time, e-Tester records a Transform (using A2 technology) to construct navigations to be used when running the script in e-Load. e-Load Thin Client cannot use object based navigations since it is not instantiating actual browsers the browser object model does not exist.
    In cases where your script does not playback in e-Tester, because the events to perform the navigation were not recorded properly, sometimes we may need to direct e-Tester to use e-Load style A2 navigations instead. We do this by setting A2 playback for the page we would like to do that on and that will force an e-Load A2 type navigation rather than using the recorded actions to navigate. It is best not to just set A2 navigations to try to resolve an e-Tester playback problem. You first need to try to understand the navigation that is being performed and determine why it was not recorded/played back properly by e-Tester. Understanding the problem is critical because their may be real problems that need to be resolved. A2 should be only used as a last resort when all other options have been exhausted.
    No Merge
    Instructs e-Tester not to merge new page content retrieved on playback with the existing recorded baseline pages in the visual script. When this is set you will see that the Visual Script will not update on playback even if there is different content retrieved (no flags or updated content will be shown in the page nodes). The example where this setting is used most is to avoid updates to the recorded items in the Parameters node as follows.
    When you record a script, e-Tester automatically captures, in the Parameters node of a page, all of the user-input form fields and data submitted from the preceding page. On playback, if that first page had additional form fields that were not there during recording, these new form fields will be merged in and added to the Parameters node of the next page.
    You can see this in the FMStocks demo. The login page has 2 fields (login and password) which will be captured in the Parameters node of page 2 of your script (if you just record a 2 page login script). If you switch to Build B of FMStocks, you will see a Customer ID field added to the login page and when you play the script back that you had originally recorded, the Customer ID field will be added to the Parameters node of page 2. If you had set "No Merge" on page 2, then this additional form field would not have been added to the page 2 Parameters node.
    There are some cases where you need to use No Merge. For example, when the form fields on a page have dynamic names which causes e-Tester to constantly keep adding Parameters every time the script plays back.
    For example lets say the Login and Password fields were called "login123" and "password123". Then you play the script back and the content of the login page is dynamically updated and the fields are now called "login456" and "password456". This would cause e-Tester to add another login and password field to the Parameters node of page 2 because it sees these as new fields (since the names are different). In this case they are actually the same fields, just with new names. Therefore you would want to set No Merge to avoid this situation so e-Tester handles it properly.
    Send to Extension Server
    Used to mark a page in your script to be sent to Extension Server when running the script in e-Load. e-Load once again uses Transforms and A2 navigations to play the script when running in Thin Client. Sometimes e-Load Thin Client will not be able to process the page to perform the navigation properly using the Transform or you may have failures during script playback in e-Load (Failed to Find/Failed to Match). When Extension Server is enabled, e-Load switches from a Thin Client to a full browser for the page that its enabled on. This allows e-Load to process that page as a full browser would. This may be required, for example, if there is some client side script that needs to be executed for the navigation to perform properly. Once again, you should not resort to Extension Server until you have understood the problem at hand. In most cases, the A2 Transforms should be able to perform the navigations in e-Load Thin Client, without the need for Extension Server. Also, enabling Extension Server is a scalability hit because a full browser must be instantiated for the page which requires much more resources than just using the Thin agent. If there are no other options, then Extension Server should be enabled.
    Treat as Direct Navigation
    Instructs e-Tester to perform a page navigation as a direct navigation to the recorded URL for that page. Once again, e-Tester normally performs script navigations by executing the recorded actions that the user performed to get from one page to the next. However, if e-Tester cannot perform the navigation in this manner because it couldnt record or playback the events proprerly, a direct navigation may need to be used instead. You would use Treat as Direction navigation if you are performing a static navigation that does not require A2. If the navigation to the next page is dynamic due to URL session variables etc. then you will need to set A2 playback instead. As in the case of using A2 playback, you should never automatically just set Treat as Direct Navigation to try to resolve an e-Tester playback problem. You first need to try to understand the navigation that is being performed and determine why it was not recorded/played back properly by e-Tester. Understanding the problem is critical because their may be real problems that need to be resolved. Treat as Direct Navigation should be only used as a last resort when all other options have been exhausted.

Maybe you are looking for

  • Extract Embedded Images-did you know that-

    there is actually a feature in Illustrator to do this even though it is not called Extract Images? Not only that once you extract the image you can update it as well  you do not have to lace it again and reposition it. When I saw this and realize it

  • Use navigateToURL to open a local pdf...

    I have a problem with the following code. I have been searching since yesterday for solutions to open pdfs in a browser window from within flash. I've found various forum posts about using navigateToURL and it looks like people have success. It seems

  • PDF ebook- text is searchable in Adobe reader but not ADE?!

    I have a PDF ebook which has fully embedded fonts and internal hyperlinks, bookmarks and when viewed via Adobe reader is fully searchable. However when the same PDF is viewed in Adobe Digital Editions all navigational features remain but the text is

  • Which New Graphic Card For 2008 Mac Pro?

    I'm going to buy Final Cut X, so I'll need a new graphic card for my 2008 MacPro. My current card is an ATI Radeon HD 2600. I asked AppleCare and they sent me a link to a lot of compatible cards (copied below). But it turns out that most of these car

  • Pictures are blurry when slideshow is burned to dvd using iPhoto, iMovie and iDvd. How do I correct?

    I used iPhoto, iMovie, and iDVD... How do I create a slideshow burned to a DVD without getting blurry images when slideshow is played through DVD a player?