问:
Custom policy in Azure AD B2C does not allow to save empty string for attribute
We have custom edit profile policy, which is based on the example provided by Microsoft, the policy has Company and Phone claims, which are not required.
When Company or Phone claim is left blank it still contains an old value after the profile is saved.

We have found, that there is a setting ConvertEmptyClaimsToNull, which is true by default, also we have tried https://learn.microsoft.com/en-us/azure/active-directory-b2c/string-transformations#nullclaim, but this did not help.

Edit profile policy:

```<code><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  PolicySchemaVersion="0.3.0.0"
  TenantId=""
  PolicyId=""
  PublicPolicyUri="">

  <BasePolicy>
    <TenantId></TenantId>
    <PolicyId></PolicyId>
  </BasePolicy>

  <RelyingParty>
    <DefaultUserJourney ReferenceId="ProfileEdit" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />

        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="email" />

        <OutputClaim ClaimTypeReferenceId="country" />
        <OutputClaim ClaimTypeReferenceId="city" />
        <OutputClaim ClaimTypeReferenceId="extension_Company" />
        <OutputClaim ClaimTypeReferenceId="extension_Phone" />
        <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>
</TrustFrameworkPolicy>
</code>```

TrustFrameworkBase:

```<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  PolicySchemaVersion="0.3.0.0"
  TenantId=""
  PolicyId="B2C_1A_TrustFrameworkBase"
  PublicPolicyUri="">

  <ClaimsProviders>
    <ClaimsProvider>
      <DisplayName>Local Account SignIn</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="login-NonInteractive">
          <DisplayName>Local Account SignIn</DisplayName>
          <Protocol Name="OpenIdConnect" />
          <Metadata>
            <Item Key="UserMessageIfClaimsPrincipalDoesNotExist">We can't seem to find your account</Item>
            <Item Key="UserMessageIfInvalidPassword">Your password is incorrect</Item>
            <Item Key="UserMessageIfOldPasswordUsed">Looks like you used an old password</Item>
            <Item Key="ProviderName">https://sts.windows.net/</Item>
            <Item Key="METADATA">https://login.microsoftonline.com/{tenant}/.well-known/openid-configuration</Item>
            <Item Key="authorization_endpoint">https://login.microsoftonline.com/{tenant}/oauth2/token</Item>
            <Item Key="response_types">id_token</Item>
            <Item Key="response_mode">query</Item>
            <Item Key="scope">email openid</Item>

            <Item Key="UsePolicyInRedirectUri">false</Item>
            <Item Key="HttpBinding">POST</Item>
          </Metadata>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="username" Required="true" />
            <InputClaim ClaimTypeReferenceId="password" Required="true" />
            <InputClaim ClaimTypeReferenceId="grant_type" DefaultValue="password" />
            <InputClaim ClaimTypeReferenceId="scope" DefaultValue="openid" />
            <InputClaim ClaimTypeReferenceId="nca" PartnerClaimType="nca" DefaultValue="1" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="oid" />
            <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid" />
            <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
            <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
            <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="upn" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />

            <OutputClaim ClaimTypeReferenceId="country" PartnerClaimType="country" />
            <OutputClaim ClaimTypeReferenceId="city" PartnerClaimType="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" PartnerClaimType="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone"  PartnerClaimType="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" PartnerClaimType="extension_MarketingConsent" />
          </OutputClaims>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Azure Active Directory</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="AAD-Common">
          <DisplayName>Azure Active Directory</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.AzureActiveDirectoryProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ApplicationObjectId">831fb406-f72d-4a18-b45c-325c87791ed0</Item>
            <Item Key="ClientId">bfde7a7f-c0a1-417e-b609-4e1d598881ef</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>

          <IncludeInSso>false</IncludeInSso>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
          </InputClaims>
          <PersistedClaims>

            <PersistedClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
            <PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password" />
            <PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="unknown" />
            <PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />

            <PersistedClaim ClaimTypeReferenceId="givenName" />
            <PersistedClaim ClaimTypeReferenceId="surname" />

            <PersistedClaim ClaimTypeReferenceId="country" />
            <PersistedClaim ClaimTypeReferenceId="city" />
            <PersistedClaim ClaimTypeReferenceId="extension_Company" />
            <PersistedClaim ClaimTypeReferenceId="extension_Phone" />
            <PersistedClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </PersistedClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="newUser" PartnerClaimType="newClaimsPrincipalCreated" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </OutputClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>
        <TechnicalProfile Id="AAD-UserReadUsingEmailAddress">
          <Metadata>
            <Item Key="Operation">Read</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
            <Item Key="UserMessageIfClaimsPrincipalDoesNotExist">An account could not be found for the provided user ID.</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />

            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="displayName" />
            <OutputClaim ClaimTypeReferenceId="accountEnabled" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />

            <OutputClaim ClaimTypeReferenceId="country" />
            <OutputClaim ClaimTypeReferenceId="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <OutputClaimsTransformations>
            <OutputClaimsTransformation ReferenceId="AssertAccountEnabledIsTrue" />
          </OutputClaimsTransformations>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>
        <TechnicalProfile Id="AAD-UserWritePasswordUsingObjectId">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <PersistedClaims>
            <PersistedClaim ClaimTypeReferenceId="objectId" />
            <PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password" />
          </PersistedClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserWriteProfileUsingObjectId">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">false</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <PersistedClaims>

            <PersistedClaim ClaimTypeReferenceId="objectId" />

            <PersistedClaim ClaimTypeReferenceId="givenName" />
            <PersistedClaim ClaimTypeReferenceId="surname" />

            <PersistedClaim ClaimTypeReferenceId="country" />
            <PersistedClaim ClaimTypeReferenceId="city" />
            <PersistedClaim ClaimTypeReferenceId="extension_Company" />
            <PersistedClaim ClaimTypeReferenceId="extension_Phone" />
            <PersistedClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </PersistedClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserReadUsingObjectId">
          <Metadata>
            <Item Key="Operation">Read</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
            <OutputClaim ClaimTypeReferenceId="displayName" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="givenName" />
            <OutputClaim ClaimTypeReferenceId="surname" />

            <OutputClaim ClaimTypeReferenceId="country" />
            <OutputClaim ClaimTypeReferenceId="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Self Asserted</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="SelfAsserted-ProfileUpdate">
          <DisplayName>User ID signup</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ContentDefinitionReferenceId">api.selfasserted.profileupdate</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="userPrincipalName" />

            <InputClaim ClaimTypeReferenceId="givenName" />
            <InputClaim ClaimTypeReferenceId="surname" />

            <InputClaim ClaimTypeReferenceId="country" />
            <InputClaim ClaimTypeReferenceId="city" />
            <InputClaim ClaimTypeReferenceId="extension_Company" />
            <InputClaim ClaimTypeReferenceId="extension_Phone" />
            <InputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />

            <OutputClaim ClaimTypeReferenceId="givenName" Required="true" />
            <OutputClaim ClaimTypeReferenceId="surName" Required="true" />

            <OutputClaim ClaimTypeReferenceId="country" Required="true"/>
            <OutputClaim ClaimTypeReferenceId="city" Required="true" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWriteProfileUsingObjectId" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Local Account</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
          <DisplayName>Email signup</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
            <Item Key="language.button_continue">Create</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
            <OutputClaim ClaimTypeReferenceId="newUser" />

            <OutputClaim ClaimTypeReferenceId="givenName" Required="true" />
            <OutputClaim ClaimTypeReferenceId="surName" Required="true" />

            <OutputClaim ClaimTypeReferenceId="country" Required="true"/>
            <OutputClaim ClaimTypeReferenceId="city" Required="true" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonEmail" />
          </ValidationTechnicalProfiles>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>

        <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email">
          <DisplayName>Local Account Signin</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="SignUpTarget">SignUpWithLogonEmailExchange</Item>
            <Item Key="setting.operatingMode">Email</Item>
            <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="password" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="login-NonInteractive" />
          </ValidationTechnicalProfiles>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>

        <TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
          <DisplayName>Reset password using email address</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
            <Item Key="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Your account has been locked. Contact your support person to unlock it, then try again.</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <IncludeInSso>false</IncludeInSso>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
        <TechnicalProfile Id="LocalAccountWritePasswordUsingObjectId">
          <DisplayName>Change password (username)</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWritePasswordUsingObjectId" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Session Management</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="SM-Noop">
          <DisplayName>Noop Session Management Provider</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.NoopSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </TechnicalProfile>
        <TechnicalProfile Id="SM-AAD">
          <DisplayName>Session Mananagement Provider</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.DefaultSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <PersistedClaims>
            <PersistedClaim ClaimTypeReferenceId="objectId" />
            <PersistedClaim ClaimTypeReferenceId="email" />
            <PersistedClaim ClaimTypeReferenceId="authenticationSource" />
            <PersistedClaim ClaimTypeReferenceId="identityProvider" />
            <PersistedClaim ClaimTypeReferenceId="newUser" />
            <PersistedClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" />
          </PersistedClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectIdFromSession" DefaultValue="true" />
          </OutputClaims>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Trustframework Policy Engine TechnicalProfiles</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="TpEngine_c3bd4fe2-1775-4013-b91d-35f16d377d13">
          <DisplayName>Trustframework Policy Engine Default Technical Profile</DisplayName>
          <Protocol Name="None" />
          <Metadata>
            <Item Key="url">{service:te}</Item>
          </Metadata>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Token Issuer</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="JwtIssuer">
          <DisplayName>JWT Issuer</DisplayName>
          <Protocol Name="None" />
          <OutputTokenFormat>JWT</OutputTokenFormat>
          <Metadata>
            <Item Key="client_id">{service:te}</Item>
            <Item Key="issuer_refresh_token_user_identity_claim_type">objectId</Item>
            <Item Key="SendTokenResponseBodyWithJsonNumbers">true</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
            <Key Id="issuer_refresh_token_key" StorageReferenceId="B2C_1A_TokenEncryptionKeyContainer" />
          </CryptographicKeys>
          <InputClaims />
          <OutputClaims />
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
  </ClaimsProviders>
</TrustFrameworkPolicy>
```

