Why is it important for every table to have a primary key?

So I have some tables in Sql Server that are essentially a list of sales, things like:

ProductID  SalesOrderID ProductFamilyID  ProductCost ProductSource 

and so on. In this case, none of the columns are necessarily unique, so I can’t create a primary key from any combination of them. In fact, the only constraint that I really have on the table is that I need every row in the table to be a unique combination of the columns. So I’m assuming something like a unique index would be the way to go there.

The only primary key I could add is something like an autoincrement primary key. But what would be the actual use of that, database wise? What are the possible problems with not creating a primary key for a table like this?

Primary index vs clustered vs non clustered vs secondary index

I am new to ETL testing and dB environment.Some say PI is clustered index some say it is not. Even I found some where that secondary index is non clustered index. What is actually primary index and secondary index? When do we need primary index and when we need secondary index? If PI index and clustered index are different then how are they different?

Can I use a spiked shield in my primary hand as a weapon? If so, does it count as a simple or martial weapon?

Can any humanoid PC use a Spiked Shield in their ‘primary hand’ as a Weapon?


Is it a Simple or Martial Weapon?

The Lizardfolk entry in the MM (p. 204) has a statblock that includes the following elements:

  • STR 15 (+2)
  • Armor Class 15 (natural armor, shield)
  • Multiattack. The lizardfolk makes two melee attacks, each one with a different weapon.
  • Spiked Shield. Melee Weapon Attack: +4 to hit, reach 5 ft., one target. Hit: 5 (1d6+2) piercing damage.

It also includes 3 other (Bite, Heavy Club, and Javelin) melee attack options, presumably for use with Multiattack.

I would like to use a Spiked Shield (1d6 + Str mod) in my ‘primary’ hand and leave my other hand empty. Is there anything in RAW that indicates the Spiked Shield is a weapon that is prohibited from PC usage in 5e?

The PHB (p. 147) has a section about improvised weapons:

An improvised weapon includes any object you can wield in one or two hands, such as broken glass, a table leg, a frying pan, a wagon wheel, or a dead goblin. Often, an improvised weapon is similar to an actual weapon and can be treated as such.

If you look at the graphic of the lizardfolk in the MM you can clearly see a shield on its left arm made out of some kind of tortoise shell with two rather large spikes extruding forwards:

Monster Manual - Lizardfolk

It certainly looks like a weapon… so is it DM fiat as to whether it “is similar to an actual weapon?

The PHB (p. 146) has this to say about weapon proficiency:

Your race, class, and feats can grant you proficiency with certain weapons or categories of weapons. The two categories are simple and martial. Most people can use simple weapons with proficiency. These weapons include clubs, maces, and other weapons often found in the hands of commoners. Martial weapons, including swords, axes, and polearms, require more specialized training to use effectively.

This says that there are two categories – Simple and Martial. The question then is, would this spiked shield “require more specialized training to [be] use[d] effectively“?

When it comes to using the shield as an improvised weapon, it seems you retain the +2 to AC when you use it as an improvised weapon, according to this November 2014 tweet by Jeremy Crawford.

Using ‘Primary Category’ in URL

I’m running into an issue where I want to set up categories in my URL (%category%/%postname%), but doing this will create multiple URLs for the same content if I select multiple categories.

So, for example, if I put a ‘Bugatti’ post in the ‘cars’ and ‘supercars’ categories, the ‘Bugatti’ post will be available at both ‘mysite.com/cars/bugatti’ as well as ‘mysite.com/supercars/bugatti’.

I want to restrict this to where the content will only be available for the primary category that I select. So if I select the category ‘supercars’ as my primary category, the post ‘bugatti’ will only be available at ‘mysite.com/supercars/bugatti’ and any secondary category URLs ( i.e. ‘mysite.com/cars/bugatti’, etc. ) would return a 404. Is there any way to do this using the ‘primary category’ from Yoast or otherwise?

I noticed that Wirecutter does this for their site. They’re running WordPress, using a %category%/%postname% permalink structure, but any of their secondary categories in the URL only return a 404.

Thanks for any help you can provide!

Doesn’t installing a TOTP client on your primary PC undermine the whole point of 2FA? [duplicate]

Authy is a popular cross-platform TOTP application that supports syncing keys across devices. I have been a little confused by the idea of having a desktop client… This way if someone accesses my primary PC they’d find all my passwords saved in my browsers, and would have access to my TOTP keys as well…

Doesn’t installing a TOTP client on your primary PC undermine the whole point of 2FA?

WordPress + Bootstrap: Replace primary navigation menu on mobile?

