Removing checkout button container in shopify debut theme | liquid

Question: I am trying to set up a minimum order amount for one product that is not affecting other products. If the minimum order is not met I want to hide the entire checkout button container i.e normal checkout, Paypal and gpay.
I was trying to write some code following this logic:
the product that is meant to have the minimum order amount get's the tag: min10.
I imagined a piece of code in the checkout and cart page that looks something like this:
 {% assign show_checkout_button = true %}
  {% for item in cart.items %}
    {% if item.product.tags contains 'min10' and item.quantity <= 9 %}
 {% assign show_checkout_button = false %}

You will need to purchase at least 10 of the product "{{ item.product.title }}"

    {% endif %}
  {% endfor %}
  {% if show_checkout_button %}

  {% endif %}

Unfortunately, that doesn't seem to work. I am unfamiliar with liquid and generally not great at writing code.
Can someone tell me what is wrong in my code and how I can actually hide the button container?
I know it's solved like checkoutbtn.ishidden in other languages. how is this done in liquid?
And where exactly would I have to place it?
Thanks in advance! This is doing my head in the entire day already.

{{ 'cart.general.title' | t }}

        {{ 'cart.general.continue_shopping' | t }}

    <form action="{{ routes.cart_url }}" method="post" novalidate class="cart">

          {{ 'cart.label.product' | t }}
          {{ 'cart.label.price' | t }}
          {{ 'cart.label.quantity' | t }}
          {{ 'cart.label.total' | t }}

          {%- for item in cart.items -%}

                    <img class="cart__image{% if item.image == null %} hide{% endif %}" src="{% comment ls-rpl %}{{ item | img_url: 'x190' }}{% endcomment %}{%- capture LS_IMG_URL -%}{%- render "ls-img-url", image: item, img_url: 'x190' -%}{%- endcapture -%}{{ LS_IMG_URL }}{% comment /ls-rpl %}{% endcomment %}" alt="{% comment ls-rpl %}{{ item.image.alt | escape }}{% endcomment %}{%- capture LS_ALT -%}{%- render "ls-alt", image: item.image -%}{%- endcapture -%}{{ LS_ALT | escape }}{% comment /ls-rpl %}{% endcomment %}" data-cart-item-image>

                        {{ item.product.title }}

                    {%- assign variant_options = 'template ' | split: ' ' -%}
                    {%- if item.product.has_only_default_variant != true -%}
                      {%- assign variant_options = item.options_with_values -%}
                    {%- endif -%}
                    {%- assign property_size = item.properties | size -%}

                      {%- for option in variant_options -%}