答:
Just use AllowGenerationOfClaimsWithNullValues metadata item in the policy you want to save empty values.</p>

```<code><Metadata>
  <Item Key="AllowGenerationOfClaimsWithNullValues">true</Item>
</Metadata>
</code>```

Body:
We have custom edit profile policy, which is based on the example provided by Microsoft, the policy has Company and Phone claims, which are not required.
When Company or Phone claim is left blank it still contains an old value after the profile is saved.

We have found, that there is a setting ConvertEmptyClaimsToNull, which is true by default, also we have tried https://learn.microsoft.com/en-us/azure/active-directory-b2c/string-transformations#nullclaim, but this did not help.

Edit profile policy:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  PolicySchemaVersion="0.3.0.0"
  TenantId=""
  PolicyId=""
  PublicPolicyUri="">

  <BasePolicy>
    <TenantId></TenantId>
    <PolicyId></PolicyId>
  </BasePolicy>

  <RelyingParty>
    <DefaultUserJourney ReferenceId="ProfileEdit" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />

        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="email" />

        <OutputClaim ClaimTypeReferenceId="country" />
        <OutputClaim ClaimTypeReferenceId="city" />
        <OutputClaim ClaimTypeReferenceId="extension_Company" />
        <OutputClaim ClaimTypeReferenceId="extension_Phone" />
        <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>
</TrustFrameworkPolicy>

TrustFrameworkBase:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  PolicySchemaVersion="0.3.0.0"
  TenantId=""
  PolicyId="B2C_1A_TrustFrameworkBase"
  PublicPolicyUri="">

  <ClaimsProviders>
    <ClaimsProvider>
      <DisplayName>Local Account SignIn</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="login-NonInteractive">
          <DisplayName>Local Account SignIn</DisplayName>
          <Protocol Name="OpenIdConnect" />
          <Metadata>
            <Item Key="UserMessageIfClaimsPrincipalDoesNotExist">We can't seem to find your account</Item>
            <Item Key="UserMessageIfInvalidPassword">Your password is incorrect</Item>
            <Item Key="UserMessageIfOldPasswordUsed">Looks like you used an old password</Item>
            <Item Key="ProviderName">https://sts.windows.net/</Item>
            <Item Key="METADATA">https://login.microsoftonline.com/{tenant}/.well-known/openid-configuration</Item>
            <Item Key="authorization_endpoint">https://login.microsoftonline.com/{tenant}/oauth2/token</Item>
            <Item Key="response_types">id_token</Item>
            <Item Key="response_mode">query</Item>
            <Item Key="scope">email openid</Item>

            <Item Key="UsePolicyInRedirectUri">false</Item>
            <Item Key="HttpBinding">POST</Item>
          </Metadata>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="username" Required="true" />
            <InputClaim ClaimTypeReferenceId="password" Required="true" />
            <InputClaim ClaimTypeReferenceId="grant_type" DefaultValue="password" />
            <InputClaim ClaimTypeReferenceId="scope" DefaultValue="openid" />
            <InputClaim ClaimTypeReferenceId="nca" PartnerClaimType="nca" DefaultValue="1" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="oid" />
            <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid" />
            <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
            <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
            <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="upn" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />

            <OutputClaim ClaimTypeReferenceId="country" PartnerClaimType="country" />
            <OutputClaim ClaimTypeReferenceId="city" PartnerClaimType="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" PartnerClaimType="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone"  PartnerClaimType="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" PartnerClaimType="extension_MarketingConsent" />
          </OutputClaims>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Azure Active Directory</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="AAD-Common">
          <DisplayName>Azure Active Directory</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.AzureActiveDirectoryProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ApplicationObjectId">831fb406-f72d-4a18-b45c-325c87791ed0</Item>
            <Item Key="ClientId">bfde7a7f-c0a1-417e-b609-4e1d598881ef</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>

          <IncludeInSso>false</IncludeInSso>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
          </InputClaims>
          <PersistedClaims>

            <PersistedClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
            <PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password" />
            <PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="unknown" />
            <PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />

            <PersistedClaim ClaimTypeReferenceId="givenName" />
            <PersistedClaim ClaimTypeReferenceId="surname" />

            <PersistedClaim ClaimTypeReferenceId="country" />
            <PersistedClaim ClaimTypeReferenceId="city" />
            <PersistedClaim ClaimTypeReferenceId="extension_Company" />
            <PersistedClaim ClaimTypeReferenceId="extension_Phone" />
            <PersistedClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </PersistedClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="newUser" PartnerClaimType="newClaimsPrincipalCreated" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </OutputClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>
        <TechnicalProfile Id="AAD-UserReadUsingEmailAddress">
          <Metadata>
            <Item Key="Operation">Read</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
            <Item Key="UserMessageIfClaimsPrincipalDoesNotExist">An account could not be found for the provided user ID.</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />

            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="displayName" />
            <OutputClaim ClaimTypeReferenceId="accountEnabled" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />

            <OutputClaim ClaimTypeReferenceId="country" />
            <OutputClaim ClaimTypeReferenceId="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <OutputClaimsTransformations>
            <OutputClaimsTransformation ReferenceId="AssertAccountEnabledIsTrue" />
          </OutputClaimsTransformations>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>
        <TechnicalProfile Id="AAD-UserWritePasswordUsingObjectId">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <PersistedClaims>
            <PersistedClaim ClaimTypeReferenceId="objectId" />
            <PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password" />
          </PersistedClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserWriteProfileUsingObjectId">
          <Metadata>
            <Item Key="Operation">Write</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">false</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <PersistedClaims>

            <PersistedClaim ClaimTypeReferenceId="objectId" />

            <PersistedClaim ClaimTypeReferenceId="givenName" />
            <PersistedClaim ClaimTypeReferenceId="surname" />

            <PersistedClaim ClaimTypeReferenceId="country" />
            <PersistedClaim ClaimTypeReferenceId="city" />
            <PersistedClaim ClaimTypeReferenceId="extension_Company" />
            <PersistedClaim ClaimTypeReferenceId="extension_Phone" />
            <PersistedClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </PersistedClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>

        <TechnicalProfile Id="AAD-UserReadUsingObjectId">
          <Metadata>
            <Item Key="Operation">Read</Item>
            <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
            <OutputClaim ClaimTypeReferenceId="displayName" />
            <OutputClaim ClaimTypeReferenceId="otherMails" />
            <OutputClaim ClaimTypeReferenceId="givenName" />
            <OutputClaim ClaimTypeReferenceId="surname" />

            <OutputClaim ClaimTypeReferenceId="country" />
            <OutputClaim ClaimTypeReferenceId="city" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <IncludeTechnicalProfile ReferenceId="AAD-Common" />
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Self Asserted</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="SelfAsserted-ProfileUpdate">
          <DisplayName>User ID signup</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ContentDefinitionReferenceId">api.selfasserted.profileupdate</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="userPrincipalName" />

            <InputClaim ClaimTypeReferenceId="givenName" />
            <InputClaim ClaimTypeReferenceId="surname" />

            <InputClaim ClaimTypeReferenceId="country" />
            <InputClaim ClaimTypeReferenceId="city" />
            <InputClaim ClaimTypeReferenceId="extension_Company" />
            <InputClaim ClaimTypeReferenceId="extension_Phone" />
            <InputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </InputClaims>
          <OutputClaims>

            <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />

            <OutputClaim ClaimTypeReferenceId="givenName" Required="true" />
            <OutputClaim ClaimTypeReferenceId="surName" Required="true" />

            <OutputClaim ClaimTypeReferenceId="country" Required="true"/>
            <OutputClaim ClaimTypeReferenceId="city" Required="true" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWriteProfileUsingObjectId" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Local Account</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
          <DisplayName>Email signup</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
            <Item Key="language.button_continue">Create</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
            <OutputClaim ClaimTypeReferenceId="newUser" />

            <OutputClaim ClaimTypeReferenceId="givenName" Required="true" />
            <OutputClaim ClaimTypeReferenceId="surName" Required="true" />

            <OutputClaim ClaimTypeReferenceId="country" Required="true"/>
            <OutputClaim ClaimTypeReferenceId="city" Required="true" />
            <OutputClaim ClaimTypeReferenceId="extension_Company" />
            <OutputClaim ClaimTypeReferenceId="extension_Phone" />
            <OutputClaim ClaimTypeReferenceId="extension_MarketingConsent" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonEmail" />
          </ValidationTechnicalProfiles>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>

        <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email">
          <DisplayName>Local Account Signin</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="SignUpTarget">SignUpWithLogonEmailExchange</Item>
            <Item Key="setting.operatingMode">Email</Item>
            <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
          </Metadata>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="password" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="login-NonInteractive" />
          </ValidationTechnicalProfiles>
          <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>

        <TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
          <DisplayName>Reset password using email address</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
            <Item Key="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Your account has been locked. Contact your support person to unlock it, then try again.</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <IncludeInSso>false</IncludeInSso>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
        <TechnicalProfile Id="LocalAccountWritePasswordUsingObjectId">
          <DisplayName>Change password (username)</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="objectId" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
            <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserWritePasswordUsingObjectId" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Session Management</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="SM-Noop">
          <DisplayName>Noop Session Management Provider</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.NoopSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </TechnicalProfile>
        <TechnicalProfile Id="SM-AAD">
          <DisplayName>Session Mananagement Provider</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.SSO.DefaultSSOSessionProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <PersistedClaims>
            <PersistedClaim ClaimTypeReferenceId="objectId" />
            <PersistedClaim ClaimTypeReferenceId="email" />
            <PersistedClaim ClaimTypeReferenceId="authenticationSource" />
            <PersistedClaim ClaimTypeReferenceId="identityProvider" />
            <PersistedClaim ClaimTypeReferenceId="newUser" />
            <PersistedClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" />
          </PersistedClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="objectIdFromSession" DefaultValue="true" />
          </OutputClaims>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Trustframework Policy Engine TechnicalProfiles</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="TpEngine_c3bd4fe2-1775-4013-b91d-35f16d377d13">
          <DisplayName>Trustframework Policy Engine Default Technical Profile</DisplayName>
          <Protocol Name="None" />
          <Metadata>
            <Item Key="url">{service:te}</Item>
          </Metadata>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    <ClaimsProvider>
      <DisplayName>Token Issuer</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="JwtIssuer">
          <DisplayName>JWT Issuer</DisplayName>
          <Protocol Name="None" />
          <OutputTokenFormat>JWT</OutputTokenFormat>
          <Metadata>
            <Item Key="client_id">{service:te}</Item>
            <Item Key="issuer_refresh_token_user_identity_claim_type">objectId</Item>
            <Item Key="SendTokenResponseBodyWithJsonNumbers">true</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
            <Key Id="issuer_refresh_token_key" StorageReferenceId="B2C_1A_TokenEncryptionKeyContainer" />
          </CryptographicKeys>
          <InputClaims />
          <OutputClaims />
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
  </ClaimsProviders>
