Is there a Johnson-Lindenstrauss Lemma for large finite fields?

The Johnson-Lindenstrauss lemma shows that points in a high-dimensional space over the real numbers (I think also works for natural numbers) can be mapped into a lower dimensional space, such that pairwise distances are approximately preserved.

Question: Is there an equivalent lemma for vector spaces over a large finite field of prime order? If not, is there some intuitive reason for why it does or cannot exist?

A related question was already asked, but the answers seemed to be exclusively concerned with the vectors over $ \mathbb{F}_2$ .

WordPress Plugin to display a list of input fields which are visible to everyone?

I am looking for a plugin/workaround recommendations. I am sorry if the title was not descriptive enough, this is the best I could think of. Any edit suggestion is welcome.

I want to display a list of editable text fields, which are updated by any visitor, and all updates are live and public to everyone else. The submitted fields may or may not be editable anymore.

So, once a visitor visits the page, there will be a list of empty blanks/fields, short text fields for instance. They will fill in their name and their details, then submit. All other visitors will see that this field is taken/filled.

The reason is that there will be a list of offerings, and the link will be distributed among participants only, each participant can fill a “slot” with their details after seeing which slots are available.

I don’t need any extra validation or complexity. Logging in is not required.

  • Preferably free, reasonably paid solutions are accepted, too.

Using built-in validation pop-up for custom fields

I am currently adding custom fields (by custom code) to the single product page in WooCommerce using the OceanWP theme. I was about to start custom validation to the fields when I noticed that the fields already had some validation and the result looks quite nice.

When the Add to Cart button is pressed and a field is invalid I get the following message pop-up: enter image description here

I’m not sure whether the warning popup is part of WordPress, WooCommerce or OceanWP.

My question is: can I can use this built-in warning popup for my own validation messages?

custom post types, custom fields and normalization

I have decided to redesign a plug I developed to use custom post types and custom fields instead of custom tables in the database.

I have some questions about abstracting data into new post types. These questions are based on the assumption that I should essentially be trying to replicate a relational database.

It’s a dictionary feature for a language learning blog. Here are the tables from the original. Simplified for readability.

CREATE TABLE words (     ID int(),     word varchar(),     parent_id int() );  CREATE TABLE nouns (     word_id int(),     plural varchar(),     [...] );  CREATE TABLE verbs (     word_id int(),     pres_part varchar(),     past_part varchar(),     [...] );  CREATE TABLE definitions (     ID int(),     word_id int(),     definition varchar(),     [...] );  CREATE TABLE examples (     ID int(),     defintion_id int(),     example varchar(),     [...] );  

Words will obviously be the first custom post type.

I’ve decided to use custom fields for the noun and verb information as they are 1:1 relationships and only existed to reduce null entries in the words table. I believe WordPress will only create an entry in the postmeta table if the fields are actually used. So that would solve that problem.

Now the main question is; should I store definitions and examples as custom post types as I would in a relational database or just use ACF repeaters? These are both genuine 1-many relationships. Although a single definition will probably only ever have a maximum of 3 examples.

The reader might wish to search for keywords within the definitions and/or examples but they would never want to view a single definition as page.

Definitions and examples might however be used outside the context of their respective word in the future. With a flashcard app for example. Is it easy to uniquely identify and request a single entry from a repeater?

Add metabox plugin data but as custom fields or php code instead

i am using a theme that has custom post type and this custom post type has two ‘boxes’ or fields or whatever they are named i will include the meta codde below now the problem is i am using a plugin to add the posts but the plugin can only add via regular custom fields with value , and i can get the value but i don’t know how to format them in such a way the metabox adds them to the database the is is how they show in the database enter image description here

here is the full code for each one of them this one is for ab_embedgroup

a:2:{i:0;a:3:{s:11:"ab_hostname";s:2:"sd";s:8:"ab_embed";s:203:"<iframe width="1263" height="480" src="" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>";s:6:"_state";s:8:"expanded";}i:1;a:3:{s:11:"ab_hostname";s:7:"fsdqfsd";s:8:"ab_embed";s:203:"<iframe width="1263" height="480" src="" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>";s:6:"_state";s:8:"expanded";}} 

and this one is for ab_downloadgroup which keep in mind i added nothing there meaning this is the default value


now here is the meta file which is code for metabox settings and format

