Language setting for Specific WordPress Page

My website is in English Language and using WordPress.

Html Code contains lang=”en-US” only.

But I want some of the page in other language like Spanish, Arabic and German.

When I create new page it is by default lang=”en-US”.

How can I set this lang=”es” or specific language attribute?

I have tried many plugins but all are converting every pages to selected languages that I don’t want.

How does one activate “Multi Mode Viewfinder” setting on Fujifilm X-T1?

The Fujifilm website documents an “Advanced Feature” which it calls “Multi Mode Viewfinder”. This allows one to use various viewfinder modes called “Full”, “Normal”, “Vertical” and “Dual”.

Dual is particularly interesting:

In the viewfinder’s “DUAL” mode, you can enjoy a view of the subject unlike anything seen through a traditional optical viewfinder. In Manual Focus, Dual cleverly displays a split screen that lets you see both a regular view of the scene, as well as the Focus Assist view (Focus Peaking and Digital Split Image Focus) at the same time, so focusing is easy and precise.

Dual mode

Having scoured forums and other sites on the internet, I’ve been unable to find how to activate this setting. Going through all the various menus on the camera has also not brought anything to light.

Does anyone know how to turn it on?

Setting the Owner property on a modal dialog in WPF/MVVM using a Func

I’m looking to solve the problem of setting the Owner property on modal dialogs in WPF, while using IoC and MVVM patterns I’ve seen (and written) all sorts of hacks.

Here’s a naive example of a window with a viewmodel containing an ICommand which prompts the user. It works by having the view set vm.Owner = this, and then the viewmodel using Owner later in a MessageBox when the command is called.