</TrustFrameworkPolicy>

Body:
Just use AllowGenerationOfClaimsWithNullValues metadata item in the policy you want to save empty values.

<Metadata>
  <Item Key="AllowGenerationOfClaimsWithNullValues">true</Item>
</Metadata>


来源: stackexchange

问:
Calling the real object's method from a shadowed method results in infinite recursion
I created a shadow class that calls into the real object as described in http://robolectric.org/extending:

```<code>@Implements(View::class)
class MyShadowView {

    @RealObject
    private lateinit var realView: View

    @Implementation
    fun animate(): ViewPropertyAnimator {
        return realView.animate() // this call ends up calling my shadow's animate() function recursively
    }
}
</code>```

However, when my shadow method gets executed, it results in an infinite recursion.

What am I doing wrong?

(I'm using Robolectric 4.2.)

答:
According to http://robolectric.org/javadoc/4.1/org/robolectric/shadow/api/Shadow.html it should be something like this:</p>

```<code>    @Implementation
    fun animate(): ViewPropertyAnimator {
        Shadow.directlyOn(realView, View::class.java).animate()
    }
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I created a shadow class that calls into the real object as described in http://robolectric.org/extending:

@Implements(View::class)
class MyShadowView {

    @RealObject
    private lateinit var realView: View

    @Implementation
    fun animate(): ViewPropertyAnimator {
        return realView.animate() // this call ends up calling my shadow's animate() function recursively
    }
}

However, when my shadow method gets executed, it results in an infinite recursion.

What am I doing wrong?

(I'm using Robolectric 4.2.)

Body:
According to http://robolectric.org/javadoc/4.1/org/robolectric/shadow/api/Shadow.html it should be something like this:

    @Implementation
    fun animate(): ViewPropertyAnimator {
        Shadow.directlyOn(realView, View::class.java).animate()
    }


问:
Insert struct have array to Mongodb with Go
I want to insert datastruct like below to MongoDB

{
    "rolecode": "DHBK1_ROLE_04",
    "functioncodelist": [
        "DHBK1_FUNC_1",
        "DHBK1_FUNC_2",
          .....
        "DHBK1_FUNC_n"]
    "productid": "ABC_Platform",
    "comid": "DHBK1"
}

Here is my code:

```<code>package main
import (
    "context"
    "gopkg.in/mgo.v2"
)

func main() {
    insertObj()
}
type CompanyRoleFunction struct {
    Rolecode         string `json:"rolecode"`
    Productid        string `json:"productid"`
    Functioncodelist []string
    Comid string `json:"comid"`
}
func insertObj() {
    session, err := mgo.Dial("mongodb://casuser:Mellon@222.255.102.145:27017/users")
    if err != nil {
    panic(err)
    }
    c := session.DB("users").C("company_role_function")
    var companyRoleFunction CompanyRoleFunction
    companyRoleFunction.Rolecode = "DHBK1_ROLE_05"
    companyRoleFunction.Productid = "XYZ_Platform"
    companyRoleFunction.Comid = "DHBK1"
    err = c.Insert(companyRoleFunction)
    if err != nil {
        fmt.Println(err)
    }
}
</code>```

My code have run but it only insert struct like this (of course, because I don't know how to handle array Functioncodelist )

[![enter image description here][1]][1]

Here is my data, I hope to insert

{"_id":{"$oid":"5ed0c2e2402a000037004c84"},"rolecode":"DHBK1_ROLE_07","functioncodelist":["DHBK1_FUNC_1","DHBK1_FUNC_2"],"productid":"ABC_Platform","comid":"DHBK1"}

答:
It doesn't show up in the database because the document you inserted did not contain any values.
Set a value in your go code and it should show up just fine in the database, unless I misinterpreted your question.

```<code>...
type Functioncode string
...
companyRoleFunction.Functioncodelist = make(map[string]Functioncode)
...
companyRoleFunction.Functioncodelist["foo"] = "bar"
...
</code>```

See https://tour.golang.org/moretypes/19 for a quick introduction to go maps.

Body:
I want to insert datastruct like below to MongoDB

{
    "rolecode": "DHBK1_ROLE_04",
    "functioncodelist": [
        "DHBK1_FUNC_1",
        "DHBK1_FUNC_2",
          .....
        "DHBK1_FUNC_n"]
    "productid": "ABC_Platform",
    "comid": "DHBK1"
}

Here is my code:

package main
import (
    "context"
    "gopkg.in/mgo.v2"
)

func main() {
    insertObj()
}
type CompanyRoleFunction struct {
    Rolecode         string `json:"rolecode"`
    Productid        string `json:"productid"`
    Functioncodelist []string
    Comid string `json:"comid"`
}
func insertObj() {
    session, err := mgo.Dial("mongodb://casuser:Mellon@222.255.102.145:27017/users")
    if err != nil {
    panic(err)
    }
    c := session.DB("users").C("company_role_function")
    var companyRoleFunction CompanyRoleFunction
    companyRoleFunction.Rolecode = "DHBK1_ROLE_05"
    companyRoleFunction.Productid = "XYZ_Platform"
    companyRoleFunction.Comid = "DHBK1"
    err = c.Insert(companyRoleFunction)
    if err != nil {
        fmt.Println(err)
    }
}

My code have run but it only insert struct like this (of course, because I don't know how to handle array Functioncodelist )

[![enter image description here][1]][1]

Here is my data, I hope to insert

{"_id":{"$oid":"5ed0c2e2402a000037004c84"},"rolecode":"DHBK1_ROLE_07","functioncodelist":["DHBK1_FUNC_1","DHBK1_FUNC_2"],"productid":"ABC_Platform","comid":"DHBK1"}

Body:
It doesn't show up in the database because the document you inserted did not contain any values.
Set a value in your go code and it should show up just fine in the database, unless I misinterpreted your question.

...
type Functioncode string
...
companyRoleFunction.Functioncodelist = make(map[string]Functioncode)
...
companyRoleFunction.Functioncodelist["foo"] = "bar"
...

See https://tour.golang.org/moretypes/19 for a quick introduction to go maps.


问:
AddressBook Listener
I am doing one application which should notify me changes (like update , delete, etc) in  contacts of addressbook ie ABAddressBook is used to get all the address contacts. I read that  ABAddressBookRegisterExternalChangeCallback will give notifications, but I am not sure how it will work. I wanted to store changes even though my application is closed. Let me know anybody has worked upon same or any inputs.

答: On iOS4+, if your app is in the background and a foreground app changes the address book, your callback will be called when your app is next brought to the foreground (i.e., not in "real time").  If your app is totally terminated then, of course, it behaves like pre-iOS4.</p>

ContentLicense: CC BY-SA 3.0

Title: AddressBook Listener


问:
DRF: How to insert data in another model class on deleting on model class
I am trying to insert data on one modal class on destroying another model class. My First model class:

```<code>class UserDevice(models.Model):
    type = models.ForeignKey(
        'Device',
        on_delete=models.CASCADE
    )
    hardware_serial = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)