{{ option.name }}: {{ option.value }}

                      {%- endfor -%}

                      {%- comment -%}
                        Optional, loop through custom product line items if available

                        Line item properties come in as having two parts. The first part will be passed with the default form,
                        but p.last is the actual custom property and may be blank. If it is, don't show it.

                        For more info on line item properties, visit:
                          - http://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-product-page-Like-for-a-monogram-engraving-or-customization
                      {%- endcomment -%}

                      {%- assign properties = 'template ' | split: ' ' -%}
                      {%- if property_size > 0 -%}
                        {%- assign properties = item.properties -%}
                      {%- endif -%}

                      {%- for p in properties -%}
                        {%- unless p.last == blank -%}

                            {{ p.first }}:

                            {%- comment -%}
                              Check if there was an uploaded file associated
                            {%- endcomment -%}

                              {%- if p.last contains '/uploads/' -%}
                                {{ p.last | split: '/' | last }}
                              {%- else -%}
                                {{ p.last }}
                              {%- endif -%}

                        {%- endunless -%}
                      {%- endfor -%}

                      {{ 'cart.general.remove' | t }}

                {%- assign hasDiscount = false -%}
                {%- if item.original_price != item.final_price -%}
                  {%- assign hasDiscount = true -%}
                {%- endif -%}

                    {%- comment -%}
                      Markup template for discount item
                    {%- endcomment -%}

                        {{ 'products.product.regular_price' | t }}

                        <s data-cart-item-original-price>{% comment ls-rpl %}{{ item.original_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}</s>

                        {{ 'products.product.sale_price' | t }}

                        {% comment ls-rpl %}{{ item.final_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.final_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                    {%- comment -%}
                      Markup template for regular price item
                    {%- endcomment -%}

                        {{ 'products.product.regular_price' | t }}

                        {% comment ls-rpl %}{{ item.original_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                    {%- comment -%}
                      Markup template for unit price
                    {%- endcomment -%}

                        {{ 'products.product.unit_price_label' | t }}

                          {%- capture unit_price_separator -%}
                            /{{ 'general.accessibility.unit_price_separator' | t }}
                          {%- endcapture -%}
                          {%- capture unit_price_base_unit -%}
                            {%- if item.unit_price_measurement.reference_value != 1 -%}
                              {{- item.unit_price_measurement.reference_value -}}
                            {%- endif -%}
                            {{ item.unit_price_measurement.reference_unit }}
                          {%- endcapture -%}

                          {% comment ls-rpl %}{{ item.unit_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.unit_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}{{- unit_price_separator -}}{{- unit_price_base_unit -}}

                {%- assign itemDiscounts = 'template ' | split: ' ' -%}
                {%- if item.line_level_discount_allocations != blank -%}
                  {%- assign itemDiscounts = item.line_level_discount_allocations -%}
                {%- endif -%}

                  {%- for discount_allocation in itemDiscounts -%}

                      {% include 'icon-saletag' %}

                        {{- discount_allocation.discount_application.title -}}
                       (-{% comment ls-rpl %}{{ discount_allocation.amount | money }}{% endcomment %}{%- assign LS_AMOUNT = discount_allocation.amount -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %})

                  {%- endfor -%}

                    {{ 'cart.label.qty' | t }}

                  <input id="updates_{{ item.key }}" class="cart__qty-input" type="number"
                    value="{{ item.quantity }}" min="0" pattern="[0-9]*"
                    data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-mobile>

                  {{ 'general.accessibility.error' | t }}
                  {% include 'icon-error' %}

                  {{ 'cart.label.quantity' | t }}
                  <input id="updates_large_{{ item.key }}" class="cart__qty-input" type="number"
                    name="updates[]" value="{{ item.quantity }}" min="0" pattern="[0-9]*"
                    data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-desktop>

                  {{ 'general.accessibility.error' | t }}
                  {% include 'icon-error' %}

                {%- comment -%}
                  Markup template for discount item
                {%- endcomment -%}

                    {{ 'cart.label.regular_total' | t }}

                    <s data-cart-item-original-price>{% comment ls-rpl %}{{ item.original_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}</s>

                    {{ 'cart.label.discounted_total' | t }}

                    {% comment ls-rpl %}{{ item.final_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.final_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                {%- comment -%}
                  Markup template for regular price item
                {%- endcomment -%}

                  {% comment ls-rpl %}{{ item.original_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

          {%- endfor -%}

          {%- if section.settings.cart_notes_enable -%}

              {{ 'cart.general.note' | t }}
              <textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes>{{ cart.note }}</textarea>

          {%- endif -%}

            {%- assign cartDiscounts = 'template ' | split: ' ' -%}
            {%- if cart.cart_level_discount_applications.size > 0 -%}
              {%- assign cartDiscounts = cart.cart_level_discount_applications -%}
            {%- endif -%}

                {%- for discount_application in cartDiscounts -%}

                    {% include 'icon-saletag' %}{{ 'customer.order.discount' | t }}:{{- discount_application.title -}}

                    -{% comment ls-rpl %}{{ discount_application.total_allocated_amount | money }}{% endcomment %}{%- assign LS_AMOUNT = discount_application.total_allocated_amount -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                {%- endfor -%}

              {{ 'cart.general.subtotal' | t }}
              {% comment ls-rpl %}{{ cart.total_price | money_with_currency }}

{% endcomment %}{%- assign LS_AMOUNT = cart.total_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money_with_currency" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

            {%- capture taxes_shipping_checkout -%}
              {%- if shop.taxes_included and shop.shipping_policy.body != blank -%}
                {{ 'cart.general.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
              {%- elsif shop.taxes_included -%}
                {{ 'cart.general.taxes_included_but_shipping_at_checkout' | t }}
              {%- elsif shop.shipping_policy.body != blank -%}
                {{ 'cart.general.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
              {%- else -%}
                {{ 'cart.general.taxes_and_shipping_at_checkout' | t }}
              {%- endif -%}
            {%- endcapture -%}

{{ taxes_shipping_checkout }}

                {%- unless section.settings.cart_ajax_enable -%}
                <input type="submit" name="update"
                  class="cart__submit btn btn--secondary"
                  value="{{ 'cart.general.update' | t }}">
                {%- endunless -%}
                <input type="submit" name="checkout"
                  class="cart__submit btn btn--small-wide"
                  value="{{ 'cart.general.checkout' | t }}">

                {{ 'general.accessibility.error' | t }}
                {% include 'icon-error' %}

              {%- if additional_checkout_buttons -%}

{{ content_for_additional_checkout_buttons }}

              {%- endif -%}

    </form>

 0 %} hide{% endif %} text-center" data-empty-page-content>

{{ 'cart.general.title' | t }}

{{ 'cart.general.empty' | t }}

{{ 'cart.general.cookies_required' | t }}

    {{ 'general.404.link' | t }}{% include 'icon-arrow-right' %}

{% schema %}
{
  "name": {
    "da": "Side med indkøbskurv",
    "de": "Warenkorb-Seite",
    "en": "Cart page",
    "es": "Página del carrito de compras",
    "fi": "Ostoskorisivu",
    "fr": "Page du panier",
    "hi": "कार्ट पेज",
    "it": "Pagina del carrello",
    "ja": "カートページ",
    "ko": "카트 페이지",
    "nb": "Handlekurvside",
    "nl": "Winkelwagenpagina",
    "pt-BR": "Página do carrinho",
    "pt-PT": "Página do carrinho",
    "sv": "Varukorgssida",
    "th": "หน้าตะกร้าสินค้า",
    "zh-CN": "购物车页面",
    "zh-TW": "購物車頁面"
  },
  "settings": [
    {
      "type": "checkbox",
      "id": "cart_ajax_enable",
      "label": {
        "da": "Aktivér automatisk opdatering af indkøbskurv",
        "de": "Automatische Warenkorbaktualisierungen aktivieren",
        "en": "Enable automatic cart updates",
        "es": "Habilitar las actualizaciones automáticas del carrito de compra",
        "fi": "Ota automaattinen ostoskorin päivitykset käyttöön",
        "fr": "Activer les mises à jour automatiques",
        "hi": "स्वचालित कार्ट अपडेट सक्षम करें",
        "it": "Abilita aggiornamenti automatici carrello",
        "ja": "自動カートの更新を有効にする",
        "ko": "자동 카트 업데이트 활성화하기",
        "nb": "Aktiver automatiske oppdateringer av handlekurven",
        "nl": "Automatische winkelwagen-updates inschakelen",
        "pt-BR": "Permitir atualizações automáticas do carrinho",
        "pt-PT": "Ativar atualizações automáticas do carrinho",
        "sv": "Aktivera automatiska uppdateringar av varukorgen",
        "th": "เปิดใช้งานการอัปเดตตะกร้าสินค้าอัตโนมัติ",
        "zh-CN": "启用购物车自动更新功能",
        "zh-TW": "啟用自動更新購物車"
      },
      "info": {
        "da": "Opdaterer indkøbskurven, så snart kunden foretager ændringer",
        "de": "Aktualisiert den Warenkorb, sobald Kundenänderungen vorgenommen werden",
        "en": "Updates the cart as soon as customer changes are made",
        "es": "Actualiza el carrito de compra tan pronto como el cliente realice cambios",
        "fi": "Päivittää ostoskorin heti, kun asiakkaan muutokset on tehty",
        "fr": "Mise à jour du panier dès que les modifications apportées aux clients ont été effectuées",
        "hi": "ग्राहक के द्वारा परिवर्तन करते ही कार्ट को अपडेट हो जाता है",
        "it": "Aggiorna il carrello appena il cliente apporta le modifiche",
        "ja": "お客様が変更されるとすぐにカートを更新します",
        "ko": "고객 변경 시 카트를 업데이트합니다.",
        "nb": "Oppdaterer handlekurven så snart kundens endringer er gjort",
        "nl": "De winkelwagen wordt bijgewerkt zodra de klant wijzigingen aanbrengt",
        "pt-BR": "Atualiza o carrinho assim que o cliente faz alterações",
        "pt-PT": "Atualiza o carrinho assim que o cliente faz alterações",
        "sv": "Uppdaterar varukorgen så snart kundändringar görs",
        "th": "อัปเดตตะกร้าสินค้าเมื่อลูกค้าได้ทำการเปลี่ยนแปลง",
        "zh-CN": "客户做出更改后立即更新购物车",
        "zh-TW": "在顧客進行變更時立即更新購物車"
      },
      "default": true
    },
    {
      "type": "checkbox",
      "id": "cart_notes_enable",
      "label": {
        "da": "Aktivér bemærkninger til indkøbskurv",
        "de": "Warenkorb-Notifikationen erlauben",
        "en": "Enable cart notes",
        "es": "Habilitar notas de carrito",
        "fi": "Ota ostoskorin huomautukset käyttöön",
        "fr": "Activer les notes de panier",
        "hi": "कार्ट नोट्स सक्षम करें",
        "it": "Abilita note carrello",
        "ja": "カートメモを有効にする",
        "ko": "카트 참고 사항 사용",
        "nb": "Aktiver handlekurvmerknader",
        "nl": "Opmerkingen voor winkelwagen inschakelen",
        "pt-BR": "Habilitar observações do carrinho",
        "pt-PT": "Ativar notas do carrinho",
        "sv": "Aktivera varukorgsmeddelanden",
        "th": "เปิดใช้หมายเหตุของตะกร้าสินค้า",
        "zh-CN": "启用购物车备注",
        "zh-TW": "啟用購物車備註"
      },
      "default": false
    }
  ]
}
{% endschema %}
Comment: Your code is correct. If you place your code in `cart-template.liquid` it should work perfectly. Can you provide the whole template file content?
Comment: Sure thing. I have added the cart code to the original post
Comment: Your code is missing your conditions
Comment: I have removed them again because they haven't worked they way i wanted them to.
Can you tell me where exactly would I have to insert them?
Answer: I believe your code should be changed to something like that:

{{ 'cart.general.title' | t }}

        {{ 'cart.general.continue_shopping' | t }}

    <form action="{{ routes.cart_url }}" method="post" novalidate class="cart">

          {{ 'cart.label.product' | t }}
          {{ 'cart.label.price' | t }}
          {{ 'cart.label.quantity' | t }}
          {{ 'cart.label.total' | t }}

          {% assign show_checkout_button = true %}
          {%- for item in cart.items -%}

                    <img class="cart__image{% if item.image == null %} hide{% endif %}" src="{% comment ls-rpl %}{{ item | img_url: 'x190' }}{% endcomment %}{%- capture LS_IMG_URL -%}{%- render "ls-img-url", image: item, img_url: 'x190' -%}{%- endcapture -%}{{ LS_IMG_URL }}{% comment /ls-rpl %}{% endcomment %}" alt="{% comment ls-rpl %}{{ item.image.alt | escape }}{% endcomment %}{%- capture LS_ALT -%}{%- render "ls-alt", image: item.image -%}{%- endcapture -%}{{ LS_ALT | escape }}{% comment /ls-rpl %}{% endcomment %}" data-cart-item-image>

                        {{ item.product.title }}

                      {% if item.product.tags contains 'min10' and item.quantity <= 9 %}
                        {% assign show_checkout_button = false %}

You will need to purchase at least 10 of the product "{{ item.product.title }}"

                      {% endif %}

                    {%- assign variant_options = 'template ' | split: ' ' -%}
                    {%- if item.product.has_only_default_variant != true -%}
                      {%- assign variant_options = item.options_with_values -%}
                    {%- endif -%}
                    {%- assign property_size = item.properties | size -%}

                      {%- for option in variant_options -%}

{{ option.name }}: {{ option.value }}

                      {%- endfor -%}

                      {%- comment -%}
                        Optional, loop through custom product line items if available

                        Line item properties come in as having two parts. The first part will be passed with the default form,
                        but p.last is the actual custom property and may be blank. If it is, don't show it.

                        For more info on line item properties, visit:
                          - http://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-product-page-Like-for-a-monogram-engraving-or-customization
                      {%- endcomment -%}

                      {%- assign properties = 'template ' | split: ' ' -%}
                      {%- if property_size > 0 -%}
                        {%- assign properties = item.properties -%}
                      {%- endif -%}

                      {%- for p in properties -%}
                        {%- unless p.last == blank -%}

                            {{ p.first }}:

                            {%- comment -%}
                              Check if there was an uploaded file associated
                            {%- endcomment -%}

                              {%- if p.last contains '/uploads/' -%}
                                {{ p.last | split: '/' | last }}
                              {%- else -%}
                                {{ p.last }}
                              {%- endif -%}

                        {%- endunless -%}
                      {%- endfor -%}

                      {{ 'cart.general.remove' | t }}

                {%- assign hasDiscount = false -%}
                {%- if item.original_price != item.final_price -%}
                  {%- assign hasDiscount = true -%}
                {%- endif -%}

                    {%- comment -%}
                      Markup template for discount item
                    {%- endcomment -%}

                        {{ 'products.product.regular_price' | t }}

                        <s data-cart-item-original-price>{% comment ls-rpl %}{{ item.original_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}</s>

                        {{ 'products.product.sale_price' | t }}

                        {% comment ls-rpl %}{{ item.final_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.final_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                    {%- comment -%}
                      Markup template for regular price item
                    {%- endcomment -%}

                        {{ 'products.product.regular_price' | t }}

                        {% comment ls-rpl %}{{ item.original_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                    {%- comment -%}
                      Markup template for unit price
                    {%- endcomment -%}

                        {{ 'products.product.unit_price_label' | t }}

                          {%- capture unit_price_separator -%}
                            /{{ 'general.accessibility.unit_price_separator' | t }}
                          {%- endcapture -%}
                          {%- capture unit_price_base_unit -%}
                            {%- if item.unit_price_measurement.reference_value != 1 -%}
                              {{- item.unit_price_measurement.reference_value -}}
                            {%- endif -%}
                            {{ item.unit_price_measurement.reference_unit }}
                          {%- endcapture -%}

                          {% comment ls-rpl %}{{ item.unit_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.unit_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}{{- unit_price_separator -}}{{- unit_price_base_unit -}}

                {%- assign itemDiscounts = 'template ' | split: ' ' -%}
                {%- if item.line_level_discount_allocations != blank -%}
                  {%- assign itemDiscounts = item.line_level_discount_allocations -%}
                {%- endif -%}

                  {%- for discount_allocation in itemDiscounts -%}

                      {% include 'icon-saletag' %}

                        {{- discount_allocation.discount_application.title -}}
                       (-{% comment ls-rpl %}{{ discount_allocation.amount | money }}{% endcomment %}{%- assign LS_AMOUNT = discount_allocation.amount -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %})

                  {%- endfor -%}

                    {{ 'cart.label.qty' | t }}

                  <input id="updates_{{ item.key }}" class="cart__qty-input" type="number"
                    value="{{ item.quantity }}" min="0" pattern="[0-9]*"
                    data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-mobile>

                  {{ 'general.accessibility.error' | t }}
                  {% include 'icon-error' %}

                  {{ 'cart.label.quantity' | t }}
                  <input id="updates_large_{{ item.key }}" class="cart__qty-input" type="number"
                    name="updates[]" value="{{ item.quantity }}" min="0" pattern="[0-9]*"
                    data-quantity-input data-quantity-item="{{ forloop.index }}" data-quantity-input-desktop>

                  {{ 'general.accessibility.error' | t }}
                  {% include 'icon-error' %}

                {%- comment -%}
                  Markup template for discount item
                {%- endcomment -%}

                    {{ 'cart.label.regular_total' | t }}

                    <s data-cart-item-original-price>{% comment ls-rpl %}{{ item.original_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}</s>

                    {{ 'cart.label.discounted_total' | t }}

                    {% comment ls-rpl %}{{ item.final_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.final_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                {%- comment -%}
                  Markup template for regular price item
                {%- endcomment -%}

                  {% comment ls-rpl %}{{ item.original_line_price | money }}{% endcomment %}{%- assign LS_AMOUNT = item.original_line_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

          {%- endfor -%}

          {%- if section.settings.cart_notes_enable -%}

              {{ 'cart.general.note' | t }}
              <textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes>{{ cart.note }}</textarea>

          {%- endif -%}

            {%- assign cartDiscounts = 'template ' | split: ' ' -%}
            {%- if cart.cart_level_discount_applications.size > 0 -%}
              {%- assign cartDiscounts = cart.cart_level_discount_applications -%}
            {%- endif -%}

                {%- for discount_application in cartDiscounts -%}

                    {% include 'icon-saletag' %}{{ 'customer.order.discount' | t }}:{{- discount_application.title -}}

                    -{% comment ls-rpl %}{{ discount_application.total_allocated_amount | money }}{% endcomment %}{%- assign LS_AMOUNT = discount_application.total_allocated_amount -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

                {%- endfor -%}

              {{ 'cart.general.subtotal' | t }}
              {% comment ls-rpl %}{{ cart.total_price | money_with_currency }}

{% endcomment %}{%- assign LS_AMOUNT = cart.total_price -%}{%- capture LS_PRICE -%}{%- render "ls-price", price: LS_AMOUNT, filter: "money_with_currency" -%}{%- endcapture -%}{{ LS_PRICE }}{% comment /ls-rpl %}{% endcomment %}

            {%- capture taxes_shipping_checkout -%}
              {%- if shop.taxes_included and shop.shipping_policy.body != blank -%}
                {{ 'cart.general.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
              {%- elsif shop.taxes_included -%}
                {{ 'cart.general.taxes_included_but_shipping_at_checkout' | t }}
              {%- elsif shop.shipping_policy.body != blank -%}
                {{ 'cart.general.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
              {%- else -%}
                {{ 'cart.general.taxes_and_shipping_at_checkout' | t }}
              {%- endif -%}
            {%- endcapture -%}

{{ taxes_shipping_checkout }}

                {%- unless section.settings.cart_ajax_enable -%}
                <input type="submit" name="update"
                  class="cart__submit btn btn--secondary"
                  value="{{ 'cart.general.update' | t }}">
                {%- endunless -%}
                {% if show_checkout_button %}
                <input type="submit" name="checkout"
                  class="cart__submit btn btn--small-wide"
                  value="{{ 'cart.general.checkout' | t }}">
                {% endif %}

                {{ 'general.accessibility.error' | t }}
                {% include 'icon-error' %}

              {%- if additional_checkout_buttons and show_checkout_button -%}

{{ content_for_additional_checkout_buttons }}

              {%- endif -%}

    </form>

 0 %} hide{% endif %} text-center" data-empty-page-content>

{{ 'cart.general.title' | t }}

{{ 'cart.general.empty' | t }}

{{ 'cart.general.cookies_required' | t }}

    {{ 'general.404.link' | t }}{% include 'icon-arrow-right' %}

{% schema %}
{
  "name": {
    "da": "Side med indkøbskurv",
    "de": "Warenkorb-Seite",
    "en": "Cart page",
    "es": "Página del carrito de compras",
    "fi": "Ostoskorisivu",
    "fr": "Page du panier",
    "hi": "कार्ट पेज",
    "it": "Pagina del carrello",
    "ja": "カートページ",
    "ko": "카트 페이지",
    "nb": "Handlekurvside",
    "nl": "Winkelwagenpagina",
    "pt-BR": "Página do carrinho",
    "pt-PT": "Página do carrinho",
    "sv": "Varukorgssida",
    "th": "หน้าตะกร้าสินค้า",
    "zh-CN": "购物车页面",
    "zh-TW": "購物車頁面"
  },
  "settings": [
    {
      "type": "checkbox",
      "id": "cart_ajax_enable",
      "label": {
        "da": "Aktivér automatisk opdatering af indkøbskurv",
        "de": "Automatische Warenkorbaktualisierungen aktivieren",
        "en": "Enable automatic cart updates",
        "es": "Habilitar las actualizaciones automáticas del carrito de compra",
        "fi": "Ota automaattinen ostoskorin päivitykset käyttöön",
        "fr": "Activer les mises à jour automatiques",
        "hi": "स्वचालित कार्ट अपडेट सक्षम करें",
        "it": "Abilita aggiornamenti automatici carrello",
        "ja": "自動カートの更新を有効にする",
        "ko": "자동 카트 업데이트 활성화하기",
        "nb": "Aktiver automatiske oppdateringer av handlekurven",
        "nl": "Automatische winkelwagen-updates inschakelen",
        "pt-BR": "Permitir atualizações automáticas do carrinho",
        "pt-PT": "Ativar atualizações automáticas do carrinho",
        "sv": "Aktivera automatiska uppdateringar av varukorgen",
        "th": "เปิดใช้งานการอัปเดตตะกร้าสินค้าอัตโนมัติ",
        "zh-CN": "启用购物车自动更新功能",
        "zh-TW": "啟用自動更新購物車"
      },
      "info": {
        "da": "Opdaterer indkøbskurven, så snart kunden foretager ændringer",
        "de": "Aktualisiert den Warenkorb, sobald Kundenänderungen vorgenommen werden",
        "en": "Updates the cart as soon as customer changes are made",
        "es": "Actualiza el carrito de compra tan pronto como el cliente realice cambios",
        "fi": "Päivittää ostoskorin heti, kun asiakkaan muutokset on tehty",
        "fr": "Mise à jour du panier dès que les modifications apportées aux clients ont été effectuées",
        "hi": "ग्राहक के द्वारा परिवर्तन करते ही कार्ट को अपडेट हो जाता है",
        "it": "Aggiorna il carrello appena il cliente apporta le modifiche",
        "ja": "お客様が変更されるとすぐにカートを更新します",
        "ko": "고객 변경 시 카트를 업데이트합니다.",
        "nb": "Oppdaterer handlekurven så snart kundens endringer er gjort",
        "nl": "De winkelwagen wordt bijgewerkt zodra de klant wijzigingen aanbrengt",
        "pt-BR": "Atualiza o carrinho assim que o cliente faz alterações",
        "pt-PT": "Atualiza o carrinho assim que o cliente faz alterações",
        "sv": "Uppdaterar varukorgen så snart kundändringar görs",
        "th": "อัปเดตตะกร้าสินค้าเมื่อลูกค้าได้ทำการเปลี่ยนแปลง",
        "zh-CN": "客户做出更改后立即更新购物车",
        "zh-TW": "在顧客進行變更時立即更新購物車"
      },
      "default": true
    },
    {
      "type": "checkbox",
      "id": "cart_notes_enable",
      "label": {
        "da": "Aktivér bemærkninger til indkøbskurv",
        "de": "Warenkorb-Notifikationen erlauben",
        "en": "Enable cart notes",
        "es": "Habilitar notas de carrito",
        "fi": "Ota ostoskorin huomautukset käyttöön",
        "fr": "Activer les notes de panier",
        "hi": "कार्ट नोट्स सक्षम करें",
        "it": "Abilita note carrello",
        "ja": "カートメモを有効にする",
        "ko": "카트 참고 사항 사용",
        "nb": "Aktiver handlekurvmerknader",
        "nl": "Opmerkingen voor winkelwagen inschakelen",
        "pt-BR": "Habilitar observações do carrinho",
        "pt-PT": "Ativar notas do carrinho",
        "sv": "Aktivera varukorgsmeddelanden",
        "th": "เปิดใช้หมายเหตุของตะกร้าสินค้า",
        "zh-CN": "启用购物车备注",
        "zh-TW": "啟用購物車備註"
      },
      "default": false
    }
  ]
}
{% endschema %}
Comment: That worked perfectly! You are an absolute legend mate!


Propositional logic simplification using laws

Question: I've been given the propisition below and the task to simplify it to the simplest equal proposition.
$$
(p \rightarrow (q \vee r)) \rightarrow (p \wedge (q \vee r))
$$
I've been trying to do this for a bit now and the only steps I can possibly think of are these.
Distribution
$$
( p \rightarrow (q \vee r)) \rightarrow ((p \wedge r) \vee (p \wedge r))
$$
or (not sure if this one is correct)
Implication
$$
(\neg p \vee (q \vee r)) \rightarrow ((p \wedge r) \vee (p \wedge r))
$$
Because I had no idea where to start, I attempted to create a truth table (I left out some of the steps below, it's a pain to create this in markdown). This shows that the proposition is equal to p. This shows me where I should end up.

p
q
r
$ (p \rightarrow (q \vee r)) \rightarrow (p \wedge (q \vee r))$

0
0
0
0

0
0
1
0

0
1
0
0

0
1
1
0

1
0
0
1

1
0
1
1

1
1
0
1

1
1
1
1

If someone could point me in the right direction and especially tell me which steps they took and more importantly why, that would be very helpful. I really want to understand this but I am struggeling.
Answer: Hint: Let $q \vee r = s$. The proposition would be $$(p \rightarrow s) \rightarrow (p \wedge s)$$
Just use implication twice then use distribution. (Yes, you can finish it like there are only two of them)
Comment: So, if I am correct, that leaves me with: $\neg(\neg p \vee s)  \vee (p \vee s)$. Can I then get rid of the $\vee s$ on both sides? Since they are the same on both sides?
Comment: @user214910485 it should be $\neg(\neg p \vee s) \vee(p \wedge s)$ which equivalent with $(p \wedge \neg s)\vee (p \wedge s)$
Comment: Yes my bad, i messed up the latex thing and can't edit it anymore. So when I simplify the negation it basically says p and not s OR p and s. Which makes the value of s irrelevant (is that the negation law?). That leaves me with $ p \vee p $ which is p, right?
Comment: @user214910485 It is also distribution law: $$(p \wedge \neg s) \vee (p \wedge s) \equiv p \vee (\neg s \wedge s).$$
Comment: I understand what you mean now, I've been able to solve it. Thank you so much for your patience!


params appearing in params[:format] when passing to _path route helper

Question: I have a function which calls a _path helper function with several parameters:
v2_specific_path(user, filter_params)
This works great, and in the controller method that handles this path I see both user and filter_params and their values.
In fact if I try to print out params they don't show up, but if I print out either one of them then they print out fine. filter_params has a helper function which builds a hash from several params[:keys] so that might be the reason.
What I'm trying to do is add another set of parameters to the function call:
v2_specific_path(user, new_params, filter_params)
Since I'm trying to add some functionality which requires passing some information to the underlying controller that resolves this request.
The problem is that this doesn't work and seems to screw things over:

If I put them in the middle: v2_specific_path(user, new_params, filter_params), then all the other params work great, but new_params actually appear inside params[:format] as: params[:format]="param1=4&param2=hi
If I put them at the end: v2_specific_path(user, filter_params, new_params) then filter_params doesn't get parsed at all and appears in params[:format] but new_format does appear to be parsed and appear in params correctly

I can't seem to figure out why this is happening. I've made sure I have correct params.require/params.permit values in the controller.
Any help is appreciated, if anyone has any other alternatives to passing values from application_helper to a controller (via _path, or some shared variable) that would also help immensely
Thank you!
Comment: an actual code block might help in understanding what's really happening
Comment: Please post the code for the `filter_params` method. Because this is where you probably need to make the change.
Answer: For anyone seeking a solution to this:
I fixed this by doing two things:
1) created proper new routes which suited my implementation (I tried to do something a bit too clever and decided to just create new relevant routes instead of doing something too dynamic
2) I added the params I needed in to the routes: /something/:param1/whatever/:param2 etc.
This worked for me


iOS13 UIDocumentPickerViewController - open directory does not display select/open/cancel buttons

Question: I am using UIDocumentPickerViewController to browse through and let the user select a directory but on iOS 13 when this UIDocumentPickerViewController is displayed, the buttons that should be displayed like select/cancel and open/done are not displayed but when you tap on that location it does behaves like how it would if the buttons were visible. Also this problem is seen only on iOS 13. With the same code, the buttons are displayed on iOS 12. Any help is appreciated
I do have the navigation bar's tint color set to nil for an instance of UIDocumentBrowserViewController in AppDelegate didFinishLaunchingWithOptions.
if #available(iOS 11.0, *) {
    UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).tintColor = nil
}

//Here is how UIDocumentPickerViewController is created and presented
let documentPickerViewController = UIDocumentPickerViewController(documentTypes:["public.folder"], in: .open)
...
...
...

self!.documentPickerViewController.delegate = self!
self!.documentPickerViewController.allowsMultipleSelection = true
self!.documentPickerViewController.modalPresentationStyle = .fullScreen

self!.navigationController?.present(self!.documentPickerViewController, animated: true, completion:nil)

Here is a screenshot

Edit :
Here is the View Hierarchy - Not sure why DOCExportModeViewController on iOS 13. On iOS 12, it is a UIDocumentBrowserViewController for the same code. Any ideas how this can be fixed?
Comment: I observe this behavior in light mode, where buttons seem to be there but white on white, and therefore invisible. That's why they still work by knowing their position.
Answer: I found this quick fix, if the document ViewController or any other picker is used at multiple places:
if #available(iOS 11.0, *) {
    UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).tintColor = nil
}

If you are worried for one place or have different colors at different places you can set tint color in ViewWillAppear and reset it in ViewWillDisappear method.
Answer: I have observed that UIDocumentPickerController is a subclass of UIViewController Where UIImagepickerController is a subclass of UINavigationController.
if you try to set tintColor of navBar for UIImagePickerController , you can directly access it like imagePicker.navigationBar.tintColor = .red, coming to the document picker, you Cann't access navigationBar directly.you can access it by imagePicker.navigationController?.navigationBar.tintColor = .red. Here navigationController is Optional.thats why we are unable to access navbar directly and make changes.

Apple created an app with document picker. Refer source code here: Particles
Comment: Your first suggestion does not work and I cannot set the tint color globally.
Comment: I have updated the answer and please make me correct if I was wrong.


Autofac in console applications (convention)

Question: I would like to use Autofac in console application. It is my really first usage. Before that I was using it in ASP.NET MVC only. In MVC project I can setup Autofac in Global.asax, inject IService to controller and we can say more and less it works.
In console application I do it like below:
internal class Program
{
    private static IContainer Container { get; set;}

    private static void Main(string[] args)
    {
         Container = Container.Configure(); // here I have all necessary objects set
         // now I can use it in Main method as:
         using (var scope = Container.BeginLifetimeScope())
         {
             scope.Resolve<ISomething>();
         }
    }
}

As you can see usage of it is simple in just Main method. How about using it in external class? Let say I would like to create class Cat, and inside that use Autofac. should I pass to contructor object Container from class Program? E.g.:
Cat cat = new Cat(Program.Container, "Molly");

Or maybe I should create IContainer inside Cat class?
What is the best solution?
Answer: Only your console application really needs to know about AutoFac, otherwise you're falling onto the service locator pattern, which is often considered an anti-pattern. Instead, your application should follow this pattern:
//in your console application
using (var scope = Container.BeginLifetimeScope())
{
    IServiceservice = scope.Resolve<IService>();
    service.Execute();
}

class SomeService : IService
{
    readonly ISomeDependency _dependency;

    public SomeService(ISomeDependency dependency)
    {
        _dependency = dependency;
    }

    public void Execute()
    {
        _dependency.DoSomething();
    }
}

interface IService
{
    void Execute();
}

Notice I never actually call a constructor. I make it a habit to never "new up" an object unless that object is just a POCO (contains only data, no logic).
Note that ISomeDependency can itself depends on 0 or more other classes, which it takes via constructor injection. Since AutoFac created the IService, and all of its dependencies, including ISomeDependency, all of ISomeDependency's dependencies will also be initialized, and so forth all the way down. A good video demonstrating this concept is Miguel Castro's Deep Dive into Dependency Injection and Writing Decoupled Quality Code and Testable Software.
Comment: mason, thank you for your valuable answer. I would like to extend my problem from first post. As you wrote we can create any object INSIDE main method. What in case I would like to use Autofac in other class?
Let's say I have class

`public class EmployeeService
{
  public Employee GetEmployee(decimal id)
 {
    // here I would like to use some other service: inject using AutoFac.
   // should I create here again Container object and then:
 // using (var scope = Container.BeginLifetimeScope()) { ... }
 }
}`
Comment: @cube I don't understand what you're asking now. Yes, you can create an instance of an object via AutoFac and inject things via constructor injection.
Comment: I get confused with my understaning. However you answered on my doubts. Thank you again.
Answer: I created this dotnet core console app template with autofac dependency injection configure, this would save your precious time for some repetitive job everytime setting up a new project. Install via nuget, hope it works well for you.
https://email@example.com/create-a-dotnet-core-cosnole-app-template-with-autofac-dependency-injections-60e09f27df17?source=friends_link&sk=d831e88acc36319e2a43e8c7dac70238


TextView does not show its value assigned to it

Question: Can any one tells me why the value of the TextView is not showing. I assign value to the TextView programmaticall but it is not showing. I also try to assign value to that TextView using android:Text but the Text never appears. Any Idea why that happens. Please see the xml file below.
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogContainer">

<RelativeLayout
    android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogRelativeLayout00"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:background="@drawable/dialog_border">
    <TableLayout
        android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogTableLayout00"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <TableRow
            android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogTableRow00"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/dialog_border">
            <ImageView
                android:id="@+id/emptyDataBaseWarningDialogIcon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_action_warning"/>
            <TextView
                android:id="@+id/emptyDataBaseWarningDialogTitleMessageValue"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="zsfsafsFS DSFAS"
                android:textColor="@android:color/black"/>
        </TableRow>

        <TableRow
            android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogTableRow01"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/dialog_border"
            android:layout_marginTop="2dp">
            <TextView
                android:id="@+id/emptyDataBaseWarningDialogMessageValue"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:textColor="@android:color/black"/>
        </TableRow>

        <TableRow
            android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogTableRow02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/dialog_border">
            <Button
                android:id="@+id/emptyDataBaseWarningDialogBtnYes"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Yes"/>
            <Button
                android:id="@+id/emptyDataBaseWarningDialogBtnCancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Cancel"/>
        </TableRow>
    </TableLayout>
</RelativeLayout>

JavaCode:
    emptyDBWarningDialog.setCancelable(true);
    LayoutInflater mDialogInflater = LayoutInflater.from(getApplicationContext());
    View DialogInflatedView = mDialogInflater.inflate(R.layout.my_saved_locations_emptydatabasewarningdialog, null);
    emptyDBWarningDialog.setContentView(DialogInflatedView);

    emptyDBWarningDialog.getWindow().setBackgroundDrawableResource(android.R.color.holo_green_dark);

    LinearLayout mLL = (LinearLayout) emptyDBWarningDialog.findViewById(R.id.mySavedLocationsEmptyDataBaseWarningDialogContainer);
    TextView dialogTitle = (TextView) emptyDBWarningDialog.findViewById(R.id.emptyDataBaseWarningDialogTitleMessageValue);
    TextView dialogMsg = (TextView) emptyDBWarningDialog.findViewById(R.id.emptyDataBaseWarningDialogMessageValue);
    Button yesBtn = (Button) emptyDBWarningDialog.findViewById(R.id.emptyDataBaseWarningDialogBtnYes);
    Button cancelBtn = (Button) emptyDBWarningDialog.findViewById(R.id.emptyDataBaseWarningDialogBtnCancel);

    dialogTitle.setText(EMPTY_DATABASE_DIALOG_TITLE);
    dialogMsg.setText(EMPTY_DATABASE_DIALOG_MSG);

    emptyDBWarningDialog.show();

Comment: Just for curiosity... why do you use such **long and unpractical ids**? i.e.: `android:id="@+id/mySavedLocationsEmptyDataBaseWarningDialogRelativeLayout00"`. And... do you **really need** to have everything with an id assigned?
Comment: It's **not necessary** to give an id to everything (do you use all of them in your Java code or refer them all in your layout?). If you really have to, you can number things like "fantasy_0000", ..., "fantasy_9999". Shorter.
Comment: @DerGolem I appreciate your advice and i think i will consider it from now on
Comment: You said you set the value to the `TextView` programmatically. I'm positive that will be where you find the mistake. Can you paste the Activity.class code please?
Comment: which color of your background `@drawable/dialog_border` ?
Comment: @DerGolem i just tring to avoid duplicate ids
Comment: post your whole layout code
Comment: @JRadtheBad yes i set the value programmatically, and when i found that there is no value appears, i chose to set value through `android:text` but after all still nothing appears
Comment: @JRadtheBad please see the java code posted above
Comment: Well, you set the text for both of those `TextView`s to whatever value your `public static` variables of `EMPTY_DATABASE_DIALOG_TITLE` and `EMPTY_DATABASE_DIALOG_MSG` are set to. Those values will ALWAYS override anything you put inside the XML because they happen after the XML is used to generate the layout. Where did you set the values for those two static variables?
Comment: @JRadtheBad `EMPTY_DATABASE_DIALOG_TITLE` and `EMPTY_DATABASE_DIALOG_MSG` are global variable assigned to some text values"string". is that what are you asking about?
Answer: Whether to use a LinearLayout or a RelativeLayout really depends on your design.
In this case, a single RelativeLayout which has it's children set in relation to itself and/or to one another is preferrable.
One single RelativeLayout also keeps down the View count, for better performances.
A TextView can hold up to 4 compound drawables (and also a background).
These can be set near the top, bottom, left and/or right side.
In your case, android:drawableLeft would make the perfect icon for your TextView

Now this is my extreme makeover to your layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <TextView
        android:id="@+id/txtTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginTop="8dp"
        android:drawableLeft="@drawable/ic_action_warning"
        android:drawablePadding="8dp"
        android:textColor="@android:color/black"
    />
    <TextView
        android:id="@+id/txtEmptyDB"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="zsfsafsFS DSFAS"
        android:textColor="@android:color/black"
    />
    <Button
        android:id="@+id/btnYes"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:text="Yes"
    />
    <Button
        android:id="@+id/btnCancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:text="Cancel"
    />
</RelativeLayout>

Maybe, you'd like to tweak the two bottom Buttons in a LinearLayout, just to set their weights to 1 and widths to 0dp (in order to make them fill the bottom line 50% and 50%)
Like this (only the last part is shown, since the rest is the same):
    />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        >
        <Button
            android:id="@+id/btnYes"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Yes"
        />
        <Button
            android:id="@+id/btnCancel"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Cancel"
        />
    </LinearLayout>
</RelativeLayout>

Answer: I just suspected the TableLayout and changed it to RelativeLayout, so that the final xml_File looks like the layout below. And values of the textview appears normally. But I still DO NOT know whhat is the problem with the TableLayout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/myContainer">

<RelativeLayout
    android:id="@+id/RelativeLayout00"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center|top"
    android:background="@drawable/dialog_border">
    <ImageView
        android:id="@+id/WarningDialogIcon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_action_warning"/>
    <TextView
        android:id="@+id/WarningDialogTitleMsgVal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/emptyDataBaseWarningDialogIcon"
        android:layout_marginTop="8dp"
        android:textColor="@android:color/black"/>
</RelativeLayout>

<RelativeLayout
    android:id="@+id/RelativeLayout01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center|center_horizontal"
    android:background="@drawable/dialog_border">
    <TextView
        android:id="@+id/WarningDialogMsgVal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textColor="@android:color/black"/>
</RelativeLayout>

<RelativeLayout
    android:id="@+id/RelativeLayout02"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center|bottom"
    android:background="@drawable/dialog_border">
    <Button
        android:id="@+id/BtnYes"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Yes"/>
    <Button
        android:id="@+id/BtnCancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/BtnYes"
        android:text="Cancel"/>
</RelativeLayout>

Comment: Wether to use a LinearLayout or a RelativeLayout really depends on your design. In this case, a single RelativeLayout which has it's children set in **relation** to itself and/or to one another is preferrable. One sigle RelativeLayout also keeps down the View count, for better performances. A TextView can hold up to 4 compound drawables (and also a background). These can be set near the top, bottom, left and/or right side. In your case, `android:drawableLeft` would make the perfect icon for your TextView.
Comment: **T** he outer LinearLayout can be deleted and all you need is a single RelativeLayout. **Y** ou still have kilometric ids. **f** ill_parent is deprecated as of API level 8 (use match_parent). **T** extViews can include pictures (as compound drawables), to save a View and enhance performances.
Comment: @DerGolem I really liked "kilometric ids" expression, i think i will modify that later. your last piece of advice regarding the "TextViews" i did not get it, do you mean that i can dispense with the `imageView` or what do you mean? sorry for misunderstanding. One more thing please, if I can delete the `LinearLayout`, so when should utilize it OR when it is useful. Sorry if am asking too much


What is $\lim_{n\to\infty}4\sin(n!)\left(\frac{n-1}{n^2+1}\right)^{10}$

Question: What is
$$\lim_{n\to\infty}4\sin(n!)\left(\frac{n-1}{n^2+1}\right)^{10}$$
By my reasoning, we can use limit arithmetic here.
$$
\lim_{n\to\infty}(a_nb_n)=\lim_{n\to\infty}(a_n)\lim_{n\to\infty}(b_n)
$$
$n$ approaches infinity in all limits.
$$
\lim_{n\to\infty}\left(\frac{n-1}{n^2+1}\right)^{10} = 0
$$
$\lim_{n\to\infty}\sin(n!)$ - doesn't exist because $\sin$ is a periodic function.
There are two options then:
1) $0$ times whatever $\sin(n!)$ currently is, is still $0$ therefore, $\lim(a_nb_n)=0$
2) the limit doesn't exist.
Which is correct?
Comment: $|\sin(\theta)|\le 1$.
Answer: If $a_n$ is a bounded sequence and $b_n$ converges to zero, then so does $a_nb_n$. So 1) is correct.
Edit: You cannot write $\lim a_nb_n = \lim a_n \lim b_n$ if $a_n$ doesn't converge.
Answer: For any small $\epsilon$, you know that for large enough $n$ you will have $$\left\lvert\frac{n-1}{n^2+1}\right\rvert<\epsilon$$ But that means for large enough $n$: $$\left\lvert\sin(n!)\frac{n-1}{n^2+1}\right\rvert\leq\left\lvert\frac{n-1}{n^2+1}\right\rvert<\epsilon$$ because $\left\lvert\sin(n!)\right\rvert\leq1$. So $\left\lvert\sin(n!)\frac{n-1}{n^2+1}\right\rvert$ approahces $0$. By the Squeeze Theorem, since $$-\left\lvert\sin(n!)\frac{n-1}{n^2+1}\right\rvert\leq\sin(n!)\frac{n-1}{n^2+1}\leq\left\lvert\sin(n!)\frac{n-1}{n^2+1}\right\rvert$$ and the outer expressions approach $0$, so does $\sin(n!)\frac{n-1}{n^2+1}$.


Australian Based Heroku-Like Service

Question: I've been using Heroku for client rails sites for some time now.
I now have a new client and would like to use Heroku for development and production, however the client is concerned about storing their data outside Australia. There are apparently some privacy, liability, and legal issues with where data is stored for their type of business.
Can anyone suggest a Heroku like service provider based in Australia?
Answer: I believe this company hosts Rails apps in the cloud, and is based in Australia: <redacted>
This is an extremely strange request, however.  I'm not quite sure that using Heroku and storing files on S3 or similar would be a big issue.
EDIT:  It appears as though the site posted originally is no longer active.
Comment: This is very common request.  Most corporates & Government clients want their sites hosted in-country.
Comment: Thanks for the link. For my part I agree with you about the strangeness of the request, however there are about 450 separate laws according to this Sydney Morning Herald article (http://www.smh.com.au/it-pro/cloud/is-it-legal-to-send-your-data-overseas-20111011-1lic0.html) that are causing a lot of confusion here. The US trade people have also criticised the Aus Govt about warning business to keep data hosted in Australia. My client happens also to be in an extremely privacy oriented business.
Comment: It's not really that odd. I've had US-based enterprise clients ask us to confirm that we store the data we hold on their behalf in US-based systems. Of course, in the case of Heroku that's so.

Australian Based Heroku-Like Service


Returning empty iterator in C++ hash table code

Question: I'm following some handwritten notes on the implementation of a hash table with separate chaining. In particular I'm looking to this function:
list<ListCell>::iterator TablaHash::FoundOnList(int key, int table_row){
    for(list<ListCell>::iterator found= table[table_row].begin();
            found != table[table_row].end();found++){
        if((*found).Key() == key){
            return found;
        }
    }
    return Ø;
}

where the last symbol is the empty set. I understand I should return an "empty" iterator there but what should I do? Maybe return the end() iterator?
Answer: Yes, returning the end() iterator is the most natural thing in C++.
For instance, std::find returns the end iterator if it cannot find the item searched.
Comment: Could I use 0 instead? There is a function afterwards that returns  FoundOnList(key,table_row) != 0 to see if certain element exists on the table.
Answer: There is no empty iterator concept in c++. You should return end() iterator. Even standard STL algoirthims do the same.


Currently what is the best Firewall & Internet security for Ubuntu?

Question: Currently what is the best Firewall & Internet security for Ubuntu?
Comment: Questions about "the best" are generally just asking for opinions, which is not the purpose of this site.
Answer: Firewall
Ubuntu has an inbuilt firewall caled ufw
The graphical version for it is gufw. Search in the Ubuntu Software Center you will find it
Ufw is installed by default and is one of the strongest firewalls ever
See this Ubuntu Documentation for Firewalls

Firewall

Antivirus
Regarding an Antivirus software, you dont need one because linux rarely catches a virus.
There are hardly any linux viruses
If you insist on having one for windows files on linux,
Then install Clamav found in the Ubuntu Software Center and the gui frontend for it is clamtk also found in the Ubuntu Software Center.
Check these Ubuntu documentations for more info

Antivirus
Do I need anti-virus software?

Also see this

Top 5 Anti virus for ubuntu
Comment: @Ali Glad to help. :)
Comment: Worst advice ever- old post to blame, but Linux gets hit by all sorts of things online in the year 2017.Application Firewalls is one way to go... especially with xss attacks, and linux does get hit by Trojans


Why is my electric wall heater slow to turn on and then quick to shut off?

Question: I have a few electric wall heaters in my bathroom and laundry room made by Intertherm.  They may be 30 years old.  When you turn the dial to high, it takes 10 minutes or more before it actually turns on.  Is the thermostat working correctly?  If not, is there a fix?
Update: fixed from Nutone to Intertherm.  Also, they seem to shut off pretty quickly after they start up, and then they stay off.
Comment: Do these units have a fan? If so, it is probably waiting for the coils to heat up before the fan kicks in so it doesn't start blowing cold air
Answer: I think it is one of two things.

The element is getting old and between the age and the moisture in the bathroom has taken the element close to end life.
The heater is 240V and maybe the breaker needs reset or it has gone bad or there is a bad connection in the heater.  I've seen wire connections fry pretty bad in some cases.

If it is the element and with today's technology, like camera phones and e-mail, you can probably work with Nutone to identify the heater, and Nutone pretty good about having parts like this on their shelve.
Just be careful with the element, because it could be very brittle.  No hard bounces or dropping it or parts on it if you take it out.


Flash AS3 not loading the xml when accessed online

Question: Helo
I am getting the xml data in my flash envronment by Test Movie. But when uploaded it does not displays the data. Note that here I have not loading a physical file with .xml extension rather i am loading a url reference which creats an xml structure for this flash object to use.
The code is given below:
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, showXML);
xmlLoader.load(new URLRequest("http://www.warraq.cc/Core/waraq/quiz-getcurrentexam"));
function showXML(e:Event):void {
XML.ignoreWhitespace = true;
var songs:XML = new XML(e.target.data);
trace(songs);
b.text = songs; //b is the name given to the text box which is a TLF text box
}

/// code ends
the uploaded url is :
http://evuae.com/desben/quiz/tst2.html
It loads the data during Testing the swf but fails when accessed via the link above.
Any help much appreciated.
Answer: It seems that http://evuae.com doesn't have a crossdomain.xml policy file. Accessing your link returns a Security Error
For testing purposes , create a file called crossdomain.xml and copy this , then load it to your public folder so that it can be accessed at http://evuae.com/crossdomain.xml
 <?xml version="1.0"?>
 <!DOCTYPE cross-domain-policy SYSTEM
     "http://www.adobe.com/xml/dtds/cross-domain- policy.dtd">
 <cross-domain-policy>
   <site-control permitted-cross-domain-policies="master-only"/>
   <allow-access-from domain="*"/>
 </cross-domain-policy>

Please note that this is the most permissive policy file, so you should get more information about policy files and learn how to make it more restrictive.
http://tv.adobe.com/watch/how-to-develop-secure-flash-platform-apps/crossdomain-policy-files/
Answer: I have the same problem and i managed to solve it.
The problem was simply about that i have the xml file with the name "Gallery.xml".
But i was loading it with non-captlized G letter like this:
myXMLLoader.load(new URLRequest("gallery.xml"));

and that will always works offline (on your own pc) - but not online.
so I just change the code like this:
myXMLLoader.load(new URLRequest("Gallery.xml"));

and everything worked very awesome.
Answer: var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, showXML);
xmlLoader.load(new URLRequest("http://www.warraq.cc/Core/waraq/quiz-getcurrentexam.xml"));

function showXML(e:Event):void
{
XML.ignoreWhitespace = true;
var songs:XML = new XML(e.target.data);
trace(songs);
b.text = songs;
//b is the name given to the text box which is a TLF text box
}

your fault is your link got no extention !!


Should I install a vapour barrier if I'm using rigid foam insulation?

Question: I'm re-insulating a room in my house from the inside.  I've read that polyisocyanurate (polyiso) rigid foam insulation is the best R-value, so I plan on using that.
Details:
The house was built in 1955 in Camrose, Alberta, Canada. And the previous wall was insulated with fibreglass batting with a type of tar paper as a barrier.  On top of that  (on the interior) was 2 sheets of plaster - pretty impermeable to air flow I'm guessing.
Question:
Do I still install vapour barrier?  I'm almost certain I should, but I've heard it could cause moisture trapping problems when using a faced insulation like polyiso.
Edit: I should mention that I'm planning on putting this insulation between the studs, not completely over the studs from the outside.  I'm not taking down the outside siding, I'm doing this all from the inside.
Edit Please note the posting time of this thread.  I asked this question in summer of 2012.  While I appreciate the enthusiasm, the question has been answered, so please refrain from answering again.
Comment: Airflow is really about the house wrap. You don't want outside air coming in. The VB is more about moisture, the idea that you don't want moist interior air condensing in the colder wall cavity. A good place to read up on VBs is Building Science's web site: http://www.buildingscience.com/documents/digests/bsd-106-understanding-vapor-barriers/
Comment: Sorry, completely missed the fact that you are using foam insulation. Foam boards are typically considered a form of vapor barrier (especially with the foil face) by default. So, as long as you have a tight seal, you shouldn't need any other barrier.
Comment: @Pickle regarding your comment about 2012 - stack exchange sites are not forums. These questions are meant to stay alive indefinitely, and ideally gradually improve so that they become a resource. The answers aren't meant just personally for the original poster.
Comment: You definitely don't want double barriers. Also, many believe that older houses 'breath' a lot naturally and don't necessarily need the VB at all. (VB's are always a slightly controversial topic in the trades anyways...)
Comment: I've heard that too, and I've also seen comments that say "breathing" is nonsense.  I'd tend to believe VB is necessary as otherwise - what's to stop air flow?

Thanks for the comment!
Comment: Ya, that's what I've seen in places too.  However, I'd need to have an airtight seal for the VB to be superfluous.  Since I'm attaching the foam to whatever siding is there, (I haven't ripped out the old insulation yet to take a look), I don't know if I'll be able to create an airtight seal. Your comment still stands though - there should only be 1 airtight seal.  Thanks.
Comment: Is there not already a 'canonical' vapor barrier in cold climates question here?
Answer: Rigid foam insulation is usually a qualified vapor barrier. However, an installation between the studs can pose a challenge. To complete the vapor barrier you would want to foam-seal or tape all the sides where the rigid meets timber, because these gaps will facilitate vapor flow.
Answer: There is more to it than vapour barrier.  The rigid board most likely meets all the required vapour barrier but does it create enough thermal break? Warm air can still hit the foam board and if the board is cool enough warm air can condense on it.  Most rigid board is R-5 per inch so you probably need 2 inches to create the thermal break necessary.  On dow's website http://building.dow.com/na/en/tools/installations/batt.htm they mention using a vapour barrier on top of the rigid board, but they don't specify what the board thickness was.  Even if you create a vapour trap between the board and poly vapour barrier I think you would be OK as it is the continual influx of vapour that causes problems and you would have stopped that.  If you are using Roxul you have nothing to worry about.  If you also have BluWood studs even less to worry about.  The small amount of vapour you could trap can migrate out through the wood-studded wall as wood naturally dries (probably at the top and bottom plate).
There are so many topics online about vapour barrier and rigid foam but thermal break isn't talked about that much and that is pretty much all that matters when you put rigid board up against an exterior basement wall and stud in front of it.  If you create enough thermal break than no barrier is needed.  If you do not, then you need additional poly vapour barrier.  Keep in mind that even if you used 1 inch rigid board, you have still done wonders for your basement by blocking the wet air from coming into your basement via the walls.
Answer: In my experience, you should vapor barrier these even if the material claims to be a good vapor barrier.  Especially if you are going to be inspected later.  Any airflow will degrade the effectiveness of insulation.
Answer: You need 2" of continuous closed cell foam to eliminated the need of a vapour barrier otherwise don't bother with foam. Anything else like  too little or gapped open cell foam and other semi solutions will be unpredictable, making a plastic vapour barrier unpredictable.
Answer: Any rigid foam board below grade must have 6-mil poly slip sheet covering the entire exterior surface as it is not qualified to be considered self-draining insulation.  The only exterior below grade insulation that I have found to be self draining is the mineral fiberglass insulation.  Please do your homework because if I am coming to do your inspection and the below grade foam insulation doesn't have a slip sheet, then you'll be mad at me because you'll be digging up the back fill.
I am a certified and licensed LBO for the state of MN.


The database [dbName] is not accessible. (ObjectExplorer)

Question: I have an issue in regards to using SQL Server 2008 R2.
I recently had an issue with my computer and therefore I had to reboot windows and had to grant permission from one user to another user (using the security feature in the properties). When giving permission initially though, it through a "Access Denied" message.
After much research, it stopped producing this error (the user which I needed to grant permission too wasn't available), which then caused another issue to occur, but this time within SQL Server. It produces this message;

The database [dbName] is not accessible. (ObjectExplorer)

This error occurs when I try to select the drop down option to see the list of tables and stored procedures of the database within SQL Server. I found an explanation for this on the following link;
http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1617&EvtSrc=MSSQLServer&EvtID=916
And I then tried to implement like so;
 USE msdb;
 GO
 GRANT CONNECT TO [DBName\MyName] ;

 CREATE DATABASE [DBNAME] ON PRIMARY

Using a script I created (luckily before this problem occurred) it through a whole lot of messages;

Msg 15151, Level 16, State 1, Line 1
  Cannot find the user 'DBName\MyName', because it does not exist or you do not have permission.
  Msg 262, Level 14, State 1, Line 2
  CREATE DATABASE permission denied in database 'master'.
  Msg 5011, Level 14, State 9, Line 1
  User does not have permission to alter database 'DBName', the database does not   exist, or the database is not in a state that allows access checks.
  Msg 5069, Level 16, State 1, Line 1 ...

After this bunch of errors, I have become unstuck and therefore would much be grateful if anyone could give me some feedback in regards to what I could do to resolve this issue. Cheers.
Comment: Do you really have a domain named "DBName"?  Shouldn't that be "ServerName"?  Otherwise, "DBName\MyName" is not a valid Login name and probably not a valid database User name.
Comment: @RBarryYoung Thanks for the reply, the DBName was the name of the database that I was trying to access. But due to not having the right named instance, it was denying me access to accessing the database.
Answer: Login with sa and expand Security > Login, right click on the username and then properties,
Click User Mapping and select the DB you want the user to access and then Ok
Answer: Generally it is a bad idea to grant permissions directly to logins. You should create role objects in the database, and all permissions in the database should be assigned to the roles.
Then when moving the database to another computer (or reinstalling) the only things you have to modify are server logins and role assignments.
Comment: it seems I am unable to create a SA, as it says I do not have permission to do so. I am also unable to create a database as well.
Comment: Well basically, the computer is connected to a server, but my individual PC was reliant on that server. But while I was away from work, an error occurred only allowing me to log in as the Owner, therefore I had to grant the permission to the owner for me to be able to see everything from what I have previous done. Also, after reading up about role assignments, that's what I have done (not knowing what the right term is).
Comment: @gregory.bmclub, have you made yourself an SA? E.g. part of the local administrators group?
Comment: You need to log in with a username which is already in the `sysadmin` server role. This usually includes the local `Administrators` group, so generally if you are a local admin you should be OK. If you are not you need to get someone who is to do this instead.
Comment: thanks for the reply. Do you have a blog or a guide in which i could follow, because in all honesty, I don't have the foggiest in what I should be doing! When i try to add a Server Role or a Login it just throws this error message; `User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)`.
Comment: @gregory.bmclub **Are you a member of the local admins group on the computer SQL server is running on?** That is the first step.
Comment: let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/22106/discussion-between-ben-and-gregory-bmclub)
Answer: One possible problem is that you have two instances of the database, so you have to deactivate one instance, if you have your database opened and accessible in your server explorer in Visual studio close connexion then go to windows services and stop and restart SQL server service (MSSQL) then go to Management studio and open your database, it should be opened and you can explore tables from Management studio.
Answer: Seems the database you are trying to access do not have admin privileges. Close SSMS and open it by Run as Administrator.


Choppy and pixelated video on Macbook Air 5,1. Unable to run/view HD videos at all

Question: I'm currently running 13.04 (I try to extend the little help I can by submitting bug reports) and the video is extremely choppy and pix-elated on any video program I run (vlc, mplayer, totem etc.), any flash or html5 videos, and HD videos won't play in a reasonable way at all (entire frames get skipped and video footage is completely distorted; I would say it's about 10 FPS on HD videos, really extremely bad quality). Also, I had this exact problem on 12.04 and 12.10 and was kind of hoping 13.04 would be better, but it is not. Video in Mac OSX works excellent, no lag or quality loss, works perfect in that OS. I would attach some sort of log file or output but I don't know how and would need directions to do so.
Specs - Macbook Air 5,1 ,8 gig ram , 256 ssd , Intel® Core™ i7-3667U CPU @ 2.00GHz × 4 , Intel® Ivybridge Mobile
How can I fix this?
Please assist.
Comment: This should be [a bug report](https://help.ubuntu.com/community/ReportingBugs) rather than a question on Ask Ubuntu. ([This question](http://askubuntu.com/questions/5121/how-do-i-report-a-bug) also has some good information about bug reporting.) This will probably be closed as off-topic, in accordance with [the FAQ](http://askubuntu.com/faq) and [this policy](http://meta.askubuntu.com/a/228/22949).
Comment: I don't understand how this is a bug. Please elaborate. Even if it is a bug, wouldn't more people have reported this problem by now? From searching google, no one has this problem with Macbook Air 5,1.
Answer: I noticed that when going into "Suspend to Ram" and back, it fixes the issue for me.
Seems a bug in the way the HD4000 chip is initialized.
Note - that I saw a "checking battery state" at the boot up, so I suppose disabling it should also fix it... Will see what I can do about it.
Comment: I tried suspending to ram but it didn't resolve for me, but thanks very much for your help. By the way I created a bug report, maybe you want to mark yourself as affected by it as well - https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1103236


Why is there condensation on a pipe near my furnace?

Question: My AC says it is trying to cool to 73 but is reading 75.  I changed the filter, which didn't help.  I looked in the closet, and apparently the installers were supposed to install an "auxiliary shut off switch to a/c condensation line to prevent water damage in case of main drain failure."  I have water condensation dripping down a long white PVC pipe and water collecting on top of the unit.  What is going on with my AC?
Picture 1 shows condensation and the top is just spewing cool air.

Picture 2 is the whole unit.

Picture 3 is condensation.

Picture 4 is condensation running down the PVC pipe to the floor of the closet.

Picture 5 is water pooling on top of the unit where there is green.
Comment: Cold pipes in a humid climate are going to have condensation on the outside.
Comment: That piece of pipe with wires coming out of it, that says "safety switch" is your aux shutoff switch.  It has a float in there, such that if the bottom vertical piece gets clogged, that will shut off the output before it can overflow the top vertical piece above the T.
Comment: I do see a **potential problem with the vent**. That vent pipe is likely supposed to be a "B-Type" vent (double-walled) and the straight pipe is but I don't think that adjustable elbow coming from the top of the unit is.
Comment: If you look down the open end of the top pipe, do you see standing water pooled in there?
Comment: It looks to me like the condensate drain line is constructed properly and is equipped with a cut-off switch. Also, I don't understand what you mean by "says it is trying to cool to 73 but is reading 75"; you have a *setpoint*, which is the temp you have set the unit to cool to; you have a *room temperature* reading, which is just a thermometer. Are you saying it will not cool the area to the desired setpoint? If it won't, then it needs servicing.
Comment: @MichaelKaras- Okay, thank you for replying.  I live in Arkansas, so it's pretty humid.
Comment: @NateS.- Thank you!  It's at the top of the closet and it was hard to see, so I missed it!  As long as it's there!  Also, I looked down far into the long PVC pipe and didn't see any pooling water.  It's long, but it's nowhere near coming out the top if it's there!
Comment: @JimmyFix-it- Okay, thank you!  I will get it looked into.  It's my first home, and I want to make sure everything is correct!  Yes, I meant it will not cool to the set point.  I'm not very good with explaining it all.  The inspector said it needed to be cleaned, so after changing out the filters, that's my next step before I call in an AC guy.Seriously, guys, THANK YOU!  I am an independent, single woman, but I need help sometimes.
Comment: You are very welcome, BTW sometimes a "non" B-vent is acceptable when it is a part of the vent pipe that does not pass through a wall, ceiling, or roof. It depends on the manufacturer's instructions and your local code.
Comment: I'm curious about the black elbow that's hanging off a zip-tie. What the heck is that for??
Comment: As a community user/editor I removed your backstory and rant. It's not relevant to the question. If you feel like any detail _about the problem_ got lost, feel free to revise further. Please [take the tour](https://diy.stackexchange.com/tour) to learn how our network operates.
Answer: I believe you may have a charge related problem. When ac systems start having icing issues they stop effective cooling a low charge can cause ice to form on the evaporator high moisture in the air you see , sometimes with severe icing it takes hours for the ice to melt, the system may run ok for a short period of time then start icing up. A simple recharge can solve this very common problem , if a R22 system note the cost of this refrigerant is very high +100 per pound a 5 ton system usually has 11-13 lbs and will need 5-7 lbs in most cases.


Add a class to a table in Sphinx?

Question: I have a table in rst, and I want to add a class to it, when compiling to HTML with Sphinx. According to the docs, adding a .. class:: directive before the table should add the class to the table, but instead it adds a definition list.
The table code is:
.. class:: special

== == ==
a  b  c
1  2  3
== == ==

which results in:

class special¶

<colgroup>
<col width="33%" />
<col width="33%" />
<col width="33%" />
</colgroup>

a
b
c

1
2
3

What am I doing wrong? I'm using Sphinx 1.3.1
Answer: The Sphinx default domain is Python and it contains a class directive which shadows the original Docutils directive with the same name.
To make it work, use rst-class instead:
.. rst-class:: special

== == ==
a  b  c
1  2  3
== == ==

Answer: Alternatively you could instead wrap your table with a .. table:: directive and use its :class: option:
.. table::
   :class: special

   == == ==
   a  b  c
   1  2  3
   == == ==

See the corresponding docutils docs here.

Add a class to a table in Sphinx?


How Do I count the number of occurrences in the IEnumerable

Question: I have this IEnumerable method in my razor page.
        @if (Orders.Any())
        {

                    Driver Name
                    Delivery Orders

                    @foreach(var objOrders in Orders)
                    {

                            @objOrders.Driver.UserName

                            @objOrders.Driver.FullName.Count()

                    }

        }

Which is from here
private IEnumerable<OrderDTO> Orders { get; set; } = new List<OrderDTO>();

    private bool IsLoading { get; set; } = true;

    public async Task SearchDate()
    {

        Orders =  await _orderRepository.GetDate(DateValue);
    }
    private async Task LoadOrders()
    {
        IsLoading=true;
        StateHasChanged();
        await SearchDate();

        //Orders = await _orderRepository.GetDate(date);
        IsLoading = false;
        StateHasChanged();
    }

And Here
public async Task<IEnumerable<OrderDTO>> GetDate(DateTime date)
    {
            if (date != null)
            {
                return _mapper.Map<IEnumerable<Order>, IEnumerable<OrderDTO>>
                   ((IEnumerable<Order>)_db.Orders.Where(u => u.DeliveryDate == date));
            }
            else
            {
                return _mapper.Map<IEnumerable<Order>, IEnumerable<OrderDTO>>(_db.Orders);
            }
        }

For now, the display is something like this
|Driver Name          | Number Delivery Orders |
| :---                |    :----:   |
| 1                   | 1  |
| 1                   | 1  |
| 2                   | 1  |
|Kim1                 | 4  |

And I want to display like this
|Driver Name          | Number Delivery Orders |
| :---                |    :----:   |
| 1                   | 2 (Occurrences)  |
| 2                   | 1 (Occurrences)  |
|Kim1                 | 1 (Occurrences)  |

I know that now the Count() Method is counting the length of the driver's name, but how do I code it such that it will return the occurrences of the driver's name.
Thank you guys.
Comment: Take a look at the `GroupBy()` extension method in LINQ: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.groupby?view=net-6.0
Answer: @foreach(var objOrders in Orders
    .GroupBy(u => u.Driver.FullName)
    .Select(group => new {
        Count= group.Count(),
        Key=group.Key }
    )
)

Manage to do it with this. Thanks to @Martin Costello