Deprecated math operator  ^ ?

I was using Cold Fusion MX7, and now I'm on CF8.
This week someone told me that I had a problem with one of my
calculation, it use to be giving the good result but now it is not
giving good result. The only thing I can see is that the math
operator ^ is deprecated in CF8, is there something that replace
it???

> the math operator ^ is deprecated in CF8,
Cite?
It certainly doesn't say anything like that in the docs:
http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_03.html
{quote}
^
Exponentiation: Return the result of a number raised to a
power (exponent).
Use the caret character (^) to separate the number from the
power; for
example, 2^3 is 8. Real and negative numbers are allowed for
both the base
and the exponent. However, any expression that equates to an
imaginary
number, such -1^.5 results in the string "-1.#IND. ColdFusion
does not
support imaginary or complex numbers.
{quote}
But anyway, if something is deprecated, it still works same
as it ever did,
it's simply flagged for obsolescence. So even if the ^
operator was
deprecated, there'd be no difference in how it worked before
and after
deprecation.
CF seldom deprecates things, and even when deprecated, things
are seldom
actually obsoleted. A good example is the parameterExists()
function: it's
be deprecated since (at least) CF5. It's still there and
functional in CF8
though.
> <cfset mtp = #rem# * 100 * ( (1 - ((1+
(#tme#/100))^-#duree#) ) ) / #tme#>
Well you don't need those pound signs in there, but having
them just makes
your code look untidy, it doesn't actually impact anything.
What kind of differences in results are you seeing?
Adam

Similar Messages

  • Math Operations on LV for Palm

    I am trying to write a program for a Treo 680 running PalmOS 5.4 (Garnet) using LV for PDA 8.0, and I observe some strange behavior in math operations. The test that I did was to calculate B = log10(A). Both A and B are defined as DBL. The B field is programmed to show 16 decimal places. When I run this program on the PC, I get the following results:
    log10(10) = 1.0000000000000000
    log10(50) = 1.6989700043360187
    log10(100)= 2.0000000000000000
    When I run the same program on the Treo (or on Palm OS Garnet Simulator - same results), I get
    log10(10) = 1.0000000000
    log10(50) = 1.2694732747
    log10(100)= 2.0000000000
    A couple more interesting results:
    log10(72) = 1.4278357668
    log10(73) = 1.0043294009
    Two questions:
    1) Why do the results on Palm have only 10 decimal places?
    2) Why are non-integer results so far from the correct values?
    A few notes:
    1) This is not a question of DBL vs. SGL: log10(50) in SGL arithmetic is 1.6989699602127075
    on the PC - the difference starts only in the 7th decimal place.
    2) I have MathLib.prc installed on the Treo (and on the simulator).
    3) The Palm calculator works correctly: e.g. log10(50) = 1.698970004336
    TIA,
    Sergey

    Cepera wrote:
    I mean, how can you have a bug in such a fundamental operation as log(a)?
    As mentioned, the PDA module converts your code to C, which is an error prone process.
    Couple that with the fact that the PDA module has a relatively small market (and the Palm version an even smaller one, as evidenced by its scrubbing), and you can see how bugs like this can slip through the cracks. As you mentioned, the error does not occur for all values of a.
    Try to take over the world!

  • Math operations on history chart

    Hi everyone, I'd like to be able to do some math processing to chart history in that way:
    1) visualizing continuous data from serial port on a multi plot chart  ---> done
    2) at a certain point be able to do some basic math operation on all the chart plots, say for example plot1 multiply by 2, plot 2 multiply by 1.5 ecc.. and visualize those operations on all the history collected till that moment on the same chart replacing raw data, and maybe return to visualize all the raw data collected, programmatically.
    Thanx

    Hi ghrsdr,
    The best way to do it is to maintain a data structure in memory containing a portion of the acquired data (even all). When you need to do some operations on the data you could use this data structure to retrieve and modify your data, even creating a new data structure to maintain the original data. If the data set is large you may consider to stream data to and from your hard disk. The chart should be used only for data visualization purposes, not as a data structure to store the acquired data.
    I suggest you to read the following white papers on the management of large data sets in LabVIEW.
    Managing Large Data Sets in LabVIEW
    http://www.ni.com/white-paper/3625/en
    Memory Management for Large Data Sets
    http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/memory_management_for_large_data_sets/
    I hope I have given you some useful suggestion for your project.
    Best regards,
    Enrico

  • (Error in documentation?) Math operator precedence problem

    Hello,
    I apologize in advance, while I do know programming (I'm a PHP and Perl programmer) I'm fairly new to Java so this may well be a silly question, but that's why I am here. I hope you'll show me where my error is so I can finally set this to rest before it drives me mad :)
    (Also, I hope I'm posting this in the right forum?)
    So, I am taking a Java class, and the question in the homework related to operand precendence. When dealing with multiplication, division and addition, things were fine, the documentation is clear and it also makes sense math-wise (multiplication comes before addition, etc etc).
    However, we got this exercise to solve:
    If u=2, v=3, w=5, x=7 and y=11, find the value assuming int variables:
    u++ / v+u++ *w
    Now, according to the operator precedence table (http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html) the unary operator u++ comes first, before multiplication, division and addition.
    This would mean I could rewrite the exercise as:
    ((u+1)/v) + ((u+1)*w) = (3/3) + (4*5) = 1+20 = 21
    However, if I run this in Java, the result I get is 15.
    I tried breaking up the result for the two values in the Java code, so I could see where the problem is with my calculation.
    For
    System.out.println(u++ /v);
    I get 0
    For
    System.out.println("u++ *w");
    I get 15
    My professor suggested I attempt to change the values from int to float, so I can see if the division came out to be something illogical. I did so, and now I get:
    For
    System.out.println(u++ /v);
    I get 0.66667
    For
    System.out.println("u++ *w");
    I get 15.0000
    Which means that for the first operation (the division) the division happens on 2/3 (which is 0.6667) and only afterwards the u value is increased. That is, the u++ operation is done after the division, not before. The same happens with the multiplication; when that is carried out, the value of u is now 3 (after it was raised by one in the previous operation) and the first to be carried out is the multiplication (3*5=15) and only then the u++.
    That is entirely against the documentation.
    This is the script I wrote to test the issue:
    public class MathTest {
         public static void main (String [] args) {
              float u=2, v=3, w=5, x=7, y=11;
              System.out.println("Initial value for 'u': " + u);
              float tmp1 = u++ /v;
              System.out.println("u++ /v = " + tmp1);
              System.out.println("First ++ value for 'u': " + u);
              float tmp2 = u++ *w;
              System.out.println("u++ *w= " + tmp2);
              System.out.println("Second ++ value for 'u': " + u);
              System.out.println(tmp1+tmp2);
    The output:
    Initial value for 'u': 2.0
    u++ /v = 1.0
    First ++ value for 'u': 3.0
    u++ *w= 20.0
    Second ++ value for 'u': 4.0
    21.0
    Clearly, the ++ operation is done after the division and after the multiplication.
    Am I missing something here? Is the documentation wrong, or have I missed something obvious? This is driving me crazy!
    Thanks in advance,
    Mori

    >
    The fact that u++ is evaluated but in the calculation itself the "previously stored" value of u is used is completely confusing.
    >
    Yes it can be confusing - and no one is claiming otherwise. Here are some more thread links from other users about the same issue.
    Re: Code Behavior is different in C and Java.
    Re: diffcult to understand expression computaion having operator such as i++
    Operator Precedence for Increment Operator
    >
    So, when they explain that ++ has a higher precedence, the natural thing to consider is that you "do that first" and then do the rest.
    >
    And, as you have discovered, that would be wrong and, to a large degree, is the nut of the issue.
    What you just said illustrates the difference between 'precedence' and 'evaluation order'. Precedence determines which operators are evaluated first. Evaluation order determines the order that the 'operands' of those operators are evaluated. Those are two different, but related, things.
    See Chapter 15 Expressions
    >
    This chapter specifies the meanings of expressions and the rules for their evaluation.
    >
    Sections in the chapter specify the requirements - note the word 'guarantees' in the quoted text - see 15.7.1
    Also read carefully section 15.7.2
    >
    15.7. Evaluation Order
    The Java programming language guarantees that the operands of operators appear to be evaluated in a specific evaluation order, namely, from left to right.
    15.7.1. Evaluate Left-Hand Operand First
    The left-hand operand of a binary operator appears to be fully evaluated before any part of the right-hand operand is evaluated.
    If the operator is a compound-assignment operator (§15.26.2), then evaluation of
    the left-hand operand includes both remembering the variable that the left-hand
    operand denotes and fetching and saving that variable's value for use in the implied
    binary operation.
    15.7.2. Evaluate Operands before Operation
    The Java programming language guarantees that every operand of an operator (except the conditional operators &&, ||, and ? appears to be fully evaluated before any part of the operation itself is performed.
    15.7.3. Evaluation Respects Parentheses and Precedence
    The Java programming language respects the order of evaluation indicated explicitly by parentheses and implicitly by operator precedence.
    >
    So when there are multiple operators in an expression 'precedence' determines which is evaluated first. And, the chart in your link shows 'postfix' is at the top of the list.
    But, as the quote from the java language spec shows, the result of 'postfix' is the ORIGINAL value before incrementation. If it makes it easier for then consider that this 'original' value is saved on the stack or a temp variable for use in the calculation for that operand.
    Then the evalution order determines how the calculation proceeds.
    It may help to look at a different, simpler, but still confusing example. What should the value of 'test' be in this example?
    i = 0;
    test = i++; The value of 'test' will be zero. The value of i++ is the 'original' value before incrementing and that 'original' value is assigned to 'test'.
    At the risk of further confusion here are the actual JVM instructions executed for your example. I just used
    javap -c -l Test1to disassemble this. I manually added the actual source code so you can try to follow this
            int u = 2;
       4:iconst_2       
       5:istore  5
            int v = 3;
       7:iconst_3       
       8:istore          6
            int w = 5;
      10:iconst_5       
      11:istore          7
            int z;
            z = z = u++ / v + u++ * w;
       13:  iload   5
       15:  iinc    5, 1
       18:  iload   6
       20:  idiv
       21:  iload   5
       23:  iinc    5, 1
       26:  iload   7
       28:  imul
       29:  iadd
       30:  dup
       31:  istore  8
       33:  istore  8The Java Virtual Machine Specification has all of the JVM instructions and what they do.
    http://docs.oracle.com/javase/specs/jvms/se7/jvms7.pdf
    Your assignment to z and formula starts with line 13: above
    13: iload 5 - 'Load int from local variable' page 466
    15: iinc 5, 1 - 'Increment local variable by constant' page 465
    18: iload 6 - another load
    20: idiv - do the division page
    21: iload 5 - load variable 5 again
    23: iinc 5, 1 - inc variable 5 again
    26: iload 7 - load variable 7
    28: imul - do the multiply
    29: iadd - do the addition
    30: dup - duplicate the top stack value and put it on the stack
    31: istore 8 - store the duplicated top stack value
    33: istore 8 - store the original top stack value
    Note the description of 'iload'
    >
    The value of the local variable at index
    is pushed onto the operand stack.
    >
    IMPORTANT - now note the description of 'iinc'
    >
    The value const is first sign-extended to an int, and then
    the local variable at index is incremented by that amount.
    >
    The 'iload' loads the ORIGINAL value of the variable and saves it on the stack.
    Then the 'iinc' increments the VARIABLE value - it DOES NOT increment the ORIGINAL value which is now on the stack.
    Now note the description of 'idiv'
    >
    The values are popped
    from the operand stack. The int result is the value of the Java
    programming language expression value1 / value2. The result is
    pushed onto the operand stack.
    >
    The two values on the stack include the ORIGINAL value of the variable - not the incremented value.
    The above three instructions explain the result you are seeing. For postfix the value is loaded onto the stack and then the variable itself (not the loaded original value) is incremented.
    Then you can see what this line does
      21:  iload   5 - load variable 5 againIt loads the variable again. This IS the incremented value. It was incremented by the 'iinc' on line 15 that I discussed above.
    Sorry to get so detailed but this question seems to come up a lot and maybe now you have enough information and doc links to explore this to any level of detail that you want.

  • Simple math operation - Help needed

    Hi, i have a simple mathematical operation to do, related to
    a shooping cart, which i want to keep simple.
    I have a input text box named QT1, where customers indicate
    quantity
    I have a dymanic text box, named ST1, where i want the value
    of QT1 to be multiplied by 10$ (hence 10)
    on the release of the button. I have a NaN answer. Here is
    the code.
    on (release) {
    var qt1:Number;
    st1 = qt1 * 10;
    And then, a grand total button will add ST1 + ST2 + ST3, with
    GT the name of the grand total dymamic box:
    on (release) {
    gt = st1 + st2 + st3;
    The second part works, but the first one, with QT1 is giving
    me a Nan (not a number) answer.
    Any help appreciated.

    Problem solved. That cary Auto-kern thing....

  • Math operator for pl/sql

    Does anyone know wich operator may I use for calculating the module like in the following expression?
    SELECT * FROM sale WHERE Customer_Id <operator> 2 = 0
    Thanks!

    Assuming you mean the modulo,
    WHERE mod(customer_id,2) = 0Justin

  • Webkit JS Core Bug in Math operation

    https://bugs.webkit.org/show_bug.cgi?id=40367
    When will Apple push out official Safari updates to fix this bug in Safari 4.1 and Safari 5.

    HI,
    Hard to say since the Apple Discussions TOU forbids discussions regarding when an update might be available.
    Help and Terms of Use
    Carolyn

  • Math operations on array in TestStand

    Hi.
    I have 2 questions
    1. Is it possible to multiply an array by a number in TestStand?
    I know there are some numeric functions available in TestStand but I don't know if like LabVIEW I can multiple ( subtract/add/divide...) all the elements of an array by a number
    2. Let's say I want to pass a 1D array of numbers ( size 10) to a code module but I would like to just pass the first 5 elements . How can I do it in TestStand ? I have checked the array function but I couldn't find something like Array Subset?
    Could you please help me with these question

    In TS 2012 and later they added some new array functions such as Min, Max, Split, Sort, etc...  They also added the ability to do Locals.MyArray[4..8].  Which will give you elements 4 through 8 of the 0 indexed array.
    As for the adding to each number I don't think that capability exists.  If it did it would be something like Locals.MyArray + 100.  It defnitely doesn't work in TS 2010.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Math Addition Operator Question

    Hi there,
    I'm trying to write a very simple math equation:
    var gal_width = 100;
    var m_box_pos = 2000;
    var total = (gal_width+m_box_pos);
    When I display this in a text element, the numbers are shown together rather than being added together
    (eg: 1002000)
    I get the feeling Edge is interpreting the + as a string operator rather than a math operator.
    Replacing the + with a - (as a test), the 2 numbers are being subtracted.
    Multiplying the numbers with the * operator also works as it should.
    I've tried many configerations, escaping the operator with no luck.
    Any ideas of how to get addition to work?
    Thanks

    Hi 29sketc.
    console.log( sym.$("text_111").text());
    // logs : 111
    console.log(typeof sym.$("text_111").text());
    // logs : string
    var number_222 = 222;
    console.log(typeof number_222);
    // logs : number
    console.log( sym.$("text_111").text() +number_222);
    // logs : 111222
    text() has produced a String so + is interpreted here as string concatenation.
    var number_111 = 111;
    console.log(typeof number_111);
    // logs : number
    console.log(number_111 +number_222);
    // logs : 333
    When you have two Number variables + is interpreted  as addition.
    Gil

  • Bit-Shifting vs. Math Ops

    I have always been under the impression that doing a bit shift is faster than I have always been under the impression that doing a bit shift is faster than performing the equivalent math operation when the math involves multiplying or dividing by a positive power of two. For instance, performing the following math op
    int i = 8;
    i = i << 3;
    System.out.println(i); //prints out the number 64should be faster than
    int i = 8;
    i = i * 8;
    System.out.println(i); //prints out the number 64The same applies when doing integer division (i.e. that a shift with zero fill to the right would be faster than performing the division operator).
    I have two questions:
    (1) Is there really a performance benefit to doing bit-shifting when it comes to integer math operations involving powers of two over using the regular multiplication and division operators?
    (2) If I perform the integer math ops using bit-shifting instead of using the traditional operators, how cross-platform is this kind of math? On my Windows machine, which apparently uses little Endian representation, the shifts perform as expected (i.e. << performs multiplication and >>> performs division on positive integer powers of two). However, if I run my code on a platform that encodes integers using big Endian, will the operations still perform as I expect, or am I unwittingly making my code platform-dependent?
    I appreciate any help you can offer me on this matter.
    -Dok

    Bit shifting seems to be used on integer operations with powers of two. Multiply or divide by 8 is being ran in the same amount of time as a bit shift of 3. However, if I change the 8 to a non-power of two like 7, then it takes longer. So these are optimizations being made by the compiler. However, these don't seem to apply to longs, and a long divide by 8 takes 4-5 times longer then a shift of 3.
    Also, I may be wrong, but I don't think you have to worry about a little Endian/big Endian representation. Bitwise operators seem to work fine on either platform (at least I haven't run into problems running them on multiple platforms).

  • Linear Correlation -- Keeps returning NaN for fields that have been operated on

    Hello, I'm trying to do just a simple linear correlation study with my data set. I can run a Linear Correlation on the entire set and all the correlation coefficients generate just fine. When I operate on columns, though, the operated fields all return "NaN"
    in the correlation matrix.
    Eg. my columns look like A, B, C, X. The correlation matrix populates correctly when I just run the Linear Correlation on the un-filtered, un-operated dataset. When I do an Apply Math Operation (divide) to append two more columns, A/C and and B/C, it applies
    the math operation just fine; I can see all the new percentages of C that each A & B feature represent. But the new columns A/C and B/C don't work in the correlation matrix. Everything shows up as NaN. I checked, and these features are all Numeric. 
    Any ideas? Thanks!

    FIXED!
    Just in case anybody else stumbles across this, the Custom Value to replace isn't "Infinity", it's "NaN".
    Use Roope's solution but with different syntax:
    You can use "Convert To Dataset" module to replace invalid values, by using following parameters (for example to reset infinity to 0):
    Action: ReplaceValues
    Replace: Custom
    Custom Value: NaN
    New Value: 0

  • Creating a form with a field that contains a simple math problem.

    I am creating a form in Acrobat 9 Standard that contains a field that requires a simple math function (divide).
    if (QuantityRow1 > 0)
    ExtensionRow1 / QuantityRow1
    Take the value input in ExtensionRow1 and divide it by the value in QuantityRow1. I have included an IF statement to prevent an error that occur if QuantityRow1 were equal to zero.
    After inputting the data into the two fields I tab past the field where I expect to see my result and the field remains blank. I don't receive any error messages.
    Any ideas? Thanks - jb

    This is a duplicate of your question on Acrobatusers.com (
    http://answers.acrobatusers.com/Need-simple-math-operation-function-Acrobat-9-Standard-cre ating-form-q142800.aspx
    Did the information provided there not help you with your problem?
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    PDF Software Development, Training and More...
    [email protected]
    http://www.khkonsulting.com

  • CRIO 9073 Math Accuracy

    An Engineer is performing an overall uncertainty analysis of a system I am working on. A temperature channel consists of an RTD element, RTD transmitter, current loop resistor, and NI-9205 A/D in the cRIO chassis. Now, we know the uncertainty of the RTD, transmitter, resistor, and the NI-9205 because they are published in their respective documentation. To complete the uncertainty calculation the analyst now wants to know the accuracy of the calculation performed in the cRIO-9073. I have attempted to explain that the cRIO uses IEEE double precision libraries, which are dependent on the library implementation, and further are application dependent, but in the worst case is far more accurate than the application requires. I have pointed him to the IEEE standard. But he wants an authoritative reference to a National Instruments document that specifies the accuracy of math operations on the cRIO 9073.
    Help, I am out of words. Does NI have any document(s) that makes any claim to math accuracy on the cRIO-9073?

    Hi,
    I didn't find anything online, so I would suggest you to contact your local NI Office with this request.
    Thanks,
    Christian

  • Avoiding data memory duplication in subVI calls

    Hi,
    I am on a Quest to better understand some of the subtle ways of the LabVIEW memory manager. Overall, I want to (as much as practically possible) eliminate calls to the memory manager while the code is running.
    (I mainly do RT code that is expected to run "forever", the more static and "quiet" the memory manager activity is, the faster and simpler it is to prove beyond reasonable doubt that your application does not have memory leaks, and that if will not run into memory fragmentation (out of memory) issues etc. What I like to see as much as possible, are near static "used memory" and "largest contiguous block available" stats over days and weeks of deployed RT code.)
    In my first example (attached, "IPE vs non-IPE.png"), I compared IPE buffer allocation (black dots) for doing some of the operations in an IPE structure vs. "the old way". I see fewer dots the old way, and removed the IPE structure.
    Next I went from initializing an array of size x to values y to using a constant array (0 values) with an "array add" to get an array with the same values as my first version of the code. ("constant array.png")
    The length of the constant array is set to my "worst case" of 25 elements (in example). Since "replace sub-array" does not change the size of the input array even when the sub-array is "too long", this saves me from constantly creating small, variable sized arrays at run-time. (not sure what the run-time cpu/memory hit is if you tried to replace the last 4 elements with a sub-array that is 25 elements long...??)
    Once I arrived at this point, I found myself wondering "how exactly the constant array is handled during run-time?". Is it allocated the first time that this sub-vi is called then remains in memory until the main/top VI terminates, or is it unloaded every time the SubVI finishes execution? (I -think- Mac's could unload, while windows and linux/unix it remains in memory until top level closes?)  When thinking (and hopefully answering),  consider that the the code is compiled to an RTEXE runningg on a cRIO-9014 (vxWorks OS).  
    In this case, I could make the constant array a control, and place the constant on the diagram of the caller, and pipe the constant all the way up to the top level VI, but this seems cumbersome and I'm not convinced that the compiler would properly reckognize that at the end of a long chain of sub-sub-sub VI's all those "controls" are actually always tied off to a single constant. Another way would perhaps be to initialize a FG with this constant array and always "read it" out from the FG. (using this cool trick on creating large arrays on a shift register with only one copy which avoids the dual copy (one for shift register, one from "initialize array" function)).
    This is just one example of many cases where I'm trying to avoid creating memory manager activity by making LabVIEW assign memory space once, then only operate on that data "in-place" as much as possible. In another discussion on "in-place element" structures (here), I got the distinct sense that in-place very rarely adds any advantage as the compiler can pick up on and do "in-place" automatically in pretty much any situation. I find the NI documentation on IPE's lacking in that it doesn't really show good examples of when it works and when it doesn't. In particular, this already great article would vastly benefit from updates showing good/bad use of IPE's.
    I've read the following NI links to try and self-help (all links should open in new window/tab):
    cool trick on creating large arrays on a shift register with only one copy
    somewhat dated but good article on memory optimization
    IPE caveats and recommendations
    How Can I Optimize the Memory Use in My LabVIEW VI?
    Determining When and Where LabVIEW Allocates a New Buffer
    I do have the memory profiler tool, but it shows min/max/average allocations, it doesn't really tell me (or I don't know how to read it properly) how many times blocks are allocated or re-allocated.
    Thanks, and I hope to build on this thread with other examples and at the end of the thread, hopefully everyone have found one or two neat things that they can use to memory optimize their own applications.  Next on my list are probably handling of large strings, lots of array math operations on various input arrays to create a result output array etc.
    -Q
    QFang
    CLD LabVIEW 7.1 to 2013
    Attachments:
    IPE vs non-IPE.png ‏4 KB
    constant array.png ‏3 KB

    I sense a hint of frustration on your part, I'm not trying to be dense or difficult, but do realize that this is more towards the "philosophical" side than "practical" side. Code clarity and practicalities are not necessarily the objectives here.
    Also, I have greatly appreciated all your time and input on this and the other thread!
    The answer to your first question is actually "yes, sort of". I had a RT application that developed a small memory leak (through a bug with the "get volume info.vi' from NI), but to isolate it and prove it out took a very long time because the constant large allocation/deallocations would mask out the leak. (Trace's didn't work out either since it was a very very slow leak and the traces would bomb out before showing anythinng conclusive.) The leak is a few bytes, but in addition to short term memory oscilations and  long term (days) cyclical "saw-tooth" ramps in memory usage, made this very hard to see. A more "static" memory landscape would possibly have made this simpler to narrow down and diagnose. or maybe not. 
    Also, you are missing my point entierely, this is not about "running out of memory" (and the size of 25 in my screen-shot may or may not be what that array (and others) end up being). This is about having things allocated in memory ONCE then not de-allocated or moved, and how/when this is possible to accomplish.  Also this is a quest (meaning something  I'm undertaking to improve and expand my knowledge, who said it has to be practical).
    You may find this document really interesting, its the sort of thing you could end up being forced to code to, albeit, I don't see how 100% compliance with this document would ever be possible in LabVIEW, thats not to say its worthless: JPL Institutional Coding Standard for the C Programming Language (while it is directed at C, they have a lot of valid general points in there.)
    Yes, you are right that the IPE would grow the output if the lenght of my replacement array is not the same, and since I can't share the full VI's its a bit of a stretch to expect people to infer from the small screen dummp that the I32 wires on the right guarantee the lengths will match up in the IPE example.
    Once, on recomendation of NI support, I actually did use the Request deallocation primitive during the hunt for what was going on in that RT app I was debugging last year. At that particular time, the symptom was constant fragmentation of memory, until the largest contiguous block would be less than a couple of kB and the app would terminate with 60+MB of free memory space.. (AKA memory leak, though we could not yet prove that from diagnostic memory consumption statistics due to the constant dynamic behavior of the program)  I later removed them. Also, they would run counter to my goal of "allocate once, re-use forever" that I'm chasing. and again, I'm chasing this more as a way to learn than because all my code MUST run this way. 
    I'm not sure I see what you mean by "copying data in and out of some temporary array". Previously (before the constant array) at every call to the containing sub-vi, I used to "initialize array" with x elements of value y (where x depends to a large degree on a configuration parameter, and y is determined by the input data array). Since I would call to "initialize" a new array each time the code was called, and the size of the array could change, I looked for a way that I could get rid of the dynamic size, and get rid of dynamically creating the array from scratch each time the sub-vi was called. What I came up with is perhaps not as clear as the old way I did it, but with some comments, I think its clear enough. In the new way, the array is created as a constant, so I would think that would cause less "movement" in memory as it at that point should be preventing the "source" array from (potentially) moving around in memory?  Considering the alternative of always re-creating a new array, how is this adding an "extra" copy that creating new ones would not create?
    How would you accomplish the task of creating an array of "n" elements, all of value "y" without creating "extra" copies? -auto-indexing using a for loop is certainly a good option, but again, is that sure to reuse the same memory location with each call? Would that not, in a nit-picking way, use more CPU cycles since you are building the array one element at the time instead of just using a primitive array add operation (which I have found to be wicked fast operations) and operate on a constant data structure?
    I cannot provide full VI's without further isolation, maybe down the road (once my weekends clear up a bit). Again, I appreciate your attention and your time!
    QFang
    CLD LabVIEW 7.1 to 2013

  • How to compare numbers in a string variable?

    I have a powershell script that is grabbing the output of a website and storing it into a string variable. What I would like to do is check a line in the output which contains two numbers - the number of emails sent out of the total number of emails.
    I have not come up with a way to do this that works. I was thinking of maybe using a regex, but there are other numbers I don't care about that keep getting caught.
    Here is a sample of what is contained in the string variable:
    Email ID: 46862270 : Succeded. Time Taken: 00:00:00.0924511
    Email ID: 46862272 : Succeded. Time Taken: 00:00:00.0493887
    -- Sent 250 of 250 emails successfully. Total Dispatch Time: 00:00:08.1406995
    --State Written to DB. Time Taken for DB Write: 00:00:00.4611053
    Here is another sample:
    Email ID: 46865840 : Succeded. Time Taken: 00:00:00.9333887
    -- Sent 17 of 17 emails successfully. Total Dispatch Time: 00:00:01.2416905
    --State Written to DB. Time Taken for DB Write: 00:00:00.0402957
    So if I have the above contained in a variable called $httpResponse how can I find only the line that starts with -- Sent
    and then subtract the first number from the second number?
    So for example if I have this:
    Email ID: 46865840 : Succeded. Time Taken: 00:00:00.9333887
    -- Sent 207 of 217 emails successfully. Total Dispatch Time: 00:00:01.2416905
    --State Written to DB. Time Taken for DB Write: 00:00:00.0402957
    I would want the check to return 10. Is this even possible?
    Any help is appreciated!

    Sure.
    $String = @'
    Email ID: 46865840 : Succeded. Time Taken: 00:00:00.9333887
    -- Sent 207 of 217 emails successfully. Total Dispatch Time: 00:00:01.2416905
    --State Written to DB. Time Taken for DB Write: 00:00:00.0402957
    if ( $string -match 'Sent (\d+) of (\d+) emails .+' )
    { $FailedEmailCount = [int]$matches[2] - $matches[1] }
    $FailedEmailCount
    10
    Each set of parens will designate a capture group, and those can be referenced from $Matches after a successful -match.
    Just remember that they will all be strings, and to do a math operation you have to cast at least the one on the LH side to a numeric type first.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

Maybe you are looking for

  • Time Capsule can't find data

    Hi I recently moved house and with it my time capsule, the problem is I can no longer find the data I held on my Time Capsules hard drive (primarily Movies and Photos). It's a 1TB TC, showing free space of 57GB so I believe the data is there but I ju

  • Command Link attribute is returning null.

    Hi all, I have a pojo iterator with me. I have to generate command link for a attribute from that iterator. I generated them using a ForEach loop as below and put address of employee as an attribute of that tag. Now in the Action Listener i am fetchi

  • Animated Necklace Help

    I'm more of an After Effects person, but I have, and have used Motion and am hope I can do this... Ok, I'm at a loss on this one. Help? I need to animate a necklace with a heart on it, swinging into the frame, swings for a second or two then breaks a

  • How to recovery the database from a complete backup

    I have a 10.2.0.3 database with archive log enabled. I do a cold backup of database every Sunday night. I shutdown the database, copy all the database files, control files and redo logs to a backup disk. Then the database started and running again. I

  • Re:  credit on Apple account

    I have a $50.00 credit at the Apple I-Tune account, why did Apple ask for my credit card information and then charge my credit card account?????  I want that Credit Card amount reversed and use the Apple credit on my account!