class NewDevice(models.Model):
    type = models.ForeignKey(
        'Device',
        on_delete = models.CASCADE
    )
    hardware_serial = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)
</code>```

Whenever I will destroy the UserDevice I want to the same device should be added in NewDevice

My serializer class is :

```<code>class UserDeviceSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.UserSensorDevice
        fields = '__all__'
        read_only_fields = ['id','created_at']

    def create(self, validated_data):
        app_id = models.UserDevice.objects.filter(sensor_code= validated_data.get('hardware_serial', None)).first()
        if app_id:
            msg = _('Application ID is already registered')
            raise serializers.ValidationError(msg, code='authorization')
        else :
            return models.UserDevice.objects.create(**validated_data)

class NewDeviceSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.NewDevice
        fields = '__all__'
        read_only_fields = ['id','created_at']
</code>```

My view class:

```<code>class UserSensorRemoveDevice(generics.DestroyAPIView):
    authentication_classes = (authentication.TokenAuthentication,)
    permission_classes = (permissions.IsAuthenticated,)
    queryset = models.UserDevice.objects.all()
    serializer_class = serializers.UserDeviceSerializer
</code>```

What I have tried to override UserDevice destroy. But somehow its not working:

```<code>def destroy(self, validated_data):
        return models.NewDevice.objects.create(type = validated_data.get('type', None),hardware_serial = validated_data.get('hardware_serial', None))
</code>```

Any help will be highly appreciated. Thanks in advance.

答:
in can just override your model UserDevice  delete function </p>

```<code>def delete(self, using=None, keep_parents=False):
    #add new NewDevice instance
    super().delete(using, keep_parents,*args,**kwargs)
</code>```

Body:
I am trying to insert data on one modal class on destroying another model class. My First model class:

class UserDevice(models.Model):
    type = models.ForeignKey(
        'Device',
        on_delete=models.CASCADE
    )
    hardware_serial = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)

class NewDevice(models.Model):
    type = models.ForeignKey(
        'Device',
        on_delete = models.CASCADE
    )
    hardware_serial = models.CharField(max_length=255)
    created_at = models.DateTimeField(auto_now_add=True)

Whenever I will destroy the UserDevice I want to the same device should be added in NewDevice

My serializer class is :

class UserDeviceSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.UserSensorDevice
        fields = '__all__'
        read_only_fields = ['id','created_at']

    def create(self, validated_data):
        app_id = models.UserDevice.objects.filter(sensor_code= validated_data.get('hardware_serial', None)).first()
        if app_id:
            msg = _('Application ID is already registered')
            raise serializers.ValidationError(msg, code='authorization')
        else :
            return models.UserDevice.objects.create(**validated_data)

class NewDeviceSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.NewDevice
        fields = '__all__'
        read_only_fields = ['id','created_at']

My view class:

class UserSensorRemoveDevice(generics.DestroyAPIView):
    authentication_classes = (authentication.TokenAuthentication,)
    permission_classes = (permissions.IsAuthenticated,)
    queryset = models.UserDevice.objects.all()
    serializer_class = serializers.UserDeviceSerializer

What I have tried to override UserDevice destroy. But somehow its not working:

def destroy(self, validated_data):
        return models.NewDevice.objects.create(type = validated_data.get('type', None),hardware_serial = validated_data.get('hardware_serial', None))

Any help will be highly appreciated. Thanks in advance.

Body:
in can just override your model UserDevice  delete function

def delete(self, using=None, keep_parents=False):
    #add new NewDevice instance
    super().delete(using, keep_parents,*args,**kwargs)


问:
An attempt was made to access a socket in a way forbidden by its access permissions. Why?

private void StartReceivingData(string ipAddress, int iPort)
{
    try
    {
        if (!_bContinueReciving)
        {
            //initializeMainSocket(ipAddress, iPort);
            _mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);//<------HERE IS RAISED THE EXCEPTION
            _mSocket.Bind(new IPEndPoint(IPAddress.Parse(ipAddress), iPort));
            //  _mSocket.Bind(new IPEndPoint(IPAddress.Loopback, iPort));
            _mSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
            _mSocket.IOControl(IOControlCode.ReceiveAll, new byte[4] { 1, 0, 0, 0 }, new byte[4] { 0, 0, 0, 0 });
            //var 1
            _mSocket.BeginReceive(_buffReceivedData, 0, _buffReceivedData.Length, SocketFlags.None,
                                 new AsyncCallback(OnReceive), null);
            initializeLocalSocket();
        }
        else
        {
            _bContinueReciving = false;
            _mSocket.Close();
        }
    }
    catch (Exception exception)
    {
        Debug.WriteLine(exception);
    }
}
```

I'm getting an error when trying to start my program:

An attempt was made to access a socket in a way forbidden by its access permissions.

I don't understand why... it worked fine, and now it doesn't.

I am streaming with VLC, and I want to receive the packets, do some reports, and then restream local to a player.

答:
I'm developing a UWP application which connects to an MQTT broker in the LAN. I got a similar error.

```<code>MQTTnet.Exceptions.MqttCommunicationException: 'An attempt was made to access a socket in a way forbidden by its access permissions [::ffff:xxx.xxx.xxx.xxx]:1883'

ExtendedSocketException: An attempt was made to access a socket in a way forbidden by its access permissions [::ffff:xxx.xxx.xxx.xxx]:1883
</code>```

Turned out that I forgot to give the app the correct capabilities ...

