Wikifunctions:Status updates/2024-04-03

From Wikifunctions
Wikifunctions Status updates Translate

<translate> Abstract Wikipedia via mailing list</translate> <translate> Abstract Wikipedia on IRC</translate> <translate> Wikifunctions on Telegram</translate> <translate> Wikifunctions on Mastodon</translate> <translate> Wikifunctions on Twitter</translate> <translate> Wikifunctions on Facebook</translate> <translate> Wikifunctions on YouTube</translate> <translate> Wikifunctions website</translate> Translate

Product Update on Diff and Upcoming API Improvements

Last week, we shared a blog post on Wikimedia’s Diff site, shedding light on the current status of Wikifunctions and our upcoming plans, including various opportunities for our community to participate. It also highlights creative and interesting ways the community has engaged with the expansion of types since the platform's launch.

The post shares our excitement to see contributions to Wikifunctions becoming increasingly robust and better aligned with natural language processing goals. It celebrates the community’s crucial role in taking over the administration of our newly created user role of ‘Functioneers’, which involves overseeing the creation of more advanced artifacts and monitoring server load during the platform's early stages. The article also outlines planned progress towards integrating with Wikidata, alongside our initial endeavors towards integration with Wikipedia. Read on Diff.

Recent Changes in the software

We've landed changes towards a new API designed to be a public entrypoint for making Wikifunctions calls (T360359). The new API will be a bit simpler and better-designed than our internal one, such as using HTTP response codes for most error states, and not wrapping the contents in an abstraction (T349967). As a public API, we intend to maintain the API without any breaking changes over time, so tools and gadgets can use it with some confidence. We plan to announce it next week.

We've made a couple of improvements to the "About" dialog when editing labels and other fields. We've changed the input for writing short descriptions to be a "text-area", which wraps over lines, rather than a single-line input, to make it easier to edit (T359158). When you edit page titles, we'll now update the page title as you edit, rather than wait for you to publish your changes (T358209). We fixed the dialog to always load the input values, without waiting for you to select a language first (T355084).

String values now won't collapse their whitespace, so e.g. a Test case showing that a string with two spaces is different from a single space can be understood (T343608). To stop very long user content breaking the page, we now tell the browser to word-wrap it wherever it can, even if there's no natural break-point (T359906). We've tweaked the global language selector at the top of the page to focus the control when you open in, to make things smoother (T343202).

We fixed a bug that meant that language filtering in both the internal and public APIs was broken, which had the same root cause (T351961 and T361213). If you change the target Function of a Test case, we now reset the suggested validator if the new target's return Type doesn't have an equality function (T361127). We fixed the renderer calls to not run on blank values and so show "Display function returned an unknown error" when you visit them (T360791). The special pages to create or run Functions now won't show if you're blocked, instead of waiting until you tried to submit to tell you that you couldn't use them (T342860).

We audited a number of linter warnings from our front-end code, finding a few minor bugs and documentation issues. As part of this, we noticed that when showing multiple errors we would show each one more than once; this is now fixed.

All Wikimedia-deployed code is using the latest version of the Codex UX library, v1.3.6, as of this week. Though we do not believe the library upgrade will have any user-visible changes in our use on Wikifunctions, please comment on the Project chat or file a Phabricator task if you spot an issue. We have worked with the Metrics Platform team to re-build our user interaction metrics using a new back-end system of theirs, ahead of decommissioning our use of their old system (T350497).

Function of the Week

bitwise or (Z13652) is a fundamental operation in computer programming that operates on individual bits of binary numbers. Since we have discussed logical OR and NOR operations in the past updates, I felt this can be a natural next step. Bitwise OR combines the corresponding bits of two numbers, applies the logical OR to them, and produces a new resultant number. The bitwise OR operation is commutative and associative, meaning that the order of operands does not affect the result, and grouping of operands does not affect the outcome.

Truth table for bitwise OR operation

Truth Table: The bitwise OR operation takes two bits as inputs and outputs a single bit. The truth table for the bitwise OR operation depicts that the result in each position is 0 if both bits are 0, while otherwise the result is 1.

Application to Binary Numbers: When performing a bitwise OR operation on two binary numbers, each bit in the result is determined by applying the OR operation to the corresponding bits in the input numbers.

Bitwise OR operation on binary numbers

In this example we have applied bitwise as:

  • 1 OR 1 = 1
  • 0 OR 1 = 1
  • 1 OR 0 = 1
  • 0 OR 0 = 0

...and so on for each bit position.

Usage: Bitwise OR is commonly used in various programming tasks:

  • Flags and Options: Each bit in a field corresponds to a specific flag or option, and bitwise OR is used to set or toggle these flags.
  • Network Protocols: In networking protocols, bitwise OR is used for defining and manipulating packet headers.
  • Graphics and Image Processing: Bitwise OR is used in graphics and image processing for operations like blending and compositing.
  • Bit Manipulation Algorithms: Bitwise OR is a fundamental operation in various bit manipulation algorithms, such as those used for finding unique elements in arrays, generating permutations, or solving combinatorial problems.
  • Low-Level System Programming: In low-level system programming, bitwise OR is used for interacting with hardware registers, configuring device settings, and implementing efficient data structures and algorithms.
  • Masking and filtering, error detection using parity bits, graphics, image processing and many other tasks.

On bitwise or (Z13652), we currently have one implementation in Python. This uses the Python syntax of bitwise OR ‘|’ as a direct implementation.

The function has one test: 123|456=507 (Z13658). The test takes two natural numbers and validates the resultant natural number using equality of natural numbers. Internally the numbers get converted to their binary base 2 equivalents and then the functions ‘|’ syntax applies the bitwise OR on them, producing the result ‘507’ in binary base 2. This is represented by the base 10 result seen by us.

Since this function has only one implementation and one test so far, there’s an opportunity to expand and diversify it! We’re looking forward to seeing what the community dreams up.

You can also read on bitwise OR on English Wikipedia.