Excel CSV with comma’s

You want a CSV, a comma-separated file, to actually have comma’s as separators and NOT semi-colons as your field delimiter!
However, in countries where the comma is used as decimal separator, this is not by default for Excel. Various sources hint to the solution, but none are really complete. You need to do this:

1. Change the system – region settings – additional settings – to use a , as list separator.
2. Change Excel – options – advanced – to not “Use system separators”, but manually set a . as Decimal separator and , as Thousands separator.
3. Then with Excel, save your file as “CSV (Comma Delimited)”
4. Change your Excel setting back to what it was (Use system separators), so you can continue your work like you’re used to.

Continue reading Excel CSV with comma’s

WooCommerce and Polylang

I ran into this issue: Any link in my code/theme/plugin to standard Woocommerce pages did not go to the correct translated page!
However the solution provided here will break whenever WooCommerce is updated. The correct way of solving this is adding some filters…

//20210216 - (c) My Brain - correction for function wc_get_page_id()
function woocommerce_translate_polylang_page_id($pageid) {
	if (!empty($pageid)) {
		if (PLL() instanceof PLL_Frontend) {
			$pllpageid = pll_get_post($pageid);
			if (!empty($pllpageid)) {
				$pageid = $pllpageid;
			}
		}
	}
	return $pageid;
}
//myaccount, edit_address, shop, cart, checkout, pay, view_order, terms
add_filter( 'woocommerce_get_myaccount_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_edit_address_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_shop_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_cart_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_checkout_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_pay_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_view_order_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );
add_filter( 'woocommerce_get_terms_page_id', array( $this, 'woocommerce_translate_polylang_page_id' ), 10, 1 );

Have a nice day!

HTTP Error 413.1

HTTP Error 413.1 – Request Entity Too Large – The page was not displayed because the request entity is too large.
Large file? Large problem! On IIS you can get this error while trying to upload. Read this and then think… maybe edit the web.config file in the root? So you try adding this, or something similar:

<serverRuntime>
  <uploadReadAheadSize>2147483647</uploadReadAheadSize>
</serverRuntime>
<security>
  <requestFiltering>
    <requestLimits>
      <maxAllowedContentLength>2147483647</maxAllowedContentLength>
    </requestLimits>
  </requestFiltering>
</security>

but you simply get: HTTP Error 500.19 – Internal Server Error – The requested page cannot be accessed because the related configuration data for the page is invalid. – so, whatever you were thinking is: Wrong!
When using IIS manager you get:

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483647" />
  </requestFiltering>
</security>

while the ‘uploadReadAheadSize’ does not appear anywhere in the web.config. But: it helps and there are no more errors while uploading!
So you have to set these values in IIS Manager itself.
Problem? Solved!

Have a nice day!

Mouse drag and drop fails

Fix problem with drag and drop not working in Windows. Have you encountered the problem in which you can no longer drag and drop files and folders in Windows Explorer (if you are using Windows 7) or File Explorer (if you are using Windows 10 or Windows 8.1)?

You can click and right click on files and folders, you can select files and folders, but you can’t drag and drop them anymore. We’ve encountered this issue ourselves and after searching for many possible solutions, we’ve found one which should work in most cases. Here’s how to restore the drag and drop feature in a couple of seconds:

Continue reading Mouse drag and drop fails

Convert between Local Time and UTC or Zulu time

Here is some visual basic code for you!
You receive a ZULU time and want to store it in your local time?

Dim MyZulu As New Date(year,month,day,hr,min,sec,DateTimeKind.Utc)
Dim MyLocal As DateTime = MyZulu.ToLocalTime()

Or is someone or some API asking you for the next format in return, and all you have is a DateTime with your local time in it?

*UTC + offset as (YYYY-MM-DDThh:mm:ss+hh:mm)
Continue reading Convert between Local Time and UTC or Zulu time

System.NullReferenceException: ‘Object reference not set to an instance of an object.’

A happy error while coding in visual basic, vb.net
It is not the line where you get this error, but something that happened before, that made one of your variables invalid and unusable.

Read this. (@ NullReference Exception — Visual Basic)

Continue reading System.NullReferenceException: ‘Object reference not set to an instance of an object.’

Descending Sort Order Thunderbird

I prefer my most recent emails at the top of the list. Unfortunately Thunderbird (and many other mail clients) do this different.
So how do I change the default sort order?
Change the advanced options!

If you want to sort all mail by DateDescending (newest at top), change the preferences in the config editor to:

mailnews.default_sort_order:    default     integer      2
mailnews.default_sort_type:     default     integer     18

So, what does that 2 stand for? And why 18?

Continue reading Descending Sort Order Thunderbird

Teamviewer Connect greyed-out and disabled

What a week… sometimes things just keep going wrong for no reason. Today it was Teamviewer not giving me the option to connect to a remote PC to simply view their desktop and help the person with an issue they were facing. The option ‘Connect’ was just greyed out, not being able to enter an ID. Even the box on the top ‘insert partner ID’ did allow me to enter a number, but expecting that number to be added to the list, the ‘Connect’ option there did not do anything either.

The “Ready to connect (secure connection)” you see at the bottom of the window is also a little misleading there, because it does not want to connect at all!
So… what is the solution?

Continue reading Teamviewer Connect greyed-out and disabled