Body:
private void StartReceivingData(string ipAddress, int iPort)
{
    try
    {
        if (!_bContinueReciving)
        {
            //initializeMainSocket(ipAddress, iPort);
            _mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);//<------HERE IS RAISED THE EXCEPTION
            _mSocket.Bind(new IPEndPoint(IPAddress.Parse(ipAddress), iPort));
            //  _mSocket.Bind(new IPEndPoint(IPAddress.Loopback, iPort));
            _mSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true);
            _mSocket.IOControl(IOControlCode.ReceiveAll, new byte[4] { 1, 0, 0, 0 }, new byte[4] { 0, 0, 0, 0 });
            //var 1
            _mSocket.BeginReceive(_buffReceivedData, 0, _buffReceivedData.Length, SocketFlags.None,
                                 new AsyncCallback(OnReceive), null);
            initializeLocalSocket();
        }
        else
        {
            _bContinueReciving = false;
            _mSocket.Close();
        }
    }
    catch (Exception exception)
    {
        Debug.WriteLine(exception);
    }
}

I'm getting an error when trying to start my program:

An attempt was made to access a socket in a way forbidden by its access permissions.

I don't understand why... it worked fine, and now it doesn't.

I am streaming with VLC, and I want to receive the packets, do some reports, and then restream local to a player.

Body:
I'm developing a UWP application which connects to an MQTT broker in the LAN. I got a similar error.

MQTTnet.Exceptions.MqttCommunicationException: 'An attempt was made to access a socket in a way forbidden by its access permissions [::ffff:xxx.xxx.xxx.xxx]:1883'

ExtendedSocketException: An attempt was made to access a socket in a way forbidden by its access permissions [::ffff:xxx.xxx.xxx.xxx]:1883

Turned out that I forgot to give the app the correct capabilities ...


问:
Flutter Reflection with Reflectable: working example needed
I want to achieve reflection in a cross-platform (iOS, Android) project using Flutter and the Reflectable package. To keep the binaries short, this package uses code generation.

However, following the tutorial/readme of this package, I am not able to generate the needed code, in this case the file main.reflectable.dart. While I have reached the point where things work without error, code generation concludes with the statement:

```<code>[INFO] Succeeded after 88ms with 0 outputs
</code>```

In the following I try to show a reproducible path of what I did. For that I moved flutter to a different path and reinstalled it, but didn't reinstall the flutter plugin in IntelliJ IDEA.

How to reproduce / What I did?

I) Install Flutter as usual for Mac. On the command line:

```<code>cd ~/development
git clone -b beta https://github.com/flutter/flutter.git
export PATH=/Users/yourname/development/flutter/bin:$PATH
flutter doctor
</code>```

II) Create a new Flutter project in IntelliJ IDEA

Choose SDK path: /Users/yourname/development/flutter

Choose project location: ~/gitroot/PlayGround/reflectable_test_2

Add directory entry_point parallel to lib directory

Add dart file main.dart inside directory entry_point

Get the content for main.dart from the main.dart in https://github.com/dart-lang/reflectable (a lot will be shown red)

Delete main.dart from lib directory (unchecked "safe delete" and "search in comments")

Delete widet_test.dart in test directory

Add "reflectable: any" to pubspec.yaml under dependencies

In main.dart, click run and in the upcoming dialog set the entry point to /Users/yourname/gitroot/PlayGround/reflectable_test_2/entry_point/main.dart

When the dependencies are loaded, some of the red wiggles will go away, but not the one in "import 'main.reflectable.dart';", since this file does not exist yet.

III) Try to generate main.reflectable.dart with the builder on the command line:

```<code>cd /Users/yourname/gitroot/PlayGround/reflectable_test_2/
flutter packages pub run build_runner build entry_point
</code>```

Note that instead of the last line, the tutorial only says

```<code>pub run build_runner build DIR
</code>```

but the used line is indeed correct when used in a Flutter project. Following the readme/tutorial so far, I got the result:

```<code>Package "build_runner" is not an immediate dependency.
Cannot run executables in transitive dependencies.
pub finished with exit code 65
</code>```

IV) In IntelliJ, add "build_runner: any" to dev_dependencies in pubspec.yaml. Run again on the command line (flutter packages pub run build_runner build entry_point). This results in the output:

```<code>[INFO] Generating build script...
[INFO] Generating build script completed, took 506ms

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 776ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 3ms

[INFO] Running build...
[INFO] Running build completed, took 7ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 69ms

[INFO] Succeeded after 88ms with 0 outputs
</code>```

To summarise, no errors, but it didn't create the file main.reflectable.dart either (0 outputs). What can I do to fix this?

答:
First, make sure you have these both packages added in pubspec.yaml

```<code>dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: any
  built_value_generator: any
</code>```

if only build_runner is added. it won't be going to generate anything and end up with success.

also, check your main.dart

//reflectable impoort statement should be like this
import 'main.reflectable.dart' show initializeReflectable;

void main(){

 // initialize Reflectable in main

initializeReflectable();

  runApp(MyApp());
}
```
<p>Now try to build with the command</p>
```flutter packages pub run build_runner build DIR
```
<p>if it's working then you are damn lucky.</p>
<p>Now let's add a <strong>build.yaml</strong> file manually (same directory of pubspec.yaml)</p>
<pre class="lang-yaml prettyprint-override"><code>targets:
  $default:
    builders:
      reflectable:
        generate_for:
          - lib/main.dart
</code>```

Now try command

```<code>flutter packages pub run build_runner build DIR
</code>```

Body:
I want to achieve reflection in a cross-platform (iOS, Android) project using Flutter and the Reflectable package. To keep the binaries short, this package uses code generation.

However, following the tutorial/readme of this package, I am not able to generate the needed code, in this case the file main.reflectable.dart. While I have reached the point where things work without error, code generation concludes with the statement:

[INFO] Succeeded after 88ms with 0 outputs

In the following I try to show a reproducible path of what I did. For that I moved flutter to a different path and reinstalled it, but didn't reinstall the flutter plugin in IntelliJ IDEA.

How to reproduce / What I did?

I) Install Flutter as usual for Mac. On the command line:

cd ~/development
git clone -b beta https://github.com/flutter/flutter.git
export PATH=/Users/yourname/development/flutter/bin:$PATH
flutter doctor

II) Create a new Flutter project in IntelliJ IDEA

Choose SDK path: /Users/yourname/development/flutter

Choose project location: ~/gitroot/PlayGround/reflectable_test_2

Add directory entry_point parallel to lib directory

Add dart file main.dart inside directory entry_point

Get the content for main.dart from the main.dart in https://github.com/dart-lang/reflectable (a lot will be shown red)

Delete main.dart from lib directory (unchecked "safe delete" and "search in comments")

Delete widet_test.dart in test directory

Add "reflectable: any" to pubspec.yaml under dependencies

In main.dart, click run and in the upcoming dialog set the entry point to /Users/yourname/gitroot/PlayGround/reflectable_test_2/entry_point/main.dart

When the dependencies are loaded, some of the red wiggles will go away, but not the one in "import 'main.reflectable.dart';", since this file does not exist yet.

III) Try to generate main.reflectable.dart with the builder on the command line:

cd /Users/yourname/gitroot/PlayGround/reflectable_test_2/
flutter packages pub run build_runner build entry_point

Note that instead of the last line, the tutorial only says

pub run build_runner build DIR

but the used line is indeed correct when used in a Flutter project. Following the readme/tutorial so far, I got the result:

Package "build_runner" is not an immediate dependency.
Cannot run executables in transitive dependencies.
pub finished with exit code 65

IV) In IntelliJ, add "build_runner: any" to dev_dependencies in pubspec.yaml. Run again on the command line (flutter packages pub run build_runner build entry_point). This results in the output:

[INFO] Generating build script...
[INFO] Generating build script completed, took 506ms

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 776ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 3ms

[INFO] Running build...
[INFO] Running build completed, took 7ms

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 69ms

[INFO] Succeeded after 88ms with 0 outputs

To summarise, no errors, but it didn't create the file main.reflectable.dart either (0 outputs). What can I do to fix this?

Body:
First, make sure you have these both packages added in pubspec.yaml

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: any
  built_value_generator: any

if only build_runner is added. it won't be going to generate anything and end up with success.

also, check your main.dart

//reflectable impoort statement should be like this
import 'main.reflectable.dart' show initializeReflectable;

void main(){

 // initialize Reflectable in main

initializeReflectable();

  runApp(MyApp());
}

Now try to build with the command

flutter packages pub run build_runner build DIR

if it's working then you are damn lucky.

Now let's add a build.yaml file manually (same directory of pubspec.yaml)

targets:
  $default:
    builders:
      reflectable:
        generate_for:
          - lib/main.dart

Now try command

flutter packages pub run build_runner build DIR


问:
turn ... of a R function into a string
In R, I want to write a function that takes in set of arguments, but doesn't evaluate them and returns the entire set of arguments as a string. I have found the following way to do this:

