Boolean logic

Hey, whats the best way to represent a minus and divide in in java for a boolean equation? Say i have x-y, i sub a matrix of values in {(0,0),(1,0),(0,1),(1,1)} and i want o return their logical boolean result. So if i do it for plus i use the OR gate, and multiplication uses the AND gate.
Do i simply reverse the result for a plus?
Podger

haha tis alright figured it out

Similar Messages

  • Can Visual Composer make decisions based on boolean logic?

    I need to know if I can use Visual Composer to manipulate data results based on boolean logic.  Basically, if a  month is less than the current month, I want a formula to dispay A instead of B. Can this be done? 
    Can I also say, if current month is greater than this month then hide values, else show values?

    In that case you don't need VC. I would then directly do that with BEx Query Designer and the use of a formula and boolean operators there. Here is the help of how you can achieve that:
    http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm
    Once you created sthe query this way, you can use the BEx Analyzer to embed it in Excel, and then use Information Broadcasting to schedule the calculations.
    Of course if your requirements change and displayint that data in VC is good enough, then you can still go as mentioned in my answers above

  • Compound boolean logic scripting

    Greetings!  I would like to pick everyone's brains for how one might implement compound boolean logic scripting in LabVIEW ... specifically LabVIEW-RT.
    My application is an in-vehicle data acquistion and logging setup.  The app is setup so that the user provides a configuration file which is the list of channels (GPS, DAQ, CAN) that they wish to record...so this means there isn't any hard coded variable but an array of clusters built from the configuration file.
    A mode of operation is a 'trigger' mode, which means the logger doesn't record anything until a trigger has occured.  Currently the user provides a simple comparator (0=lessthan, 1=equalto, 2=greaterthan, else=none), and the trigger value.
    The users want to be able do compound conditions like PARAMETER <= x OR Parameter >= y ... possiblly even between 2 different data points like PARAMETER_A <= x AND PARAMETER_B >=y.
    Any comment, hints, tips, suggestions ?
    Thanks!
    Jason Stallard

    Jason,
    It's interesting how often the problem of text-based scripting to drive LV pops up.
    I had a problem with similar properties: given a set of data and an
    arbitrary set of rules, substitute data into each rule and see if it
    evaluates to true or false.  This is used to provide directions
    from engineers to operators on how to perform failure analysis and
    recovery, without the engineer needing to be present.
    The problem that I ran into turns out to not be in evaluating the data
    and rules, but in parsing the arbitrary input equation.  There
    just isn't any general way inherent to LV to parse an arbitrary text
    language into an intermediate form (like a postfix expression or an
    abstract syntax tree).  A relative lack of recursion makes it a
    little more painful as well.
    I can't release my code, but it essentially had three parts:
    1.  In a given rule in infix form (variableA<7, for instance),
    perform macro replacement.  Essentially, substitute values for
    variable names, perform file lookups, etc.
    2.  Transform the substituted infix equation into a much easier to
    deal with postfix equation.  (Thanks to Mike Porter for this
    suggestion as well).  This step can be non-trivial.  I'm
    currently building an editor that will build equations more easily,
    sparing my engineers much pain.
    3.  Evaluate the postfix equation for a single true/false
    result.  This algorithm should be available in many books, but I
    adapted the one from an earlier version of this book:
    http://www.amazon.com/gp/product/0201702975/qid=11​37608429/sr=2-3/ref=pd_bbs_b_2_3/103-3337903-13870​46?s=books&v=glance&n=283155
    It also contains a short description of a stack-based parser that's fairly easy to implement for step 2.
    Anyway, there's my 2 cents.  Maybe someday I'll find time to write
    that LV based parser generator to "simplify" all of this   Good
    luck!
    Joe Z.

  • Implies Boolean Logic

    Hi guys,
    just a bit stuck on something.
    In my programs i've been using a shift register and a not-implies boolean function to perform an action once only, when a value changed from false to true
    in boolean logic how would I spot a change so that a true to false change will provide true, but other states false?
    any help very much appreciated - got a bit of a hangover and my brain isn't flying at full-mast!
    cheers!

    Since the state of (one true/one false) has a different output depending on the motor running or not, you need a shift register to store the motor state. Only if both are equal, the state should change.
    The attached codelet shows one possibility.
    (edit: replaced booleans with counters in image. Thanks tst)Message Edited by altenbach on 04-03-2005 02:14 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Motor1.gif ‏3 KB

  • Creating Boolean Logic formulas within Cell Editor

    Good afternoon,
    Does anyone know if boolean logic works within the cell editor?  I want to create boolean logic to choose a different help cell based on a condition.

    Hi,
    Check these help.sap links
    http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c1/759b3c4d4d8d15e10000000a114084/content.htm
    Regards,
    DST

  • Boolean Logic in the Page

    Hi!
    I have a beginners problem that seems very trivial, but I can simply not find the solution. How do you do boolean logic in a JSF page. I want to be able to hide some buttons depending on some data in the bean, but I do not know how to do that. I guess what I am after is the equivalent of the Struts <logic:equal> and <logic:notEqual> tags.
    Regards,
    Magnus

    Use rendered attribute.
    For example:
    <h:commandButton value="Edit" action="edit" rendered="#{MyBean.editable}" />
    In this example, editable should be a bean property with type Boolean and public getter.
    Generally, you can use any expression based on JSF EL (JavaServer Faces Expression Language).
    For example:
    <h:commandButton value="Create" action="createUser" rendered="#{MyBean.userName == null }" />

  • Boolean Logic in Workflows?

    Is it possible to perform any boolean logic in a Podcast Producer workflow? I'd like to set up a workflow that can potentially take in .flv files and pipe them through ffmpeg using the pcastaction shell command. I need to be able to check the file extension and if it's .flv then run the shell command, otherwise carry on normally.
    Thanks,
    Jason

    It's not possible to do branching or conditional logic directly in the Xgrid tasks. But, for the scenario you described, you could write a shell task that determines if the input file is Flash video and then pre-process with ffmpeg, or return immediately if not.

  • VI crashes when completing boolean logic

    Hi guys,
    I'm an amatuer trying to do some basic parallel port control through labview. I've designed this big state machine, but whenever I complete the logic Labview will crash upon saving or running the vi.
    I've attached the broken vi. Go to the top right of the block diagram and connect the open OR gate to something. Even a true constant causes a crash. Is the logic simply too big and bloated to handle? What can I do to fix it? Is a while loop+feedback nodes for registers the correct way to implement digital logic?
    Sorry if this seems silly. I only just started using labview.
    Attachments:
    keypad logic.vi ‏13 KB

    Seiko809 wrote:
     I've designed this big state machine, ...
    You still have not explained what the program is supposed to do. I am pretty sure that 80% of the current code is not necessary and the entire thing could be done much simpler.
    I am also not sure why you call it a state machine (and it is not "big" either).
    Just glancing at Lynn's image above, many things make absolutely no sense and just clutter and complicate the diagram.
    Find the following constructs. All boolean operations where one input is a diagram constant can be eliminated and replace with a plain wire or possibly an invert.
    "A .AND. TRUE" is simply "A" (a wire!)
    "A .OR. FALSE" is simply "A" (a wire!)
    "A .XOR. TRUE" is simply ".NOT. A"
    "(A .OR. FALSE) _AND_ (.NOT. (A .AND. FALSE))" is simply "A" (a wire!)
    Instead of inverting a FALSE constant, you could simply use a TRUE constant.
    For example, the code operating in the lower shift register can be reduced to a single "invert". Of course all the currently remaining feedback nodes currently give an invariant constant. Obviously, you must have had much more in mind so either their inputs need to be hooked up somewhere useful or they should be deleted.
    So, please describe in a few words what kind of outputs you expect based on the changing values of the four boolean input value. I am sure we can point you to an almost atomic solution.
    Seiko809 wrote:
    Sorry if this seems silly. I only just started using labview.
    Virtually all your problems are algorithmic and would be an problem in any programming language. The problems have nothing to do with LabVIEW per se.
    LabVIEW Champion . Do more with less code and in less time .

  • Evaluating an arbitrary length boolean logic expression

    Is it possible to have labview evaluate a boolean expression of arbitrary length and complexity, which would be input by the user. Storage format of the expression isn't necessarily important. Use of the attached vi might provide some help for evaluating the expressions.
    Attachments:
    Test_Comparator.vi ‏28 KB

    There are a couple of ways to go about this. You may want to look into the Mathmatics&#0187Formula&#0187Advanced Formula Parsing pallet for some useful VIs.
    One way to do it would be to parse a string for expresions and perform the oppertation specified. Attached is a first step in doing this. Note that it returns an array of results...the code for anding and oring still needs to be added.
    Hope this helps,
    Amaury Rolin
    NI Applications Engineer
    Attachments:
    multi_compare.llb ‏41 KB

  • Does my boolean logic make sense?

    Hello. I am currently working on a linked list assignment, but for some reason my boolean doesn't seem to do what I want it to do. can someone take a look to see why I am getting a black screen?
    public boolean addEmployee(Employee newEmployee) //if there is fresh meat coming, returns true. I think something's wrong here
          EmployeeNode previous = search(newEmployee);
          EmployeeNode present= setPresent(previous);
          EmployeeNode add = new EmployeeNode();
              boolean freshMeat = false;
              add.data = new Employee(newEmployee);
              while((present!=null)&&(present.data.compareTo(newEmployee)<0))
              {     previous = present;
                   add.link = present;
                   present = add;
                    System.out.println("present is: "+present.data);
                    System.out.println("previous is: "+previous.data);
                   freshMeat = true;
              return freshMeat;
       }if I remove the while loop and the condition, it will display everything that I am adding to it:
    public boolean addEmployee(Employee newEmployee) //if there is fresh meat coming, returns true. I think something's wrong here
          EmployeeNode previous = search(newEmployee);
          EmployeeNode present= setPresent(previous);
          EmployeeNode add = new EmployeeNode();
              boolean freshMeat = false;
              add.data = new Employee(newEmployee);
              previous = present;
              add.link = present;
              present = add;
              System.out.println("present is:" + present.data);
              freshMeat = true;
              return freshMeat;
       }why can't I have my previous.data display if i type it into SOPLN?

    I did a couple of linkedlist assignments not long ago, of which one is employee related.
    I thought that the method names are a bit ambigous to me, and it will definitely help if you can outline your algo.
    Putting your while condition to words, i have, if (current node exists) AND (newEmployee is "bigger" than the employee data in the current node) perform loop content. I am not sure if that is what you want.
    Furthermore, I am not sure if you are traversing forward or backward, or if you are traversing your list at all in your while loop.
    if your add.link refers to to next node in the list, shouldn't you do something like
    previous = present;
    present = add.link;
    ....again, it will greatly help if you are provide more info on what exactly are you trying to do.

  • Trouble with boolean logic

    //StringBuffer underscoreBufferWord = new StringBuffer ()
    //StringBuffer stringBufferWord = new StringBuffer()
    //I have also tried ; if (underscoreBufferWord == stringBufferWord)
    I cannot get the logic to return true and print "you did it" It always skips to else.
    if (underscoreBufferWord.equals(stringBufferWord))
    System.out.println("You did it");
    result = 1;
    else
    if (numOfWrongGuesses == 7)
    result = 0;
    System.out.println("You lose");
    Thank you for you comments

    Okay, I can see where it's not as obvious as I might have made it out to be.
    You'll notice two main sections: Methods that SB defines or overrides, and Methods inherited from class java.lang.Object.
    The fact that equals appears in the latter, rather than the former, tells you that it uses Object's equals, which returns true if and only if obj == this.
    For SB to have content-comparing semantics, it would have to override equals, which means equals would appear with the rest of the SB-specific methods. It would probably (though not necessarily) also inlude an explanation of what it does.

  • Boolean Logic Issue

    I have 2 sensors in a system.
    Items pass these sensors.
    First is an inductive sensor and only activated by a passing metal object, which is what we want.
    Second is an IR Through Beam - if the Inductive sensor activates it means a metal object has passed so the second IR Through beam is redundant in that case
    If the IR Through Beam is broken and the Inductive HASN'T been activated, it means the passing object isn't metal (in this case it's plastic).
    So if Inductive is (A) and IR is (B)
    Metal:
    (A) will activate on its own very briefly
    (B) activates also
    (A) deactivates
    (B) still activated on its own for a very brief period
    (B) deactivates
    Plastic:
    (B) activates on it's own
    (B) deactivates
    I've knocked up a VI and Metal is easy enough - if (A) is activated, using an implies and not gate, I can make sure only once it enqueues 'metal'
    But for the Plastic on, it works most of the time, but sometimes puts 'reject' onto the queue when a metal passes - i'm assuming that because of the subVI iterating quickly and the period when (B) remains on alone, this somehow picks it up as plastic.
    Can anyone see where i'm going wrong?
    Cheers
    without getting this first bit right I can't sort the second inspection part as it relies on a successful decision from the first section to fully assertain what to do at the reject area following - nightmare!
    Attachments:
    InspectionArea.vi ‏52 KB

    Hi there tbob
    the VI is a subVI in a while loop, along with other subVIs, so the frequency of the code running has been ok - it's in a loop with a 100ms delay - all these 6 subVIs seem to run as expected and are doing ok in that respect (as far as I know )
    I'll try to answer your questions now........
    ' Could you explain what is your desired end result?'
    Basically, there are 4 sensors along a conveyor belt, split into 2 groups of two. The first two are an inductive and infra-red through beam, the second two are an infra-red reflective sensor and a large capacitive sensor (I have attached a photo of the two sections in question to get a feel for it - conveyor goes left to right - if, as you can see, a metal based object passes the left section, it activates the inductive sensor (the blue one), then the infra-red beam (the bit under the blue frame) is broken shortly after (so now both sensors are active), then the trailing edge of the metal peg leaves the field of the inductive sensor and the inductive sensor deactivates - and now the infra-red through beam is still broken momentarily before the metal object fully passes. If it was a plastic ring passing (a plastic ring can just be seen in the assembly hopper on the far left of the picture), the inductive sensor would not be activated, with only the IR through beam being broken. One problem I was getting is that sometimes a passing metal is getting put down as both metal and plastic - presumably due to the last part where only the IR through beam is broken.
    'Do you want to put reject in the first queue if the object is non-metal and put metal base in the second queue if the object is metal?'
    Yes and no...............either 'reject' or 'plastic base' (the wording is inconsequential I suppose) onto the first queue for non-metal and 'metal-base' onto the first queue instead for metal (I am using the second queue for the second stage of the inspection as can be seen just after on the picture.
    'Also, does the conveyor belt run such that one object passes both sensors before the next object gets to the first sensor, or can you have a case where you have objects at both sensors at the same time.'
    The way it works with the spacing of objects as they are fed into the machine (there is a chain conveyor with uniform spacing, as can be seen in the background), only one object should be in the field of these sensors at a time BUT there is always the risk that something could be placed on manually and cause that situation to be true - that's all part of a final critical evaluation I suppose - not being able to properly identify anything in the system, only 'assuming'.
    I think the question about the loops shouldn't be an issue - the profiling suggests not
    sorry, i've waffled a bit there - think that answers everything!
    thanks
    Attachments:
    Inspection.jpg ‏57 KB

  • Boolean logic for Smart Mailboxes?

    So all my incoming email goes thru a mail filter and I maintain a separate mailbox as a logfile. This is so that I can view the log online via a web client. The log is basically a mail box whereby I trip off the body of the message and annotate how the message was handled. Now this becomes an issue when I want to create a smart mailbox where I have multiple addresses to the same mailbox but I don't want to see the log messages. So I make use of message no in mailbox a lot whenever I'm using smart mailboxes but Mail.app doesn't let you define ((this address or that address) and (message not in mailbox))

    So all my incoming email goes thru a mail filter and I maintain a separate mailbox as a logfile. This is so that I can view the log online via a web client. The log is basically a mail box whereby I trip off the body of the message and annotate how the message was handled. Now this becomes an issue when I want to create a smart mailbox where I have multiple addresses to the same mailbox but I don't want to see the log messages. So I make use of message no in mailbox a lot whenever I'm using smart mailboxes but Mail.app doesn't let you define ((this address or that address) and (message not in mailbox))

  • Strange mapping of Boolean from Logical to DB2 Relational model

    Hi guys,
    Using most recent version of Data Modeler (3.3.0.747) I notice strange behavior:
    Attribute, declared as Boolean in Logical model is engineered to a column, with type CHAR(1) in Relational Model, when "RDBMS Type" is Oracle, but when "RDBMS Type" is "DB2", column type is CHAR(254)
    Is this a bug or a feature?
    Is there any way, where I can control type mapping between logical and relational model?
    Well, I can just go and change CHAR(254) to CHAR(1) all over my Relational Model, but this is pretty frustrating.
    MfG,
    Stoyan Tsonev

    Hi Stoyan,
    Is there any way, where I can control type mapping between logical and relational model?In fact mapping is between logical data type and database native types - Tools>Types Administration.
    You need to change mapping for Boolean logical data type - check "size" check box and put value in text field to define default size. Default size will be used when there is no explicitly defined size in column/domain definition.
    Philip

  • Is it possible to use booleans to build a VI that uses buttons to switch between screens (3 only) while the other screens disappear?

    As a beginner, I need help figuring out how to build a simply VI that uses boolean logic to switch between three different screens. I need a "Home" screen, the next screen which has a button to go back "Home" and a third screen which has two buttons to go "Home" and "Previous Screen". Can someone help me with a simple block diagram?

    Hi,
    Or put the data in three tab controls. The tabs itself are hidden. The
    program switches between the tab sheet if one of the buttons is pressed.
    The buttons are best not copied, e.g. the same buttons are used in every tab
    sheet (buttons hover above the tab, a black shadow will apear). If the first
    sheet is shown, button 2 and 3 are hidden, sheet two: only button 3 is
    hidden, sheet three no button is hidden.
    Showing the tabs allows the user to choose the views directlly. The button
    logic is not needed anymore. But you'll have to live with a simple tab
    sheet, instead of a fancy button system!
    Regards,
    Wiebe.
    "Jason R" wrote in message
    news:[email protected]...
    > Another solution if you want to avoid property-node hell...
    >
    > Divide your screen into 1/4ths. That is, make your FP 4x larger than
    > your desktop.
    >
    > Place screen 1 on the upper left quadrant.
    > Place screen 2 on the upper right quadrant.
    > Place screen 3 on the lower left quadrant.
    > Screen 4 (lower right quadrant) is unused.
    >
    > Disable the ability to scroll at run time.
    >
    > As the user clicks buttons, use the properties of this vi to move what
    > the user can see on the front panel.
    >
    > Cheating? yep. Easier? yep.
    >
    > Hope this helps! =)
    >
    > btw - be sure not to update the FP controls when they are not visible,
    > or this will eat processor cycles.
    >
    > Sincerely,
    > Jason G Richmond
    > Project Engineer II and LVAAD Instructor
    > VI Engineering
    > [email protected] (domain should be vieng.com (no A's))
    >
    >
    > missileman wrote:
    > > Is it possible to use booleans to build a VI that uses buttons to
    > > switch between screens (3 only) while the other screens disappear?
    > >
    > > As a beginner, I need help figuring out how to build a simply VI that
    > > uses boolean logic to switch between three different screens. I need a
    > > "Home" screen, the next screen which has a button to go back "Home"
    > > and a third screen which has two buttons to go "Home" and "Previous
    > > Screen". Can someone help me with a simple block diagram?
    >
    >

Maybe you are looking for

  • What is needed for the Student Discount?

    Hi, ordering (Well, my parents are. Im just helping) a Mac book soon for my brother who attends NJIT. What would I need to do to obtain the student discount? Is there anything I would need from my brother such as student id or something like that or

  • WM - LX22 : unlock inventory cleared

    Hi all I got an old inventory document (dated 2006 ! ) , with the status cleared (see in LX22). That inventory document is blocking all the storage bins concerned by this old invenory document. I want to unlock those storage bins, in order to do the

  • Logging server start/stop to syslog?

    Hi All! I have spent all day on this and I am ripping my hair out! Using Solaris 10 (update 5) and SMF I am trying to get the same start/stop information that is logged to /var/svc/log/... to output via syslog. According to the man page for svc.start

  • Suggestions welcome...what all reports needed to monitor DB performance

    Hi All, Could you all please let me know what reports would you need to monitor a database. I am writing something that one could use to monitor database. not like statspack which would take snaps at regular intervals but a GUI where in you would cli

  • Problems reported with DFSR

    I have the health report add on running on our recently installed Windows 2012 essential server. I am receiving the following error: The DFS   Replication service stopped replication on volume C:. This occurs when a DFSR JET database is not shut down