public partial class MyWindow : Window {     private readonly MyWindowViewModel vm;      public MyWindow(MyWindowViewModel vm)     {         InitializeComponent();         DataContext = vm;         vm.Owner = this;     } }  public class MyWindowViewModel {     private readonly RelayCommand<object> fooCommand;      public ICommand FooCommand => fooCommand;     public Window Owner { get; set; }      public MyWindowViewModel()     {         fooCommand = new RelayCommand<object>(OnFooCommand);     }      private void OnFooCommand(object obj)     {         if (MessageBox.Show(Owner, "Are you sure?", MessageBoxButton.OKCancel) == MessageBoxResult.OK)         {             // ...         }     } } 

This works, but the ViewModel is doing View-related things like opening message boxes, and knowing who owns it.

Here’s an example that abstracts the dialog into a Func, which is set in the constructor of the Window.

public partial class MyWindow : Window {     private readonly MyWindowViewModel vm;      public MyWindow(MyWindowViewModel vm)     {         InitializeComponent();         DataContext = vm;         vm.OkCancelBox = OkCancelBox;     }      private MessageBoxResult OkCancelBox(string text)     {         return MessageBox.Show(this, text, "Confirm", MessageBoxButton.OKCancel, MessageBoxImage.Question);     } }  public class MyWindowViewModel {     private readonly RelayCommand<object> fooCommand;      public ICommand FooCommand => fooCommand;     public Func<string, MessageBoxResult> OkCancelBox { get; set; } = s => throw new NotImplementedException();      public MyWindowViewModel()     {         fooCommand = new RelayCommand<object>(OnFooCommand);     }      private void OnFooCommand(object obj)     {         if (OkCancelBox("Are you sure?") == MessageBoxResult.OK)         {             // ...         }     } } 

This feels better, now my ViewModel calls OkCancelBox and gets back a MessageBoxResult, without knowing anything about the View. If you “forget” to set OkCancelBox, you’ll get a NotImplementedException. In a test, I can trivially set the Func to simulate the user clicking “OK”:

vm.OkCancelBox = s => MessageBoxResult.OK; 

Still, I’m not sure I like it.

There are other solutions like passing in (or service-locating) an IMessageBoxService, but I don’t fully understand how you can specify the owner of a dialog without the ViewModel knowing who owns it.

Any thoughts on my implementation using Func<string, MessageBoxResult>?

is there a way to do generic code with macro setting in language C?

I have a code who manages a lot of different products. Variables and their characteristics are set by X macro. 5 functions(of 10) by product that have the same process with different prefix and different macro.

i would like to put these functions as generic.

file product_1.c

void product_1_init(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_A;   PRODUCT1_XMACRO_LOCAL_DATA   PRODUCT1_XMACRO_UART_DATA #undef DATA }  void product_1_format_data_uart(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_B;   PRODUCT1_XMACRO_UART_DATA #undef DATA } ... 

file product_2.c

void product_2_init(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_A;   PRODUCT2_XMACRO_LOCAL_DATA   PRODUCT2_XMACRO_UART_DATA #undef DATA }  void product_2_format_data_uart(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_B;   PRODUCT2_XMACRO_UART_DATA #undef DATA } ... 

I would like know if is it possible of doing something like this:

file product_generic.c

void PRODUCT_GEN_NAME ## _init(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_A;   PRODUCT_GEN_XMACRO_LOCAL_DATA   PRODUCT_GEN_XMACRO_UART_DATA #undef DATA }  void PRODUCT_GEN_NAME ## _format_data_uart(void* p_generic_ptr) { #define DATA(v1,...,v20) PROCESS_B;   PRODUCT_GEN_XMACRO_UART_DATA #undef DATA } ... //put here every function with process in commun to every product 

file product_1.c

#define PRODUCT_GEN_NAME product_1 #define PRODUCT_GEN_XMACRO_LOCAL_DATA PRODUCT1_XMACRO_LOCAL_DATA #define PRODUCT_GEN_XMACRO_UART_DATA PRODUCT1_XMACRO_UART_DATA  #include product_generic.c  #undef PRODUCT_GEN_NAME #undef PRODUCT_GEN_XMACRO_LOCAL_DATA #undef PRODUCT_GEN_XMACRO_UART_DATA 

file product_2.c

#define PRODUCT_GEN_NAME product_2 #define PRODUCT_GEN_XMACRO_LOCAL_DATA PRODUCT2_XMACRO_LOCAL_DATA #define PRODUCT_GEN_XMACRO_UART_DATA PRODUCT2_XMACRO_UART_DATA  #include product_generic.c  #undef PRODUCT_GEN_NAME #undef PRODUCT_GEN_XMACRO_LOCAL_DATA #undef PRODUCT_GEN_XMACRO_UART_DATA 

“Custom Scripts” setting inside our tenant, who it works exactly

I spent many days reading about how “Custom scripts” work for sharepoint online, but i can not fully understand it. for example we have this case.

  1. inside SP admin center >> Settings >> we have custom scripts disabled as follow:-

enter image description here 2. now using the office 365 admin (who is also a sharepoint admin), i created 2 sites (modern communication site + classic team site). 3. so now i got these “custom script” setting for the site collections:-

  • our build-in root site collection (which is a classic team site)–> custom scripts is Disabled.
  • the modern site collection –> custom scripts is Disabled.
  • the classic team site which i created –> custom scripts is Enabled!!

so i have the following questions:-

  1. since we have prevent custom scripts inside the “SharePoint admin center”, then how custom script was enabled inside the classic team site i have created?

  2. if we allow custom scripts from the “SharePoint admin center”, then i assume this will affect future site collections, but will it also affect all our current 3 site collections?

  3. if i want to enable custom scripts for our modern communication site collection ONLY. so can i do so? or as a first step i will need to enable custom scripts from “SharePoint admin center” ?

  4. if i want to add a script to a classic page. can i Temporary enable custom script on the intended site >> add the custom script >> disable custom script inside the site collection? will the script keep working as-is even if we disable custom script on the site?

  5. final question inside the “SharePoint admin center” >> “Custom Script”, they use the word “Prevent users” & “Allow users”.. so what do users represent? does it cover office 365 & sharepoint admins? or users refer to non-admin users?

Thanks in advance for any help.

Setting a URL prefix for the Glassfish admin GUI

The Glassfish admin gui runs on port 4848, which is behind my firewall. Other high order port web apps either have a consistent prefix or allow me to set one in order to proxy from 443 to the higher order port. For instance Jenkins is running on 9009 on the same server, but I can rely on /jenkins being the prefix to all traffic there. The Glassfish admin gui has no such consistency. I’ve seen /theme, /common, /resource, etc.

Is there a way to set a prefix for the Glassfish admin gui?