Snippets created by Johann Deneux

  • Incremental auto-completion

    Returns subsets of strings which match a specified prefix. The prefix is built incrementally by repeatedly calling a search function.

    1 people like this
    Posted: 11 months ago by Johann Deneux

  • Repeat until

    Repeatedly call a function until it returns a positive result. Implemented using sequences.

    2 people like this
    Posted: 10 months ago by Johann Deneux

  • Circular queue

    A circular queue implemented over an array.

    3 people like this
    Posted: 8 months ago by Johann Deneux

  • Copy-set an array

    Copy an array into a new one, changing the value at index 42 to 123. Uses "function" and pattern patching.

    0 people like this
    Posted: 6 months ago by Johann Deneux

  • XNA's Vector3 with units of measure

    A vector type with units of measure built on top of XNA's Vector3. Not complete, the point is mainly to show how to use generic units of measure to adapt an existing type.

    7 people like this
    Posted: 4 months ago by Johann Deneux

  • Using units of measure for safe array access

    A typical problem when working with arrays and indices is that it's easy to access an array with the wrong index. Units of measure in F# can be applied to integers, which makes it possible to abuse them to prevent this kind of error.

    6 people like this
    Posted: 4 months ago by Johann Deneux

  • Auto-completion in any winforms text box

    The standard windows.forms text box supports auto-completion, but only for single-line text boxes. The code below can be used to add auto-completion against a fixed set of words to any text box that inherits from TextBoxBase.

    3 people like this
    Posted: 3 months ago by Johann Deneux