plugins – FacetWP – change number range “Min” and “Max” labels independently

I have a slight problem for renaming facets individually
as said here on this page,
this code rename all the min and max for all facets range number.

<?php

// Add to your (child) theme's functions.php

add_filter( 'gettext', function( $translated_text, $text, $domain ) {
    if ( 'fwp-front' == $domain ) {
        if ( 'Min' == $translated_text ) {
            $translated_text = 'Min (translated)';
        }
        elseif ( 'Max' == $translated_text ) {
            $translated_text = 'Max (translated)';
        }
    }
    return $translated_text;
}, 10, 3 );

I have a facet price and another area.

I would like to rename their placeholders independently.

if somebody understands the code which line I must add to allow me this modification?

thank you for your patience

plotting – Overlaying 2d plots of regions with different colors and labels

I’m using the command Show to overlay the following three regions:


r1 = RegionPlot( 5/2 y + 3 x <= 3 && y < 2/3 && 5/2 y + x <= 2, {x, 0, 1}, {y, 0, 1})

r2 = RegionPlot( y < 13/12 - 13/12 x && y < 13/24 , {x, 0, 1}, {y, 0, 1})

r3 = RegionPlot(y <= 1 - x && y < 2/3 , {x, 0, 1}, {y, 0, 1})

Show(r1, r2, r3)


The problem is that I can’t label them in the final picture and I’d like to change the colors as well to distinguish them more clearly. If possible, I’d like to plot some special points on this picture (like a few of the corners). Is there a “simple” way of doing that?

I’d appreciate any input that you may have. Thanks!

Color swatches versus color labels on Product Listings

Would love to follow-up on Nash’s answer with some W3C official suggestions if that helps!

According to the Web Content Accessibility Guidelines (WCAG 2.2) Success Criterion 1.4.1 Use of Color “Color (should not be) used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.”

This means that (as other users have responded) color by sight shouldn’t be the ONLY distinguishing information conveyed for a user to make a choice, having adjective words written out as an alternative would pass this criteria. This is to account not only for users with blindness or varying color-blindness, but maybe even users with no vision impairments and are using a tiny phone screen or poorly color-calibrated display (or everything is just super orange because I’m using a nighttime-display color shift!).

That said, this isn’t an argument to hide colors completely, this just means that word descriptions are way more valuable than a color blob, might as well have both!

I say this a ton to fellow designers: learning great accessibility means you’re learning to make great designs regardless of how “uncool” documentation sounds. 😀

coding style – Unindenting labels by half of indent (alt. title: Indentation as representation of scope rather than control flow)

Some people prefer to unindent labels by 2 spaces to show that full (4-spaced) indentation level represents the new scope, while half-level (2-spaced) represents the same scope:

https://stackoverflow.com/a/4300065

Examples:

1st way: indent = 4 space; labels are unindented by 2.

class X
{
  public:
    int member_function()
    {
        switch (expression)
        {
          case X:
            return 6;

          default:
            int n = get_value() / 6;
            return n * n;
        }
    }

  private:
    int member_variable_;
};

2nd way: indent = 4 spaces. 4 or 2 – doesn’t matter. What does matter is that indent doesn’t change.

class X
{
    public:
        int member_function()
        {
            switch (expression)
            {
                case X:
                    return 6;

                default:
                    int n = get_value() / 6;
                    return n * n;
            }
        }

    private:
        int member_variable_;
};

3rd way: labels are unindented to the same level as the block they are in.

// indent = 4 spaces.
// 4 or 2 - doesn't matter. What does matter is that indent doesn't change.
class X
{
public:
    int member_function()
    {
        switch (expression)
        {
        case X:
            return 6;

        default:
            int n = get_value() / 6;
            return n * n;
        }
    }

private:
    int member_variable_;
};

In other words, indentation is treated as representation of scoping, not control flow.

Is this approach really logical? If “yes”, why so few people and code styles follow it?

tagging – Transfer Lightroom Classic colour labels to Mac Finder

I have photos in Lightroom Classic on a Mac some of which I have assigned some colour label attributes.

How can I transfer these colour labels for the select photos to their location in Finder? This will then allow me to easily select photos when sharing them through something like WeTransfer or Whatsapp.

I have tried exporting these photos but that just copies them and wastes a lot of time. The one semi-solution I have is deleting (removing from disk) the selected photos from within Lightroom, assigning colour tags to them in Bin and then putting this all back into the original folder. The problem with this is that the photos are now gone from Lightroom and when I import them again, all attributes they might have had are gone. This therefore doesn’t work for larger photo selections and photos with multiple attributes (such as colour and star rating).

plotting – How to add contour labels for contour lines?

How can I add contour labels to contour lines? The usual ContourLabels->Automatic doesn’t seem to be working when the input is given in the third form of ContourPlot.

labelFontSize = 24;
ticksFontSize = 16;
lineThickness = 2;

contourPlotToF = ContourPlot[
tArrival - tDeparture == Table[Δt, {Δt, 0, 70, 7}],
{tDeparture, 30, 60}, {tArrival, 30, 60},
ImageSize -> Full,
FrameLabel -> {Row[{"Departure time/", Quantity[None, "Days"]}], 
Row[{"Arrival time/", Quantity[None, "Days"]}]},
FrameTicksStyle -> Directive[FontSize -> ticksFontSize],
LabelStyle -> {FontSize -> labelFontSize},
ContourLabels -> Automatic,
ContourStyle -> {Directive[
  ColorData[97, "ColorList"][[4]],
  AbsoluteThickness[lineThickness]]},
GridLines -> Automatic
]

Across different web technologies, do “Components” and “Modules” represent equivalent concepts, despite using different labels?

I’m trying to get my head around the underlying / implied significance of two terms used in Web Development:

I am aware that:

  • Node.js uses CommonJS Modules
  • ES2015 uses ES Modules
  • Deno uses ES Modules

I am also aware that:

  • React.js uses Components
  • Angular 7 uses Components
  • Vue.js uses Components
  • WebComponents uses Components

But at a conceptual level, in each technology-environment, do Components and Modules represent essentially the same sort of category (ie. self-contained, fundamental blocks of code, around which the technology-environment revolves)?

In summary: are Components and Modules two distinct names for the same sort of thing? Can we say that even if they aren’t identical concepts, they are, at least, equivalent?

OR…

is it the case that Components and Modules represent blocks of code at fundamentally different levels of hierarchy?

And that these labels are more than just arbitrary – they actually represent two different concepts.

Can we say that Components and Modules are not only not-identical, they are also not-equivalent?

formatting – HowTo “correctly” avoid clipping in GraphicsRow[{Labeled[Graphics[]]}]? Both images and labels

$Version

(* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *)

gr = GraphicsRow({Labeled(Graphics({Circle()}), 
    "A(ThinSpace)=(ThinSpace)B(ThinSpace)-(ThinSpace)!(*FractionBox(
(C), (2)))"), 
   Labeled(Graphics({Circle()}), 
    "A(ThinSpace)=(ThinSpace)B(ThinSpace)-(ThinSpace)!(*FractionBox(
(C), (2)))")})

enter image description here

The clipping does not occur. Compare your values for these options

AbsoluteOptions(gr, {ImageMargins, ImagePadding, PlotRange, PlotRangeClipping,
   PlotRangePadding})

(* {ImageMargins -> 0., ImagePadding -> All, 
 PlotRange -> {{0., 1152.}, {-606.9, 0.}}, PlotRangeClipping -> False, 
 PlotRangePadding -> {6., 5.}} *)

Perhaps one or more defaults have been changed.