$  meta_boxes[] = array(         'id'         => 'episode',         'title'      => __( 'Episode' ),         'post_types' => array( 'watch' ),         'context'    => 'normal',         'autosave'   => true,         'fields'     => array(             array(                 'name'  => __( 'Episode' ),                 'id'    => "{$  prefix}eps",                 'type'  => 'text',             ),             array(                 'name'  => __( 'Episode Title' ),                 'id'    => "{$  prefix}epstitle",                 'type'  => 'text',             ),             array(                 'name' => __('Status', 'meta-box'),                 'id' => "{$  prefix}lang",                 'type' => 'radio',                 'options' => array(                     'RAW' => __('RAW', 'meta-box'),                     'Sub' => __('Sub', 'meta-box'),                 ),                 'multiple' => false,                 'std' => 'Sub'             ),             array(                 'name' => __('Series', 'meta-box'),                 'id' => "{$  prefix}series",                 'type' => 'post',                 'post_type' => 'series',                 'field_type' => 'select_advanced',                 'query_args' => array(                     'post_status' => 'publish',                     'posts_per_page' => -1,                     'orderby' => 'title',                     'order' => 'ASC'                 )             ),         ),     );     $  meta_boxes[] = array(         'title'  => 'Embed Video',         'pages' => array( 'post','watch' ),         'tabs'      => array(             'input-version' => array(                 'label' => 'Input Version',                 'icon'  => 'dashicons-admin-customizer',             ),             'sc-version'  => array(                 'label' => 'Shortcode Version',                 'icon'  => 'dashicons-editor-code',             ),         ),         'tab_style' => 'default',         'fields' => array(             array(                 'id'     => 'ab_embedgroup',                 'type'   => 'group',                 'clone'  => true,                 'sort_clone'  => true,                 'save_state' => true,                 'desc' => '<b style="color:red;">You can insert embed code or shortcode</b>',                 'tab'  => 'input-version',                 'fields' => array(                     array(                         'name'  => 'Host Name',                         'id'    => 'ab_hostname',                         'type'  => 'text',                     ),                     array(                         'name'   => 'Embed',                         'id'     => 'ab_embed',                         'type'   => 'textarea',                         'sanitize_callback' => 'none',                     ),                 ), //episode             ), //input-version             array(                 'name'  => __( 'Shortcode Video', 'meta-box' ),                 'id'    => "{$  prefix}embed",                 'type'  => 'textarea',                 'clone' => 'true',                 'sort_clone'  => true,                 'sanitize_callback' => 'none',                 'tab' => 'sc-version',             ),         ),     );     $  meta_boxes[] = array(         'title'  => 'Download',         'pages' => array( 'post','watch' ),         'tabs'      => array(             'input-version' => array(                 'label' => 'Input Version',                 'icon'  => 'dashicons-admin-customizer',             ),             'sc-version'  => array(                 'label' => 'Shortcode Version',                 'icon'  => 'dashicons-editor-code',             ),         ),         'tab_style' => 'default',         'fields' => array(             array(                 'id'     => 'ab_downloadgroup',                 'type'   => 'group',                 'clone'  => true,                 'sort_clone'  => true,                 'tab'  => 'input-version',                 'save_state' => true,                 'fields' => array(                     array(                         'name'  => 'Host Name',                         'id'    => 'ab_hostname',                         'type'  => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Language',                         'id'     => 'ab_language',                         'type'   => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Quality',                         'id'     => 'ab_quality',                         'type'   => 'text',                         'columns' => '3',                     ),                     array(                         'name'   => 'Link',                         'id'     => 'ab_linkurl',                         'type'   => 'text',                         'columns' => '3',                         'sanitize_callback' => 'none',                     ),                 ),             ), //input-version             array(                 'name'  => __( 'Shortcode Download', 'meta-box' ),                 'id'    => "{$  prefix}url",                 'type'  => 'textarea',                 'desc'  => 'Example: [dl n="FileHosting" u="" s="English" q="HD"]',                 'clone' => 'true',                 'sanitize_callback' => 'none',                 'tab' => 'sc-version',             ),         ),     ); 

here is how they show on the dashboard this the first box enter image description here

here is the second box enter image description here

and thank you in advace 🙂

Using conditional logic on fields in gravity form based on Paid Memberships Pro membership level

I’m trying to use conditional logic to hide/show fields in my gravity form based on user’s membership level determined by Paid Memberships Pro. I’ve tried all different variations using {user:membership_level} in a hidden field. Then, using conditional logic on selected fields, I’ve tried to hide/show based on the value of the membership level.

Any help would be appreciated. Is my meta key ({user:membership_level}) incorrect?

Having issues with CMB2 uploader and fields saving in IOS and Safari [closed]

I’m using a WordPress theme and everything works fine on Chrome, Firefox and Edge, but on Safari and iOS the CMB2 image uploader does nothing and the php form also submits empty fields (randomly).

This seems to only be happening with Safari and iOS.

I can attach the form process if anyone could point me in the right direction it would be a great help.

What kind of JavaScript protection is usually applied on password fields to prevent value injection? [closed]

There is a certain website with a certain login form which includes two fields; username and password.

I can successfully inject data with vanilla JavaScript to the first field:

document.querySelector("#username").value = "USERNAME"; 

But when I try to inject a password:

document.querySelector("#password").value = "PASSWORD"; 

I get an error:

VM1766:1 Uncaught TypeError: Cannot set property ‘value’ of null at :1:45

My problem

I double checked if the field exists as is and it is indeed existing in DOM;
I further ran a code like console.log(document.querySelector("#password")); and got lots of output which I purposely evade pasting here due to legal reasons.

My question

What kind of JavaScript protection is usually applied on password fields to prevent value injection?