Generate Events based on Cache size

Hi,
I have a use case where I need to generate events when the size of the cache has reached a specific value. The cache will be highly transactions (lot of inserts and deletes totaling to 6 million transactions per day). Also, I cannot limit the size of the cache as I don't want any data to be lost (trying to insert when cache size has reached its limit).
One of the ways I could do this is to use a MapListener to generate an event on every insert to the Cache, and then check for size each time to decide if the further processing needs to be done. With the nature of the traffic in the cache, the items in the cache are to be processed when the size threshold is reached and then deleted. But, I'm not sure how much of an overhead these events and listeners will have (with 6 million items going through the cache each day)
Is there any other more efficient way to do this? I have looked at Continuous Query cache which uses a filter based on a cache. But, I'm not able to figure out a way to get the size of the cache using a filter.
Any pointers are helpful
Thanks in advance
Regards
Vikas
Edited by: vikascv on Nov 17, 2009 8:48 AM

Hi Vikas,
Typically a size type calculation is the cumulative result of all storage enabled nodes, i.e. a Count aggregation. In your use case you want to be made aware of changes to an aggregation but as an aggregation is point in time of request opposed to continually being updated it does not fit your use case. One option is to create a MapEventTransformer that you register with the cache which increments a counters cache (on a separate service) using an EntryProcessor, i.e.
MapEventTransformer...
public class CounterMapEventTransformer implements MapEventTransformer, PortableObject
    String m_cacheName;
    public CounterMapEventTransformer()
    public CounterMapEventTransformer(final String cacheName)
        m_cacheName = cacheName;
    public MapEvent transform(MapEvent event)
        Long prevCount    = null;
        Long currentCount = null;
        switch( event.getId() )
            case( MapEvent.ENTRY_INSERTED ):
                // perform counter++
                currentCount = (Long) CacheFactory.getCache("counters").invoke(m_cacheName, new CounterOp(true));
                break;
            case( MapEvent.ENTRY_DELETED ):
                // perform counter--
                currentCount = (Long) CacheFactory.getCache("counters").invoke(m_cacheName, new CounterOp(false));
                break;
        MapEvent newEvent = new MapEvent(event.getMap(), event.getId(), event.getKey(), currentCount-1, currentCount);
        return newEvent;
    public void writeExternal(PofWriter out) throws IOException
        out.writeString(0, m_cacheName);
    public void readExternal(PofReader in) throws IOException
        m_cacheName = in.readString(0);
    }Incrementing EP...
public class CounterOp extends AbstractProcessor implements PortableObject
    boolean m_increment;
    public CounterOp()
    public CounterOp(boolean increment)
        m_increment = increment;
    @Override
    public Object process(Entry entry)
        Long newVal = null;
        if( !entry.isPresent() )
            entry.setValue(newVal = Long.valueOf(1));
        else
            newVal = ((Long)entry.getValue()).longValue() + (isIncrement() ? 1 : -1);
            entry.setValue( newVal );
        return newVal;
    protected boolean isIncrement()
        return m_increment;
    public void writeExternal(PofWriter out) throws IOException
        out.writeBoolean(0, m_increment);
    public void readExternal(PofReader in) throws IOException
        m_increment = in.readBoolean(0);
    }cache-config
     <!--
          | listener-cacheconfig.xml | | Copyright 2001-2009 by Oracle. All
          rights reserved. | | Oracle is a registered trademarks of Oracle
          Corporation and/or its | affiliates. | | This software is the
          confidential and proprietary information of Oracle | Corporation. You
          shall not disclose such confidential and proprietary | information and
          shall use it only in accordance with the terms of the | license
          agreement you entered into with Oracle. | | This notice may not be
          removed or altered.
     -->
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">
<cache-config>
     <caching-scheme-mapping>
          <cache-mapping>
               <cache-name>dist-*</cache-name>
               <scheme-name>distributed-scheme</scheme-name>
          </cache-mapping>
          <cache-mapping>
               <cache-name>counters</cache-name>
               <scheme-name>counter-scheme</scheme-name>
          </cache-mapping>
     </caching-scheme-mapping>
     <caching-schemes>
          <!--
    Distributed caching schemes
    -->
          <distributed-scheme>
               <scheme-name>distributed-scheme</scheme-name>
               <service-name>DistributedCache</service-name>
               <serializer>
                    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                    <init-params>
                         <init-param>
                              <param-type>string</param-type>
                              <param-value>pof-config.xml</param-value>
                         </init-param>
                    </init-params>
               </serializer>
               <backing-map-scheme>
                    <local-scheme />
                    <!--
                         <read-write-backing-map-scheme> <internal-cache-scheme>
                         <local-scheme /> </internal-cache-scheme> <cachestore-scheme>
                         <class-scheme>
                         <class-name>com.oracle.coherence.cachecounter.store.CacheCounterStore</class-name>
                         </class-scheme> </cachestore-scheme>
                         </read-write-backing-map-scheme>
                    -->
               </backing-map-scheme>
               <autostart>true</autostart>
          </distributed-scheme>
          <distributed-scheme>
               <scheme-name>counter-scheme</scheme-name>
               <service-name>CounterDistributedCache</service-name>
               <serializer>
                    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                    <init-params>
                         <init-param>
                              <param-type>string</param-type>
                              <param-value>pof-config.xml</param-value>
                         </init-param>
                    </init-params>
               </serializer>
               <backing-map-scheme>
                    <local-scheme />
               </backing-map-scheme>
               <autostart>true</autostart>
          </distributed-scheme>
     </caching-schemes>