```<code>ff = function(...) {
  dots = dplyr::enquos(...)
  strs = sub("^[~]","=",sapply(dots,deparse))
  return(paste(paste(names(strs),strs,sep=""),collapse=","))
}
</code>```

but it seems like there must be an easier, less fragile way to do this that does not depend on dplyr using the base R functions quote and deparse, but I can't figure it out.

Is there a better way to do this?

答:
You can use match.call():

```<code>ff = function (...) {
    args = match.call()[-1L]
    argvalues = vapply(args, deparse, character(1L))
    paste(names(args), argvalues, sep = ' = ', collapse = ', ')
}
</code>```

Or, if you only want the dots, and not potential positional arguments, change just the first line of that function to

```<code>args = match.call(expand.dots = FALSE)$...
</code>```

Title: turn ... of a R function into a string

Body:
In R, I want to write a function that takes in set of arguments, but doesn't evaluate them and returns the entire set of arguments as a string. I have found the following way to do this:

ff = function(...) {
  dots = dplyr::enquos(...)
  strs = sub("^[~]","=",sapply(dots,deparse))
  return(paste(paste(names(strs),strs,sep=""),collapse=","))
}

but it seems like there must be an easier, less fragile way to do this that does not depend on dplyr using the base R functions quote and deparse, but I can't figure it out.

Is there a better way to do this?

Body:
You can use match.call():

ff = function (...) {
    args = match.call()[-1L]
    argvalues = vapply(args, deparse, character(1L))
    paste(names(args), argvalues, sep = ' = ', collapse = ', ')
}

Or, if you only want the dots, and not potential positional arguments, change just the first line of that function to

args = match.call(expand.dots = FALSE)$...


问:
text not centered with background color
so i have created this flexbox container with some flex-items:

so what i have is when i press on overview or alerts, it doesn't have this white border background color, when i press on one of them it will trigger a class called .selected and will color the background in white.

the problem is when i press on one of them the white border is not spamming the entire width ( from start to end) also the text inside the background is not centered in the middle when i press it and i don't know why

code:

```<code><div className="container">
            <div className="flex-item item-1 item">John Smith</div>
            <div className="flex-item item-2 item">Male, 26 years old</div>
            <div className='flex-item item-3 item'onClick={setSelectedItem} style={style} > Overview</div>
            <div className='flex-item item-4 item'onClick={setSelectedItem} style={style}>Alerts</div>
            </div>
        </div>
</code>```

css code:

```<code>.container {
    border: 2px solid #57c0e8;
    background-color: #57c0e8;
    margin-top: 5%;
    float: left;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    color:white;
    display: flex;
    flex-direction: column;
    height:40rem;
    width:15rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    font-size:0.9rem;
}

.flex-item{
    margin-top: 2rem;
}

.selected{
    background-color: white;
    color: #57c0e8;
    border-radius: 50px 0 0 50px;
    box-shadow: 2px 2px 5px lightgray;
    width: 14rem;
    height: 5%;
    text-align: left;
}
</code>```

答:
If I understood correctly, you want the white part where it says "Overview" to have the text centerent vertically.
If this is the case, I would give your .selected element display:flex; align-items:center; . For the part with the width of it, seems like you have a cointainer that has a fixed width. As we dont have a codepen, I can't say for sure, but I think that width is the problem. Try removing it , and give all items but that "Overview" a padding left. Tell me what happens after you do it.

Would like me some codepen.

Title: text not centered with background color

Body:
so i have created this flexbox container with some flex-items:

so what i have is when i press on overview or alerts, it doesn't have this white border background color, when i press on one of them it will trigger a class called .selected and will color the background in white.

the problem is when i press on one of them the white border is not spamming the entire width ( from start to end) also the text inside the background is not centered in the middle when i press it and i don't know why

code:

John Smith

Male, 26 years old

 Overview

Alerts

css code:

.container {
    border: 2px solid #57c0e8;
    background-color: #57c0e8;
    margin-top: 5%;
    float: left;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    color:white;
    display: flex;
    flex-direction: column;
    height:40rem;
    width:15rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    font-size:0.9rem;
}

.flex-item{
    margin-top: 2rem;
}

.selected{
    background-color: white;
    color: #57c0e8;
    border-radius: 50px 0 0 50px;
    box-shadow: 2px 2px 5px lightgray;
    width: 14rem;
    height: 5%;
    text-align: left;
}


问:
C# Encrypt string to RSA based on public key HUAWEI E8372
i've HUAWEI E8372 (LTE Wingle). I want to use the WEB API to control some settings.
WEB API is HTTP but encrypted with RSA POST/GET messages

At this moment i can get the SESSION TOKEN and PUBLIC RSA KEY for data exhchage.

But i'm unable to encrypt data with this public RSA key.

This is the public RSA that you can get from {modem_ip}/api/webserver/publickey.

```<code><?xml version="1.0" encoding="UTF-8"?>
<response>
<encpubkeyn>badee4e0554786797c0338bff35b80f68644c8cd96ccffd1b0f1f1558c885f237212e6499a91be2e578ee97418dac79aff85f871f38579fdc9b597aa50ad6b60dbc04a84f739647d6854881667688152c6686e715853a1adb2e5181a2ec38f86a6220e2cb30c9efab33fc453b78f0eb38a078b9c22d13b23969717b251bce6614f1c4a57decc0389ccb365ee6313f1b9fd82fc7872dd896c04518f765e7c02fa319d2f80bb2c3fc8cf615b5016ac8925ff299680b9e25ec996bb4a25cb045cc25bafd17b1d3648fbf3a69d5131b851d10e220b9f63f206db01debef0fa086cc0cf8fe816c83aac5232bbf0bda2335339556a0752f204ba3c18bdf4487b1ddbcb</encpubkeyn>
<encpubkeye>010001</encpubkeye>
</response>
</code>```

when i'm trying to convert it for RSA.FromXmlString(String) - bad data exception

see the following
C# RSA FromXmlString() BadData Exception

答:
The public key encryption method uses a combination of private key and public key. The private key is only known to your computer, and the public key is provided by your computer to any other computer that wants to communicate securely with it. To decode the encrypted message, the computer must use the public key provided by the computer that sent the message, as well as its own private key. Pretty good privacy (PGP) is a very popular public key encryption utility, which can be used to encrypt almost any data. The sending computer encrypts the document with the symmetric key, and then encrypts the symmetric key with the public key of the receiving computer. The latter uses its private key to decode the symmetric key, and then uses the symmetric key to decode the document.
  Implementing public key encryption on a large scale (for example, a secure web server might need it) requires an alternative approach. At this time, digital certificates can be used. Fundamentally, a digital certificate is a piece of information that states that the web server is trusted by an independent source called a certification authority. The certification authority acts as an intermediary that both computers trust. It confirms that the identity of each computer matches its declared identity, and then provides the public key of each computer to the other.</p>

Body:
i've HUAWEI E8372 (LTE Wingle). I want to use the WEB API to control some settings.
WEB API is HTTP but encrypted with RSA POST/GET messages

At this moment i can get the SESSION TOKEN and PUBLIC RSA KEY for data exhchage.

But i'm unable to encrypt data with this public RSA key.

This is the public RSA that you can get from {modem_ip}/api/webserver/publickey.

<?xml version="1.0" encoding="UTF-8"?>
<response>
<encpubkeyn>badee4e0554786797c0338bff35b80f68644c8cd96ccffd1b0f1f1558c885f237212e6499a91be2e578ee97418dac79aff85f871f38579fdc9b597aa50ad6b60dbc04a84f739647d6854881667688152c6686e715853a1adb2e5181a2ec38f86a6220e2cb30c9efab33fc453b78f0eb38a078b9c22d13b23969717b251bce6614f1c4a57decc0389ccb365ee6313f1b9fd82fc7872dd896c04518f765e7c02fa319d2f80bb2c3fc8cf615b5016ac8925ff299680b9e25ec996bb4a25cb045cc25bafd17b1d3648fbf3a69d5131b851d10e220b9f63f206db01debef0fa086cc0cf8fe816c83aac5232bbf0bda2335339556a0752f204ba3c18bdf4487b1ddbcb</encpubkeyn>
<encpubkeye>010001</encpubkeye>
</response>

when i'm trying to convert it for RSA.FromXmlString(String) - bad data exception

see the following
C# RSA FromXmlString() BadData Exception


问:
How to filter a particular category in Django for the blog?
How to filter a particular category in Django for the blog?
I have written the following code, you can mainly focus on views.py

