Why not using LOCALs in LOOPs ?

Why avoiding LOCALs in LOOPs? (I saw some posts that suggest it).
In my case, I have one button (Stop) and I want to be able to stop the application along 3 different independent loops. How can I do it without locals ?
Thanks

The use of a sequence you describe here is ok but I think the goal here is to initialize the local to a known state BEFORE you start reading it in the loops. After the VI has stopped there is no need to set the local false again. Cleanup is usually a waste of time since the VI is stopped anyway. Also for initializing a single local just follow the example attached...
Michael Aivaliotis
VI Shots LLC
Attachments:
Stopping_parallel_loops_with_locals.vi ‏24 KB

Similar Messages

  • Why not use notifyall

    now I'm reading this book "Java Threads 2nd edition" by Scott Oaks and Henry Wong. Writer provide a class called BusyFlag to simulate the mutex.
    I wonder why not use notifyall() to replay notify().
    public class BusyFlag {
         protected Thread busyflag = null;
         protected int busycount = 0;
         public synchronized void getBusyFlag() {
              while (tryGetBusyFlag() == false) {
                   try {
                        wait();
                   } catch (Exception e) {
         public synchronized boolean tryGetBusyFlag() {
              if (busyflag == null) {
                   busyflag = Thread.currentThread();
                   busycount = 1;
                   return true;
              if (busyflag == Thread.currentThread()) {
                   busycount++;
                   return true;
              return false;
         public synchronized void freeBusyFlag() {
              if (getBusyFlagOwner() == Thread.currentThread()) {
                   busycount--;
                   if (busycount == 0) {
                        busyflag = null;
                        *notify();*
         public synchronized Thread getBusyFlagOwner() {
              return busyflag;
    }

    naficbm wrote:
    now I'm reading this book "Java Threads 2nd edition" by Scott Oaks and Henry Wong. Writer provide a class called BusyFlag to simulate the mutex.
    I wonder why not use notifyall() to replay notify().Looks like it should work with notifyall as well.

  • Why not use "new" operator  with strings

    why we not use new when declaring a String .because in java String are treated as objects. we use new operator for creating an object in java .
    and same problem wiht array when we declare array as well as initialize .here we are alse not using new for array
    why

    Strings aren't just treated as objects, Strings are Objects.
    As for why not using new for Strings, you can, if you want.:
    String str = "this is a string";
    and
    String str = new String("this is a string");
    do the same thing (nitty-gritty low level details about literals aside). Use whatever you like, but isn't it simpler not to type new String(...) since you still need to type the actual string?
    As for arrays, you can use new:
    int[] ints = new int[10];
    or
    int[] ints = { 0, 1, 2, 3, ..., 9 };
    But the difference here is you are creating an empty array in the first one, the second creates and fills the array with the specified values. But which to you often depends on what you are doing.

  • Why not use paper label on finished DVD project?

    I also use printed paper labels for my DVD covers
    why not use them?
    please advise?

    Hi
    The DVD get's unbalanced = Laser can't read track
    DVD are several times more sencitive than CD (not advicable to put lables on them either)
    And DVDs/CDs that are unbalanced also give more strain to the player mechanism
    that eventually stops working.
    Yours Bengt W

  • Why not use interfaces for constants?

    Hi,
    I have been getting conflicting views about why not use interfaces for constants?
    Can anyone shed some light on it?
    Piyush

    How so?
    If the constants are only used in a single classhow
    does it help to put them in a separate structute?
    (Ignoring the a type safe enumeration of course.)Well, mainly for readability. Suppose that you have a
    web application which has a servlet class
    "RedirectServlet", which takes a variable to redirect
    to a given JSP file. In the JSP files, you want to
    create forms which take this servlet as their action.
    You could of course put all these "redirect"
    constants in the RedirectServlet itself, but then
    it's kind of weird that you have to import a
    servlet in your jsp file to include these constants
    and to be able to write
    <form action="servlet/RedirectServlet?key=<%=
    RedirectServlet.HOMEPAGE %>> or so.
    Instead, you could create an interface called
    "RedirectConstants", and then your servlet
    RedirectServlet could implement this interface. Then
    your JSP can also access these constants via this
    interface.
    But then again, this is merely a matter of style, I
    fully agree that there is never a real _need_ to put
    constants in a separate structure if they're only used
    in a single class.Are you claiming that your example above is a single class?

  • Labview FPGA: Why not have local variable without indicator?

    In Labview FPGA, to transfer data among parallel loops, there are three ways or maybe more, local variable, global variable and block memory. The problem with local variable is that it needs an indicator along with, not like global variable. I was thinking why Labview doesn't make a kind of local variable not need indicator? I guess local variable itself doesn't cost resource much compared to global variable, however when it comes into indicator, it will cost more. Just an idea, though. I guess there is a reason NI doesn't do that. 

    As in Labview document, global variable can be used for transfer data among VIs, which local variable isn't capable of. 
    Global variable is not always a better solution. From my experience, it is still unclear among different compilations using local vs global in terms of resources. A thread here http://forums.ni.com/t5/LabVIEW/FPGA-global-variables-vs-front-panel-items/td-p/1407282 talks about that too.
    Stephen, is there any documents say that global makes timing worse? I didn't see this noticeable.

  • Some Clients not using Local Distribution Point

    I have a new physcial site that we are wanting to put the SCCM client on the workstations. The local DP has been setup and the SCCM 2012 config settings for the new site have been made. I did a manual push to 5 workstations and monitored the ccmsetup.log.
    I had some clients using the local DP for the client install and some went back across the WAN to the MP to get the files. The ones that come back across the WAN to the MP have this in their log shown below. It does not appear to be boundary related or
    Client OS as they are in the same subnet that is configured and have both xp and win7 working and not working. I found a few others have had this issue come up searching the web, but none of solutions helped in my situation. The client is installing on
    all of the workstations I have manually pushed it to. I just can't figure out why some are not using the local DP and YES I have verified that the ones not using the local DP are in the same boundary group as the ones that do. 
    Any help is appreciated. FVH081-DP1 is the local DP and AHDC400 is my MP
    Only one MP AHDC400.phs-sfalls.amck.net is specified. Use it. ccmsetup 1/23/2015 2:56:41 PM 2728 (0x0AA8)
    Searching for DP locations from MP(s)... ccmsetup 1/23/2015 2:56:41 PM 2728 (0x0AA8)
    Current AD site of machine is FVH LocationServices 1/23/2015 2:56:41 PM 2728 (0x0AA8)
    Local Machine is joined to an AD domain LocationServices 1/23/2015 2:56:41 PM 2728 (0x0AA8)
    Current AD forest name is amck.net, domain name is fvh.amck.net LocationServices 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    DhcpGetOriginalSubnetMask entry point not supported. LocationServices 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Begin checking Alternate Network Configuration LocationServices 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Finished checking Alternate Network Configuration LocationServices 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Adapter {AB6BAB2C-7B65-441A-A83C-C91FF8B8498D} is DHCP enabled. Checking quarantine status. LocationServices 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Sending message body '<ContentLocationRequest SchemaVersion="1.00">
      <AssignedSite SiteCode="MCK"/>
      <ClientPackage/>
      <ClientLocationInfo LocationType="SMSPACKAGE" DistributeOnDemand="0" UseProtected="0" AllowCaching="0" BranchDPFlags="0" AllowHTTP="1" AllowSMB="0" AllowMulticast="0"
    UseInternetDP="0">
        <ADSite Name="FVH"/>
        <Forest Name="amck.net"/>
        <Domain Name="fvh.amck.net"/>
        <IPAddresses>
    <IPAddress SubnetAddress="10.7.64.0" Address="10.7.79.3"/>
        </IPAddresses>
      </ClientLocationInfo>
    </ContentLocationRequest>
    ' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Sending message header '<Msg SchemaVersion="1.1"><ID>{DA5C91BE-3A3E-4E14-AF6E-DB0E9AC36878}</ID><SourceHost>FVHH008</SourceHost><TargetAddress>mp:[http]MP_LocationManager</TargetAddress><ReplyTo>direct:FVHH008:LS_ReplyLocations</ReplyTo><Priority>3</Priority><Timeout>600</Timeout><ReqVersion>5931</ReqVersion><TargetHost>AHDC400.phs-sfalls.amck.net</TargetHost><TargetEndpoint>MP_LocationManager</TargetEndpoint><ReplyMode>Sync</ReplyMode><Protocol>http</Protocol><SentTime>2015-01-23T20:56:42Z</SentTime><Body
    Type="ByteRange" Offset="0" Length="1068"/><Hooks><Hook3 Name="zlib-compress"/></Hooks><Payload Type="inline"/></Msg>' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    CCM_POST 'HTTP://AHDC400.phs-sfalls.amck.net/ccm_system/request' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Content boundary is '--aAbBcCdDv1234567890VxXyYzZ' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Received header '<Msg SchemaVersion="1.1">
     <ID>{45121E9D-C6EE-4154-BF60-AADD6204B66E}</ID>
     <SourceID>GUID:1B6F821D-DF54-4E9D-89BD-D68DD917DBD2</SourceID>
     <SourceHost>AHDC400</SourceHost>
     <TargetAddress>direct:FVHH008:LS_ReplyLocations</TargetAddress>
     <ReplyTo>MP_LocationManager</ReplyTo>
     <CorrelationID>{00000000-0000-0000-0000-000000000000}</CorrelationID>
     <Priority>3</Priority>
     <Timeout>600</Timeout>
     <TargetHost>FVHH008</TargetHost><TargetEndpoint>LS_ReplyLocations</TargetEndpoint><ReplyMode>Sync</ReplyMode><Protocol>http</Protocol><SentTime>2015-01-23T20:56:42Z</SentTime><Body Type="ByteRange"
    Offset="0" Length="2590"/><Hooks><Hook3 Name="zlib-compress"/><Hook Name="authenticate"><Property Name="Signature">3082018F06092A864886F70D010702A08201803082017C020101310B300906052B0E03021A0500300B06092A864886F70D0107013182015B30820157020101303430203110300E0603550403130741484443343030310C300A06035504031303534D53021058042BA685CEB3A74AC16009523D655A300906052B0E03021A0500300D06092A864886F70D0101010500048201002E2019E353A4244A8CA9D2451A6206393F00541279E76F3EFEED3C768C36F01EB88834E74E53D3063FC56D5A899C604036B8DCBACC765156270E5417D0A384440A2B29B08487F9BCEB84C3642D736587692675CBFB78DAF8017D94C5782E5166868F7B0B01E006319B1BDF6FA37DE9AFE5389C5CADF3A72572B08D01D68EE369C9830F4952B6C1B38F710B87888C65C27EB8176B8064BC392DB06C966112F119AD62E53C7B79EC26CEA9CFE027D401E535EAB166E18A5F37CB806EC21AF66510A41B5B4936953682DAF157EA50E02D51DF8A78DE4E12A368AE7693EEC37ACFAAC16ACF4C5DA0838F5821413C79A478DBAF1DCDAE23F6734C1D70882D3CBF4433</Property><Property
    Name="AuthSenderMachine">AHDC400;AHDC400.phs-sfalls.amck.net;</Property><Property Name="MPSiteCode">MCK</Property></Hook></Hooks><Payload Type="inline"/></Msg>' ccmsetup 1/23/2015
    2:56:42 PM 2728 (0x0AA8)
    Received reply body '<ContentLocationReply SchemaVersion="1.00"><ContentInfo PackageFlags="16777216"><ContentHashValues/></ContentInfo><Sites><Site><MPSite SiteCode="MCK" MasterSiteCode="MCK"
    SiteLocality="LOCAL" IISPreferedPort="80" IISSSLPreferedPort="443"/><LocationRecords><LocationRecord><URL Name="http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSPKG$/AHS00002" Signature="http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSSIG$/AHS00002"/><ADSite
    Name="FVH"/><IPSubnets><IPSubnet Address="10.7.64.0"/><IPSubnet Address=""/></IPSubnets><Metric Value=""/><Version>7804</Version><Capabilities SchemaVersion="1.0"><Property
    Name="SSLState" Value="0"/></Capabilities><ServerRemoteName>FVH081-DP1.phs-sfalls.amck.net</ServerRemoteName><DPType>SERVER</DPType><Windows Trust="1"/><Locality>LOCAL</Locality></LocationRecord></LocationRecords></Site><Site><MPSite
    SiteCode="MCK" MasterSiteCode="MCK" SiteLocality="LOCAL"/><LocationRecords/></Site></Sites><ClientPackage FullPackageID="AHS00002" FullPackageVersion="1" FullPackageHash="5EF3A189C48F3469440A83026EC8ECD36EAD6EAF3B5D35663F8201BDE175413C"
    MinimumClientVersion="5.00.7804.1000" RandomizeMaxDays="7" ProgramEnabled="false" LastModifiedTime="30282566;3841038464" SiteVersionMatch="true" SiteVersion="5.00.7804.1000" EnablePeerCache="true"/></ContentLocationReply>' ccmsetup 1/23/2015
    2:56:42 PM 2728 (0x0AA8)
    Found local location 'http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSPKG$/AHS00002' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Discovered 1 local DP locations. ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    PROPFIND 'http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSPKG$/AHS00002' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Got 401 challenge Retrying with Windows Auth... ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    PROPFIND 'http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSPKG$/AHS00002' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Failed to correctly receive a WEBDAV HTTP request.. (StatusCode at WinHttpQueryHeaders: 401) ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Failed to check url http://FVH081-DP1.phs-sfalls.amck.net/SMS_DP_SMSPKG$/AHS00002. Error 0x80004005 ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    Enumerated all 1 local DP locations but none of them is good. Fallback to MP. ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    GET 'HTTP://AHDC400.phs-sfalls.amck.net/CCM_Client/ccmsetup.cab' ccmsetup 1/23/2015 2:56:42 PM 2728 (0x0AA8)
    C:\WINDOWS\ccmsetup\ccmsetup.cab is Microsoft trusted. ccmsetup 1/23/2015 2:56:43 PM 2728 (0x0AA8)

    Single forest with mutiple child domains. SCCM is in one child domain trying to get this other child domain's workstations as clients. We have the same setup for another child domain and it worked without any issues.
    The IIS log file in C:\inetpub\logs\logfiles\w3svc1 only shows the successful installs. There are no entries about any failures in the log to correlate unfortunately. All failures have been XP SP3 machines except for one Win7 pc and all successes have been
    Win7 except for one xp machine.
    You wouldn't think it is network related because some workstations can access the DP fine.
    It's not boundaries because the successes and failures are all sharing the same subnet that is configured.
    Wasn't MSI 4.5 required for SCCM 2012 clients?

  • Why not use Jsp for  control in MVC2 ?

    hi
    i am rajendra , i am preparing interview FAQ, so please give me my Que. Ans.
    1) we are using servlet for control in MVC2 Module,then why we can not use
    Jsp for control in mvc2
    2) if we used jsp for control in mvc2 then what is disadvantage compare to if using servlet for control in mvc2
    Please give me ans. as soon as..
    Thanks.

    Are you preparing a FAQ for others or are you just cramming before an upcoming interview and someone gave you a set of questions? It looks more like the latter to me.
    If you haven't actually written any MVC based code, you won't be able to snow the interviewer. It's better to just relax, get a good night's sleep and impress them with your willingness to learn, your fit with the team and whatever real accomplishments you have to show.
    If you really want an answer to this I suggest that you try writing an MVC2 system using JSP for the controller, which is possible, and then try doing the same in a servlet, or better yet using a framework like Spring MVC or Struts to provide the servlet for you and let you concentrate on your application.

  • Apache VS Netscape Why Not Use Apache....

    Is this correct?
              I should use Netscape as a proxy server to proxy jsp and servlet requests to
              a weblogic cluster because the libproxy.so module has special functionality
              in dealing with weblogic clusters.
              I should NOT use Apache because it does not handle the in-memory replication
              of Sessions to the weblogic cluster.
              Why shouldn't I use Apache in a clustered environment?
              Thanks
              Michael Schreiber
              

                   Your assumption is correct. Currently there is no Apache plugin to
              handle session replication for a clustered environment in 4.51. You can
              use Apache's mod_proxy for simple proxying, but that will not handle
              failover or load balancing. An apache plugin for clustered setups will
              be available in Weblogic 5.0 (currently in public beta).
                                  - Mike
              Michael Schreiber wrote:
              >
              > Is this correct?
              >
              > I should use Netscape as a proxy server to proxy jsp and servlet requests to
              > a weblogic cluster because the libproxy.so module has special functionality
              > in dealing with weblogic clusters.
              >
              > I should NOT use Apache because it does not handle the in-memory replication
              > of Sessions to the weblogic cluster.
              >
              > Why shouldn't I use Apache in a clustered environment?
              >
              > Thanks
              > Michael Schreiber
              

  • Xletview: why not use sun's javaTV source code directly ?

    xletview : one emulator for viewing MHP Xlets on a PC;
    I see many difference from sun's code about the part of javaTV.
    Why the author Martin Sveden need to rewrite them and not use sun's javaTV source code directly ?
    Thank you for your any answer.
    Sorry for my horrible english.

    XleView is a fine effort, but it has its limitations. I tried using it for the GunBunny demo available in the JavaME SDK 3.0 Eary Access available in
    http://java.sun.com/javame/downloads/sdk30ea.jsp
    and I encountered some of thost limitations. What Sveden does it several tricky manipulations in a classloader for the Xlet. In particular, he translates bytecode as he loads the Xlet's classes, changing some class names, such as changing
    java.awt.Toolkit
    tto
    xjava.awt.Toolkit
    This works up to a point. This version of Toolkit usually just turns around calls java.awt.Toolkit's corresponding routine, but he deliberately he does not implement the ubiquitous
    public Image createImage(URL url)
    When I downloaded his source and tried adding ths into his code, I then encountered at runtime
    Uncaught error fetching image:
    java.lang.NullPointerException
    at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:97)
    at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:107)
    at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240)
    at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
    at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    I think that this is some optimization within J2SE where they do not wait for the image to load and do the fetching in a separate thread. I do not know if there is some way to force the Sun's JVM to disable this optimization and I have not investigated furher, but I did email Svenden. I noticed that the current version of XleTView is 0.3.6 which is dated June 2004 and the web site http://www.xletview.org/ has had not news since 2005 .
    I note that Svenden provides an elegant user interface but I advise you not try to learn the API's from his classes: he makes no effort to keep his implementation separate from the API standards so, for instance, his version of HScene is
    package org.havi.ui;
    public class HScene extends Container
    implements HComponentOrdering, ImageObserver, MenuContainer, Serializable {
    whereas the real standard is
    public class HScene extends Container
    implements HComponentOrdering {
    I hate to critize such a fine effort, but it is best to keep an imlementation separate from the public API.
    I agree that having a lightweight, simple and Java feature-complete Xlet viewer running would be very helpful, especially if BD-J gains much popularity. I have found trying to work with the vendor players described at
    http://wiki.java.net/bin/view/Mobileandembedded/Blu-RayDiscHelloWorld
    to be frustrating. I tried all four mentioned and I have gotten none of them to work for me yet. These are huge downloads and the "Intro Version" of Arcsoft pointed to at the SDK 3.0 Early Access page
    http://www.arcsoft.com/products/totalmediatheatre/
    just gives a "File not found" HTML page. This forum post mentions that perhaps it was recently taken down?
    http://www.arcsoft.com/forum/forum_posts.asp?TID=1084
    I have already emailed Michael Downs of Arcsoft since he is mentioned here:
    http://wiki.java.net/bin/view/Mobileandembedded/BDJPCPlayers
    What did work for me was to take Sun's JavaTV 1.1 Reference Implementation and PowerDVD's BDJ.jar and hack/fix a few classes to get GunBunny to work within the RI's RunXlet program. This is not trivial but I will will describe:
    Download the JavaME 3.0 SDK EA and then download the correct version of PowerDVD that the SDK page points to:
    http://www.brothersoft.com/powerdvd-download-50794.html
    Download the RI binary and source of Java TV API 1.1
    http://java.sun.com/javame/technology/javatv/index.jsp
    Since I am too lazy to use anything but the latest 1.6 JRE as a runtime, I have to fix
    com.sun.tv.media.util.MediaThread
    to comment out its stop() method. This is becase stop() was deprecated and made final in J2SE 1.5
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#stop()
    http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html
    Next, I had to mae a change to Sun's JavaTV implementation to keep the GunBunny demo happy by providing a ServiceContext. The RunXlet program calls SIEmulator, but that environment does not provide a ServiceContex, so I added one back in:
    com.sun.tv.receiver.SIEmulator
    private static ServiceContext svcctx = null;
    Add before every call to new AppSignalEvent() and add the svcctx as the second-to-last argument:
    if(svcctx == null){ try { svcctx = new com.sun.tv.ServiceContextImpl(); }catch (Exception e){ e.printStackTrace(); } }
    I then had to hack a few PowerDVD classes, which is evil of me. First, I had to build an empty class by the name of
    sun.util.BDJPlugin
    becuase some PowerDVD class extends it but it is not in its BDJ.jar and then I had to reverse-compile (evil!) and modify one of their internal classes to avoid a dependency on their native methods. What I ended up with was a hacked version of com.cl.bdj.helper.CUtil to avoid the native methods which access the registry where they query for registry settings but also provide a default value (which I return).
    com.cl.bdj.helper.CUtil
    private static String pGetRegistryString(long i ,String string ,String string3) {
    return string3;
    private static int pGetRegistryInt(long i ,String string ,int j) {
    return j;
    The last thing I had to do was to change com.hdccookbook.gunbunny.BaseXlet, to use the JavaTV container rather than the org.havi one:
    import javax.tv.graphics.TVContainer;
    import java.awt.Container;
    change
    // protected HScene scene;
    protected Container scene;
    public final void run() {
    // waitForPresenting();
    // scene = HSceneFactory.getInstance().getDefaultHScene();
    scene = TVContainer.getRootContainer(xletContext);
    In order to having working keys, I had to add the KeyListener interface to BaseXet and
    run(){
    addKeyListener(this);
    and then add a near duplicate of the org.dvb.event.UserEvent* stuff that is already there:
    public void keyPressed(KeyEvent e){
    switch(e.getKeyCode()){
    case KeyEvent.VK_0:
    case KeyEvent.VK_1:
    case KeyEvent.VK_2:
    case KeyEvent.VK_3:
    case KeyEvent.VK_4:
    case KeyEvent.VK_5:
    case KeyEvent.VK_6:
    case KeyEvent.VK_7:
    case KeyEvent.VK_8:
    case KeyEvent.VK_9:
    numberKeyPressed(e.getKeyCode() - KeyEvent.VK_0);
    break;
    case KeyEvent.VK_ENTER:
    enterKeyPressed();
    break;
    case KeyEvent.VK_LEFT:
    arrowLeftKeyPressed();
    break;
    case KeyEvent.VK_RIGHT:
    arrowRightPressed();
    break;
    case KeyEvent.VK_UP:
    arrowUpPressed();
    break;
    case KeyEvent.VK_DOWN:
    arrowDownPressed();
    break;
    public void keyReleased(KeyEvent e){
    // System.out.println("Released: e="+e+" code="+e.getKeyCode());
    public void keyTyped(KeyEvent e) {
    // System.out.println("Typed: e="+e+" code="+e.getKeyCode());
    It then comes up and functions, but the rendering is not very good. Again, this is complete hack. Running the Java TV 1.1 RI in a JRE 1.6 is not supported. If you try to run any of the other examples, you will discover that the XML parsing is broken in JRE 1.6 with this message:
    Parsing failed: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequence
    Exception: Invalid byte 1 of 1-byte UTF-8 sequence., file: lib\JavaTVSampleFile01.xml
    and you have to go and change the lines in
    lib\JavaTV.properties
    from
    ServiceFileHandler=com.sun.tv.receiver.ReceiverFile
    # ServiceFileHandler=SampleData_01
    to
    # ServiceFileHandler=com.sun.tv.receiver.ReceiverFile
    ServiceFileHandler=SampleData_01
    and build samples\db\SampleData_01.java and put it in your classpath along with all these other hacks.
    Nonetheless, if you want to develop a somewhat generic Xlet that uses some BD-J features, that is how you might do it. But the moment you exercise anything else in the vendor's BDJ.jar that simply doe snot work outside of their environment or invokes one of their native methods, you are again stuck.
    It would be nice if Sun would at least bother to update the JavaTV RI with the fixes I hae mentioned. Their "jmflite" implementation does not render perfecly but at least it would give the programmer something to work with without having to deal with an older JRE, etc.
    Andrew
    Edited by: AndrewMorrow on Oct 20, 2008 2:48 AM

  • Why not use Redo log for consistent read

    Oracle 11.1.0.7:
    This might be a stupid question.
    As I understand if a select was issued at 7:00 AM and the data that select is going to read has changed at 7:10 AM even then Oracle will return the data that existed at 7:00 AM. And for this Oracle needs the data in Undo segments.
    My question is since redo also has past and current information why can't redo logs be used to retreive that information? Why is undo required when redo already has all that information.

    user628400 wrote:
    Thanks. I get that piece but isn't it the same problem with UNDO? It's written as it expires and there is no guranteee until we specifically ask oracle to gurantee the UNDO retention? I guess I am trying to understand that UNDO was created for effeciency purposes so that there is less performance overhead as compared to reading and writing from redo.And this also you said,
    >
    If data was changed to 100 to 200 wouldn't both the values be there in redo logs. As I understand:
    1. Insert row with value 100 at 7:00 AM and commit. 100 will be writen to redo log
    2. update row to 200 at 8:00 AM and commit. 200 will be written to redo log
    So in essence 100 and 200 both are there in the redo logs and if select was issued at 7:00 data can be read from redo log too. Please correct me if I am understanding it incorrectly.I guess you didnt understand the explaination that I did. Its not the old data that is kept. Its the changed vector of Undo that is kept which is useful to "recover" it when its gone but not useful as such for a select statement. Whereas in an Undo block, the actual value is kept. You must remember that its still a block only which can contain data just like your normal block which may contain a table like EMP. So its not 100,200 but the change vectors of these things which is useful to recover the transaction based on their SCN numbers and would be read in that order as well. And to read the data from Undo, its quite simple for oracle to do so using an Undo block as the transaction table which holds the entry for the transaction, knows where the old data is kept in the Undo Segment. You may have seen XIDSEQ, XIDUSN, XIDSLOT in the tranaction id which are nothing but the information that where the undo data is kept. And to read it, unlke redo, undo plays a good role.
    About the expiry of Undo, you must know that only INACTIVE Undo extents are marked for expiry. The Active Extents which are having an ongoing tranaction records, are never marked for it. You can come back after a lifetime and if undo is there, your old data would be kept safe by oracle since its useful for the multiversioning. Undo Retention is to keep the old data after commit, something which you need not to do if you are on 11g and using Total Recall feature!
    HTH
    Aman....

  • Why not use iPhone in car as active noise canceller.

    The iPhone uses noise cancellation during conversations. Why not make that available in the car through the car audio to quiet the interior at all times?

    I have one of those stereos bought from Ebay, no badge, no name, and with multitude of functions,and a mic attached to my visor. Once it is paired with Iphone, all my music and calls go through the car stereo.
    for applications that do not direct Audio through BT such as CoPilot (GPS navigation) I connect the Iphone through headset socket and into the stereo AUX input and works great (all sounds, voice,calls) go through it. One disadvantage of this method is that I can't listen to the radio. Well you cannot have it all. Or perhaps there is a Radio application where it plays in the background while I still use my GPS application.

  • Why not use DateFormat?

    I've noticed a few posts recently that deal with how to calculate the differences between dates (example, example), and it seems like folks are shying away from DateFormat to parse dates for these calculations. Incidentally, the OPs are running into month offset problems as well when trying to calculate using Calendars.
    DateFormat seems much more simple to me than all the other parsing rigmarole, but I wonder if I'm missing something. Is there a good reason to not use this technique in the listed examples, or can it be chalked up to unfamiliarity with the API?

    In "Literate Programming," Donald Knuth wrote "We
    should forget about small efficiencies, about 97% of
    the time. Premature optimization is the root of all
    evil." That'll garner the remaining Dukes. Excellent words to program by, even (especially) for newbies such as I.

  • [SOLVED] urxvt not using locale

    Help! I am stuck here.
    For the life of me I cannot find a reason why urxvt won't use my locale.
    Output of locale
    LANG=en_DK.utf8
    LC_CTYPE="en_DK.utf8"
    LC_NUMERIC="en_DK.utf8"
    LC_TIME="en_DK.utf8"
    LC_COLLATE=C
    LC_MONETARY="en_DK.utf8"
    LC_MESSAGES="en_DK.utf8"
    LC_PAPER="en_DK.utf8"
    LC_NAME="en_DK.utf8"
    LC_ADDRESS="en_DK.utf8"
    LC_TELEPHONE="en_DK.utf8"
    LC_MEASUREMENT="en_DK.utf8"
    LC_IDENTIFICATION="en_DK.utf8"
    LC_ALL=
    Output of locale -a
    C
    POSIX
    en_DK
    en_DK.iso88591
    en_DK.utf8
    en_US
    en_US.iso88591
    en_US.utf8
    Whenever I try to start urxvt from a(nother) terminal I get
    urxvt: the locale is not supported by Xlib, working without locale support.
    I have tried using both en_DK.utf8 and en_US.utf8. Neither works for me. (I would prefer en_DK.utf8)
    If I set the locale to C, then I don't get the error message. However I also don't get the filenames displayed correctly then.
    Anyone know what I can do?
    I am using lxde with openbox. Don't know if that makes a difference.
    I have spend the last 4 hours looking for a solution to this. Google turns up a lot of results, but they all (more or less) just tell me to make sure my locale is correct!? The word frustrating comes to mind
    EDIT: Somehow urxvt is using my locale for showing the files correctly, but not for input from the keyboard. The keys that normally produce æ, ø and å (danish chars) just doesn't do anything at all?
    EDIT2: Just in case someone stumbles upon this, here is what I decided to do. I didn't exactly solve the problem, but found another terminal to use instead.
    What I actually was trying to do was getting yeahconsole to work. I really liked using yakuake in kde, but after deciding to use lxde didn't want to pull in the complete QT library. yeahconsole however which is actually a wrapper for xterm/urxvt didn't want to behave the way I wanted it to. Well the truth is urxvt didn't want to work the way I wanted it to
    Fortunately for my nerves I found another quake like terminal called stjerm. This one works great (until now...). It has tabs and recognizes my locale setting. It's not in the official repos, but is easily installed from AUR.
    EDIT3: OK. This is kind of annoying. Now I don't need the solution any more and of course now I have found it
    To make urxvt use my locale correctly I must set it as follows: (note the LC_CTYPE setting)
    LANG=en_DK.utf8
    LC_CTYPE="en_US.utf8"
    LC_NUMERIC="en_DK.utf8"
    LC_TIME="en_DK.utf8"
    LC_COLLATE=C
    LC_MONETARY="en_DK.utf8"
    LC_MESSAGES="en_DK.utf8"
    LC_PAPER="en_DK.utf8"
    LC_NAME="en_DK.utf8"
    LC_ADDRESS="en_DK.utf8"
    LC_TELEPHONE="en_DK.utf8"
    LC_MEASUREMENT="en_DK.utf8"
    LC_IDENTIFICATION="en_DK.utf8"
    LC_ALL=
    I mark this topic as solved.
    Last edited by madeye (2009-10-31 21:21:06)

    Move 'exec awesome' to the bottom of your ~/.xinitrc.

  • Why not use Arch Linux only?

    Named as an Arch Linux "Linux Addict" (according to my upgraded user profile ), for some times I have asked myself why use other distros than AL, especially RedHat, SuSE and Mandrake. What do they provide what AL doesn't?
    One of the roles of RedHat became clear reading Linux Today, though it may not be for the common users but have to admit its impressive (there are three major advances in the new RHEL3 product line....):
    http://linuxtoday.com/it_management/2003102200926NWRHSW
    PS.
    Does it sound like I am addicted??... it feels natural   :idea: 

    maturity? stable? can't trust?
    let me tell you something i learned by experience ...
    i runed SuSE for long time (from 5.2 to 8.1) and what i know they do wrong is: if you have e.g. 6.0 (the most stable SuSE i know) then you can update your packages over internet, but after some time you will be "forced" to  buy the next release that is totally differently constructed (7.1, because it uses YaST2 instead of the YaST and other stupid inovations that you cannot easily update from internet) ... and after a while again you have to upgrade by buying the next one ...
    sure, you install it in about an hour and everything works, but hey, each package costs some money and this install is each time from quite 0 (because the integrated update often does not work) :-(
    trusting?
    i trust only in systems i configure myself ... and since SuSE 7.2 i lost the overview in where you can configure what and why ... and you are not sure that YaST2 will change your changed settings to default
    archlinux is fully configureable and does not have a tool that changes files behind your back (well, there is one case: when you update init-scripts with packman without setting in pacman.conf to exclude some files you changed ... but also then you can restore the settings by mv'ing the original files to their right name-links :-)
    why using also other distros?
    well since arch 0.5 i removed all other linuces from my machine (to save space) and now have only arch and winXP ... xp is used only for watching tv (because hauppauge usb "usbvision" module cannot be compiled with  a 2.4.x or 2.6.0tx kernel (but 2.5.x) and because of ebanking software that will not install on archlinux but easily on SuSE and WinXP (need the original sun's java vm, but have no time to construct a PKGBUILD for sun's jdk 1.4)
    ... and the needed other software i built packages of and installed on my local repository (and also copied in incoming) ... now i'm quite happy with archlinux as an OS (and i hope with a more advanced 2.6.x TV will come too, and java i will find one day time to build for ebanking)
    -> "use an OS that works, use archlinux"
    ps
    and about "linux addict":
    no, i dont think i'm addict, but i use this forum as a normal member  (to help others switching to an os that works,  to help people with problems i had myself often some time ago, to ask if i find something interessting or funny about something in arch, to inform that i built packages and put them in incoming :-) ... i would be much happier to have "regular user" instead of "linux addict", but that's something i cannot change

Maybe you are looking for