How to use to use rank over() function in block coding

Hi,
I am having problem with using rank () over function in block coding. I can't use it in declaration section with select statement.
How to use in executable section of pl sql ?
--Sujan                                                                                                                                                                                                                                                                                                                                                                                                           

thanks

Similar Messages

  • No possible debug for mapping containing "rank() over"

    It looks like mappings using "rank() over" functions (most of mines) are no candidate for debug functionalities :-/
    Analyzing map for debug...
    Retrieving runtime connection info...
    Connecting to runtime schema...
    Checking character set of runtime schema...
    Configuring sources and targets...
    Analyzing map for debug...
    Configuring sources and targets...
    Validating map...
    Correlated Commit is OFF.
    Generating debug package...
    Deploying temp debug tables...
    Deploying debug package...
    Debug code deployment messages:
    LINE 5964 ,COLUMN 66:
    PLS-00103: Encountered the symbol "OVER" when expecting one of the following:
    . ( * % & = - + ; < / > at in is mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between ||
    End debug code deployment messages
    DBG1012: Debug deployment errors, can't run debug code.

    That's right.
    Though, use of dedup is totally prohibitive to nest rank() function (in order to use it in the outer where clause) and creation of dumb tables are messy in a way.
    I chose creating a dumb constant vector that matches the rest of the query, filtering it to an empty set and then UNION ALL with the main query that is thenafter filtered on rank column (and it works pretty fine)
    ...just a pity it can't be debugged (they are my most complex mappings) with the debugger

  • How to use rank() over(...) in a map?

    I use rank() over(...) in a Filter operator
    validate give a error: ora-30483

    Currently OWB does not directly support analytical functions. The (not very elegant) workaround could be implementing these feature in custom transformations.
    Regards:
    Igor

  • How to use group by in analytic function

    I need to write department which has minimum salary in one row. It must be with analytic function but i have problem with group by. I can not use min() without group by.
    select * from (select min(sal) min_salary, deptno, RANK() OVER (ORDER BY sal ASC, rownum ASC) RN from emp group by deptno) WHERE RN < 20 order by deptno;
    Edited by: senza on 6.11.2009 16:09

    different query, different results.
    LPALANI@l11gr2>select department_id, min(salary)
      2  from hr.employees
      3  group by department_id
      4  order by 2;
       DEPARTMENT_ID      MIN(SALARY)
                  50            2,100
                  20            2,100
                  30            2,500
                  60            4,200
                  10            4,400
                  80            6,100
                  40            6,500
                 100            6,900
                                7,000
                 110            8,300
                  70           10,000
                  90           17,000
    12 rows selected.
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- Always lists one department in a non-deterministic way
    LPALANI@l11gr2>select * from (
      2  select department_id, min(salary) min_salary
      3  from hr.employees
      4  group by department_id
      5  order by 2) where rownum = 1;
       DEPARTMENT_ID       MIN_SALARY
                  20            2,100
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- Out of the departments with the same least salary, returns the one with the least department number
    LPALANI@l11gr2>SELECT   MIN (department_id) KEEP (DENSE_RANK FIRST ORDER BY salary) AS dept_with_lowest_sal, min(salary) min_salary
      2  FROM        hr.employees;
    DEPT_WITH_LOWEST_SAL       MIN_SALARY
                      20            2,100
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- This will list all the deparments with the minimum salary
    LPALANI@l11gr2>select department_id, min_salary
      2  from (select
      3  department_id,
      4  min(salary) min_salary,
      5  RANK() OVER (ORDER BY min(salary) ASC) RN
      6            from hr.employees
      7            group by department_id)
      8  WHERE rn=1;
       DEPARTMENT_ID       MIN_SALARY
                  20            2,100
                  50            2,100

  • How do I use the "What's Here" function in Google Maps on my Mac?

    Being a new convert to Mac I was used to using right-click to access the "What's Here?" function in Google Maps on my old Windows PC. How do I use it on the Mac?

    Click on the Up Next icon (ringed in my screenshot):
    then on the Clear button:
    and Hey presto!

  • How can I use Automator to toggle the Function Keys?

    I am trying to create a Automated process to toggle the Function Keys on my keyboard. This is because I use several programs, including After Effects, which use the F1-12 keys, but when I am not using that program I commonly use the Apple-defined shortcuts on the keyboard. I have a full-sized keyboard, hence no Fn key. So that's out right away – I've read several comments on this topic where people suggested that this is the ONLY option. I refuse to beleive that.
    Automator contains a "Watch Me Do" feature, which I have tried to use to record this process. Problem is, it never clicks the right object. If I record clicking the dock, the magnification (I suspect) throws off the virtual-controlled mouse and picks the wrong object. If I record the Apple Menu route, it gets it about 1/2 the time.
    I think what I'm really looking for is a console command I can feed into the Terminal which toggles the keys. It seems to be that this HAS to be an option, even if it is more than one line of commands. I believe if I can feed this process into Automator, it would work.
    Any ideas?
    Thanks in advance, Mac Geniuses!

    iKey lets you define function keys per application. You seem to want to turn on & off the defined apple keys.  Not sure if these keyboard re-mappers will do the trick.
    Here is my other most favored application. Of course, I haven't checked these out in newer OS's. I'm a Tiger man myself.
    iKey is a front end program that simulates typing and mouse movements. I use iKey to remap the Function keys.
    "iKey is an automation utility, a program that creates shortcuts to accomplish repetitive tasks. In essence, an iKey shortcut is a little program in its own right, but you don't need to know the first thing about programming to create an iKey shortcut. All you have to do is put together three necessary parts of a shortcut: One or more commands that give the shortcut its functionality, a context in which it runs, and a launcher that defines how the shortcut is activated."
    http://www.scriptsoftware.com/ikey/
    iKey  has a little more function then the previous free version called youpi key. For many years, I used youpi key before switching to iKey.  It works fairly well for me in MAC OS 10.4 although not officially supported.  The youpi key download is hard to find & no longer here.
    http://www.versiontracker.com/dyn/moreinfo/macosx/11485&vid=75326
    ( Send me a message for a copy of youpi  key. )
    *Examples:*
    I have the common programs that I use assigned to function keys. I have F4 assigned to Firefox. When I want to start FireFox, I press F4. When I want to switch to firefox, I press F4! Starting & switching to an application in Mac OS are the same thing in Mac OS.
    Here is an example of to assign volumn control to a function key.
    http://discussions.apple.com/message.jspa?messageID=10361085#10361085
    Here is my script for listing my application folder. I have it assigned to function-key 6.
    tell application "Finder"
       open folder "Applications" of startup disk
       select Finder window 1
       set bounds of Finder window 1 to {-3, 44, 691, 545}
       --set position of Finder window 1 to {33, 44}
       set position of Finder window 1 to {60, 45}
       activate
    end tell
    The second portion of this script was generated in the script editor record mode. After I recorded the script and did some editing, I copy the script to ikey/youpi key.
    Full Key Codes
    http://download.cnet.com/Full-Key-Codes/3000-2094_4-44175.html
    Spark
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation!"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675
    Mac OS X remap or rename keyboard keys
    by vivek
    So how do you remap or rename keyboard keys under Mac OS X?
    Simply use DoubleCommand software.  It is a free program
    http://theos.in/apple/download-doublecommand-to-remap-keyboard-keys/
    Keyboard Maestro is a powerful macro program for Mac OS X (including Tiger and Leopard) which has received glowing reviews. Keyboard Maestro will take your Macintosh experience to a new level in “Ease of Use”. With Keyboard Maestro you can design a custom action sequence with your own shortcuts and use them at any time, you can navigate through running applications and open windows with Program Switcher, and you can work with an unlimited number of clipboards - all by pressing simple keystrokes.
    http://www.keyboardmaestro.com/main/
    "Spark is a powerful, and easy Shortcuts manager. With Spark you can create Hot Keys to launch applications and documents, execute AppleScript, command iTunes, and more... You can also export and import your Hot Keys library, or save it in HTML format to print it. Spark is free, so use it without moderation"
    http://www.versiontracker.com/dyn/moreinfo/macosx/22675

  • How to use a mysql built-in function with dataprovider

    hi.
    I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
    Something like this doesn't work:
    MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
    How should it be done?
    thanks.
    Mike.

    hi.
    thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
    best regards.
    Mike.

  • After the most recent firefox update I can no longer copy and paste. the fuinction only works in Windows and I HATE usign it. Any suggestions on how to restore the copy and paste function while using Mozilla?

    I have been unable to use the copy and past command while using mozilla. the fucntion does work in windows IE, but I don't want to use windows. How do I restore or fix this function? I varies, works some days and not others.

    See http://kb.mozillazine.org/Clipboard_not_working
    Try to use the keyboard if the buttons on the web page aren't working.
    * Copy: Ctrl+C or Ctrl+Insert
    * Paste: Ctrl+V or Shift+Insert
    * Cut: Ctrl+X or Shift+Delete

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • How to integrate c# library's function to use F# type expression for function of function?

    i succeed to implement the initial prototype for function structure in c#
    but i do not know how to integrate in F#
    i make c# library's function to accept template T, for F# to pass type expression into it.
    but how to write in c# to make template like type expression, 
    in Addvaluetoeachitem
    hope make function structure depend on left or right, i got twisted in my mind when integrating into F#
    if translate c# into F# , how to write for this class?
    func1(func1(param1, param2), param2) etc
    if i define funcvalue as
    type expr =
    | And of expr * expr
    | Or of expr * expr
    expr[] funcvalues = new expr[] {And, Or, And, Or, And, Or, And}
    int[] values = new int[] { 1, 2, 3, 4, 5, 6, 7 };
    got some error when translate member value and constructor into F#
    // Learn more about F# at http://fsharp.net
    // See the 'F# Tutorial' project for more help.
    open System.Collections.Generic
    type expr =
    | And of expr * expr
    | Or of expr * expr
    | Param1
    type BinaryTree =
    let mutable value = 0
    let left : BinaryTree = null
    let right : BinaryTree = null
    let mutable dict : Dictionary<int, BinaryTree> = new Dictionary<int, BinaryTree>();
    member this.Load(tree : BinaryTree, values : int[], index : int) =
    this.value = values.[index];
    if index * 2 + 1 < values.Length then
    this.left = new BinaryTree(values, index * 2 + 1)
    if index * 2 + 2 < values.Length then
    this.right = new BinaryTree(values, index * 2 + 2)
    new() = BinaryTree(values : int[]) : this(values, 0) { }
    //public BinaryTree(int[] values) : this(values, 0) { }
    new() = BinaryTree(values : int[], index : int)
    let dict = new Dictionary<int, BinaryTree>()
    Load(this, values, index)
    member this.Visit(tree : BinaryTree) =
    dict.Add(dict.Count, tree);
    member this.ChangeToString(m : List<int>) : String =
    let result = "";
    for i in m do
    result = result + i.ToString()
    result
    member this.CopyList(queue : Queue<List<int>>) : Queue<List<int>> =
    let mutable newqueue : Queue<List<int>> = new Queue<List<int>>();
    if queue != null then
    while (queue.Count > 0) do
    let source : List<int> = queue.Dequeue()
    let destination : List<int> = new List<int>();
    for a in source do
    destination.Add(a);
    newqueue.Enqueue(destination)
    for m in newqueue do
    queue.Enqueue(m);
    newqueue
    member this.IsAscending(m : List<int>) : bool =
    let mutable result = true
    let mutable prev : int = 0
    for i in m do
    if prev > i then
    result <- false
    prev <- i
    result
    member this.Addvaluetoeachitem(queue : Queue<List<int>>, value : int, maxlimit : int, ref Dictionary<String , List<int>> allpath, Boolean IsBackUp, T func1, T param1, T param2, Dictionary<T, T> allfunctionstructure, Queue<List<T>> funcqueue, Boolean LeftOrRight) : Queue<List<int>>=
    let newqueue : Queue<List<int>> = new Queue<List<int>>()
    if queue != null then
    while queue.Count > 0 do
    List<int> path = queue.Dequeue();
    //List<T> func = funcqueue.Dequeue();
    let mutable afteradd = false
    if path.Count < maxlimit then
    path.Add(value);
    afteradd <- true
    if path.Count = maxlimit && afteradd = true && IsBackUp = false then
    if IsAscending(path) = true then
    if allpath.ContainsKey(ChangeToString(path)) = false then
    allpath.Add(ChangeToString(path), path)
    newqueue.Enqueue(path);
    if queue = null then
    let mutable path : List<int> = new List<int>();
    let mutable afteradd = false
    if path.Count < maxlimit then
    path.Add(value)
    afteradd <- true
    if path.Count == maxlimit && afteradd == true && IsBackUp = false then
    if IsAscending(path) = true then
    if allpath.ContainsKey(ChangeToString(path)) = false then
    allpath.Add(ChangeToString(path), path)
    newqueue.Enqueue(path)
    else
    if queue.Count = 0 then
    let mutable path : List<int> = new List<int>();
    let mutable afteradd = false
    if path.Count < maxlimit then
    path.Add(value)
    afteradd <- true
    if path.Count = maxlimit && afteradd = true && IsBackUp = false then
    if IsAscending(path) == true then
    if allpath.ContainsKey(ChangeToString(path)) = false then
    allpath.Add(ChangeToString(path), path)
    newqueue.Enqueue(path)
    newqueue
    member this.Deepfirst(tree : BinaryTree, ref queuepath : Queue<List<int>>, backpath : Queue<List<int>>, maxlimit : int, ref allpath : Dictionary<String, List<int>>, func1 : expr, param1 : expr, param2 : expr, allfunctionstructure : Dictionary<expr, expr>, ref queuefunc : Queue<List<expr>>, LeftOrRight : bool) : Queue<List<int>>=
    queuepath = Addvaluetoeachitem(queuepath, tree.value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, LeftOrRight);
    //path.Add(tree.value);
    Queue<List<int>> newpath = new Queue<List<int>>();
    newpath = CopyList(queuepath);
    Queue<List<int>> newpath2 = new Queue<List<int>>();
    newpath2 = CopyList(queuepath);
    backpath = Addvaluetoeachitem(backpath, tree.value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, LeftOrRight);
    //Queue<List<int>> backpathx = new Queue<List<int>>();
    Queue<List<int>> backpathx = backpath;//Addvaluetoeachitem(backpathx, tree.value, maxlimit, ref allpath, false);
    Queue<List<int>> newpathx = new Queue<List<int>>();
    newpathx = CopyList(queuepath);
    Queue<List<int>> backpath1 = backpathx;
    if tree.left != null then
    newpathx = Deepfirst(tree.left, ref newpath, newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, false) // Left
    if tree.value = 1 then
    Console.WriteLine("")
    Visit(tree)
    for m in queuepath do
    newpath2.Enqueue(m)
    let mutable backpath2 : Queue<List<int>> = newpathx
    if tree.right != null then
    newpathx = Deepfirst(tree.right, ref newpath2, newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, true) // Right
    if tree.value = 1 then
    Console.WriteLine("")
    if newpathx != null then
    return newpathx
    if backpath2 != null then
    return backpath2
    if backpath1 != null then
    return backpath1
    if backpath != null then
    return backpath
    else
    return backpath
    [<EntryPoint>]
    let main argv =
    printfn "%A" argv
    0 // return an integer exit code
    BinaryTree<int> b = new BinaryTree<int>(values);
    Queue<List<int>> queuepath = new Queue<List<int>>();
    Queue<List<int>> backpath = null;
    Queue<List<int>> queuefunc = new Queue<List<int>>();
    Dictionary<String, List<int>> allpath = new Dictionary<String, List<int>>();
    Dictionary<int, int> allfunctionstructure = new Dictionary<int, int>();
    int a3 = 0;
    int b3 = 0;
    int c3 = 0;
    queuepath = b.Deepfirst(b, ref queuepath, backpath, 3, ref allpath, a3, b3, c3, allfunctionstructure, ref queuefunc, false);
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace testTable
    public class BinaryTree<T>
    public int value;
    BinaryTree<T> left;
    BinaryTree<T> right;
    public Dictionary<int, BinaryTree<T>> dict;
    public BinaryTree(int[] values) : this(values, 0) { }
    BinaryTree(int[] values, int index)
    dict = new Dictionary<int, BinaryTree<T>>();
    Load(this, values, index);
    public void Visit(BinaryTree<T> tree)
    dict.Add(dict.Count, tree);
    public String ChangeToString(List<int> m)
    String result = "";
    foreach (int i in m)
    result = result + i.ToString();
    return result;
    public Queue<List<int>> CopyList(Queue<List<int>> queue)
    Queue<List<int>> newqueue = new Queue<List<int>>();
    if (queue != null)
    while (queue.Count > 0)
    List<int> source = queue.Dequeue();
    List<int> destination = new List<int>();
    foreach (int a in source)
    destination.Add(a);
    newqueue.Enqueue(destination);
    foreach (List<int> m in newqueue)
    queue.Enqueue(m);
    return newqueue;
    public Boolean IsAscending(List<int> m)
    Boolean result = true;
    int prev = 0;
    foreach (int i in m)
    if (prev > i)
    result = false;
    prev = i;
    return result;
    public Queue<List<int>> Addvaluetoeachitem<T>(Queue<List<int>> queue, int value, int maxlimit, ref Dictionary<String , List<int>> allpath, Boolean IsBackUp, T func1, T param1, T param2, Dictionary<T, T> allfunctionstructure, Queue<List<T>> funcqueue, Boolean LeftOrRight)
    Queue<List<int>> newqueue = new Queue<List<int>>();
    if (queue != null)
    while (queue.Count > 0)
    List<int> path = queue.Dequeue();
    //List<T> func = funcqueue.Dequeue();
    Boolean afteradd = false;
    if (path.Count < maxlimit)
    path.Add(value);
    afteradd = true;
    if (path.Count == maxlimit && afteradd == true && IsBackUp == false)
    if( IsAscending(path) == true)
    if(allpath.ContainsKey(ChangeToString(path)) == false)
    allpath.Add(ChangeToString(path), path);
    newqueue.Enqueue(path);
    if (queue == null)
    List<int> path = new List<int>();
    Boolean afteradd = false;
    if (path.Count < maxlimit)
    path.Add(value);
    afteradd = true;
    if (path.Count == maxlimit && afteradd == true && IsBackUp == false)
    if (IsAscending(path) == true)
    if (allpath.ContainsKey(ChangeToString(path)) == false)
    allpath.Add(ChangeToString(path), path);
    newqueue.Enqueue(path);
    else
    if (queue.Count == 0)
    List<int> path = new List<int>();
    Boolean afteradd = false;
    if (path.Count < maxlimit)
    path.Add(value);
    afteradd = true;
    if (path.Count == maxlimit && afteradd == true && IsBackUp == false)
    if (IsAscending(path) == true)
    if (allpath.ContainsKey(ChangeToString(path)) == false)
    allpath.Add(ChangeToString(path), path);
    newqueue.Enqueue(path);
    return newqueue;
    public Queue<List<int>> Deepfirst(BinaryTree<T> tree, ref Queue<List<int>> queuepath, Queue<List<int>> backpath, int maxlimit, ref Dictionary<String, List<int>> allpath, T func1, T param1, T param2, Dictionary<T, T> allfunctionstructure, ref Queue<List<T>> queuefunc, Boolean LeftOrRight)
    //if (path.Count < maxlimit)
    queuepath = Addvaluetoeachitem(queuepath, tree.value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, LeftOrRight);
    //path.Add(tree.value);
    Queue<List<int>> newpath = new Queue<List<int>>();
    newpath = CopyList(queuepath);
    Queue<List<int>> newpath2 = new Queue<List<int>>();
    newpath2 = CopyList(queuepath);
    backpath = Addvaluetoeachitem(backpath, tree.value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, LeftOrRight);
    //Queue<List<int>> backpathx = new Queue<List<int>>();
    Queue<List<int>> backpathx = backpath;//Addvaluetoeachitem(backpathx, tree.value, maxlimit, ref allpath, false);
    Queue<List<int>> newpathx = new Queue<List<int>>();
    newpathx = CopyList(queuepath);
    Queue<List<int>> backpath1 = backpathx;
    if (tree.left != null)
    newpathx = Deepfirst(tree.left, ref newpath, newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, false); // Left
    if (tree.value == 1)
    Console.WriteLine("");
    Visit(tree);
    if (backpath1 != null)
    Boolean afteradd = false;
    if (backpath1.Count < maxlimit)
    backpath1.Add(tree.value);
    afteradd = true;
    if (backpath1.Count == maxlimit && afteradd == true)
    allpath.Add(backpath1);
    foreach (List<int> m in queuepath)
    newpath2.Enqueue(m);
    Queue<List<int>> backpath2 = newpathx;
    if (tree.right != null)
    newpathx = Deepfirst(tree.right, ref newpath2, newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, true); // Right
    if (tree.value == 1)
    Console.WriteLine("");
    //Queue<List<int>> newpath3 = new Queue<List<int>>();
    //newpath3 = CopyList(queuepath); // 2 -> 1 -> 3 1(2,3) difficult case
    //return newpath3;
    if (newpathx != null)
    return newpathx;
    if(backpath2 != null)
    return backpath2;
    if (backpath1 != null)
    return backpath1;
    if (backpath != null)
    return backpath;
    else
    return backpath;
    public void Load(BinaryTree<T> tree, int[] values, int index)
    this.value = values[index];
    if (index * 2 + 1 < values.Length)
    this.left = new BinaryTree<T>(values, index * 2 + 1);
    if (index * 2 + 2 < values.Length)
    this.right = new BinaryTree<T>(values, index * 2 + 2);
    computing nightmare

    This builds, and fixes the most egregious style issues
    open System
    open System.Collections.Generic
    type expr =
    | And of expr * expr
    | Or of expr * expr
    | Param1
    [<AllowNullLiteral>]
    type BinaryTree(values : int[], index : int) =
    let value = values.[index]
    let left = if index * 2 + 1 < values.Length then
    BinaryTree(values, index * 2 + 1)
    else null
    let right = if index * 2 + 2 < values.Length then
    BinaryTree(values, index * 2 + 2)
    else null
    let dict : Dictionary<int, BinaryTree> = new Dictionary<int, BinaryTree>();
    new(values : int[]) = BinaryTree(values, 0)
    member this.Value with get() = value
    member this.Left with get() = left
    member this.Right with get() = right
    member this.Visit(tree : BinaryTree) =
    dict.Add(dict.Count, tree);
    static member ChangeToString(m : List<int>) : String =
    String.Join(String.Empty, m)
    static member CopyList(queue : Queue<List<int>>) : Queue<List<int>> =
    let newqueue = Queue<List<int>>();
    if queue <> null then
    while (queue.Count > 0) do
    let source : List<int> = queue.Dequeue()
    let destination : List<int> = new List<int>();
    for a in source do
    destination.Add(a);
    newqueue.Enqueue(destination)
    for m in newqueue do
    queue.Enqueue(m);
    newqueue
    static member IsAscending(m : List<int>) : bool =
    m
    |> Seq.pairwise
    |> Seq.forall (fun (x,y) -> y > x)
    static member Addvaluetoeachitem(
    queue : Queue<List<int>>,
    value : int,
    maxlimit : int,
    allpath : Dictionary<String , List<int>> byref,
    isBackUp : Boolean,
    func1 : 'T,
    param1 : 'T,
    param2 : 'T,
    allfunctionstructure : Dictionary<'T, 'T>,
    funcqueue : Queue<List<'T>>,
    leftOrRight : Boolean) : Queue<List<int>>=
    let newqueue : Queue<List<int>> = new Queue<List<int>>()
    if queue <> null then
    while queue.Count > 0 do
    let path = queue.Dequeue();
    let afteradd = path.Count < maxlimit
    if afteradd then
    path.Add(value)
    if path.Count = maxlimit && afteradd && (not isBackUp) then
    if BinaryTree.IsAscending(path) then
    if allpath.ContainsKey(BinaryTree.ChangeToString(path)) = false then
    allpath.Add(BinaryTree.ChangeToString(path), path)
    newqueue.Enqueue(path);
    if (queue = null) || (queue.Count = 0) then
    let path = List<int>();
    let afteradd = path.Count < maxlimit
    if afteradd then
    path.Add(value)
    if path.Count = maxlimit && afteradd && (not isBackUp) then
    if BinaryTree.IsAscending(path) then
    if not <| allpath.ContainsKey(BinaryTree.ChangeToString(path)) then
    allpath.Add(BinaryTree.ChangeToString(path), path)
    newqueue.Enqueue(path)
    newqueue
    member this.Deepfirst(tree : BinaryTree,
    queuepath : Queue<List<int>> byref,
    backpath : Queue<List<int>> byref,
    maxlimit : int,
    allpath : Dictionary<String, List<int>> byref,
    func1 : expr, param1 : expr, param2 : expr,
    allfunctionstructure : Dictionary<expr, expr>,
    queuefunc : Queue<List<expr>> byref,
    leftOrRight : bool) : Queue<List<int>>=
    queuepath <- BinaryTree.Addvaluetoeachitem(queuepath, tree.Value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, leftOrRight);
    let newpath = BinaryTree.CopyList(queuepath);
    let newpath2 = BinaryTree.CopyList(queuepath);
    backpath <- BinaryTree.Addvaluetoeachitem(backpath, tree.Value, maxlimit, ref allpath, false, func1, param1, param2, allfunctionstructure, queuefunc, leftOrRight);
    let backpathx = backpath;
    let mutable newpathx = BinaryTree.CopyList(queuepath);
    let backpath1 = backpathx;
    if tree.Left <> null then
    newpathx <- this.Deepfirst(tree.Left, ref newpath, ref newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, false) // Left
    if tree.Value = 1 then
    Console.WriteLine("")
    this.Visit(tree)
    for m in queuepath do
    newpath2.Enqueue(m)
    let backpath2 = newpathx
    if tree.Right <> null then
    newpathx <- this.Deepfirst(tree.Right, ref newpath2, ref newpathx, maxlimit, ref allpath, func1, param1, param2, allfunctionstructure, ref queuefunc, true) // Right
    if tree.Value = 1 then
    Console.WriteLine("")
    if newpathx <> null then
    newpathx
    else if backpath2 <> null then
    backpath2
    else if backpath1 <> null then
    backpath1
    else backpath

  • I am on a plan with a basic phone that is breaking. I was given a smartphone that belonged to a relative that is now deceased, (they used the phone since they have passed it is deactivated.) how can I switch my phone over and is there anyway to avoid a da

    I am on a plan with a basic phone that is breaking. I was given a smartphone that belonged to a relative that is now deceased, (they used the phone since they have passed it is deactivated.) how can I switch my phone over and is there anyway to avoid a data package/plan?

    What is your current plan?  In some cases it can be cheaper to move to a More Everything plan with an out of contract line. With More Everything, you will get a $15 per month reduction in line fee with a minimal data. 

  • How do I stop a tool from functioning on my work after I finish using it?

    How do I stop a tool from functioning on my work after I finish using it?

    Switch to another tool?
    I really don't know what you mean by "stop functioning". The Zoom tool will always work when selected.
    Is there a specific example you have in mind?  Give us the exact version of Photoshop you are using, and the version of Mac OSX or Windows.
    A screenshot outlining your problem is best.
    Gene

  • Need an example how to use SCAN_Start with a callback function

    I would appreciate if someone helps me with a working example of how to use SCAN_Start with a callback function. I need just a basic functionality: to specify a channel list (with gains probably), to start a data acquisition task and to receive data buffers utilizing a callback function. t this time whatever I was trying to do caused computer hangups, though it is supposed to be one of the most regular tasks to perform.
    Thank you in advance,
    Mike

    Hello Mike,
    Thank you for contacting National Instruments.
    Attached is an example project which uses a callback function to begin analog acquisition (AI) by calling SCAN_Start. This project acquires from the first 2 channels on your DAQ device. Make sure to modify the device number in the code to match the number of your card.
    Let me know if you have any further questions...
    Sincerely,
    Sean C.
    Applcications Engineer
    National Instruments
    Attachments:
    Acquire_multichannel_61xx.zip ‏11 KB

  • How to find how much memory used by particular procedure or function.

    Hi,
    How can we find out memory used by particular procedure or function?
    If procedure or function is called many times in particular interver, wil it be cached in memory?
    and how will it affect performance?
    what type of pl/sql statement will take more time than normal sql statement?

    Hi
    There are several different memory issues to consider:
    - the code itself (stored in the shared pool)
    - simple variables defined in the code
    - complex variables (eg VARRAY, TABLE etc)
    There's a helpful note on PL/SQL profiling here - http://www.oratechinfo.co.uk/tuning.html - which mentions how to measure memory use (session PGA and UGA - that's program and user global areas)
    You can find out more about shared pool memory structures here - http://download-east.oracle.com/oowsf2005/003wp.pdf.
    Calling a function many times - yes, the function code will be cached (if possible). Session state (for a package) will also be retained (ie global package variables).
    If many users call the same function, there will be one copy of the code but many copies of the private state.
    Finally: PL/SQL statements that can take a long time include:
    - anything that does heavy processing inside a tight loop;
    - anything that waits (select for update; read from a pipe or dequeue from AQ etc)
    Probably the most common mistake is to use PL/SQL for relational processing that can be done from SQL itself (eg writing nested PL/SQL loops to join data that could have been queried in a single SQL statement. Try to minimise context switches between PL/SQL and SQL:
    - use bulk collect where possible
    - use set operations in SQL
    Good luck, HTH
    Regards Nigel

Maybe you are looking for

  • BPC 7.5NW Drill-through to FIM

    Hi all, I upload data to BPC 7.5 NW SP06 through FIM. I tried to set up the Drill-through functionality of BPC so as to see the analysis of the trial balance uploaded in FIM, but with no success. The How-to-paper for drill-through functionality for N

  • Can i transfer youtube music i have downloaded on my iphone  to my ipod? or computer?

    Can i transer youtube music from my iphone to my ipod or my computer ? And how do i do it Thank You

  • How can detect the serial port is active

    I made a program. It can read datas via serial port. But the datas wont came all the time, so the other part of the program not need to run. I want to put before the "reading serial port" a detection about the serial port is get a data. So the readin

  • Inconsistent information listed

    When I go into Network Discovery | Device List | All Types | List All or Window types it will show a list with IP addresses. Not much information shown on this page, ie: no User, Name or Product = Unknown. Except for the ZAM server it will show the U

  • Where is link between 0007 and 0008 infotype

    Dear Members, Where is link between 0007 and 0008 infotype.How the system automatically populating WORK HOURS/PERIOD AND CAPACITY UTIL .LEVEL.where is integration . Regards Nandhini