urls.py-

urlpatterns = [
    path('', views.homepage, name="home"),
    url(r'^News/', views.News, name="News"),
    url(r'^Android/', views.android, name="android"),
    url(r'^PC/', views.PC, name="PC"),
    url(r'^MachineLearning/', views.MachineLearning, name="Offers"),
    url(r'^Offers/', views.Offers, name="Offers"),
    url(r'^Gaming/', views.Gaming, name="Gaming"),
    url(r'^Others/', views.Others, name="Others"),
    path('create/', views.article_create, name="create"),
    url(r'^(?P<slug>[\w-]+)/$', views.article_detail, name="detail"),
    url(r'^(?P<slug>[\w-]+)/edit/', views.article_update, name="post_edit"),
    url(r'^(?P<slug>[\w-]+)/edit/post_edit', views.article_update, name="post_edit"),
    url(r'^(?P<slug>[\w-]+)/delete/', views.article_delete, name="delete_post"),
]```
</div>
</div>
</p>

<p><strong>models.py-</strong></p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>class Home(models.Model):
    title = models.CharField(max_length=100)
    tag1 = models.CharField(max_length=100, default='Tech')
    tag2 = models.CharField(max_length=100, default='Android')
    tag3 = models.CharField(max_length=100, default='Best')
    tag4 = models.CharField(max_length=100, default='News')
    tag5 = models.CharField(max_length=100, default='PC')
    slug = models.SlugField(max_length=250, null=True, blank=True)
    body = models.TextField()
    CATEGORY_CHOICES = [
        ('NEWS', 'News'),
        ('ANDROID', 'Android'),
        ('PC', 'PC'),
        ('Machine Learning', 'Machine Learning'),
        ('OFFERS', 'Offers'),
        ('OTHERS', 'Others'),
        ('GAMING', 'Gaming'),
    ]
    category = models.CharField(
        max_length=20,
        choices=CATEGORY_CHOICES,
        default='OTHERS',
    )

    link = models.URLField(blank=True)
    date = models.DateTimeField(auto_now_add=True)
    pub_date = models.DateTimeField(auto_now_add=True)
    thumb = models.ImageField(default='default.png', blank=True)
    thumbnail = CloudinaryField('image')
    author = models.ForeignKey(User, default=None, on_delete=models.CASCADE)

    def __str__(self):
        return self.title

    def snippet(self):
        return self.body[:100]+'...'

    def get_absolute_url(self):
        return '/' + self.title</code>```

views.py-

def Others(request):
    homeblog_list = Home.objects.all().order_by('-date')
    paginator = Paginator(homeblog_list, 10)
    page = request.GET.get('page')
    homeblog = paginator.get_page(page)
    return render(request, 'home/Others.html', {'articles': homeblog})```

Now, in views.py I want to fetch only the "Others" category in < Home.objects.all().order_by('-date') > this function.
How to do that. What parameter should I pass?

答:
Use filter()

```<code>Home.objects<b>.filter(category='OTHERS')</b>.order_by('-date')</code>```

Body:
How to filter a particular category in Django for the blog?
I have written the following code, you can mainly focus on views.py

urls.py-

urlpatterns = [
    path('', views.homepage, name="home"),
    url(r'^News/', views.News, name="News"),
    url(r'^Android/', views.android, name="android"),
    url(r'^PC/', views.PC, name="PC"),
    url(r'^MachineLearning/', views.MachineLearning, name="Offers"),
    url(r'^Offers/', views.Offers, name="Offers"),
    url(r'^Gaming/', views.Gaming, name="Gaming"),
    url(r'^Others/', views.Others, name="Others"),
    path('create/', views.article_create, name="create"),
    url(r'^(?P<slug>[\w-]+)/$', views.article_detail, name="detail"),
    url(r'^(?P<slug>[\w-]+)/edit/', views.article_update, name="post_edit"),
    url(r'^(?P<slug>[\w-]+)/edit/post_edit', views.article_update, name="post_edit"),
    url(r'^(?P<slug>[\w-]+)/delete/', views.article_delete, name="delete_post"),
]

models.py-

class Home(models.Model):
    title = models.CharField(max_length=100)
    tag1 = models.CharField(max_length=100, default='Tech')
    tag2 = models.CharField(max_length=100, default='Android')
    tag3 = models.CharField(max_length=100, default='Best')
    tag4 = models.CharField(max_length=100, default='News')
    tag5 = models.CharField(max_length=100, default='PC')
    slug = models.SlugField(max_length=250, null=True, blank=True)
    body = models.TextField()
    CATEGORY_CHOICES = [
        ('NEWS', 'News'),
        ('ANDROID', 'Android'),
        ('PC', 'PC'),
        ('Machine Learning', 'Machine Learning'),
        ('OFFERS', 'Offers'),
        ('OTHERS', 'Others'),
        ('GAMING', 'Gaming'),
    ]
    category = models.CharField(
        max_length=20,
        choices=CATEGORY_CHOICES,
        default='OTHERS',
    )

    link = models.URLField(blank=True)
    date = models.DateTimeField(auto_now_add=True)
    pub_date = models.DateTimeField(auto_now_add=True)
    thumb = models.ImageField(default='default.png', blank=True)
    thumbnail = CloudinaryField('image')
    author = models.ForeignKey(User, default=None, on_delete=models.CASCADE)

    def __str__(self):
        return self.title

    def snippet(self):
        return self.body[:100]+'...'

    def get_absolute_url(self):
        return '/' + self.title

views.py-

def Others(request):
    homeblog_list = Home.objects.all().order_by('-date')
    paginator = Paginator(homeblog_list, 10)
    page = request.GET.get('page')
    homeblog = paginator.get_page(page)
    return render(request, 'home/Others.html', {'articles': homeblog})

Now, in views.py I want to fetch only the "Others" category in < Home.objects.all().order_by('-date') > this function.
How to do that. What parameter should I pass?

Body:
Use filter()

Home.objects.filter(category='OTHERS').order_by('-date')


答:
To center (vertically) text inside, just add align-items: center to .flex-item:

```<code>.flex-item {
    display: flex;
    align-items: center;
}
</code>```

And to be full width, change to width: 100% on .selected

Title: text not centered with background color

Body:
To center (vertically) text inside, just add align-items: center to .flex-item:

.flex-item {
    display: flex;
    align-items: center;
}

And to be full width, change to width: 100% on .selected


问:
Fetching JSON data on Ajax button click in .net core
I am new to Ajax. Trying to fetch JSON data returned from Get webAPI from controllers but on button click nothing rendering on View.

This is how my view look like

<!DOCTYPE html>

    <title></title>
    <meta charset="utf-8" />

    <input id="btn" type="button" value="Get All Employees" />
    <input id="btnClear" type="button" value="Clear" />

```

This is the JSON data returned by webapi

Can anyone help me what went wrong here? Thanks in advance.

答:
Below should work:</p>

```<code>    $(document).ready(function () {
    var ulEmployees = $('#ulEmployees');
    $('#btn').click(function () {
        var id = $(this).attr('id');
        fetch('/api/employee?id=' + id)
        .then((resp) => resp.json())
        .then(function(data) {
        ulEmployees.empty();
            $.each(data, function (index, val) {
                var fullName = val.firstName + ' ' + val.lastName;
                ulEmployees.append('<li>' + fullName + '</li>');
            });
        })
        .catch(function(error) {
            console.log(error);
        });

    });
});
</code>```

Body:
I am new to Ajax. Trying to fetch JSON data returned from Get webAPI from controllers but on button click nothing rendering on View.

This is how my view look like

<!DOCTYPE html>

    <title></title>
    <meta charset="utf-8" />

    <input id="btn" type="button" value="Get All Employees" />
    <input id="btnClear" type="button" value="Clear" />

This is the JSON data returned by webapi

Can anyone help me what went wrong here? Thanks in advance.

Body:
Below should work:

    $(document).ready(function () {
    var ulEmployees = $('#ulEmployees');
    $('#btn').click(function () {
        var id = $(this).attr('id');
        fetch('/api/employee?id=' + id)
        .then((resp) => resp.json())
        .then(function(data) {
        ulEmployees.empty();
            $.each(data, function (index, val) {
                var fullName = val.firstName + ' ' + val.lastName;
                ulEmployees.append('<li>' + fullName + '</li>');
            });
        })
        .catch(function(error) {
            console.log(error);
        });

    });
});


