URGENT: Covert a true - false value into a bit value

Hello :)
I have a problem, How can I convert a true false value into a bit value, because, I declare a variable value with true or false, that means that I have a 1 or a 0, (thinking about digital information)
for example, one this is my part of my code:
private boolean _x3 = true;
     private boolean _x5 = false;
     private boolean _x6 = true;
     private boolean _x7 = false;
     private boolean _x9 = true;
     private boolean _x10 = false;
     private boolean _x11 = true;
public boolean CheckP1(boolean pP1)
          pP1 = x3^x5 ^_x7 ^_x9 ^_x11;
          return pP1;
This method will send a true or false value, but now I have two doubts, one of them, is, how can get this value, and the second value, how can I conver this value into a bit value
Thank you so much :)
Nataly

Look at a BitSet to hold your boolean values.
Check the API for details.
JJ

Similar Messages

  • Creating an expression to return a yes/no or True/False statement in Ms SQL Server Report Builder

    I am attempting to create a field that returns a True/False value instead of a numeric value. I have a field with the expression =Fields!CreditLimit.Value*.95 this returns a value that is equal to 95% of the value in my Balance field. The issue is I
    don't remember how to turn =IIF (Fields!CreditLimit.Value > *.95, true, false) into an expression that compares the 2 fields and then returns True/False. Can you please help me out?
    Thanks,
    -John

    Hi,
    Try below one:
    =IIF (Fields!CreditLimit.Value *.95>95, true, false) 
    Here you have to define a limit. For Example; When output of Fields!CreditLimit.Value
    *.95 is greater than 95 then True else False. So specify the value according to your requirement. 
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Parameter Query for True or False values

    I have what seems like a painfully simple task and it has me stopped dead.  I reviewed a similar thread, and the answers there don't seem to apply. Working in Crystal 11.5 with an MS SQL database.
    I am pulling data from vwCommmittees.  There is a field in this view called IsActive.  I want to create a committee list report that will allow the user to select only the active committees or all committees.
    A SQL select statement that says where dbo.IsActive = '1' will return only the active committees.
    In Crystal reports, if I place the IsActive field on the report, it returns with "True" or "False."
    When I create a parameter for this field, I find that 1) I can't see the parameter in the report expert -- my only choices are Is any value, Is true, Is false or Formula.
    I've made several attempts to create a formula and nothing is working. It's not clear to me wheter I should be creating a static or a dynamic parameter.  When I choose boolean as the type, that doesn't seem to help.  I tried a dynamic parameter which gave me true and false values, but don't seem to work.
    Any pointers on dealing with this kind of parameter query would be greatly appreciated.
    Sincerely,
    Ridge (in New Joisey)

    Hi..
    Create a static parameter and give the default values like
    0 and 1
    In Record Selection check like..dbo.IsActive = {?parameter}
    If the above is not working for you, then create a formula
    like..
    If dbo.IsActive = '1' then
    "Active"
    Else "In Active"
    Place this formula on your report and create a static parameter with default values Active and In Active.
    In record selection filter the above.
    Thanks,
    Sastry

  • Error: this type needs one of the following values('true','false')

    I'm trying to use <c:if> in a jsp (in Workshop 8.1), as in:
                   <c:if test="1 == 1">
              <!-- something here -->
              </c:if>
              But, I get the following message when I hover over the error indicator
              at the test:
              Error: this type needs one of the following values('true','false')
              It will actually work if I do:
                   <c:if test="true">
              <!-- something here -->
              </c:if>
              but, of course, that's useless.
              Am I missing something here?

    David Karr wrote:
              > The value of the "test" attribute needs to be an Expression Language expression. Try changing it to "${1 == 1}", and that should work.
              Actually, I had tried that, and it would have worked that way if I had
              the right taglib declaration -- I had accidentally left in the rt
              versions, so a <%= test %> type of expression worked.
              But, that's not the way I wanted to do it, so I put the non-rt versions
              in, along with tld and jar files that I had in some other directories,
              then it worked fine. In the process, when searching my hard drive for
              standard.jar, I noticed I had four or five different versions, each with
              a slightly different size. Of course, I had to tinker, and downloaded
              the zip from Apache, figuring it would be best to have a matched set of
              tlds and jars.
              And now I get an error that the matching class cannot be found:
              > ERROR: response.jsp:1: Package org.apache.taglibs.standard.tag.el.core contains no member type of this name.
              and
              > ERROR: response.jsp:14: The tag handler class was not found "org.apache.taglibs.standard.tag.el.core.IfTag".
              But, if I navigate the standard .jar that is in my WEB-INF/lib
              directory, lo and behold, there is the file IfTag.class in what appears
              to be the correct package.

  • Powershell DSC - Get registry value and send $True / $False depending on present or not

    Hello,
    With the script below, I can check if a registry key is present, and if it is not, it will create that registry key. But I just want to know if that registry key is present, and get $True / $False as a result of script. - Is this possible with DSC?
    Configuration ClientConfig
    Param ($MachineName)
    Node $MachineName
    Registry FooCorpReg1
    Ensure = "Present"
    Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Test1"
    ValueName = "Name"
    ValueData = "DSCDemo"
    # Save the MOF file
    ClientConfig -MachineName "localhost" -OutPutPath "c:\Temp\DSC"
    #Start configuration
    Start-DscConfiguration -Path "C:\Temp\DSC\" -Wait -Verbose
    Best regards,
    Anders Johansson

    Not what DSC does or is for.  Use erg to look for vale.
    Test-Path HKLM:\SOFTWARE\Test1\Name
    That is all - it returns true or false.
    ¯\_(ツ)_/¯

  • How can I display True/False in my dropdownlist as "Yes" and "No"?

    Hi All,
    I want to bind a dropdownlist to a boolean value (so it's either true or false).  I'm particularly interested in using two-way binding to when the user changes from "yes" to "no" the boolean value automatically changes from "true" to "false."  But, I want the user to see "yes" and "no" as the options, rather than "true" and "false".
    How can I display "yes" and "no" and still take advantage of binding?  Or can I not use binding in this circumstance?
      -Josh

    Solution 1:
    In order to display Yes/No for True/False, you may specify labelFunction for the dropdownList.
    In MXML:
    <s:DropDownList labelFunction="myLabelFunction" />
    In actionscript:
    private var arr:ArrayCollection = new ArrayCollection(["true","false"]);
                private function mylabelFunction(item:Object):String
                    if(item.toString() == "true")
                        return "yes";
                    else return "No";
    OR
    Solution2:
    may be u can try making an array collection like
    private var arr:ArrayCollection = new ArrayCollection([{label:"yes",value:"true"},{label:"no",value:"false"}]);
    and specify labelField for the dropdownList like
    <s:DropDownList labelField="label" dataProvider="{arr}" />

  • Control the render true/false after rollback in ValueChangeListener

    Hello
    I am using Jdeveloper 11.1.1.3.0 ADF BC.
    I have this problem:
    in my page I have some LOV that conrol the rendering true/false for other components,
    and we achieved this by a valuechangeLisntener method in a backing bean. and
    everything works well. However when we use the rollback the rendering does not work as expected.
    to clarify the problem, suppose we have LOV1(has two values 1,2) that control the rendering of
    LOV2, when the user selects 1 LOV2 will be rendered and when the user selects 2 LOV2 will be hidden
    now suppose that the default value of LOV1 is 2, so LOV2 is hidden, now the user change the value
    of LOV1 to 1 so the LOV2 will be rendered, now the user press rollBack the value of LOV1 will
    reset to 2 but the LOV2 is still rendered on the page. which is not true.
    initially I thought that I need to call the valueChangeListener method again after rollback,
    I found something like this in this thread:
    Dynamic ValuechangeListener Addition
    but this is for Jdeveloper 10g and that method is deprecated in 11g, as someone comments, and
    he mentioned that this is not the best practice. is there any working solution for this problem?
    can anyone help please

    Thank you LovettWB and Navaneeth for your suggestion, but unfortunately the problem is still exist.
    I will a snapshot for my code and my page definition.
    my page definition is:
    <af:selectOneRadio value="#{bindings.Citizen.inputValue}"
                                         label="#{bindings.Citizen.label}"
                                         required="#{bindings.Citizen.hints.mandatory}"
                                         shortDesc="#{bindings.Citizen.hints.tooltip}"
                                         id="citizen" autoSubmit="true"
                                         immediate="true"
                                         valueChangeListener="#{StudentInformationBean.showCountriesLOV}"
                                         binding="#{StudentInformationBean.citizenRadio}">
                        <f:selectItems value="#{bindings.Citizen.items}" id="si6"/>
                      </af:selectOneRadio>
    <af:selectOneChoice value="#{bindings.CountryOfCitizenship.inputValue}"
                                          label="#{bindings.CountryOfCitizenship.label}"
                                          required="#{bindings.citizenValue.inputValue=='غير كويتي'}"
                                          shortDesc="#{bindings.CountryOfCitizenship.hints.tooltip}"
                                          id="soc2"
                                          partialTriggers="citizen"
                                          binding="#{StudentInformationBean.countryOfCitizenship}"
                                          requiredMessageDetail="#{bundle.non_ku_country}"
                                          visible="#{bindings.citizenValue.inputValue=='0'}">
                        <f:selectItems value="#{bindings.CountryOfCitizenship.items}"
                                       id="si5"/>
                      </af:selectOneChoice>                      and my code is in the valueChangeLisitener is:
        public void showCountriesLOV(ValueChangeEvent valueChangeEvent) {
               // Add event code here...
               FacesContext context = FacesContext.getCurrentInstance();
               if(valueChangeEvent.getNewValue().toString().equals("0"))
                 System.out.println("the new citizen value is " + valueChangeEvent.getNewValue().toString());
               //  this.countryOfCitizenship.setRendered(false); 
                 this.countryOfCitizenship.setVisible(false);
                 this.countryOfCitizenship.setRequired(false);
                 context.renderResponse();            
               else
                 System.out.println("the new citizen value is " + valueChangeEvent.getNewValue().toString());
             //  this.countryOfCitizenship.setRendered(true);
                 this.countryOfCitizenship.setVisible(true);
                 this.countryOfCitizenship.setRequired(true);
                 context.renderResponse();
          public void rollBack(ActionEvent actionEvent) {
            // Add event code here...
            OperationBinding operationBinding = bindings.getOperationBinding("Rollback");
            System.out.println("perform the rollback");
            Object result = operationBinding.execute();
              AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
            adffacesctx.addPartialTarget(this.citizenRadio);
            public void setRollBackButton(RichCommandButton rollBackButton) {
            this.rollBackButton = rollBackButton;
        public RichCommandButton getRollBackButton() {
            return rollBackButton;
         }any help or suggestion please.
    Edited by: M.Jabr on Feb 7, 2011 12:26 AM
    Edited by: M.Jabr on Feb 7, 2011 12:29 AM

  • TRUE/FALSE problem

    I got a wired situation with a VI I wrote.
    I have a case TRUE/FALSE structure, and first of all, the true-part is
    ALWAYS first executed. When this part is done, I execute the false-case,
    for message handling and so on.
    But in the true case, I generate some data I want to use as a source in
    the false case.
    So in true case the string is an indicator, but in the false case, that
    string is the source for displaying. Does anyone know how to solve this.
    This true/false case is part of a loop. So I tried with a SHIFT
    REGISTER, but that doesn't seem to work.
    Any tip is welcome !
    Thanks
    Kristof

    Sorry I posted my message so early, mayby because the sunshine that lights
    my mind, but I have found a solution myself. Just putting the value in a
    loop and in the false case, connect the previous shift-register-value with
    the next....
    Thanks anyway !
    Kristof Poppe wrote:
    > I got a wired situation with a VI I wrote.
    > I have a case TRUE/FALSE structure, and first of all, the true-part is
    > ALWAYS first executed. When this part is done, I execute the false-case,
    > for message handling and so on.
    > But in the true case, I generate some data I want to use as a source in
    > the false case.
    > So in true case the string is an indicator, but in the false case, that
    > string is the source for displaying. Does anyone know how to solve this.
    > This true/false case is part
    of a loop. So I tried with a SHIFT
    > REGISTER, but that doesn't seem to work.
    > Any tip is welcome !
    >
    > Thanks
    >
    > Kristof

  • 1. True/False

    I am busy with Photoshop Basic course. I have 2 True/False questions that I need help with. If answer is False, I need an explanation.
    1. True/False? If you want to move the selected pixels, rather than the selection marquee, you should drag with the Move tool, not a selection tool.
    2. True/False? Double-clicking a type layer's "T" thumbnail switches to the Horizontal Type tool and selects all of the text on that layer.
    Can you people help me, please?
    Thank you
    Monya

    first is totally true
    and in the second one double ckicking goes into text editing in general..
    if the text layer was written with horizontal type tool then double ckicking will make you go into that type of typing mode,
    if you created text layer with vertical tool, then doubleckicking the T will take you to vertycally typing mode

  • Building a case structure with four boolean (true/false) inputs.

    I currently have two boolean inputs that I would like to use to select cases in a case structure. I would like to have four cases, each one dependent on the true/false condtions of the two booleans. If boolean 1 =true, then case 1 should be used, if boolean 2=true, then case 2 should be used, etc.
    What structure should I use to convert these boolean inputs into numeric cases?

    Or build them in to an array and "Search 1d Array".  If you are only looking for a single bool being true, this would be easier because your cases could be {0,1,2,3} instead of {1,2,4,8}

  • Sum, total, or count true false data vs using the insert summary

    Please, does someone have specific knowledge on how to count total instances of true or false data vs using the insert summary?
    We have data such as:
         Name          Formula1        Formula2
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          False          True
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          True          False
    Group level                    (value)          (value)
    Detail level     Drew Carey          True          True
    Detail level     Drew Carey          False          True     
    Detail level     Drew Carey          False          False
    Group level                    (value)          (value)
    I would like to group by person and run a total in the group level but count only the true data, not every instance.  The insert summary wants to sum all instances formula1 or formula2 whether they are true or false, so Bob Barker will have a value of 4 for formula1 and a value of 4 for formula2 if the insert summary is used.  Our goal is to show Bob having a value of 3 for formula1 and a value of 1 for formula2, only counting the true instances.
    I was unsucessful using the insert summary, running totals, and my  if, then, else formula statements. 
    Any ideas or suggestions?

    Instead of using true/false (which is actually returning a 1 or a 0), try using a formula like this...
    IF {TableName.FieldName} = true condition THEN 1
    Notice there is no ELSE condition, which means that if the formula evaluates to false the result will be a null value. Null values are not included in counts.
    HTH,
    Jason

  • Evaluating a String True/False with a Regular Expression

    I need to write a regular expression to make the following strings display the values of true/false:
    112 Elm Street True
    112 South Elm St. True
    112 S. Elm True
    Elm St. False
    South 112 Elm False
    Here's what I have so far:
    public class MethodOne
         public static void main (String args[])
              return street.matches (//d+//s+[A-Z]{1}[a-z][.]?//s{1}[A-Z]{1}[a-z]+[.]);
            String address1 = "112 Elm Address"
            String address2 = "112 South Elm St."
            String address3 = "112 S. Elm"
            String address4 = "Elm St."
            String address5 = "South 112 Elm"
            if (address1.matches(street) ) {
            System.out.println("True");
            else {
            System.out.println("False")
               }// end if
         Can anyone help me out?

    Is this what you want?
    String address1 = "112 Elm Street";
    String address2 = "112 South Elm St.";
    String address3 = "112 S. Elm";
    String address4 = "Elm St.";
    String address5 = "South 112 Elm";
    String matchString = "\\d+ [A-Z,a-z,. ]+";
    System.out.println(address1.matches(matchString));
    System.out.println(address2.matches(matchString));
    System.out.println(address3.matches(matchString));
    System.out.println(address4.matches(matchString));
    System.out.println(address5.matches(matchString));

  • Scalar conversion to true/false

    I would like to convert a time-varying scalar to a true/false variable.  To clarify, I would like to take a time-varying scalar and pass the value of the zeroeth bit to a true/false variable which can then be passed to a digital line output device.  The DO device has solid-state relays and its DAQmx driver requires a true/false input and does NOT permit a scalar nor digital signal.  It seems to me that this is a very simple c-language intrinsic function call.
    I have looked at the SE Steps-Anaylze-Analog-Formula functions but they always output another scalar.  The Trigger step outputs a true/false momentarily and does not latch.  Limit Test has a true/false output but that is for all samples in aggregate of the scalar and not any one scalar value.
    Any suggestions?  or better yet, can someone post a simple LV vi which does this simple data conversion?  Is there some utility vi hidden on the installation disk somewhere that can do this?
    Thanks
    Solved!
    Go to Solution.

    The scalar is simply that which SignalExpress creates and stores as output from many different "Steps".  It seems to me that all scalars in SignalExpress are REAL data type and 32 bits.  For my purpose I need to move the value of bit Zero (0) to a variable that SignalExpress sees as data type True/False (boolean) which can be input to a DAQmx step which takes only that boolean data type.  This is a rare case as very few DAQmx drivers demand a boolean and only a boolean as input.  Since such DAQmx drivers do exist then it seems to me that SignalExpress should accomodate them by providing bit manipulation and conversion functions as found in "C" libraries.  This should be very easy to add to SE???
    Thank you for asking.

  • Executing Code with true/false input

    Ok so I must be over thinking on how to do this. I am trying to run a section of my code when I recieve a True value. When False I do not want it to do anything. Ive tried using a true/false case structure but the requirement to hook the false case to something is screwing me. Also tried a while loop but it just latches on and never reads the false after its already on. 
    Solved!
    Go to Solution.

    joedirt wrote:
    Okay and I will check out tutorials. I just did all that silly code because I wanted to take the last element of the array and write it to the spreadsheet without adding other values, BUT at the same time enable it to append to file because Ill repeat this code over. 
    You don't have an array until you make one right there out of a single element. There are no "other values". There is one element in the array, which is the first and the last element and exactly same as the value you used to build the array. Once you do the tutorials, you'll laught about your code. It is absolutely pointless.
    LabVIEW Champion . Do more with less code and in less time .

  • Difference between "false" and "FALSE" value

    Hello All,
    Many times i have seen that intellisence shows options "true" , "TRUE" , "false" , "FALSE" together.
    Can anyone tell me the difference between lowercase and uppercase value?
    For Example : ActivateOnDefault Property of SPFeature shows these options.
    Thanks in advance.

    there are also True and False options. Inside xml with Sharepoint artifacts (including mentioned feature declaration) all versions should work.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

Maybe you are looking for