Tuesday, May 14, 2019

Eliminating International Trade Deficit Is Suicide for the US

The United States has been running international trade deficits for more than forty years. The reason that the United States let this continued for so long is that international trade deficits are needed to maintain the US dollar's status of being the international trade currency.



When any country in the world wants to buy oil from the Middle East, it needs to pay with US dollars. Where would the US dollars come from? You trade with the US using any merchandise other than US dollar, of course. Once you have the US dollars, you can then buy oil from the Middle East. Of course, you can also buy shirts from China, or cars from Japan, all in US dollars. These US dollars are not going back to the US, for sure. Because they are needed for international trade with countries other than the US. As the world economy grows bigger and bigger, more and more US dollars are needed to circulate outside of the United States. The only way that this can happen is that the US runs a bigger and bigger "trade deficit".


Notice that the US trade deficit chart agrees with the fact that starting from the early seventies, the values of exported goods as share of GDP for the entire world started to rise drastically.

Here is one interesting thing that happened in 1973 (http://www.thepeoplehistory.com/1973.html):


US exports the US dollars, just like any other merchandise. It is a commodity. No other currency has this status because no other can be used for international trade this way. Once you understand this, and you accept the fact that the US dollar is a unique commodity that can be traded like any other merchandise, you will see that US does not have an international trade imbalance after all.

What would happen if US eliminates its trade deficit, i.e., no longer exports US dollars? As the world economy grows, there will be a shortage of US dollars on the international market. Like with a shortage of anything else, two things will happen:
  1. People will look for substitutes
  2. Its price will go up before substitutes are found. After a substitute is found, its price will drop.  
When the price of the US dollar goes up, US export will suffer. If you are a US exporter (a soybean farmer for example), you will see your business shrink.

When people find substitutes, US dollar will lose its international trade currency status. US will lose all of the perks that came with it, such as the controlling power of the international banking system, for example. Then the value of the US dollar will collapse. Because once it loses the international trade currency status, it will have far less value. Its only remaining value will be for buying merchandise from the US. Then the American people will really have to work hard for it. Just imagine, if you are having a hard time when you can just print value on paper, how hard would it be when you can no longer do that?

Many countries have been seeking substitutes of the US dollar for years. Japan wants to use Japanese Yen, EU wants to use Euro, and China wants to use Chinese Yuan. None succeeded because the cost of doing business with US dollars is always cheaper.  Now with the help of Mr. Navarro, things just might tip to the side of Japan, or the side of China, or the side of EU.

Because the international trade deficits are actually balanced with the export of US dollars, there has been an influx of wealth in other commodities for the last forty some years, equal to the international trade deficits. If you have been worse off, or if you are not better off as much as you think that you should have been, you need to examine the wealth distribution system of the US in that time frame. Where did the wealth go? The cost of printing (producing) US dollars as a commodity for export should be close to zero, right? Do we really have to resort to letting Uncle Sam doing the actual importing with the dollars that it prints to be convinced of that?

If the wealth distribution system does not work right, trade or no trade, you have a problem.

Thursday, January 24, 2019

Ambulance Drivers Need to Know Better

My son is attending University of California San Diego. He almost got ran over by an ambulance in the middle of a pedestrian crossing, because the ambulance driver turned the pedestrian crossing signal to red immediately and gave himself a green light, and the driver then just drove through the crossing as if no one was there.

My son said that this was the second time that this happened to him.

While it is true that "the walk cycle can be skipped or shortened as emergency vehicles approach these intersections, in accordance with federal rules" (https://www.sun-sentinel.com/news/fl-miami-traffic-turnbell-091415-20150914-column.html), the law also says that the "drivers are required to yield to pedestrians already in a crosswalk, even if the signal has turned green." I do not know how many people know these laws, but the ambulance driver must have known. If he did not know, his employer is definitely being very negligent.

Putting someone's life at such great danger just because you are trying to save another makes no sense. I hope that the ambulance drivers in San Diego would not wait until something terrible happens to realize that. 



Saturday, December 15, 2018

Epson Workforce WF-3640 Keeps Going Offline

My Epson WF-3640 printer kept going offline, even though it was turned on, and connected to my local LAN. I could even use it to scan documents, but I just could not print with it. If I checked its status in Windows, it would show that it was offline:
Not only that, each time Epson's software updater did an update, it could not find the existing printer, so it added another copy of the Epson FAX printer.

The cause of this problem is that Epson printer driver installer installs the printer with a standard TCP/IP port. But when the printer's TCP/IP address changes, Windows will no longer be able to find the printer. You can right click on the printer, select "Printer Properties", and then go to the "Ports" tab to verify this:


I suppose that you can assign the printer a static IP address. But usually this would be too much of a hassle.

It turns out that Epson has a printer port software called "EpsonNet Print". You can google for it, or you can just go to the link http://support.epson.net/win7/updates/network/001_dl.html and download the software there. If you install the Epson printer software combo, it would probably include this as well. But because the date on the combo software is older than the printer driver, people would likely not install this software combo.

Once the EpsonNet Print software is installed, you can add a new port of the type "EpsonNet Print":


This port will work with whatever IP address the Epson printer happens to be on. You would then repeat this for the Epson WF-3640 Series (FAX) printer, and then delete all the other copies.

From here on, each time the printer is turned on, it will always be shown as "online" in Windows.


Thursday, December 13, 2018

Move Resource Group to a New Subscription on Azure Cloud

I have all of my resources in a single resource group. When I tried to move this resource group to a new subscription, I got an error saying that "Move resources specified storage account(s) yourStorageAccountName are not found with sourceSubscription..., sourceResourceGroup yourTargetResourceGroup, targetSubscription..., targetResourceGroup yourSourceResourceGroup."

It turned out that you cannot move all resources in a resource group at once if they are not in the same region. Some of my resources are in the region US West, and some are in the region US West 2.

So, I first selected all resources in the region US West 2, and moved them. After the move was done, I selected all of the remaining resources in the region US West, and moved them as well.

Everything went without any errors.


Tuesday, October 9, 2018

Upgrade Read-only Mode Databases on a SQL Server

Recently I upgraded my SQL server to SQL Server 2017. Everything went well.

But today when I tried to open a read-only mode database, I got an error:

Cannot open database 'DatabaseName' version 782. Upgrade the database to the latest version. (Microsoft SQL Server, Error: 946)

The database could not be detached. When I tried to detach it, the same error occured. I could not view the database's properties, either, because of the same error.

Nothing could be done on this read-only database, it seemed. I did not try to delete it, since I still wanted to keep the data.

Some google results suggested that the file access permissions could be the problem. Not in my case. The database files were fully accessible, both by the SQL sever process and myself.

The solution turned out to be very simple. All I needed to do was to run the following SQL script:

USE master; 
GO 
ALTER DATABASE DatabaseName
SET READ_WRITE; 
GO

When I ran this script, SQL server automatically started upgrading my database:
Converting database 'DatabaseName' from version 782 to the current version 869. Database 'DatabaseName' running the upgrade step from version 782 to version 801.
Database 'DatabaseName' running the upgrade step from version 801 to version 802.
Database 'DatabaseName' running the upgrade step from version 802 to version 803.
Database 'DatabaseName' running the upgrade step from version 803 to version 804.
Database 'DatabaseName' running the upgrade step from version 804 to version 805.
Database 'DatabaseName' running the upgrade step from version 805 to version 806.
Database 'DatabaseName' running the upgrade step from version 806 to version 807.
Database 'DatabaseName' running the upgrade step from version 807 to version 808.
Database 'DatabaseName' running the upgrade step from version 808 to version 809.
Database 'DatabaseName' running the upgrade step from version 809 to version 810.
Database 'DatabaseName' running the upgrade step from version 810 to version 811.
Database 'DatabaseName' running the upgrade step from version 811 to version 812.
Database 'DatabaseName' running the upgrade step from version 812 to version 813.
Database 'DatabaseName' running the upgrade step from version 813 to version 814.
Database 'DatabaseName' running the upgrade step from version 814 to version 815.
Database 'DatabaseName' running the upgrade step from version 815 to version 816.
Database 'DatabaseName' running the upgrade step from version 816 to version 817.
Database 'DatabaseName' running the upgrade step from version 817 to version 818.
Database 'DatabaseName' running the upgrade step from version 818 to version 819.
Database 'DatabaseName' running the upgrade step from version 819 to version 820.
Database 'DatabaseName' running the upgrade step from version 820 to version 821.
Database 'DatabaseName' running the upgrade step from version 821 to version 822.
Database 'DatabaseName' running the upgrade step from version 822 to version 823.
Database 'DatabaseName' running the upgrade step from version 823 to version 824.
Database 'DatabaseName' running the upgrade step from version 824 to version 825.
Database 'DatabaseName' running the upgrade step from version 825 to version 826.
Database 'DatabaseName' running the upgrade step from version 826 to version 827.
Database 'DatabaseName' running the upgrade step from version 827 to version 828.
Database 'DatabaseName' running the upgrade step from version 828 to version 829.
Database 'DatabaseName' running the upgrade step from version 829 to version 830.
Database 'DatabaseName' running the upgrade step from version 830 to version 831.
Database 'DatabaseName' running the upgrade step from version 831 to version 832.
Database 'DatabaseName' running the upgrade step from version 832 to version 833.
Database 'DatabaseName' running the upgrade step from version 833 to version 834.
Database 'DatabaseName' running the upgrade step from version 834 to version 835.
Database 'DatabaseName' running the upgrade step from version 835 to version 836.
Database 'DatabaseName' running the upgrade step from version 836 to version 837.
Database 'DatabaseName' running the upgrade step from version 837 to version 838.
Database 'DatabaseName' running the upgrade step from version 838 to version 839.
Database 'DatabaseName' running the upgrade step from version 839 to version 840.
Database 'DatabaseName' running the upgrade step from version 840 to version 841.
Database 'DatabaseName' running the upgrade step from version 841 to version 842.
Database 'DatabaseName' running the upgrade step from version 842 to version 843.
Database 'DatabaseName' running the upgrade step from version 843 to version 844.
Database 'DatabaseName' running the upgrade step from version 844 to version 845.
Database 'DatabaseName' running the upgrade step from version 845 to version 846.
Database 'DatabaseName' running the upgrade step from version 846 to version 847.
Database 'DatabaseName' running the upgrade step from version 847 to version 848.
Database 'DatabaseName' running the upgrade step from version 848 to version 849.
Database 'DatabaseName' running the upgrade step from version 849 to version 850.
Database 'DatabaseName' running the upgrade step from version 850 to version 851.
Database 'DatabaseName' running the upgrade step from version 851 to version 852.
Database 'DatabaseName' running the upgrade step from version 852 to version 853.
Database 'DatabaseName' running the upgrade step from version 853 to version 854.
Database 'DatabaseName' running the upgrade step from version 854 to version 855.
Database 'DatabaseName' running the upgrade step from version 855 to version 856.
Database 'DatabaseName' running the upgrade step from version 856 to version 857.
Database 'DatabaseName' running the upgrade step from version 857 to version 858.
Database 'DatabaseName' running the upgrade step from version 858 to version 859.
Database 'DatabaseName' running the upgrade step from version 859 to version 860.
Database 'DatabaseName' running the upgrade step from version 860 to version 861.
Database 'DatabaseName' running the upgrade step from version 861 to version 862.
Database 'DatabaseName' running the upgrade step from version 862 to version 863.
Database 'DatabaseName' running the upgrade step from version 863 to version 864.
Database 'DatabaseName' running the upgrade step from version 864 to version 865.
Database 'DatabaseName' running the upgrade step from version 865 to version 866.
Database 'DatabaseName' running the upgrade step from version 866 to version 867.
Database 'DatabaseName' running the upgrade step from version 867 to version 868.
Database 'DatabaseName' running the upgrade step from version 868 to version 869.
What a surprise.

Sunday, September 16, 2018

Completely Uninstall SQL Server 2016

Recently, I upgraded the development SQL database server on my workstation from SQL Server 2016 to SQL Server 2017.

After the upgrade, I tried to uninstall SQL Server 2016 from Windows Control Panel. But after the uninstall, there were still a lot of SQL Server 2016 components on my workstation. In fact, of the several SQL Server components shown in the Windows Control Panel, many would either not go away after uninstall, or would display dependency warnings and refuse to uninstall. In addition, there were many SQL Server 2016 components that were simply not shown in the Windows Control Panel.

So, I had to manually uninstall these components forcefully. First I ran a query for installed SQL Server 2016 components on the command line:

          wmic product where "name Like '%SQL%' and name like '%2016%'" get identifyingnumber,name,vendor,version > c:\temp\SQL2016Components.txt

Here the output file path "c:\temp\SQL2016Components.txt" is specific to my workstation, of course. You would need to change that to a path that is valid to your computer, obviously.

This command can take quite some to run.

After this command was completed, the contents of the output file would look like this:

IdentifyingNumber                       Name                                                                   Vendor                 Version       
{29A56A10-FEB1-4B4F-99DA-8DE4108AA1D8}  SQL Server 2016 Management Studio for Reporting Services Localization  Microsoft Corporation  13.0.16106.4  
{60B9E230-65C3-4A54-9659-1313FBC051B3}  Microsoft AS OLE DB Provider for SQL Server 2016                       Microsoft Corporation  13.0.2164.0   
{DD9B76B0-4B93-4C50-9A9E-4D1C7C3B596F}  SQL Server 2016 Management Studio                                      Microsoft Corporation  13.0.16106.4  
{8A3AE1F0-0752-435D-A01C-033BDD629C8B}  SQL Server 2016 Connection Info                                        Microsoft Corporation  13.0.14500.10 
{B9EED901-157A-4AB8-BFD1-2C6FBF5CF802}  SQL Server 2016 Common Files                                           Microsoft Corporation  13.0.1601.5   
{F8001E21-CFCC-47AD-A3B1-6B3EB6D35E48}  SQL Server 2016 Shared Management Objects                              Microsoft Corporation  13.0.14500.10 
{D3FC7A31-F127-4E2A-96F6-B24FA7D3FFAF}  SQL Server 2016 Shared Management Objects                              Microsoft Corporation  13.0.14500.10 
{1D792861-C84B-4BD0-8347-34AF40F5ACD1}  SQL Server 2016 Management Studio Extensions                           Microsoft Corporation  13.0.1601.5   
{EC234B43-728E-4CA9-8AE6-7815325D6AAD}  SQL Server 2016 Client Tools Extensions                                Microsoft Corporation  13.0.1601.5   
{59200093-D6A8-453E-B1AA-8D5E8921598A}  Microsoft SQL Server 2016 Setup (English)                              Microsoft Corporation  13.0.1601.5
   
...

From the contents of this file, I then created a batch file that looks like this:

msiexec /i {29A56A10-FEB1-4B4F-99DA-8DE4108AA1D8}
msiexec /i {60B9E230-65C3-4A54-9659-1313FBC051B3}
msiexec /i {8A3AE1F0-0752-435D-A01C-033BDD629C8B}
...

For each GUID in the output file of "wmic", I added a line "msiexec /i ..." with that GUID as the uninstall parameter.

Then I ran this batch file from the command line. 

I was getting prompted on each line of the batch file:


 

I selected "Yes" each time. On some steps, I was getting error popups:


On some other steps, I was getting warning popups like this:


But I continued with the batch file.

I repeated the batch file three times. On the third pass, none of the components remained. SQL Server 2016 was completely uninstalled.

To make sure that the new SQL Server 2017 installation has all the components intact, I ran SQL Server 2017 Setup, checked all of the features that I wanted. The SQL Server 2017 Setup has some problems (http://programount.blogspot.com/2018/06/sql-server-2017-installation-errors-on.html), but once patched, everything works fine.

Thursday, August 30, 2018

IIS, Self-Signed Certificate, and Chrome

Recently, I needed to set up an IIS server for development. I installed a self-signed certificate on the IIS server, since it is never going to be public facing.

It turned out to be a lot of trouble to get the self-signed certificate to work with Chrome.

First I created a domain certificate from the IIS manager. I exported the certificate and installed it on developer workstations' trusted root certificate store. That seemed to work with Internet Explorer and Edge. But it did not work with Chrome.

I read online that Chrome now requires a "Subject Alternative Name".  The IIS manager generated domain certificate did not have a "Subject Alternative Name". Apparently Microsoft's "makecert" does not generate certificates with "Subject Alternative Name" either. So I used the Power Shell command "New-SelfSignedCertificate" and generated a self-signed certificate with "Subject Alternative Name".

That still did not work with Chrome. Chrome's development tool says everything is okay, but the page is not secure (ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY):


These self-contradicting results from Chrome is definitely not helpful to me for solving the problem.

I downloaded IIS Crypto (https://www.nartac.com/Products/IISCrypto/). It suggested a bunch of changes for "Best Practice". I made the changes as suggested, and rebooted the server.

Now Chrome is showing the page without any warnings on the certificate.

This is surprising to me because the server is a new installation of Windows Server 2016. Somehow the out-of-the box settings of IIS on such a server is considered insufficient to Chrome.