问:
need help with excel vlookup
```<code>=IF(N101<>"",ROUND(VLOOKUP($N101,$I$30:$U$39,12,FALSE)/(1-(U$96+U$98)),0),0)
</code>```

That is the current VLOOKUP in the spreadsheet that is returning the wrong data. I didnt write it, it was on a spreadsheet before i came to the company.

What I want to happen is look up the value in $N101 then i want it to find the row that is the same from i30 to i40 take whats in ((k30-j30/)/(1-(U$96+U$98))
when i say k30 i actually mean k30-k40 depending on the match.

This would really help me out

答:
Try

=IF(N101<>"",ROUND(VLOOKUP($N101,$I$30:$U$39,#COL,FALSE)/(1-(U$96+U$98)),0),0)

where #COL is the integer that corresponds to the column containing the resulting value from K$30-J$30 (for example).

Title: need help with excel vlookup

Body:
=IF(N101<>"",ROUND(VLOOKUP($N101,$I$30:$U$39,12,FALSE)/(1-(U$96+U$98)),0),0)

That is the current VLOOKUP in the spreadsheet that is returning the wrong data. I didnt write it, it was on a spreadsheet before i came to the company.

What I want to happen is look up the value in $N101 then i want it to find the row that is the same from i30 to i40 take whats in ((k30-j30/)/(1-(U$96+U$98))
when i say k30 i actually mean k30-k40 depending on the match.

This would really help me out


问:
need to pass another value to change event
please give me advise, how can I solve this problem. I need to pass area.id to onChangeArea method to make request, but also I can not change value of options, because I need area.code in formControlName. How can I pass id to onChangeArea?

答:
You can simply call the function by binding it with the click event of the dropdown.
You have the access to the whole object area at the options level. so just modify your code with the below lines of code.</p>

```<code><select id="area" class="form-control" #area formControlName="area">
  <option value="*" (click)="onAreadChange('*')">Bce</option>
  <option *ngFor="let area of areas" [value]="area.code"
  (click)="onAreaChange(area._id)">
   {{area.code}}
  </option>
</select>
</code>```

Body:
You can simply call the function by binding it with the click event of the dropdown.
You have the access to the whole object area at the options level. so just modify your code with the below lines of code.

<select id="area" class="form-control" #area formControlName="area">
  <option value="*" (click)="onAreadChange('*')">Bce</option>
  <option *ngFor="let area of areas" [value]="area.code"
  (click)="onAreaChange(area._id)">
   {{area.code}}
  </option>
</select>


问:
How to separate table rows with a line
I have a basic HTML table which contains table rows. My goal is to separate those table rows with a visible line (for better readability of the content).

How could I do this?

答:
Set colspan to your number of columns, and background color as you wish</p>

```<code><tr style="background: #aaa;">
 <td colspan="2"></td>
</tr>
</code>```

Title: How to separate table rows with a line

Body:
Set colspan to your number of columns, and background color as you wish

<tr style="background: #aaa;">
 <td colspan="2"></td>
</tr>


问:
Endless loop and StackOverflow with a proxy
I'm trying to make the tricky thing. I have method ObjectFactory.getObject() which returns an Object that needs to implement Serializable. I'm trying to make a proxy of an already existing instance of ObjectFactory, intercept its method getObject() and then wrap returned object to a proxy, which implements Serializable.

```<code>@Override
public Object get(String name, ObjectFactory<?> objectFactory) {

    ...

    ObjectFactory<?> serializableObjectFactory = (ObjectFactory<?>)Proxy.newProxyInstance(CurrentClass.class.getClassLoader(), new Class[]{ObjectFactory.class}, new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            //Here I'm getting StackOverflow exception. I guess, it just invokes itself recursively. Don't know why
            Object result = ((ObjectFactory<?>) proxy).getObject();

            //Here I make object implement Serializable
            return Mixin.create(new Class[]{Serializable.class, result.getClass()}, new Object[] {result});
        }
    });

    ...

    return super.get(name, serializableObjectFactory);
}
</code>```

When code comes to Object result = ((ObjectFactory<?>) proxy).getObject() it seems just invokes itself recursively(I'm getting StackOverflow exception) and I have no idea why.

I have two guesses about which I can't be sure:

I use proxy in the wrong way. But I checked and it seems to be fine.

Object proxy in method invoke() comes as a proxy so it might invoke itself in an endless loop. I didn't find how to unwrap this proxy to a real object besides Advise, but it doesn't suit this proxy.

Do you have any guesses what's wrong?

答:
Let's take a look at this line:

```<code>Object result = ((ObjectFactory<?>) proxy).getObject();
</code>```

What do you think is going to happen?

It invokes the proxy.

The proxy invokes your InvocationHandler.

Go back to step 1.

Maybe call the method on objectFactory instead?

Body:
I'm trying to make the tricky thing. I have method ObjectFactory.getObject() which returns an Object that needs to implement Serializable. I'm trying to make a proxy of an already existing instance of ObjectFactory, intercept its method getObject() and then wrap returned object to a proxy, which implements Serializable.

@Override
public Object get(String name, ObjectFactory<?> objectFactory) {

    ...

    ObjectFactory<?> serializableObjectFactory = (ObjectFactory<?>)Proxy.newProxyInstance(CurrentClass.class.getClassLoader(), new Class[]{ObjectFactory.class}, new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            //Here I'm getting StackOverflow exception. I guess, it just invokes itself recursively. Don't know why
            Object result = ((ObjectFactory<?>) proxy).getObject();

            //Here I make object implement Serializable
            return Mixin.create(new Class[]{Serializable.class, result.getClass()}, new Object[] {result});
        }
    });

    ...

    return super.get(name, serializableObjectFactory);
}

When code comes to Object result = ((ObjectFactory<?>) proxy).getObject() it seems just invokes itself recursively(I'm getting StackOverflow exception) and I have no idea why.

I have two guesses about which I can't be sure:

I use proxy in the wrong way. But I checked and it seems to be fine.

Object proxy in method invoke() comes as a proxy so it might invoke itself in an endless loop. I didn't find how to unwrap this proxy to a real object besides Advise, but it doesn't suit this proxy.

Do you have any guesses what's wrong?

Body:
Let's take a look at this line:

Object result = ((ObjectFactory<?>) proxy).getObject();

What do you think is going to happen?

It invokes the proxy.

The proxy invokes your InvocationHandler.

Go back to step 1.

Maybe call the method on objectFactory instead?


问:
How to avoid all TSLint errors
I have 2 angular projects in my machine.

When I doing the first project nothing wrong with me there. I worked freely(without TSLint errors). But my second project always shows TSLint errors. I want the second project to be like the first one. Is there any way to do this?

```<code>Angular CLI: 8.3.26
Node: 12.16.3
OS: win32 x64
Angular: 8.2.14

@angular-devkit/architect         0.803.26
@angular-devkit/build-angular     0.803.26
@angular-devkit/build-optimizer   0.803.26
@angular-devkit/build-webpack     0.803.26
@angular-devkit/core              8.3.26
@angular-devkit/schematics        8.3.26
@angular/cli                      8.3.26
@ngtools/webpack                  8.3.26
@schematics/angular               8.3.26
@schematics/update                0.803.26
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2
</code>```

This is an image of the First project. Which if works fine. Look,5 new lines, but no TSLint errors.

This is an image of the second project.

I want to make the second project work like the first. Is there is any way to do this?

答:
If you are using vs code, and you have tslint extension installed disable it to ignore lint errors.

Alternate options:

Remove the tslint.json file

Remove the dependency on tslint in the package.json file

Uninstall TSLint with npm uninstall tslint

Title: How to avoid all TSLint errors

Body:
I have 2 angular projects in my machine.

When I doing the first project nothing wrong with me there. I worked freely(without TSLint errors). But my second project always shows TSLint errors. I want the second project to be like the first one. Is there any way to do this?

Angular CLI: 8.3.26
Node: 12.16.3
OS: win32 x64
Angular: 8.2.14

@angular-devkit/architect         0.803.26
@angular-devkit/build-angular     0.803.26
@angular-devkit/build-optimizer   0.803.26
@angular-devkit/build-webpack     0.803.26
@angular-devkit/core              8.3.26
@angular-devkit/schematics        8.3.26
@angular/cli                      8.3.26
@ngtools/webpack                  8.3.26
@schematics/angular               8.3.26
@schematics/update                0.803.26
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

This is an image of the First project. Which if works fine. Look,5 new lines, but no TSLint errors.

This is an image of the second project.

I want to make the second project work like the first. Is there is any way to do this?