change a character above certain pattern

I have a file that looks like this: C 0.749421709 0.227878968 1.429202011 0.000039192 C 1.632642695 -0.091443576 2.542631832 -0.000184939 N 0.043615933 0.482209037 0.540453037 0.000123677 H 2.515045687 0.527073165 2.500388888 -0.001989853 H 1.941072900 -1.159598231 2.494001492 0.001039872 H 1.143298831 0.111732200 3.499873978 0.001236466 which is a pattern that repeats several times across the entire file. I need to change only…

Details

What is the difference between sanitize_text_field() and wp_filter_nohtml_kses()?

I need to sanitize some custom settings added with the Customize API, namely some simple text fields. Other data types have some dedicated functions, i.e. email addresses should use sanitize_email(), URL’s have esc_url_raw() and so on. But with simple text fields, I’m not really sure if I must use sanitize_text_field() or wp_filter_nohtml_kses(), even after reading…

Details

Woocommerce – dynamicly change product price by field value – calculate server-side

In Woocommerce, how can I dynamically recalculate a product price based on field values? This has to be on the product page, live, while changing the field values. In other words, not just in the cart at checkout. A simplified example: I make 2 custom woocommerce fields with woocommerce_wp_text_input() and woocommerce_wp_hidden_input() The ..input() is a…

Details

Linux packets going to strange interfaces when NATing between bridges

I have a desktop computer (Ubuntu 19.10) running containers and VMs. Its ethernet enp2s0 is bridged with systemd-networkd: [Match] Name=enp2s0 [Network] Bridge=bridge LinkLocalAddressing=no The bridge interface is named exactly bridge and has IP addresses when shown with ip a, for example, 192.168.1.2/24. It also has a wireless interface wlp3s0 with IP address 192.168.5.2/24 and an…

Details