Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.


Sign Up

Articles related to "type"


International Conference on Functional Programming (ICFP) 2020 – Research Papers

  • PACMPL (ICFP) seeks contributions on the design, implementations, principles, and uses of functional programming, covering the entire spectrum of work, from practice to theory, including its peripheries.
  • Authors of papers published in this issue of PACMPL will present their work at ICFP in Jersey City, providing an opportunity for researchers and developers to hear about the latest work in functional programming.
  • PACMPL issue ICFP 2020 also welcomes submissions in two separate categories — Functional Pearls and Experience Reports — that must be marked as such when submitted and that need not report original research results.
  • Authors of conditionally accepted papers will be provided with committee reviews (just as in previous conferences) along with a set of mandatory revisions.
  • The second and final reviewing phase assesses whether the mandatory revisions have been addressed adequately by the authors and thereby determines the final accept/reject status of the paper.

save | comments | report | share on


Syntax changes from C++11 to C++20

  • In C++14 the “high level” syntax hasn’t changed much, but the capture clause allows you perform “capture with initialiser”, and the parameter list can take auto arguments (it means generic lambdas).
  • Additionally, the return type of a lambda expression follows the rules of a regular function return type deduction (auto), so in short, compilers are smarter now.
  • And another significant change is a generic lambda which supports auto as an argument.
  • Since C++17 you can now use constexpr as an additional specifier for the lambda.
  • Another thing to have in mind is that in C++17 the dynamic exception specification is removed so in practice you can only use noexcept to mark functions and lambdas.
  • Since C++20 you can now use consteval as an additional specifier for the lambda, and what’s more, you can specify a template tail!

save | comments | report | share on


Making Advanced GUI Applications with Godot

  • So I can e.g. use the arrow keys to move to a container or panel I wish to add a GUI component to.
  • Then I can hit Cmd+A (on Mac) to open up a dialog to select a GUI component.
  • In Godot accidentally selecting a child component is not a problem.
  • Godot uses a dynamic language with Python syntax called GDScript which was specifically tailored to integrate with the editor.
  • Think about it if somebody wants to look at some GUI you are working on, you can send them the Godot project files and they are a 31 MB download away from looking at it.
  • Sure you can copy paste a collection of GUI components in Qt Creator, but if you decide you want to make a modification you are screwed.
  • In Godot in contrast you can use a collection of GUI components you made as a template.

save | comments | report | share on


UFCS for C++ in Clang

  • However, static extension methods come into their own when viewed as generic approaches to extending already existing classes that cannot be modified.
  • Whilst not strictly the “most pure” decision, I think that it’s sensible to allow users to specify which functions they intend to be used in overload resolution.
  • It also allows UFCS to be backward compatible with existing code, means that I think this is the most sensible approach to take.
  • It should be noted that the choice of OR2 is in contrast with C#’s extension methods, where, in the case of ambiguity between a UFCS candidate and a member function, the member function is always chosen (i.e., C# uses OR2+).
  • Instead, I think creating a new function declaration type derived from FunctionDecl is probably a better approach.

save | comments | report | share on


Property-based Testing with Python

  • For example, if you unit test a function which receives an integer, you might think about testing 0, 1, and 2.
  • The property testing framework hypothesis offers a lot of strategies for many types.
  • We need to base our test on an inherent property of the function.
  • Sometimes it is easy to generate a sample to test the function you’re interested in.
  • If you have a complex algorithmic problem, you might first want to implement a brute-force solution and then test your faster algorithm against that easier to understand solution.
  • Example-based testing is good to cover known corner-cases, wheres property-based testing is good to discover unknown corner-cases.
  • It takes more time to execute property-based tests than to execute example-based tests.
  • hypothesis is a good Python framework to write property-based tests.

save | comments | report | share on


Property-based Testing with Python

  • For example, if you unit test a function which receives an integer, you might think about testing 0, 1, and 2.
  • The property testing framework hypothesis offers a lot of strategies for many types.
  • We need to base our test on an inherent property of the function.
  • Sometimes it is easy to generate a sample to test the function you’re interested in.
  • If you have a complex algorithmic problem, you might first want to implement a brute-force solution and then test your faster algorithm against that easier to understand solution.
  • Example-based testing is good to cover known corner-cases, wheres property-based testing is good to discover unknown corner-cases.
  • It takes more time to execute property-based tests than to execute example-based tests.
  • hypothesis is a good Python framework to write property-based tests.

save | comments | report | share on


Property-based Testing with Python

  • For example, if you unit test a function which receives an integer, you might think about testing 0, 1, and 2.
  • The property testing framework hypothesis offers a lot of strategies for many types.
  • We need to base our test on an inherent property of the function.
  • Sometimes it is easy to generate a sample to test the function you’re interested in.
  • If you have a complex algorithmic problem, you might first want to implement a brute-force solution and then test your faster algorithm against that easier to understand solution.
  • Example-based testing is good to cover known corner-cases, wheres property-based testing is good to discover unknown corner-cases.
  • It takes more time to execute property-based tests than to execute example-based tests.
  • hypothesis is a good Python framework to write property-based tests.

save | comments | report | share on


nasa/VICAR

  • VICAR, which stands for Video Image Communication And Retrieval, is a general purpose image processing software system that has been developed since 1966 to digitally process multi-dimensional imaging data.
  • For a full list of programs being released click here.
  • We have set up a VICAR Open Source Google group, where you can find notifications of new releases, bug reports, and general discussion.
  • The VICAR source code can be obtained via github.com using the links below.
  • In addition to the VICAR source code an externals package containing 3rd party software is required.
  • Note that for externals you'll find a tarball that contains all the platforms, as well as separate ones for each platform.
  • Externals are 3rd party packages that are required to run VICAR.
  • See section 2 of the Building VICAR document for more information.
  • Pre-built VICAR binaries are available at https://github.com/nasa/VICAR/releases.

save | comments | report | share on


The Semver Trick

  • The semver trick refers to publishing a breaking change to a Rust library without requiring a coordinated upgrade across its downstream dependency graph.
  • By way of example, consider a simplified version of the libc crate that exposes only two things: the c_void type and the EVFILT_AIO constant from NetBSD.
  • Existing code that passes libc::EVFILT_AIO to a function accepting an argument of type int32_t would be broken, and this needs to be reflected in the semver version of the libc crate.
  • What needs to happen is first B upgrades to libc 0.3, releases this as a major version bump of B (because its public API has changed in a breaking way), and then A may upgrade to the new version of B.
  • Fundamentally the semver trick is beneficial when a crate needs to break a rarely used API while leaving widely used APIs unchanged, or when a crate wants to shuffle types around in its module hierarchy.

save | comments | report | share on


A Comprehensive Tutorial to Rust Operators for Beginners

  • Rust uses the two’s complement to find the bitwise negation for signed types.
  • We are going to use this XOR to solve the LeetCoder problem called Single number.
  • Using a for loop, we iterate the input array, nums using XOR compound assignment, ans ^= n.
  • Line 6–10: We create a method single_number in impl Solution.
  • In this problem, you input a non-negative integer num and return the number of steps to reduce it to zero.
  • While self.num is greater than 0, we use the compound assignment /=2 if self.num 's remainder is 0, otherwise, we subtract 1, and increase the number of step by 1.
  • We learned arithmetic, comparison, logical, bitwise, and compound assignment operators in Rust.
  • We also learned operator overloading, the difference between associated function and methods, how to use operators in Rust by converting simple Python codes to Rust.

save | comments | report | share on