</cache-config>pof-config...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pof-config SYSTEM "pof-config.dtd">
<pof-config>     
   <user-type-list>          
      <!-- include all of the standard Coherence type -->
      <include>coherence-pof-config.xml</include>          
      <!-- our custom types (user types) 1000+ -->          
      <user-type>                 
         <type-id>1000</type-id>            
         <class-name>com.oracle.coherence.cachecounter.event.CounterMapEventTransformer</class-name>          
      </user-type>
      <user-type>                 
         <type-id>1001</type-id>            
         <class-name>com.oracle.coherence.cachecounter.processors.CounterOp</class-name>          
      </user-type>
   </user-type-list>
   <allow-interfaces>true</allow-interfaces>
   <allow-subclasses>true</allow-subclasses>
</pof-config>Test class
public class MapEventTransformerTest
    public static final String m_cacheName = "dist-test1";
    public static void setUp()
        System.setProperty("tangosol.coherence.cacheconfig", "counter-cacheconfig.xml");
        System.setProperty("tangosol.coherence.distributed.localstorage", "false");
    public static void loadVals()
        final NamedCache cache = CacheFactory.getCache(m_cacheName);
        final int MAX_SIZE = 100;
        for( int i=0; i<MAX_SIZE; i++ )
            cache.put(i, "msg "+i);
    public static void removeVals()
        final NamedCache cache = CacheFactory.getCache(m_cacheName);
        final int MAX_SIZE = 100;
        for( int i=0; i<MAX_SIZE; i++ )
            if( i%2==0 )
                cache.remove(i);
    public static void testTransformer()
        final NamedCache cache = CacheFactory.getCache(m_cacheName);
        cache.addMapListener(new CounterAwareListener(),
                new MapEventTransformerFilter(AlwaysFilter.INSTANCE, new CounterMapEventTransformer(m_cacheName)),
                false);
    public static void main(String[] args) throws IOException
        setUp();
        testTransformer();
        loadVals();
        removeVals();
        System.out.println("press a key to end...");
        System.in.read();
    public static class CounterAwareListener extends MultiplexingMapListener
        @Override
        protected void onMapEvent(MapEvent evt)
            System.out.format( "# of items in cache: %d\n", evt.getNewValue() );
    }Note: Events could be received out of order but for your use case where you are interested in a threshold you may not care! -- food for thought :)
