The case of a missing value of an object...

I have set up a put and get method so as to synchronize two of my threads the synchronization works fine but the value of the object myteriously when i trying to again get the value after i have set it disappears. Could someone please help me...
Here are some part of my code
private Object value;
      public RequestArrayGetSet(){
           request = null;
public synchronized void put(Object value){
           print("in put() - Entering!");
           while(request !=  null){
                try{
                     print("in put() - occupied, about to wait()");
                     wait();
                     print("in put() - notified, back from wait()");
                }catch(Exception e){
                     e.printStackTrace();
           value = value;
           print("in put() - filled the slot, about to notifyAll()");
           System.out.println(value);
           notifyAll();
           print("in put() - leaving");
      public synchronized Object get(){
           print("in get() - Entering");
           while(request == null){
                try{
                     print("in get() - empty - about to wait()");
                     wait();
                     print("in get() - notified, back from wait()");
                }catch(Exception e){
                     e.printStackTrace();
           Object obj = value;
           System.out.println(obj);
           request =  null;
           print("in get() - emptied the slot, about to notifyAll()");
           notifyAll();
           print("in get() - leaving");
           return  obj;
      }Hope some of you can help thanks!

value = value;Oh, so you have one of those new compilers that reads your mind and knows which value is which in that statement, huh?
Lucky.
The rest of us are stuck doing this.value = value;so that the compiler can distinguish the member variable from the method parameter.

Similar Messages

  • Manually typing in the x and y position values for an object?

    Hello,
    I work in the vinyl industry and I am working on creating pattern vinyl rolls for people to cut a custom design out of. I set up each beginning pattern "block" at 5" x 5" and I repeat it to 2-3 times across and all the way down to the length of the roll (which can go up to 50 yds). I use the alt key to duplicate each square but I need to make sure each "block" is lined up perfectly to the one beside it seamlessly without any lines or spaces. Is their a way to manually type in the X and Y values of each given block to make sure that I can confirm "technically" and visually that each block is lined up perfectly? I've tried using the smart guides and rulers but even then I get a 1 px line. I have a picture below to help better understand what I mean, the blue guides indicate where the pattern blocks begin and end.
    Any help or suggestions is greatly appreciated. Thank You!
    -emski

    Emski,
    If you want to be able to adjust the artwork while you look at the full set (and/or minimize the file size) you may:
    1) Select the original artwork,
    2) Effect>Distort & Transform>Transform>Move horizontally by the width with the desired number of copies,
    3) Effect>Distort & Transform>Transform>Move vertictally by the height with the desired number of copies.
    Any change will show across all duplicates (and show whether the transitions work as desired), without the need for deletion and recopying.
    You may Object>Expand Appearance if you want separate objects later.

  • Applescript output volume consistently "missing value"

    It seems that the output volume returned by the "get volume settings" applescript call is consistently the "missing value".  Setting the output volume to a different value "works" -- that is, the effective volume is set to the value I specify -- but the value returned by applescript is still "missing value".
    For example, the following script
    display dialog "output volume = " & (get output volume of (get volume settings))
    set volume output volume 50
    display dialog "output volume = " & (get output volume of (get volume settings))
    gives me this dialog both times
    What's up with that?
    This is on Mavericks 10.9.0

    Yes, I discovered much the same thing.  If I have my system/default output device set to my headset, then I get the behavior I described.
    However, I also find that while the output device is "missing value" the other values, including muted, have proper values. 
    There is also no way to set the output device via Applescript (except by the distasteful method of poking they System Preferences GUI settings).  So there is no proper way of really controlling sound output via applescript.
    But thanks for the prompt response.  If only the Applescript documentation were complete in this respect (unless I missed it somehow).

  • With multiple events in a single event case, how to associate value with the correct object?

    I am playing with the template where an event structure takes note of user inputs and a main state machine is then used to respond to these inputs. When I only monitor one control I use the 'NewVal' output to read out the changed value. But when I monitor multiple objects with a single case I also have to associate the readout with the correct owner. After some tinkering I was able to extract the label property and use a case to assign them. Are there better ways of doing this? For example maybe there is a way to connect the label text directly to the 'bundle by name'?
    Also this should be easy to accomplish by simply creating local variables of the objects and read from them, but I got the impression that the use of global and local variables is now strongly discouraged?
    Thanks for any suggestions!
    Attachments:
    Untitled.png ‏39 KB

    Well, I don't really like these theroretical discussions. Can you attach a simplified version of some of your code?
    There are many other ways to identify the particular control. You could for example search an array of references for the value of the "ctlref" event data node. This would make the code much more robust (your code will fail for example if you (or some other programmer updating your code in a few years!) notices a mispelling and edits the label without also changing the case structure cases).
    LabVIEW Champion . Do more with less code and in less time .

  • How can I wire a string value to the case selector terminal and depending on that value, execute a selected case?

    Hi Everyone
    In the block diagram of the posted VI, thru serial comm, byte #2 is either 00 or 01 (Hex). This byte should dictate which case to execute. If Hex value = 00 executes case #1, If Hex value = 01 executes case #2. If neither, nothing should execute.
    How can I do this? I am fairly new to LabVIEW any feedback is highly appreciated.
    Thanks
    Mahir
    Solved!
    Go to Solution.
    Attachments:
    testing whole string Bank A & B.vi ‏24 KB

    easier to just wire in the integer to the case structure rather than convert to string.  
    Then just go up to the case selector and type what you want.
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • I thought I read this summer that with iOS 6 if you deleted an email on one mobile device, it would delete that email on your other mobile devices. This does not seem to be the case but it sure would be handy. Am I missing something?

    I thought I read this summer that with iOS 6 you could delete an email on one mobile device and it would delete it on your other mobile devices. This doe not seem to be the case but it sure would be handy. Am I missing something?

    Perhaps you're thinking of iCloud?
    http://www.apple.com/icloud/features/calendar-contacts-mail.html
    I'm not sure if deletions are synched as are new messages - I don't use iCloud for mail myself - but it might. Someone else here might know for sure, or you can ask in the iCloud forum.
    For other email providers, it's always been the case the if your email account is IMAP or Exchange, mail deletions appear on all devices since they're all just looking at the same database of messages on the email server.
    Regards.

  • Syntax for CASE Function when multiple values equates to the same result?

    Tried using the 'IN' keyword with the CASE function but it does not work, does each case have to be stated separately? trying to save some lines..
    tried:
    case me607.rmc_code
    when in ('M','MS','MP') then 'H311'
    end as carrier_code
    Do i have to do:
    case me607.rmc_code
    when 'M' then 'H311'
    when 'MS' then 'H311'
    when 'MP' then 'H311'
    end as carrier_code,
    etc..
    Thanks for any help..

    One other thing forgot to ask, how do you do a second case selection as:
    case when me607.rmc_code
    in ('M','MP','MS') then 'H311'
    case when me607.rmc_code
    in ('1','2') then 'H252'
    end as carrier code
    wanting to keep the results in carrier_code..
    Thanks..
    Edited by: user12296489 on Dec 10, 2009 3:53 PM

  • How to map a missing value to a member?

    Hi all,
    Let say I have 3 dimensions in my data source file:
    Account, Entity, Product, Data
    A400, E100, P200, 10000
    A401, E110, P300, 20000
    A401, ,P400, 30000
    As you can see in the third record, Entity is missing. How can I map this to, let's say, No_Entity? In my Entity mapping table, Type: Like, I have tried using Null and Missing as the Rule Definition, but neither worked.
    Couple of clarifications: This is for an Essbase BSO cube. In my real case, the missing values are not Entity members, but 3 custom dimension members.
    Any ideas?
    We are on 11.1.2.2.
    Thanks,
    Mehmet

    You have a couple of options:
    1) Add a wilcard mapping to your entity maps which maps anything you have not explicitly mapped to NoEntity i.e. * --> NoEntity
    2) You cannot have an empty string as a source value so in your import format, associate an import script with the Entity dimension source field entry and check the length of the string of the source field as it comes in. If the length is 0 assign a value of NoEntity to be returned and map that source value explicitly inyour Entity map

  • CRYSTAL XI SOME PARAMETERS ARE MISSING VALUES

    I have a huge problem with parameters in crystal reports XI.
    Iam developing using jdeveloper 10g and a jndi connection
    I use th following code into my jsp
    the report filelds are set correctly and they HAVE values
    but after the execution of the following code
    i get the following message
    ERROR SOME PARAMETERS ARE MISSING VALUES
    also I install both commonwinXI_chf and cXIwin_chf fixes from crystal and still nothing .Any solutions to this problem because Iam freaking out
    for once more crystal reports XI supports sucks
    my code:
    IReportSource reportSource= (IReportSource)session.getAttribute("reportSource");
    Fields fields=(Fields)session.getAttribute("reportFields");
    CrystalReportViewer crViewer=new CrystalReportViewer();
    crViewer.setReportSource(reportSource);
    crViewer.setParameterFields(fields);
    crViewer.setEnableParameterPrompt(false);
    crViewer.refresh();
    // my fields have values
    crViewer.setOwnPage(true);
    crViewer.setOwnForm(true);
    crViewer.setPrintMode(CrPrintMode.ACTIVEX);
    // if i set fields=crViewer.getParameterField then filelds variable is empty!!
    try{
    crViewer.processHttpRequest(request,response,getServletConfig().getServletContext(),out);
    crViewer.dispose();
    }catch(ReportSDKException e){
    out.println(e);
    }

    Sorry man sometimes i forget even my self!!
    In order to connect crystal with JNDI you have to set the correct parameters
    into CRConfig.xml
    for example
    <JDBCURL>jdbc:oracle:thin:@somewhere:ORA_DB</JDBCURL>
         <JDBCClassName>oracle.jdbc.driver.OracleDriver</JDBCClassName>
         <JDBCUserName>username</JDBCUserName>
         <JNDIURL>t3://somewhere:7001</JNDIURL>
         <JNDIConnectionFactory>weblogic.jndi.WLInitialContextFactory</JNDIConnectionFactory>
         <JNDIInitContext>/</JNDIInitContext>
         <JNDIUserName>weblogic</JNDIUserName>
    also
    you have to provide the same info into file
    CRDB_JavaServer.ini
    [CRDB_JDBC]
    CacheRowSetSize = 100
    JDBCURL =
    JNDIURL =t3://somewhere:7001
    JDBCUserName = guest
    JNDIUserName = weblogic
    JNDIConnectionFactory = weblogic.jndi.WLInitialContextFactory
    JNDIInitContext = /
    I put both files into WEB-INF classes directory
    and finaly in both cases you have to include in your project the driver libs
    in my case I use weblogic therefore I have included weblogic.jar into my classpath

  • The Case for an Updated SQL Expert Exam

    There have been a couple of discussions in this space about the shortcomings of the current SQL Expert exam.  I decided to write something of an open letter to OU about the concept of creating an updated version for the 12c release of Oracle:
    The Case for an Updated Oracle SQL Expert Exam - Certification Magazine
    So what do you think -- what advanced SQL topics did I miss that would make a good topic for an improved version of the exam?

    That does touch on a fundamental issue of certification: Does it realistically reflect work capability?  Many people over the years have just stated a categorical "no."  I wouldn't go that far, but I would say that for any particular job, it takes weeks or months to really evaluate them.  Some people when saying how they interview candidates state they would reject anyone who would just go google something new (I think that is a silly way to judge and am glad to see you google too IRL).  I know with analytics, I use them so rarely I have to basically re-learn them each time.  But there's nothing wrong with that, and subsequent "re-learns" are more rapid, and asktom (among others) is invaluable.  I would do the same thing for an exam - learn them long enough to pass the exam.  There's just too large of a knowledge space to make details of sql syntax a deal-breaker.  If you are using something every day, you remember the details.  The logical problem is assuming because someone is not using it every day now they haven't in the past or won't in the future.
    In the past I've mentioned I think the value of certification for me lies in exposure to things I don't use.  A problem that goes along with that is if you don't use it soon after learning it, you might well have not learned it.  There are some courses I've taken that could be described as drinking the kool-aid - features that Oracle pushes that don't apply as generally as marketing or the developers of seed databases would like us to believe.  You never know what new features will be used and how and when.  Oracle doesn't always know, for that matter. 

  • If Condition for missing value or zero

    Hi There,
    I have formula like this
    IF (("ActualTax" ==0 ) and @ISMBR("Budget") )
    "BudgetTax" = "Revenue" * 0.37;
    But ActualTax in case could also be blank or missing value, how do I say it in the script
    I try IF (("ActualTax"=='#MI') and ..., it gave me error
    Thanks

    Mehmet,
    Thanks. == missing works. On my elseif, I also want to say ActualTax < 0, do something else, but it seems the condition not getting picked up. Or how do I say ActualTax has value, then BudgetTax = 0 or no value
    IF (("ActualTax" ==0 ) and @ISMBR("Budget") )
    "BudgetTax" = "Revenue" * 0.37;
    ELSEIF("ActualTax" <0)
    Thanks
    Edited by: Donny on Feb 6, 2012 9:34 AM

  • Clearing up accounts with zero / #missing values

    Hi all,
    Compliments of the season to everyone.
    I'm looking at cleaing up my cubes (created from Planning), I want to delete all the accounts that don't have any values in them for the last 5 years. Besides running a smartview extract, is there an easier way to check for accounts that contain either #Missing or Zero?
    Regards,
    Fraser

    Hi,
    For #missing values it's quite easy and efficient to use a smartview report, you only need to look at the top level of every aggregating dimension/hierarchy for each of the 5 years.
    Other possibility is to export every single data of the last 5 years into a SQL table, have another table contain the complete list of accounts, and use a SQL join to look for accounts with no data. Obviously the most precise method. Even if you have a big database, you will always have some dimensions that aggregate for sure so exporting the top level of those dimension should prevent you from obtaining billions and billions of SQL records.
    For zero values it could be a bit more tricky if you have accounts that are supposed for example amounts to be eliminated at higher levels, in that case they may equal 0 yet you need to preserve them, but that's application dependent.
    Thanks,
    JM

  • How to differentiate the EMPTY Records and Null Values in DSO

    Hello....how is everyone here?? Ehehehe!
    I try to load some data from the flat file which contains some EMPTY data and Null Values for the records. The data type for the InfoObjects of the fields "Quantity" is "number". The sample data from the flat file (CSV) are as below:
    Food              Quantity
    Hamburger  -       12
    Cheese        -       0
    Vegetable      -               (Empty)
    When I try to load the above sample data to the DSO, I get the results of the data as follow:
    Food              Quantity
    Hamburger     - 12.000
    Cheese           -  0.000
    Vegetable         - 0.000
    In this case, how can the user differentiate whether the records is contain empty value of null values in DSO? This is kinda of hard to differentiate the both scenarios above. Is there any way to differentiate the scenarios described here?
    Thanks alot =)

    Hi Fluffy,
    It depends on the initial values of the data type
    The inital values For quantity/Currency/ Numbers it takes spaces as 0
    for char it is SPACE
    We cannot differeniate between space and null values.
    IF you have to force this then define quantity as char and load the data. we will not have units and aggregation in this case.
    Hope this helps.
    PV

  • Crystal Report: ERROR - Some parameters are missing values

              mine report it possesses a single parameter ....
              this is the example of like tries of to change the value set up in the report...
              ERROR: Some parameters are missing values
              thanks help...
              EXAMPLE:
              <%@ page import="com.crystaldecisions.report.web.viewer.*"%>
              <%@ page import="com.crystaldecisions.report.htmlrender.*"%>
              <%@ page import="com.crystaldecisions.reports.reportengineinterface.*"%>
              <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.*"%>
              <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
              <%@ page import="com.crystaldecisions.common.keycode.*"%>
              <%@ page import="java.util.*"%>
              <%
              try {
              IReportSourceFactory2 rptSrcFactory = new JPEReportSourceFactory();
              String report = "report/ReportParametro1.rpt";
              IReportSource reportSource = (IReportSource) rptSrcFactory.createReportSource(report,
              request.getLocale());
              Fields fields = new Fields();
              ParameterField pfield1 = new ParameterField();
              Values vals1 = new Values();
              ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
              pfield1.setName("CICCIA");
              pfieldDV1.setValue("SELECT descrizione, validoDa, validoA FROM tariffari");
              pfieldDV1.setDescription("Query Dinamica....");
              vals1.add(pfieldDV1);
              pfield1.setCurrentValues(vals1);
              fields.add(pfield1);
              CrystalReportViewer viewer = new CrystalReportViewer();
              viewer.setReportSource(reportSource);
              // layout
              viewer.setOwnPage(true);
              viewer.setBestFitPage(true);
              viewer.setHasLogo(false);
              viewer.setHasRefreshButton(true);
              // group navigation
              viewer.setHasToggleGroupTreeButton(false);
              viewer.setDisplayGroupTree(false);
              // page navigation:
              viewer.setHasGotoPageButton(false);
              // print/export
              viewer.setHasExportButton(true);
              //viewer.setPrintMode(CrPrintMode.PDF);
              viewer.setPrintMode(CrPrintMode.ACTIVEX);
              viewer.setIgnoreViewStateOnLoad(true);
              viewer.setParameterFields(fields);
              viewer.setEnableParameterPrompt(false);
              viewer.refresh();
              viewer.processHttpRequest(request, response, getServletConfig().getServletContext(),
              out);
              viewer.dispose();
              }catch(Exception e){
              out.println("Errore " + e.getMessage());
              %>
              

    I am facing the same problem. After selecting an export option (PDF/RTF), the same error message is coming up.
              Also, what needs to be done for displaying export option of EXCEL?
              Thanks,
              Farzal

  • How can I pass data generated in a SubVI inside a Case Structure out of the Case Structure?

    Hello,
    I am using a USB 2701 to control a heater.  I have three SubVIs that are all working properly on their own.  I'd like to use an Enum to select which of the SubVIs is running at a given time.  The problem is that no data is passing out of the case structure.  How can I pass the temperatures and heater outputs acquired by the SubVIs to the main VI?  I've attached my some of my code below.  I can't attach more than 3 files, but you can see how the main VI is configured.  Like I said, the SubVIs are working individually, so you shouldn't really need to look at them.
    Thank you,
    CJones581
    Attachments:
    RampHeater6-21-07.vi ‏305 KB
    69_Heater_Case.vi ‏23 KB
    HeaterTCD6-21-07.vi ‏210 KB

    CJones,
    You might check a couple of things.
    Your HeaterTCD... VI has a While loop with a stop button condition.  HeaterTCD pass out values only when it finishes running.  If it doesn't pop open the front panel (which usually doesn't happen when running a SubVI) you could run into a stuck loop because you don't have access to the Stop button.  This could appear in the form of no data being passed out (because the SubVI never stops running).  The primary VI opens the HeaterTCD VI, starts it, and waits for the VI to finish and pass final values .
    Secondary note: Unless you want your SubVI panel (which probably isn't open when running the main VI) to update continuously, consider moving your Temperature Graph and Temperature oC indicators outside the while loop.  Pass final values to them via a tunnel, since the main VI will only read their values after the loop finishes running, anyway.
    It might help to add error management to HeaterTCD like you have for RampHeater.  If you connect error lines with Error Outs to your main VI, that will help tell if there is an error somewhere that is preventing info output.
    RampHeater SubVI has the same issue with the stop button.  It is also probably getting stuck in the While loop waiting for a manual push of that SubVI's Stop button.
    An easy way to test this would be to set up a logic circuit so that when the While loop iteration counter reaches a certain number, it registers True and sends it to the conditional.  I know this isn't what you want to do long-term, but if that lets your SubVI return outputs it means that the SubVI was just never stopping.
    Hope that helps.
    David C, Applications Engineering
    David C
    Applications Engineering

Maybe you are looking for