So, I have a site that has a main navigation bar at the top and a secondary nav in the sidebar. The secondary nav includes the same links in the main nav but with dropdowns for the child pages. It works fine on desktop but when the navs collapse, I get two navbars at the top, basically showing the same thing. So, I’m thinking, for mobile, since the sidebar nav is just a more detailed version of the main nav, I just need to replace the menu in the main nav with the menu in the sidebar then hide the sidebar.

Essentially, I need to switch the sidebar menu location for mobile with a different menu. But, I a bit stumped on how to do that.

Here’s my header.php:

    <header id="masthead" class="site-header fixed-top <?php echo wp_bootstrap_starter_bg_class(); ?>" role="banner">         <div class="container-fluid">             <nav class="navbar navbar-expand p-0 flex-column flex-md-row px-0">                 <div class="navbar-brand">                     <?php if ( get_theme_mod( 'wp_bootstrap_starter_logo' ) ): ?>                         <a href="<?php echo esc_url( home_url( '/' )); ?>">                             <img src="<?php echo esc_url(get_theme_mod( 'wp_bootstrap_starter_logo' )); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">                         </a>                     <?php else : ?>                         <a class="site-title" href="<?php echo esc_url( home_url( '/' )); ?>"><?php esc_url(bloginfo('name')); ?></a>                     <?php endif; ?>                  </div>                 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-nav" aria-controls="" aria-expanded="false" aria-label="Toggle navigation">                     <span class="navbar-toggler-icon"></span>                 </button>                   <?php                  wp_nav_menu(array(                 'theme_location'    => 'primary',                 'container'       => 'div',                 'container_id'    => 'main-nav',                 'container_class' => 'collapse navbar-collapse d-flex justify-content-end',                 'menu_id'         => false,                 'menu_class'      => 'navbar-nav',                 'depth'           => 3,                 'fallback_cb'     => 'wp_bootstrap_navwalker::fallback',                 'walker'          => new wp_bootstrap_navwalker()                 ));                 ?>             </nav>         </div>     </header><!-- #masthead --> 

Here’s my sidebar.php

<aside id="secondary" class="widget-area col-md-3 col-xl-2 sidebar" role="complementary">      <?php dynamic_sidebar( 'sidebar-1' ); ?>              <nav class="navbar sidebar-nav navbar-light">                 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#secondary-nav" aria-controls="" aria-expanded="false" aria-label="Toggle navigation">                     <span class="navbar-toggler-icon"></span>                 </button>                                  <?php                                 wp_nav_menu(array(                                 'theme_location'    => 'sidebar',                                 'container'       => 'div',                                 'container_id'    => 'secondary-nav',                                 'container_class' => 'collapse navbar-collapse',                                 'menu_id'         => false,                                 'menu_class'      => 'navbar-nav flex-column',                                 'depth'           => 3,                                 'fallback_cb'     => 'wp_bootstrap_navwalker::fallback',                                 'walker'          => new wp_bootstrap_navwalker()                                 ));                                 ?>              </nav>  </aside><!-- #secondary --> 

How to authorize a subkey using a primary master key pair?

I’m using webcrypto, not PGP/GPG.

I would like to use a key pair to create a “subkey” that is authorized by my primary key in a way anyone can publicly verify so I don’t need to expose the primary key’s private component to any web-facing systems.

My idea is to:

  • primary key signs a hash of subkeys public component
  • then use the subkeys private key (proving it has access) to encrypt this signed blob

Verification would be:

  • use the subkey public key to decrypt the signature
  • use the primary key’s public to verify the signature.

Would this be safe? Do I need to ad any tamper protection (AHEAD/HMAC)? I’m interested in an answer for both ECC and RSA.

dbDelta change PRIMARY KEY

I have a table with a composite primary key (call_id, submission_id). Now, I would like to change the composite primary key (call_id, submission_id, version). The code I am running is similar to the following:

        $  charset_collate = $  wpdb->get_charset_collate();         $  sql = "CREATE TABLE $  table_name (                   call_id INTEGER NOT NULL,                   submission_id INTEGER NOT NULL,                   version INTEGER NOT NULL,                    submission_form_data LONGBLOB,                   PRIMARY KEY  (call_id, submission_id, version)                 ) $  charset_collate;"; 

When I run this code, I get the following error:

      WordPress database error Multiple primary key defined for query ALTER TABLE wp_hugo_changes_submission_table ADD PRIMARY KEY  (`call_id`,`submission_id`,`version`) made by activate_plugin, do_action('activate_hugo-changes/hugo-changes.php'), WP_Hook->do_action, WP_Hook->apply_filters, SubmissionDatabase->createSubmissionDatabase, dbDelta 

I came across this ticket when I was searching for a solution. So, is this issue still not solved? Is there any workaround to change the PRIMARY KEY using dbDelta after the table was created?