--harvey                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Generate an Event based on Counter Trigger

    Hello,
    I have the following part that is already working: a counter (used for period measurement) which is triggered by a digital input. After that I'm reading the data and I'm puting them in a Queue. Here I get an error. The Enqueue Element Vi is providing an error. (Error 1, something with a @  character that is illegal). I've notice that if I disable the trigger for the counter I don't get the error. I'm thinking that this is cause by the delay between the moment in which the Enqueue Block tries to enqueue and the moment in which the counter provides something to its ouptut.
    What I want to do is to Generate an Event based on the Counter Trigger Signal and to put all the reading and Enqueue part in an Event Structure. I've tried to do that using an Export Signal - Property Node, but I didn't manage to make it work.
    If you have any solution for this (with or without events -  I just want to get rid of that error) please let me know.
    PS: I have Labview 8.5.1 and the USB-6210.
    Thanks,
    LostInHelp

    Hello Mike,
    Thanks for your replay.
    I've attached two vi files. In one you can find how I've tried to generate an event based on the counter trigger (test.vi).
    The second one (test1.vi) is the vi where I get the queue error. I've deleted from the second vi the part where the data are dequeue and handled.
    Thanks
    LostInHelp
    Attachments:
    test41.vi ‏50 KB
    test110.vi ‏35 KB

  • Client cache size reverts to default

    (SCCM 2012 SP1 with CU5)
    I've used a powershell script to set the client cache size to 20GB, using get-wmiobject and the Put() function.  I've deployed this to a test collection of PCs using a CI with remediation, and it's both checking and remediating correctly.
    However, while the 'compliance' is reported at near 100%, when manually checking the clients, many have reset to 5120MB. This affects both Windows 7 and 8.x based clients.
    To take one client specifically, at the time of writing this the CI reports it ran and remediated at 11:45am - it is now 8pm, and the cache is back to 5120.
    Triggering the CI to evaluate again sets the cache to 20GB (verified via get-wmiobject), but I'm sure if I check again at some point tomorrow it will have reverted to 5120 again.
    I can't see any evidence in any client log that indicates what could be causing this.  I've looked into how I can see what has made the change in WMI via the Analytic/Debug logs in Event Viewer, but the tracing available needs to be run at the
    time the change is made - and I don't know exactly when that is.
    Any ideas?!
    Thanks, Bob
    Edit:  CI is set to evaluate every day at 9am.  Client push properties on primary site now include SMSCACHESIZE=20480, but this is recent change - when the existing clients were installed this was not present so they installed at 5120MB.

    Changing the value directly in WMI is unsupported. You need to use the UIResource.UIResourceMgr COM object to perform this task on the client side:
    http://msdn.microsoft.com/en-us/library/cc145211.aspx
    PowerShell examples are available at
    http://www.david-obrien.net/2013/02/07/how-to-configure-the-configmgr-client/
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • User Level based Validation caching

    Hi,
    This is with references to JSP/JPDK based portlets.
    To implement validation based caching in JSP portlets, the first step I understand is to create our own class that extends JspValidateRenderer and reference this new class in the provider.xml file in the <showPage class=" "> tag for the appropriate Portlet/s.
    The questions I had -
    1) What do I call to cause a change in the version identifier? Do I call getNewVersion() and
    let my implementation of the JspValidateRenderer's getNewVersion()take care of
    setting/updating the version identifier? I dont need to take care of storing the version
    identifier anywhere - is that correct?
    2) How do I implement this if, for eg. events in Portlet A determines if a cached version or a
    new version of Portlet B has to be rendered? In my case Portlet A would be a
    showDetails page of Portlet A collecting data that drives the content in Portlet B.
    So, everytime the html form in Portlet A'showDetails page is submitted, I would like to
    refresh Portlet B, otherwise simply use the cached version. How do I change the version
    identifier in Portlet B, to cause the Portlet A to not use the cached version?
    3) How do I enforce USER level in this model? I didnt see any parameter that accepts the LEVEL in
    validation based caching methods.
    Appreciate any suggestions/help since this is my first attempt at implementing any form of cahing
    regards
    -Ananth Makaram

    Yes. There will be 20000 instances in the case you have mentioned.
    To answer your question "Would that be expensive OR is it a non-issue? "
    - The File Cache is built to handle 10 million cache items efficiently. So, This will NOT be an issue for the cache you are mentioning.
    - Assuming each of the portlet is about 2k. In your case you'd only have about 40MB in case. Even in very big sites the cache size is only about 2GB per mid-tier
    Moreover, Disk space is very Cheap. There are cache clean jobs which clean up the cache regularly to make sure that it does NOT grow to unmanageable proportions.

  • Top time events showing global cache  buffer busy waits

    can any one guide me to find the root cause for global cache buffer waits

    "Segments by Global Cache Buffer Busy" output from an AWR report.
    And let us know how many CPUs you have If you don't want to reveal the names of the objects, then change them (but do it in a way that means if two indexes are for the same table then it's visible). The distribution of waits is significant.
    How many of the indexes in the "segments" are based on an Oracle Sequence ? Check the values for the CACHE size of those sequences they probably ought to be at least 1,000.
    See note below about producing readable output.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • In EJB3 entities, what is the equiv. of key-cache-size for PK generation?

    We have an oracle sequence which we use to generate primary keys. This sequence is set to increment by 5.
    e.g.:
    create sequence pk_sequence increment by 5;
    This is so weblogic doesn't need to query the sequence on every entity bean creation, it only needs to query the sequence every 5 times.
    With CMP2 entity beans and automatic key generation, this was configured simply by having the following in weblogic-cmp-rdbms-jar.xml:
    <automatic-key-generation>
    <generator-type>Sequence</generator-type>
    <generator-name>pk_sequence</generator-name>
    <key-cache-size>5</key-cache-size>
    </automatic-key-generation>
    This works great, the IDs created are 10, 11, 12, 13, 14, 15, 16, etc and weblogic only needs to hit the sequence 1/5 times.
    However, we have been trying to find the equivalent with the EJB3-style JPA entities:
    We've tried
    @SequenceGenerator(name = "SW_ENTITY_SEQUENCE", sequenceName = "native(Sequence=pk_sequence, Increment=5, Allocate=5)")
    @SequenceGenerator(name = "SW_ENTITY_SEQUENCE", sequenceName = "pk_sequence", allocationSize = 5)
    But with both configurations, the autogenerated IDs are 10, 15, 20, 25, 30, etc - weblogic seems to be getting a new value from the sequence every time.
    Am i missing anything?
    We are using weblogic 10.3

    If you are having a problem it is not clear what it is from what you have said.  If you have sugestions for improving some shortcomings you see in Flash CC then you should submit them to:
    Adobe - Wishlist & Bug Report
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • How to pick the multiples based on file size

    Hi All,
    my sender file adapter needs to pick up 5 files based on file size.
    for example 1file size is 500kb,2nd file size 300kb,3rd file size 400kb, 4file size 100kb and 5file size 600kb.
    here my requirement is, my file adapter needs to pick in the below order like 5th file,1st file,3rd file 2nd file and 4th file.
    means based on file size, i need to pick up my file adapter.
    could you please ang inputs on this requirement.
    Thanks & Regards,
    AVR

    Hi AVR,
    for case 2:
    1. At specific time each day  "23:58:00" hours ,count the number of files in directory say "c:\apps\acm".
    2. sort the files on basis of their size.
    3. place the files one by one after definite  time interval (more than polling time of the sender communication channel).
    in target directory say "c:\apps\acm1" from where PI server  picks up the files for further processing. The file with smallest size is placed last.
    4. In this case you need to ensure all files are present in the directory "c:\apps\acm" before "23:58:00" hours.
    for case 2  java code
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class sortFilesOnSpecificTime {
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try
    * In Unix/Linux OS, dir1="/usr/apps/test"  etc
    int pollingInterval=10,sleepTime=1*60;
    String dir1="c:\\apps\\acm";
    String dir2="c:\\apps\\acm1";
    File fread=new File(dir1);
    File fwrite=new File(dir2);
    if(fread.canRead()==false)
    System.out.println("error: "+dir1+" does not have read permission. Program Terminates.");
    return;
    if(fwrite.canWrite()==false)
    System.out.println("error: "+dir2+" does not have write permission. Program Terminates.");
    return;
    String fileNames[],fileNamesOut[];
    long fileSize[];
    int i,j;
    byte b[];
    int t=4;
    Calendar cal;
    int hour24,min,fileCopyHour=23,fileCopyMin=58;
    long waitSeconds=1,currentTime=0;
    while(t>0)
    cal = new GregorianCalendar();
    hour24 = cal.get(Calendar.HOUR_OF_DAY);     // 0..23
    min = cal.get(Calendar.MINUTE);             //0..59
    System.out.println("current time="+hour24+":"+min);
    /*loop unless time reaches a specific predetermined value
    * predetermined values are provided by values
    * fileCopyHour=8,fileCopyMin=30 i.e say 08:30 hours
    currentTime=(hour24*60+min)*60;
    waitSeconds=(fileCopyHour*60+fileCopyMin)*60 - currentTime;
    if(waitSeconds>0)
    * in case you wanna to make this thread sleep for
    * say sleepTime(10) minutes before it checks the files once again
    * because looping continuously causes wastage of CPU cycles.   
    Thread.sleep(waitSeconds*1000);
    //read list of files
    fileNames=fread.list();
    if(fileNames.length;=0)
    * time is up but there are no file
    * in dir1 to copy. Then this program
    * goes to sleep for some time and
    * checks only at 11:55 hours. That is
    * end of the day
    continue;
    fileSize=new long[fileNames.length];
    fileNamesOut=new String[fileNames.length];
    //read their sizes
    for(i=0;i<fileNames.length;++i)
    fileNamesOut<i>=fileNames<i>;
    fileNames<i>=dir1+System.getProperty("file.separator";)+fileNames<i>;
    fileSize<i>=new File(fileNames<i>).length();
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    //sorting on basis of file size descending order
    long value;
    String temp;
    for(i=1;i<fileSize.length;++i)
    value=fileSize<i>;
    temp=fileNames<i>;
    for(j=i-1;j>=0 && fileSize[j]<value;--j)
    fileSize[j+1]=fileSize[j];
    fileNames[j+1]=fileNames[j];
    fileSize[j+1]=value;
    fileNames[j+1]=temp;
    //now copy files to dir2
    b=new byte[512];
    for(i=0;i<fileNames.length;++i)
    System.out.println(fileNames<i>+" size="+fileSize<i>);
    for(i=0;i<fileNames.length;++i)
    File f=new File(fileNames<i>);
    FileInputStream in=new FileInputStream(f);
    FileOutputStream out=new FileOutputStream(dir2+System.getProperty("file.separator";)+fileNamesOut<i>);
    int len=0;
    while(2>1)
    if((len=in.read(b))<0)
    break;
    out.write(b,0,len);
    in.close();
    //delete files after copying from dir1
    f.delete();
    out.close();
    //put each file after polling interval is over
    Thread.sleep(pollingInterval*1000);
    catch(Exception e)
    e.printStackTrace();
    The code runs in infinite loop. You need to run them in command line in DOS environment as you indicated that you OS is WIN XP.  I have a few print statements which I kept for debugging, you can safely remove them and run the codes. This code is independent of the Operating System you are using. Only change is required in values of "dir1","dir2", timings and file count, which I think you can take care easily.
    Hope this solves your problem.
    regards
    Anupam

  • I need help with my event-based cue points with audio

    Im having trouble with my video game project for my action script 3 class at school. Here is what i did, i made a game called Tailgate toss up. I filmed my character and rendered it in Adobe Premiere. I than brought my .mov file into After Effects and I put event-based cue points-
    my first cue point at 0:00:03:13 called "loop"
    my second cue point at 00:00:03:27 called "draw"
    my third cue point at 00:00:05:24 called "bang"
    my fourth cue point at 00:00:13:29 called "dead"
    my fifth cue point at 00:00:14:29 called "You Lose"
    my last cue point at 00:00:19:14 called "End"
    Here is my action script 3 code
    ///first frame:
    start_btn.addEventListener(MouseEvent.CLICK, startGame);
    function startGame(event:MouseEvent){
    gotoAndStop(2);
    SoundMixer.stopAll()
    stop();
    ///second frame:
    stop();
    var loopTime
    var hitHim:Boolean = false;
    var vConnection:NetConnection = new NetConnection();
    vConnection.connect(null);
    var vStream:NetStream = new NetStream(vConnection);
    var client:Object = new Object();
    client.onCuePoint = onCuePoint;
    vStream.client = client;
    var myVideo:Video = new Video(418, 480);
    myVideo.y = 0;  ///this adjusts where the video is, right now it is the size of the canvas which is 418,480
    addChild(myVideo);
    myVideo.attachNetStream(vStream);
    vStream.play("michelle.flv");
    var throw_bottle:Sound
    throw_bottle = new Sound(new URLRequest("audio/throw_bottle.mp3")); //change to button noise, will add sound into ae file
    target_mc.addEventListener(MouseEvent.CLICK, shoot);
    target_mc.buttonMode = true;
    target_mc.visible = false;
    draw_mc.visible = false;
    function onCuePoint(cuePoint:Object):void {
       if(cuePoint.name == "loop"){
    loopTime = cuePoint.time;
        if(cuePoint.name == "draw"){
    var randomLoop:Number = Math.random()*10;
    if(randomLoop > 2){
    vStream.seek(loopTime);
    }else{
    setChildIndex(target_mc, numChildren - 1);  
    setChildIndex(draw_mc, numChildren - 1);    
    target_mc.visible = true;
    draw_mc.visible = true;
    if(cuePoint.time == "5:24"){
    draw_mc.visible = false;
    target_mc.visible = false;
    if(!hitHim){
    vStream.seek(15);    
    if(cuePoint.name == "dead"){
    vStream.close();
    myVideo.clear();
    gotoAndStop(3);
    if(cuePoint.name == "end"){
    gotoAndStop(3);
    function shoot(event:MouseEvent){
    throw_bottle.play();
    hitHim = true;
    ///my third and last frame
    playAgain_btn.addEventListener(MouseEvent.CLICK, playAgain);
    function playAgain(event:MouseEvent){
    gotoAndStop(2);
    SoundMixer.stopAll()
    stop();
    When I have no audio it works perfectly, no problems. When I bring audio in i re-render it as a .mov file and bring it back into After Effects and add the cue points to it. Than i re-render it out again as a flv file. When i bring it into my flash project it will work when the looping variable does just one loop and my target will appear so you can click on it or not. But when the looping variable makes it loop 2 to 10 times it skips over the catching (the part of the clip if you clip the button) and goes directly to the dropping of the can, not giving you the option of clicking the button. So basically it skips the "draw" or second cue point of my game and goes to "You Lose" cue point.
    Any suggestions?

    Hi,
    The latest audio driver for your machine is on the following link.
    http://ftp.hp.com/pub/softpaq/sp59501-60000/sp59649.exe
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Trying to change the cache size of FF3.6 from 75meg to a larger size, it only applies on a per session basis. i check the about:config and the changes have applied but when i restart FF it has reset itself to 75 :(

    as per the question, tried to up the cache from 75meg to 300meg but it resets after i restart firefox, have tried to change to various cache sizes but to no avail.
    -=EDIT=-
    it must be something to do with the profile, as when i set up a new profile in the manager, the cache size problem no longer appears. but now, how to repair my profile

    ok, nothing in that text file helped but the original file that it was based on pointed me in the direction that it might be an extension. The only extensions i have are NoScript and FasterFox Lite version....
    I have now traced the fault to lie with FasterFox... if you are not familiar with fasterfox it speeds up internet connections in firefox... several of the options are presets... but when i selected custom it gave me the option of a cache setting, which was set to 75megs.
    I have now changed that cache setting in fasterfox to 300 Megs and it is now persistant in firefox on restart.
    hopefully this information will be helpful to other people in the future that suffer the same problem.
    Thanks for your help TonyE, its greatly appreciated

  • Can I use AWT elements in a JSP, and so could I generate events with them?

    This is because I�m doing a simple JSP that showing a button, my JSP is:
    <html>
    <%@ page import="java.awt.*" %>
    <%! Button b = new Button("Hola!!!"); %>
    <% add(b); %>
    </html>
    But when I tried to see the button in the browser, my JSP generates the following:
    Compilation of '/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java' failed:
    /RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java:79: cannot resolve symbol
    probably occurred due to an error in /gep/alterno/23_mayo/mr4.jsp line 7:
    <% add(b); %>
    Could somebody help me please?.....
    Can I use AWT elements in a JSP, and so could I generate events with them?
    Thanks!!!

    There are 2 ways to run a web page dynamically:
    1) Reload the page via use of javascript or some other scripting language.
    2) Use an applet to regularly check a URL for the data
    Remember, as Paul pointed out, JSP's only generate HTML output. AWT components need to run inside a JVM not a just the browser.
    I could recommend an applet but you may have problems with IE6 not supporting java. Otherwise there shouldn't be too much of a prob.
    If you prefer to use an AWT/Swing setup (for example an application) rather than a JSP setup, Webstart is good for delivering online applications which operate standalone or remotely.
    When you consider that the Java-Plugin and the Webstart puligin are about the same size it's just a matter of weighing up who your target clients are and whats easiest.
    Cheers,
    Anthony

  • Set font size based on component size

    Hi everybody,
    This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a component, but still be able to have the whole string visible, if you're using a font other than default?
    For example:
    public static void main( String args[] ){
    try {
              JFrame frame = new JFrame( "Title" );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              int guiWidth = width / 2;
              int guiHeight = height / 2;
              frame.setSize( guiWidth, guiHeight );
              Container pane = frame.getContentPane();
              // Create main label
              String labelString = "Test";
              JLabel label = new JLabel( labelString );
              label.setBackground( new Color( 179, 0, 0 ) );
              label.setForeground( new Color( 235, 191, 16 ) );
              label.setHorizontalAlignment( CENTER );
              label.setOpaque( true );
              label.setFont( new Font( �Old English Text MT�, 0, 48 ) );
              pane.add( label, BorderLayout.NORTH );
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
    } catch( Exception e) {
    e.printStackTrace();
         }As you can see, right now the font needs to be hard coded. I'd like it to be dynamic, based on the size of the screen the user has.
    Sorry if the partial double post annoys anybody; I figured it would be less annoying than resurrecting my old post.
    Any help on this would be great, and thank you!
    Jezzica85
    Message was edited by:
    jezzica85
    Message was edited by:
    jezzica85

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.AffineTransform;
    import javax.swing.*;
    public class DynamicFont {
        private JLabel getNorth() {
            // Create main label
            String labelString = "Test";
            final JLabel label = new JLabel( labelString ) {
                public void paint(Graphics g) {
                    ((Graphics2D)g).setRenderingHint(
                            RenderingHints.KEY_TEXT_ANTIALIASING,
                            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                    super.paint(g);
            label.setBackground( new Color( 179, 0, 0 ) );
            label.setForeground( new Color( 235, 191, 16 ) );
            label.setHorizontalAlignment( JLabel.CENTER );
            label.setOpaque( true );
            label.setFont( new Font( "Old English Text MT", 0, 48 ) );
            label.addComponentListener(new ComponentAdapter() {
                Font font = label.getFont();
                public void componentResized(ComponentEvent e) {
                    int w = label.getWidth();
                    int sw = label.getFontMetrics(font).stringWidth(label.getText());
                    double scale = (double)w/sw;
                    AffineTransform at = AffineTransform.getScaleInstance(scale, 1.0);
                    label.setFont(font.deriveFont(at));
                    label.repaint();
            return label;
        public static void main( String[] args ) {
            JFrame frame = new JFrame( "Title" );
            frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            Container pane = frame.getContentPane();
            pane.add( new DynamicFont().getNorth(), BorderLayout.NORTH );
            frame.setSize( 400, 100);
            frame.setLocationRelativeTo( null );
            frame.setVisible( true );
    }

  • Event based decision

    Hi every one,
    I am working with jcaps 5.1.3.
    I am doing a business process to implement timer event, following user guide of eDesigner on page 63.
    I want to receive a message on my business process and do anything whit this message, but I want to control timeout while.
    I use a event based decision, but when I build my project I get next error:
    I test my business process and I found this error is generated when I configure event based decision (message event).
    Have everyone an example How implement a timeout on a bussiness process?
    Thanks on advanced,
    conhector
    com.stc.codegen.framework.model.CodeGenException: code generation error at = initializingnull
    at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1567)
    at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
    at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
    at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
    at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
    at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
    at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
    at org.openide.util.Task.run(Task.java:136)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
    Caused by: java.lang.ClassCastException
    at com.stc.codegen.eInsightImpl.model.EInsightCodelet.validatePorts(EInsightCodelet.java:1597)
    at com.stc.codegen.eInsightImpl.model.EInsightCodelet.validate(EInsightCodelet.java:1567)
    at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.validateCodelets(CodeGenFrameworkImpl.java:1049)
    at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1542)
    ... 8 more

    Hello,
    i become acquainted with JavaCAPS at the moment.
    Working with the JavaCAPS Tutorial v2.1, i´m having the same problem like conector.
    Trying to built the EAR file in project 4 (Viewing store data), CAPS throws an exception named "code generation error at = initializingnull".
    I checked the corresponding connectivity map but everything seems to be ok.
    Exception:
    code generation error at = initializingnullError details:
    com.stc.codegen.framework.model.CodeGenException: code generation error at = initializingnull
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1567)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
         at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
         at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
         at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
         at org.openide.util.Task.run(Task.java:136)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
    Caused by: java.lang.ClassCastException
         at com.stc.codegen.eInsightImpl.model.EInsightCodelet.validatePorts(EInsightCodelet.java:1597)
         at com.stc.codegen.eInsightImpl.model.EInsightCodelet.validate(EInsightCodelet.java:1567)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.validateCodelets(CodeGenFrameworkImpl.java:1049)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1542)
         ... 8 moreFor help i would be deeply grateful!
    Thanks.

  • How to run a particular case continuously in event based state machine architecture.

    I am making a program using event based state machine architecture, it is running as expected whenever i am generating an event, case structure corresponding to that event executes.
    we are taking some measurements from oscilloscope e.g. i am having one boolean button for rise time whenever i am pressing that that button it displays the value of rise time, it displays only once( since i have generated an event on that boolean button so it executes only once and displays value for one time and then comeback to timeout state) but in our program what we want, we want it to update value continously once that button is pressed.
    Now for a time being i have placed while loop on the case corresponding to rise time but this is not the right approach.
    since i am using state machine architecture( event based ), i am not getting how to run particular case continuously ,or if there is any other better architecture that i can use to implement the same application.
    Attached below is the program.
    Attachments:
    OScilloscope .zip ‏108 KB

    Say, in the attached program, when the user selects Autoset, it inserts corresponding state (Autoset) and now if you want this state to run again and again, probbbly you can again insert Autoset state while executing Autoset state... ohhh its confusing... check the picture below (A picture is worth a thousand words):
    1. Based on user selection, insert Autoset state.
    2. Re-insert Autoset state again and again while executing Autoset state.
    3. Now to come out of this loop, based on appropriate event generation, insert any other state AT FRONT (equivalent to Enqueue Element At Opposite End).
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Swapping and Database Buffer Cache size

    I've read that setting the database buffer cache size too large can cause swapping and paging. Why is this the case? More memory for sql data would seem to not be a problem. Unless it is the proportion of the database buffer to the rest of the SGA that matters.

    Well I am always a defender of the large DB buffer cache. Setting the bigger db buffer cache alone will not in any way hurt Oracle performance.
    However ... as the buffer cache grows, the time to determine 'which blocks
    need to be cleaned' increases. Therefore, at a certain point the benefit of a
    larger cache is offset by the time to keep it sync'd to the disk. After that point,
    increasing buffer cache size can actually hurt performance. That's the reason why Oracle has checkpoint.
    A checkpoint performs the following three operations:
    1. Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk.
    It's the DBWR that writes all modified databaseblocks back to the datafiles.
    2. The latest SCN is written (updated) into the datafile header.
    3. The latest SCN is also written to the controlfiles.
    The following events trigger a checkpoint.
    1. Redo log switch
    2. LOG_CHECKPOINT_TIMEOUT has expired
    3. LOG_CHECKPOINT_INTERVAL has been reached
    4. DBA requires so (alter system checkpoint)

  • CMP PK Sequence generated by Bean Self Cache !!

    Hi All,
    In WL6.1, one can mention the name of the sequence and the DB in the cmp-rdbms-jar.xml
    to use the sequence generated number to use as a primary key.
    Though my work is being done by the WL server but still WL server is hitting the
    DB for each insert.
    There are a couple of discussions listed on theserverside.com, but most of them
    fail for a clustered environment.
    Can anyone please suggest me a solution where the WL server would cache the keys
    instead of hitting the DB for each insert ?
    Thanks in advance for your help !!
    Regards
    -Rais

    Hi,
    I performed a test and ran 3 scenarios(inserting 1000 records).
    1. SEQUENCE INCREMENT BY 10 And key-cache-size = 1.
    Time taken = 13 seconds
    Records were inserted as 1,11,21,31.....
    2. SEQUENCE INCREMENTED BY 10 And key-cache-size = 10
    Records were inserted as 1,2,3,4,5...
    Time = 8 seconds
    3. SEQUENCE INCREMENTED BY 1 And key-cache-size = 10
    I got the duplicate primary key problem.
    The behaviour in case 2 is ambiguous to me...I was expecting the records to be
    inserted as 1,11,21,31.....
    Can anyone please clarify ??
    Thanks
    -Rais
    "Rais" <[email protected]> wrote:
    >
    Hi Rob,
    The weblogic Docs and the DTD says that "key-cache-size" should be equal
    to the
    INCREMENT VALUE of the Sequence in DB.Lemme point out what I have interpreted
    from that.Please correct me if I am wrong.
    lets say my sequence is
    CREATE SEQUENCE TEMP_SEQ INCREMENT BY 2.
    And my key-cache-size value is also 2.
    I believe that by keeping these two values equal,records would be inserted
    into
    the DB as 1,3,5,7......
    But in a clustered environment,each CMP would still be hitting the DB
    to get the
    sequence number.
    What I mean to say is key-cache-size is actually not meant for caching
    the sequence
    numbers.
    Even if it is ,how would the servers in the cluster maintain the same
    state of
    their individual cache same ??
    Regards
    -Rais
    Rob Woollen <[email protected]> wrote:
    Did you set a key-cache-size in your CMP deployment descriptor?
    -- Rob
    Rais wrote:
    Hi All,
    In WL6.1, one can mention the name of the sequence and the DB in thecmp-rdbms-jar.xml
    to use the sequence generated number to use as a primary key.
    Though my work is being done by the WL server but still WL server
    is
    hitting the
    DB for each insert.
    There are a couple of discussions listed on theserverside.com, butmost of them
    fail for a clustered environment.
    Can anyone please suggest me a solution where the WL server would
    cache
    the keys
    instead of hitting the DB for each insert ?
    Thanks in advance for your help !!
    Regards
    -Rais

Maybe you are looking for

  • Problem with  Windows Vista and Ipod!!!!

    I tried a couple of times to import my music from my computer and cds to my ipod nano . The thing is that I know I have transfered some songs and photos properly cause I can see the files are in the ipod memory but as soon as I unplug it from the USB

  • Why can't I just use songs from my library as ringtones?

    If iTunes is so fundamental to the iPhone even being able to be turned on and iTunes already has a built in function to limit any song to any snippet of time shouln't it be a simple call to the same underlying iTunes function to play a song (possibly

  • What can Apple TV do?

    I guess I am a little confused about the capabilities of Apple TV. Will it allow me to view on my HDTV anything that is displayed on my Mac monitor. As an example maybe I want to display a iPhoto slideshow or album. How about a keynote or powerpoint

  • Medruck sapscript-purchase order text

    I would like to print the Purchase order header texts in the first line of main program.But it is printing at the end only. SAPSCRIPT -medruck Text SUPPL_TEXT &TTXIT-TDTEXT& INCLUDE &T166A-TXNAM& OBJECT &T166A-TDOBJECT& ID &T166A-TDID& Thanks

  • Error in create applicant  bapi_applicant_create

    Hello everyone! I'd like to use BAPI_APPLICANT_CREATE in order to create the applicants in our system. I was doing some tests in se37 but the error: 'E00055 Make an entry in all required fields' always appears. I tryed to write data in all fields and