Code Monkey home page Code Monkey logo

structures's Introduction

> bitmask:new(10).
{bitmask,<<0,0:2>>,1,10}
> B1 = bitmask:new(10).
{bitmask,<<0,0:2>>,1,10}
> bitmask:append_list([1,2,3], B1).
{bitmask,<<224,0:2>>,1,10}
> B2 = bitmask:append_list([1,2,3], B1).
{bitmask,<<224,0:2>>,1,10}
> B3 = bitmask:append_list([3,6,8], B1).
{bitmask,<<37,0:2>>,1,10}
> bitmask:to_list(bitmask:union(B3, B2)).
[1,2,3,6,8]
> bitmask:to_list(bitmask:intersection(B3, B2)). 
[3]


> S2 = ordsets:from_list([1,2,3]).
[1,2,3]
> S3 = ordsets:from_list([3,6,8]).
[3,6,8]
> ordsets:intersection(S2, S3).
[3]
> ordsets:union(S2, S3).       
[1,2,3,6,8]

> ST = ordsets:from_list("test me now!").
" !emnostw"

> ordsets:intersection(lists:seq($a, $z), ST).
"emnostw"

> F = fun(X, Acc) -> 
    case ux_char:is_letter(X) of 
        true -> Acc+1; 
        false -> Acc 
    end 
end.
> ordsets:fold(F, 0, ordsets:from_list("test ми")).
5

structures's People

Contributors

arcusfelis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.