extract the positive values of a 2D array

Hello

I have a table 2D with positive value in column 2.

What I want to do is to find the positive value of each column.

For example, I have this table

A        B

-1        1

2         -2

3         9

5         4

-5        6

6         7

and I want to get the following

A          B

3          9

5          4

6          7

I managed to have the positve in each case, but the value do not match (I have all the positive values of each column) as

A AND B

2 1
3 9
5 4
6 6
7

can you help me please?

Just to be clear: you want the output array to contain all rows in the input table that have positive values in the two column A and column B?  Are you using strictly positive (> 0) comparisons or not negative (> = 0)?  Are integers of values?

RIF answers: Yes and strictly positive, this will do what you want.

Lynn

Tags: NI Software

Similar Questions

  • Get the positive values of sql

    I have the balance column and I need to choose only positive of the sql query values.

    Balance
    200
    -20
    -220
    100

    EXPECTED
    Balance
    200
    100

    Like this??

    SELECT SUM (balance)
      FROM (SELECT total (KEY, program) balance
              FROM your_table
             WHERE total (KEY, program) > 0)
    
  • How to get the Position value current sliderField

    I'm on SliderField for example following

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

    But the problem is I want to get her current state value after each trip for this I use this code

    but it is not updated LabelField with its current value

    protected boolean touchEvent (TouchEvent message)
    {
    System.out.println ("method called touch");
    int vall = sixthSlider.getNumStates ();
    String txt = Integer.toString (vall);
    lbtitle.setText (txt);
    fieldChangeNotify (1);
    Returns false;
    }

    Two tips:

    (1) you use getNumStates where you call getState!

    (2) do not substitute the touchEvent at all. SliderField is a field almost entirely executed, so that she calls fieldChangeNotify on the changes of State. Set up a FieldChangeListener, configured to listen on this field and put your logic inside fieldChanged.

    Good luck!

  • How to extract the string values

    Hello

    Database: 11.2.0.3.0

    I have a JSON string like below. I want to extract only the propetyvalues. Can you help me with the query:

    {

    'documents':]

    {

    'document':]

    {

    'propertyname': 'Id',

    'propertyvalue': "{1C236CB2-AB97-4982-8117-DE0BE6D7DB46}".

    }

    ]

    },

    {

    'document':]

    {

    'propertyname': 'Id',

    'propertyvalue': "{1318AC90-C321-4D3D-9558-6547EFE49A7E}".

    }

    ]

    }

    ]

    }

    Hello

    Too bad, that you do not have version 12. Then, you can use the function JSON_VALUE mentioned previously.

    Here's something you can do in your version:

    SELECT LEVEL AS n

    , REGEXP_SUBSTR (: str)

    , ' "propertyvalue": "([^"]*) "

    1

    LEVEL

    NULL

    1

    ) AS propertyvalue

    OF the double

    CONNECT BY LEVEL<= regexp_count="" (:str,="">

    ;

    If you want to know that adapts to your specific problem, post CREATE TABLE and INSERT statements for some sample data and the exact results you want from these sample data.

  • How to change the position of two objects?

    I have four componensts of course is that I imported from my main mxml file

    and each placed at the four corners.

    What I want to achieve is to drag each item on others then swap their position.

    For example, A comp is slipped on model B, in this case, change the position of A and b.

    But for the moment, it doesn't seem to work properly. I could not find out what the problem with my code. Could someone help me reach this goal?

    A big thank you to all those who could give me a helping hand!

    ///////////////////////////////////////////////////////////////////

    This is one of my component *.

    All the other three components are made in the same way, except each source image file is different *.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Box ' http://www.Adobe.com/2006/MXML "width ="42"height ="42"> "
    < mx:Image source="Images/air.png"/ >
    < / mx:Box >

    ////////////////////////////////////////////////////////////////////////////////////////

    It's my mxml that calls my components *.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:WindowedApplication ' http://www.Adobe.com/2006/MXML "layout ="absolute"xmlns:comp ="Comp.*"creationComplete ="onInit()"> "
    < mx:Script >
    <! [CDATA]
    Import mx.containers.Box;
    Import Comp.Icon_illustrator;
    Import Comp.Icon_air;
    Import Comp.Icon_flash;
    Import Comp.Icon_flex;

    private var i_1:Icon_air; 1
    private var i_2:Icon_flash; 2
    private var i_3:Icon_flex; 3
    private var i_4:Icon_illustrator; 4
    private var origX:Number;
    private var origY:Number;
    private var startObj:String;
    private var icons: Array;

    private var h_1:Box;
    private var h_2:Box;
    private var h_3:Box;
    private var h_4:Box;

    private function onInit (): void {}

    initialize all icons
    i_1 = new Icon_air();
    i_2 = new Icon_flash();
    i_3 = new Icon_flex();
    i_4 = new Icon_illustrator();

    i_1.name = "i_1;
    i_2.name = "i_2;
    i_3.name = "i_3;
    i_4.name = "i_4";

    Fill icon
    showArea.addChild (i_1);
    showArea.addChild (i_2);
    showArea.addChild (i_3);
    showArea.addChild (i_4);

    Set x position
    i_1.x = 100;
    i_2.x = 200;
    i_3.x = 100;
    i_4.x = 0;

    the position value is
    i_1.y = 0;
    i_2.y = 100;
    i_3.y = 200;
    i_4.y = 100;

    icons = [i_2 i_3, i_1, i_4];
    addEventListeners
    for (var i: int = 0; i < icons.length; i ++) {}
    icons [i] .addEventListener (MouseEvent.MOUSE_DOWN, sensors);
    icons [i] .addEventListener (MouseEvent.MOUSE_UP, stopDragMe);
    }

    } //end of onInit

    private void moveMe(e:MouseEvent):void {}
    e.currentTarget.startDrag ();
    showArea.setChildIndex (DisplayObject (e.currentTarget), 0);

    origX = e.currentTarget.x;
    origY = e.currentTarget.y;

    startObj = e.currentTarget.name;
    }

    private void stopDragMe(e:MouseEvent):void {}
    {if (this [startObj].hitTestObject(Icons[1]))}
    trace ("hit 2");

    This [startObj] .x = i_2.x;
    This there [startObj] = i_2.y;

    i_2.x = origX;
    i_2.y = origY;

    } else {if (this [startObj].hitTestObject(icons[0]))
    trace ('hit 1');


    This [startObj] .x = i_1.x;
    This there [startObj] = i_1.y;

    i_1.x = origX;
    i_1.y = origY;

    } else {}
    trace ("knocking others');
    This [startObj] .x = origX;
    This there [startObj] = origY;
    }
    e.currentTarget.stopDrag ();

    } //end stopDragMe

    []] >
    < / mx:Script >

    < mx:Panel id = "showArea" width = "400" height = "300" layout = "absolute" backgroundColor = "0 x 999999" / >

    < / mx:WindowedApplication >

    This shows you how to create dynamic user interface.

    
    
         
              
         
         
         
    
    
  • SQL change the positive to negative

    Hello

    What is the most simple and quick way to change the positive value to the negative terminal.

    Table1:

    Salary

    23,12

    100,23

    1000,22

    53233,43

    Output should be:

    Table1:

    Salary

    -23,12

    -100,23

    -1000,22

    -53233,43

    you will be surprised, because very simple solution

    Select salary *-1 of...

    ----

    Ramin Hashimzade

  • Access to the original value of a property before you apply an expression

    I have a layer that has an expression applied to the Position. The expression overrides the value of Position over time. I want to do is access the Position value as if she had no expression applied. The property("Position").value method does not work because it takes current Position which is influenced by the expression value. What I need is the original value. Is it possible to achieve this?

    You try to do it with a script or an expression?

    With a script, you use just.valueAtTime(time,preExpression) with preExpression set to true;

    It's more complicated with an expression but, if the value of the expression is static, you can use "negative time. In the expression, you do something like this:

    If (time<>

    value

    } else {}

    your actual expression goes here

    }

    Then your other expression could do something like this:

    your_property.valueAtTime(-1)

    If the value of the expression is not static, it's a little more complicated, but you can always do.

    Dan

  • How to extract the XML with namespace?

    Hi all

    Here's the XML I:

    <? XML version = "1.0" encoding = "UTF-8"? >
    -< transaction xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://schemas.test.com/Support/Services/test1/2012" xsi: schemaLocation = "http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd" >
    -< application >
    < > 10 Sam < / Sam >
    < > 32 Actid < / Actid >
    < Pax > 3 < / Pax >
    < > 10 - DEC - 2012 Flt < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < application >
    < Sam > 1 < / Sam >
    < Actid > 3 < / Actid >
    < > 2 Pax < / Pax >
    < Flt > 2012 - dec - 12 < / Flt >
    < user name > WebUserNameTest < / name >
    < / request >
    < / transaction >

    I need to extract the item values:

    The code below will help me when I have no namespace, what needs to be done in order to work with the value of the element namespace and etract

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Sam / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .memid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();


    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Actid / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .actid: =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Pax / text () ';
    v_ssp_table (v_ssp_table..) Pax COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getnumberval ();

    v_string_xml: =.
    ' / / Query [' |] To_char (counter_xml) | '] / Flt / text () ';
    v_ssp_table (v_ssp_table..) Flt COUNT): =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();

    v_string_xml: =.
    ' / / Query [']
    || To_char (counter_xml)
    || '] / Username / text () ';
    v_ssp_table (v_ssp_table. COUNTY) .username: =.
    p_xml_in. EXTRACT (v_string_xml) .getstringval ();
    declare
      v_xml xmltype := xmltype( '
    
    
    10
    32
    3
    2012-DEC-10
    WebUserNameTest
    
    
    1
    3
    2
    2012-DEC-12
    WebUserNameTest
    
    ' );
    begin
      for r_xml in ( select *
                     from xmltable( xmlnamespaces( default 'http://schemas.test.com/Support/Services/test1/2012' )
                                   , '/Transaction/Request'
                                   passing v_xml
                                     columns memid number path 'Memid'
                                           , actid number path 'Actid'
                                           , pax number path 'Pax'
                                           , flt varchar2(100) path 'Flt'
                                           , username varchar2(100) path 'Username'
                                  )
                   )
      loop
        dbms_output.put_line( r_xml.memid );
        dbms_output.put_line( r_xml.actid );
        dbms_output.put_line( r_xml.pax );
        dbms_output.put_line( r_xml.flt );
        dbms_output.put_line( r_xml.username );
      end loop;
    end;
    
  • Extract the contents of an XML string in offline mode

    HI gentlemen,

    Could you help me solve this problem? I had a string of Java (see below) read in a smart German eHealth card. I have to extract the tag values and put them in local variables for further processing in my Java module. How to move forward without connecting to a database, it is enough to analyze the source - the string variable? Note that the lines are separated by only 0x0A.
    <?xml version="1.0" encoding="ISO-8859-15" standalone="yes"?>
    <UC_PersoenlicheVersichertendatenXML CDM_VERSION="5.1.0" xmlns="http://ws.gematik.de/fa/vsds/UC_PersoenlicheVersichertendatenXML/v5.1">
        <Versicherter>
            <Versicherten_ID>X110101627</Versicherten_ID>
            <Person>
                <Geburtsdatum>19840717</Geburtsdatum>
                <Vorname>Johanna</Vorname>
                <Nachname>Düsterbehn</Nachname>
                <Geschlecht>W</Geschlecht>
                <StrassenAdresse>
                    <Postleitzahl>93055</Postleitzahl>
                    <Ort>Regensburg</Ort>
                    <Land>
                        <Wohnsitzlaendercode>D</Wohnsitzlaendercode>
                    </Land>
                    <Strasse>Sulzfeldstraße</Strasse>
                    <Hausnummer>7</Hausnummer>
                </StrassenAdresse>
            </Person>
        </Versicherter>
    </UC_PersoenlicheVersichertendatenXML>
    Thank you very much for your help,
    sincere friendships of

    Miklós HERBOLY
    java.lang.NoClassDefFoundError: XpathSampleClass (wrong name: XPathSampleClass)
    

    If you use my code sample in extenso, the class is named 'XPathSampleClass' (capital P), and of course the .class file must have the same name.

  • extraction of positive numbers

    Hello world


    I have a table and this table has positive values and nagetive several records,
    It comes to my table
    create table item_tran_cost)
    Number of i_code (10),
    Number of i_cost (10);
    )
    data such as
    i_code i_cost
    001 1,000
    001 400
    001.350
    001 25
    001 15
    and so on

    I want back the positive values only (1,000,.350)
    is it possible to do?
    any help please

    Published by: Mohammed July 31, 2011 23:04

    Jin

    You can the user ROUND, TRUNC, SIGN of way more
    Try this please

     SELECT I_CODE, I_COST FROM ITEM_TRAN_COST where  SIGN(I_COST) =1;
    
  • How to know the position of the object in a script?

    I want to know the number of position or page when I find something (e.g. when using findtext()) and move to that. It's the same function find/change in indesign, but I can't find the position value and can not move the position of the object.

    How can I make this script?

    Thank you

    Use:

    myText.showText ();

    @+

    Marc

  • display a positive value in a form

    I had a table tblshipping who got two col called as send_qty, received_qty where I calculate the amount.

    the thing is a few times in the calculation, I get a negative and positive moments, I always want the positive value should appear to the end user

    SQL > select sum (send_qty) - sum (received_qty) from tblshiping where matid = '1';
    I'll say something (-5)
    fom I want to show this-(5) (5). ghoulish any1 help me how it is possible...

    I know to change the order in the query, it can be done, but once again for a State, it will show negative value which I did not see it

    Use ABS

    SELECT ABS(SUM(SEND_QTY)-SUM(RECEIVED_QTY)) ...
    
  • How to extract the value of the element as an array in javascript

    Hi all

    I want to do some calculations on the value entered by the user in the textfield of a tabular presentation, how can I retrieve the value of the element as an array in javascript?

    I use as a normal, do not use in the form of apex_item.

    I can pass the current value of the textfield to the function using 'this' as a parameter, but how can I retrieve the value of other lines of the same column?

    Thank you
    Tauceef

    If it is a page element wouldn't be better to make a calculation of point page when onload of the page? Just do a SQL as select sum (col1) of dual nationality or whatever is your table/column?

  • How re - initialize an array with the new values at run time?

    Hello

    In this application of particluar I want to change the value of a particular index (Ex: 4th move in a 1 d table) and store the changed value (Inremented) in the same index position.

    I wrote a program, can someone tell what I am doing wrong?

    LabVIEW version: 8.6

    Screenshot kindly updated instead of .vi

    Two things.

    First of all:

    You must initialize the table (via the feedback loop).

    Click with the right button on the wire of the array and create constant.  Move the index of item 99.  Initialize element 0.  This thread up to the lower part of the feedback node.

    Second:

    You use an Insert in the table VI, but it's not describe what you try to do.  While he places an element in the position shown is also increases the size of the table.

    This change to a subset of table replace VI.

  • At the same time, write in an array of structure to two positions without losing a single change

    I have a picture that contains a structure.

    I address the sub-table (1 entry) of index i and n parallel with the function of the subset of the array because I want to update the entry to the position i and n parallel, let's say in a parallel for loop.

    So, I use the subset of the table replace to write in the same table.

    Everything is done using a local variable, first reading it, then write it.

    The problem is when you write the updated table in the local variable, I could lose the parallel change.

    So, this approach has always written the entire table. If there is a change in parallel with the old array as input, changes to the n position may be lost, when I is changed (although I never address = n i concurrently).

    This could be avoided if the right position n is written or just me, when I handle them. Is there a way to write only the subset without having to rewrite the entire variable? Or an another workaround?

    > Can be using data value reference will help... and it will lead to no copies of table to each parallel iteration.

    It maintains only one copy of the main table and replaces all requested (5) items.

    Edit: it does not help. Structure of the element InPlace disables a parallel operation. All the other options I know of generate copies of data.

    Result: no, labview does not work with data very good references and it seems that your request is not possible (unless labview only).

Maybe you are looking for

  • USB wouldn't Devie recognized

    I used my ipod and iphone on my computer very well, and now all of a sudden whenever I'm trying to plug one or the other in one of the front usb ports I get "Unrecognized USB device". Any suggestions? Using Windows Vista.

  • T400 - 276532G

    Bishop 6.63.1 of installed power. When click on the green symbol the program does start just pop in the field of activity as a red icon (battery symbol). I'm used to that the program starts and I can change the power settings, look at the State of th

  • 23 - g010 removal of the back cover

    I am trying to remove the rear panel of the all-in-one computer from HP 23 - G010. I can't find a manual with instructions. I know that once I open the back cover it will probably cancel my warrany and that's okay. I want to increase the RAM on my ow

  • NDK 1.0 for Mac zip file is broken

    Tried downloading the NDK 1.0 zip file several times with different browsers, but the built-in archival utility Snow Leopard or Zipeq can decompress.  Archive only said: he cannot do.  Zipeg says it is an unsupported format.  I had no problem uncompr

  • qmlRegisterType problem

    I cannot register a QML type. The first time I did it with the DataModel PrayerModel type I managed to do the work. However, I get errors with the PrayerBBMManager now. It is based on the example of Battambang, but I simplified the entire BBM feature