text:
Q: how to nginx reverse proxy\redirect subdomain to subdirectory? I've got a substack newsletter with a CNAME record pointing to newsletter.identosphere.net
I want that content to be displayed from identosphere.net/newsletter so the user can access each newsletter as a part of my main site:
identosphere.net/newsletter/issue-13/ should display content from newsletter.identosphere.net/issue-13/
Moreover, if possible (whether by nginx or dns) I want to redirect subdomain traffic to its folder on the root domain.
Right now I'm using:
location /newsletter/ {
    proxy_pass        http://newsletter.identosphere.net/;
    access_log /var/log/nginx/reverse-access.log;
    error_log /var/log/nginx/reverse-error.log;
}

What happens with this setting:
I type https://identosphere.net/newsletter and am redirected to https://newsletter.identosphere.net/

As requested by @ppuschmann, I'm posting the rest of my nginx config.
What I didn't mention, is that I'm using MailInABox its a selfhosted e-mail service that includes a web-server and dns.
Mainly, customizations are done via gui. I am using an unsupported feature that allows some customization of your config, but not of the main config, which is regularly refreshed. Apparently I cannot add server blocks to my "nginx user-config", only location blocks.
At this point, I'm not expecting to solve this, but if possible I'd like to determine how the dns (NSD) re-direct is set thats preventing my reverse proxy.
Here is the NGINX config
As stated in the comments, I can't edit this file, but I can add instructions via a config located elsewhere.
/etc/nginx/conf.d/local.conf
## NOTE: This file is automatically generated by Mail-in-a-Box.
##       Do not edit this file. It is continually updated by
##       Mail-in-a-Box and your changes will be lost.
##
##       Mail-in-a-Box machines are not meant to be modified.
##       If you modify any system configuration you are on
##       your own --- please do not ask for help from us.

upstream php-fpm {
    server unix:/var/run/php/php7.4-fpm.sock;
}
## identosphere.net

# Redirect all HTTP to HTTPS *except* the ACME challenges (Let's Encrypt TLS certificate
# domain validation challenges) path, which must be served over HTTP per the ACME spec
# (due to some Apache vulnerability).
server {
    listen 80;
    listen [::]:80;

    server_name identosphere.net;
    root /tmp/invalid-path-nothing-here;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    location / {
        # Redirect using the 'return' directive and the built-in
        # variable '$request_uri' to avoid any capturing, matching
        # or evaluation of regular expressions.
        return 301 https://identosphere.net$request_uri;
    }

    location /.well-known/acme-challenge/ {
        # This path must be served over HTTP for ACME domain validation.
        # We map this to a special path where our TLS cert provisioning
        # tool knows to store challenge response files.
        alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;
    }
}

# The secure HTTPS server.
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name identosphere.net;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    ssl_certificate /home/user-data/ssl/ssl_certificate.pem;
    ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

    root /home/user-data/www/default;

    # ssl files sha1: 4d28ac1a16c0e04772557f6a765cbaa2e4a1d96f / a2eda6be4854a2530dc96a579325f3e95160fc48
    add_header Strict-Transport-Security "max-age=15768000" always;
    include /home/user-data/www/identosphere.net.conf;

    # Control Panel
    # Proxy /admin to our Python based control panel daemon. It is
    # listening on IPv4 only so use an IP address and not 'localhost'.
    location /admin/assets {
        alias /usr/local/lib/mailinabox/vendor/assets;
    }
    rewrite ^/admin$ /admin/;
    rewrite ^/admin/munin$ /admin/munin/ redirect;
    location /admin/ {
        proxy_pass http://127.0.0.1:10222/;
        proxy_set_header X-Forwarded-For $remote_addr;
        add_header X-Frame-Options "DENY";
        add_header X-Content-Type-Options nosniff;
        add_header Content-Security-Policy "frame-ancestors 'none';";
    }

    # Roundcube Webmail configuration.
    rewrite ^/mail$ /mail/ redirect;
    rewrite ^/mail/$ /mail/index.php;
    location /mail/ {
        index index.php;
        alias /usr/local/lib/roundcubemail/;
    }
    location ~ /mail/config/.* {
        # A ~-style location is needed to give this precedence over the next block.
        return 403;
    }
    location ~ /mail/.*\.php {
        # note: ~ has precendence over a regular location block
        include fastcgi_params;
        fastcgi_split_path_info ^/mail(/.*)()$;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/roundcubemail/$fastcgi_script_name;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;
    }

    # Nextcloud configuration.
    rewrite ^/cloud$ /cloud/ redirect;
    rewrite ^/cloud/$ /cloud/index.php;
    rewrite ^/cloud/(contacts|calendar|files)$ /cloud/index.php/apps/$1/ redirect;
    rewrite ^(/cloud/core/doc/[^\/]+/)$ $1/index.html;
    rewrite ^(/cloud/oc[sm]-provider)/$ $1/index.php redirect;
    location /cloud/ {
        alias /usr/local/lib/owncloud/;
        location ~ ^/cloud/(build|tests|config|lib|3rdparty|templates|data|README)/ {
            deny all;
        }
        location ~ ^/cloud/(?:\.|autotest|occ|issue|indie|db_|console) {
            deny all;
        }
        # Enable paths for service and cloud federation discovery
        # Resolves warning in Nextcloud Settings panel
        location ~ ^/cloud/(oc[sm]-provider)?/([^/]+\.php)$ {
            index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /usr/local/lib/owncloud/$1/$2;
            fastcgi_pass php-fpm;
        }
    }
    location ~ ^(/cloud)((?:/ocs)?/[^/]+\.php)(/.*)?$ {
        # note: ~ has precendence over a regular location block
        # Accept URLs like:
        # /cloud/index.php/apps/files/
        # /cloud/index.php/apps/files/ajax/scan.php (it's really index.php; see 6fdef379adfdeac86cc2220209bdf4eb9562268d)
        # /cloud/ocs/v1.php/apps/files_sharing/api/v1 (see #240)
        # /cloud/remote.php/webdav/yourfilehere...
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/owncloud/$2;
        fastcgi_param SCRIPT_NAME $1$2;
        fastcgi_param PATH_INFO $3;
        fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
        fastcgi_param MOD_X_ACCEL_REDIRECT_PREFIX /owncloud-xaccel;
        fastcgi_read_timeout 630;
        fastcgi_pass php-fpm;
        client_max_body_size 1G;
        fastcgi_buffers 64 4K;
    }
    location ^~ /owncloud-xaccel/ {
        # This directory is for MOD_X_ACCEL_REDIRECT_ENABLED. Nextcloud sends the full file
        # path on disk as a subdirectory under this virtual path.
        # We must only allow 'internal' redirects within nginx so that the filesystem
        # is not exposed to the world.
        internal;
        alias /;
    }
    location ~ ^/((caldav|carddav|webdav).*)$ {
        # Z-Push doesn't like getting a redirect, and a plain rewrite didn't work either.
        # Properly proxying like this seems to work fine.
        proxy_pass https://127.0.0.1/cloud/remote.php/$1;
    }
    rewrite ^/.well-known/host-meta /cloud/public.php?service=host-meta last;
    rewrite ^/.well-known/host-meta.json /cloud/public.php?service=host-meta-json last;
    rewrite ^/.well-known/carddav /cloud/remote.php/carddav/ redirect;
    rewrite ^/.well-known/caldav /cloud/remote.php/caldav/ redirect;

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /mailinabox.mobileconfig {
        alias /var/lib/mailinabox/mobileconfig.xml;
    }
    location = /.well-known/autoconfig/mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /.well-known/mta-sts.txt {
        alias /var/lib/mailinabox/mta-sts.txt;
    }

    # Z-Push (Microsoft Exchange ActiveSync)
    location /Microsoft-Server-ActiveSync {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/index.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_read_timeout 630;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;
    }
    location ~* ^/autodiscover/autodiscover.xml$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_pass php-fpm;
    }

    # Disable viewing dotfiles (.htaccess, .svn, .git, etc.)
    # This block is placed at the end. Nginx's precedence rules means this block
    # takes precedence over all non-regex matches and only regex matches that
    # come after it (i.e. none of those, since this is the last one.) That means
    # we're blocking dotfiles in the static hosted sites but not the FastCGI-
    # handled locations for Nextcloud (which serves user-uploaded files that might
    # have this pattern, see #414) or some of the other services.
    location ~ /\.(ht|svn|git|hg|bzr) {
        log_not_found off;
        access_log off;
        deny all;
    }
}
## autoconfig.identosphere.net

# Redirect all HTTP to HTTPS *except* the ACME challenges (Let's Encrypt TLS certificate
# domain validation challenges) path, which must be served over HTTP per the ACME spec
# (due to some Apache vulnerability).
server {
    listen 80;
    listen [::]:80;

    server_name autoconfig.identosphere.net;
    root /tmp/invalid-path-nothing-here;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    location / {
        # Redirect using the 'return' directive and the built-in
        # variable '$request_uri' to avoid any capturing, matching
        # or evaluation of regular expressions.
        return 301 https://autoconfig.identosphere.net$request_uri;
    }

    location /.well-known/acme-challenge/ {
        # This path must be served over HTTP for ACME domain validation.
        # We map this to a special path where our TLS cert provisioning
        # tool knows to store challenge response files.
        alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;
    }
}

# The secure HTTPS server.
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name autoconfig.identosphere.net;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    ssl_certificate /home/user-data/ssl/identosphere.net-20210401-90d5ae2d.pem;
    ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

    root /home/user-data/www/default;

    # ssl files sha1: 4d28ac1a16c0e04772557f6a765cbaa2e4a1d96f / a2eda6be4854a2530dc96a579325f3e95160fc48
    add_header Strict-Transport-Security "max-age=15768000" always;
    include /home/user-data/www/autoconfig.identosphere.net.conf;

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /mailinabox.mobileconfig {
        alias /var/lib/mailinabox/mobileconfig.xml;
    }
    location = /.well-known/autoconfig/mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /.well-known/mta-sts.txt {
        alias /var/lib/mailinabox/mta-sts.txt;
    }

    # Z-Push (Microsoft Exchange ActiveSync)
    location /Microsoft-Server-ActiveSync {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/index.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_read_timeout 630;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;
    }
    location ~* ^/autodiscover/autodiscover.xml$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_pass php-fpm;
    }

    # Disable viewing dotfiles (.htaccess, .svn, .git, etc.)
    # This block is placed at the end. Nginx's precedence rules means this block
    # takes precedence over all non-regex matches and only regex matches that
    # come after it (i.e. none of those, since this is the last one.) That means
    # we're blocking dotfiles in the static hosted sites but not the FastCGI-
    # handled locations for Nextcloud (which serves user-uploaded files that might
    # have this pattern, see #414) or some of the other services.
    location ~ /\.(ht|svn|git|hg|bzr) {
        log_not_found off;
        access_log off;
        deny all;
    }
}
## autodiscover.identosphere.net

# Redirect all HTTP to HTTPS *except* the ACME challenges (Let's Encrypt TLS certificate
# domain validation challenges) path, which must be served over HTTP per the ACME spec
# (due to some Apache vulnerability).
server {
    listen 80;
    listen [::]:80;

    server_name autodiscover.identosphere.net;
    root /tmp/invalid-path-nothing-here;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    location / {
        # Redirect using the 'return' directive and the built-in
        # variable '$request_uri' to avoid any capturing, matching
        # or evaluation of regular expressions.
        return 301 https://autodiscover.identosphere.net$request_uri;
    }

    location /.well-known/acme-challenge/ {
        # This path must be served over HTTP for ACME domain validation.
        # We map this to a special path where our TLS cert provisioning
        # tool knows to store challenge response files.
        alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;
    }
}

# The secure HTTPS server.
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name autodiscover.identosphere.net;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    ssl_certificate /home/user-data/ssl/identosphere.net-20210401-90d5ae2d.pem;
    ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

    root /home/user-data/www/default;

    # ssl files sha1: 4d28ac1a16c0e04772557f6a765cbaa2e4a1d96f / a2eda6be4854a2530dc96a579325f3e95160fc48
    add_header Strict-Transport-Security "max-age=15768000" always;
    include /home/user-data/www/autodiscover.identosphere.net.conf;

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /mailinabox.mobileconfig {
        alias /var/lib/mailinabox/mobileconfig.xml;
    }
    location = /.well-known/autoconfig/mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /.well-known/mta-sts.txt {
        alias /var/lib/mailinabox/mta-sts.txt;
    }

    # Z-Push (Microsoft Exchange ActiveSync)
    location /Microsoft-Server-ActiveSync {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/index.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_read_timeout 630;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;
    }
    location ~* ^/autodiscover/autodiscover.xml$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_pass php-fpm;
    }

    # Disable viewing dotfiles (.htaccess, .svn, .git, etc.)
    # This block is placed at the end. Nginx's precedence rules means this block
    # takes precedence over all non-regex matches and only regex matches that
    # come after it (i.e. none of those, since this is the last one.) That means
    # we're blocking dotfiles in the static hosted sites but not the FastCGI-
    # handled locations for Nextcloud (which serves user-uploaded files that might
    # have this pattern, see #414) or some of the other services.
    location ~ /\.(ht|svn|git|hg|bzr) {
        log_not_found off;
        access_log off;
        deny all;
    }
}
## mta-sts.identosphere.net

# Redirect all HTTP to HTTPS *except* the ACME challenges (Let's Encrypt TLS certificate
# domain validation challenges) path, which must be served over HTTP per the ACME spec
# (due to some Apache vulnerability).
server {
    listen 80;
    listen [::]:80;

    server_name mta-sts.identosphere.net;
    root /tmp/invalid-path-nothing-here;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    location / {
        # Redirect using the 'return' directive and the built-in
        # variable '$request_uri' to avoid any capturing, matching
        # or evaluation of regular expressions.
        return 301 https://mta-sts.identosphere.net$request_uri;
    }

    location /.well-known/acme-challenge/ {
        # This path must be served over HTTP for ACME domain validation.
        # We map this to a special path where our TLS cert provisioning
        # tool knows to store challenge response files.
        alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;
    }
}

# The secure HTTPS server.
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name mta-sts.identosphere.net;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    ssl_certificate /home/user-data/ssl/identosphere.net-20210401-90d5ae2d.pem;
    ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

    root /home/user-data/www/default;

    # ssl files sha1: 4d28ac1a16c0e04772557f6a765cbaa2e4a1d96f / a2eda6be4854a2530dc96a579325f3e95160fc48
    add_header Strict-Transport-Security "max-age=15768000" always;
    include /home/user-data/www/mta-sts.identosphere.net.conf;

    location = /robots.txt {
        log_not_found off;
        access_log off;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /mailinabox.mobileconfig {
        alias /var/lib/mailinabox/mobileconfig.xml;
    }
    location = /.well-known/autoconfig/mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /mail/config-v1.1.xml {
        alias /var/lib/mailinabox/mozilla-autoconfig.xml;
    }
    location = /.well-known/mta-sts.txt {
        alias /var/lib/mailinabox/mta-sts.txt;
    }

    # Z-Push (Microsoft Exchange ActiveSync)
    location /Microsoft-Server-ActiveSync {
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/index.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_read_timeout 630;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;
    }
    location ~* ^/autodiscover/autodiscover.xml$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
        fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
        fastcgi_pass php-fpm;
    }

    # Disable viewing dotfiles (.htaccess, .svn, .git, etc.)
    # This block is placed at the end. Nginx's precedence rules means this block
    # takes precedence over all non-regex matches and only regex matches that
    # come after it (i.e. none of those, since this is the last one.) That means
    # we're blocking dotfiles in the static hosted sites but not the FastCGI-
    # handled locations for Nextcloud (which serves user-uploaded files that might
    # have this pattern, see #414) or some of the other services.
    location ~ /\.(ht|svn|git|hg|bzr) {
        log_not_found off;
        access_log off;
        deny all;
    }
}
## www.identosphere.net

# Redirect all HTTP to HTTPS *except* the ACME challenges (Let's Encrypt TLS certificate
# domain validation challenges) path, which must be served over HTTP per the ACME spec
# (due to some Apache vulnerability).
server {
    listen 80;
    listen [::]:80;

    server_name www.identosphere.net;
    root /tmp/invalid-path-nothing-here;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    location / {
        # Redirect using the 'return' directive and the built-in
        # variable '$request_uri' to avoid any capturing, matching
        # or evaluation of regular expressions.
        return 301 https://www.identosphere.net$request_uri;
    }

    location /.well-known/acme-challenge/ {
        # This path must be served over HTTP for ACME domain validation.
        # We map this to a special path where our TLS cert provisioning
        # tool knows to store challenge response files.
        alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;
    }
}

# The secure HTTPS server.
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name www.identosphere.net;

    # Improve privacy: Hide version an OS information on
    # error pages and in the "Server" HTTP-Header.
    server_tokens off;

    ssl_certificate /home/user-data/ssl/identosphere.net-20210401-90d5ae2d.pem;
    ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

    rewrite ^(.*) https://identosphere.net$1 permanent;
}

A: You need to at least set:
proxy_set_header Host newsletter.identosphere.net;

This sends the correct Host header to the upstream server, which might be configured to send redirects when there is an incorrect Host header in the request.

A: You could use a server block within the Nginx config, then using the Reverse Proxy. It even allows a port redirection, which is just fantastic.
Here's an exceprt regarding a live website, from my config file at /etc/nginx/sites-available/default :
server {
    server_name   wows-karma.com www.wows-karma.com;
    location / {
        proxy_pass         http://localhost:5021;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }

server {
    server_name   api.wows-karma.com;
    location / {
        proxy_pass         http://localhost:5020/api/;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }

This example (which is a real, live and working website by the way) should be enough material to cover your usecase. I'd suggest you follow the API example, and adapt it to your needs.
Oh and also, that Reverse Proxy works also on remote destinations, not just local. Think about the possibilities...


text:
Q: Visualizing all tag values I'm looking for a way to visualize all the available values for one specific tag ("pair" in the picture)
I understand that I can manually create individually, but I'm not sure if there's a better for this
Thanks in advance

A: You can group by the tag of interest.
So, here you can insert "tag(pair)" to the GROUP BY part. Remove it from the where clause as well.

redpajama_set_name: RedPajamaStackExchange


text:
Q: SKPaymentQueue getting SKPaymentTransactionStateFailed when OFFLINE and for products that no longer exist in the store I'm adding In-App-Purchase (IAP) to my App. I've followed all the guidelines regarding setting up a test user for the Sandbox and logging OUT of the real App Store account. While testing I was buying and cancelling. At one point the device re-sync'd with iTunes and apparently restored and re-connected me to the production store. I didn't notice this until an attempt to buy didn't produce the normal login dialog, which I cancelled. Since that point I've been getting SKPaymentTransactionStateFailed in:
-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
And the error SKError in the Error object indicates: SKErrorPaymentCancelled which was true but also happened days ago.
I get this regardless of if the device is connected to the internet or not (even if wifi is off). It appears to have cached the fact that the transaction was cancelled someplace and is stuck. Nothing clears it that I have tried including:

*

*Creating a new test user and deleting the old one.

*Deleting the App and re-installing.

*Deleting the test products that generate this.

*Clean and re-build the project including build folder.

*Resetting the device and all the other voodoo.

Any ideas what is going on here? How does one clear what is cached? It doesn't appear that I am required to acknowledge that fact to the store in anyway. Furthermore, what I find really odd is that I get these  SKPaymentTransaction notifications at launch, EVEN if the device is offline?!

A: SOLUTION: Well the App Store was caching something on the device and the only solution was to re-install iOS 9 and to NOT restore from a previous backup. Cleaning the project and the build folder did not help, neither did deleting the App from the device or any of the places that iTunes stores it and then re-installing the production App.


text:
Q: Get value from associative array with string I have a json response I'm getting from a server with different response structures.
One uses another value "data" to store a link:

and the other doesn't (with "image" being the link):

I was wondering if there was a way I can get the "data.link" from the associative array with a reusable method, with linkVariableName being the key of the associative array.
function addLink(responseText, successVariableName, isError, linkVariableName)
{
    var jsonResponse = JSON.parse(responseText);

    var state;
    if (isError)
        state = !jsonResponse[successVariableName];
    else
        state = jsonResponse[successVariableName];

    if (state) {
        var link = jsonResponse[linkVariableName];
        insertAtCursor(textArea, '[img]' + link + '[/img]\r\n');
    } else
        console.log('Error: ' + responseText);
}

so I can use either
addLink(response.responseText, 'success', false, 'data.link');

or
addLink(response.responseText, 'error', true, 'image');

A: Yes you can, as explained here: Accessing nested JavaScript objects with string key
However, IMO the function tries to do too much. Why does it need to parse the JSON and extract the value? You could just pass the value directly to it:
function addLink(link) {
  insertAtCursor(textArea, '[img]' + link + '[/img]\r\n');
}

And move the other logic to where you handle the response:
var isError = ...;
var response = JSON.parse(responseText);

if (isError && !response.error) {
  addLink(response.image);
} else if(!isError && response.success) {
  addLink(response.data.link);
} else {
  console.log('Error: ' + responseText);
}


text:
Q: error DSolve::dsfun: cannot be used as a function I tried to solve system of ODEs, but something was wrong.
Clear[P]
Clear[A]
A = {1, 0, 0}
P[t_] = {P1[t], P2[t], P3[t]}
Q[t_] = {Q1[t], Q2[t], Q3[t]}
sol3 = DSolve[{P'[t] == Cross[A, Q[t]], Q'[t] == Cross[A, P[t]],
  P[0] == {0.5, 0.5, 0.3}, Q[0] == {0.1, 0.2, 0.3}}, {P[t], Q[t]}, t]

The result is
 DSolve::dsfun: {P1[t],P2[t],P3[t]} cannot be used as a function. >>

What interesting for me is that when I try to solve only one equation (not a system), everything is OK:
sol2 = DSolve[{P'[t] == Cross[A, P[t]], P[0] == {0.5, 0.5, 0.3}},
  P[t], t]
  {{P1[t] -> 0.5, P2[t] -> 0.5 Cos[t] - 0.3 Sin[t],
  P3[t] -> 0.3 Cos[t] + 0.5 Sin[t]}}

I don't understand how it works...

A: Update:
Threading is not needed, thanks to comment by Michael below. Both solution work ofcourse, but Michael's sugestion is simpler, just Flatten the list if dependent variables:
Clear[P, A, t]
A = {1, 0, 0}
P[t_] = {P1[t], P2[t], P3[t]}
Q[t_] = {Q1[t], Q2[t], Q3[t]}
sol3 = DSolve[{P'[t] == Cross[A, Q[t]], Q'[t] == Cross[A, P[t]],
  P[0] == {0.5, 0.5, 0.3}, Q[0] == {0.1, 0.2, 0.3}}, Flatten@{P[t], Q[t]}, t]

Original answer
Need to thread the equations
Clear[P, A, t]
A = {1, 0, 0}
P[t_] := {P1[t], P2[t], P3[t]}
Q[t_] := {Q1[t], Q2[t], Q3[t]}
eq = {Thread[P'[t] == Cross[A, Q[t]]], Thread[Q'[t] == Cross[A, P[t]]]}
ic = {Thread[P[0] == {0.5, 0.5, 0.3}], Thread[Q[0] == {0.1, 0.2, 0.3}]}
sol3 = DSolve[Flatten@{eq, ic}, Flatten@{P[t], Q[t]}, t]


text:
Q: Unable to center fixed image horizontally relative to containing div I was working on an HTML page with a sticky header, and I want to center a logo image inside of the header div. I have tried the method of styling it in CSS as follows, but it keeps it's location at the left.
  margin-left: auto;
  margin-right: auto;

Any help figuring this out is much appreciated. Thanks everyone!
Code snipet:

div.secheadlogo {
  text-align: center;
  display: block;
  width: 10vh;
  margin-left: auto;
  margin-right: auto;
}

div.sechead {
  background-color: #F2EDE7;
  position: fixed;
  height: 4.18vh;
  z-index: 10;
  width: 100vw;
  text-align: center;
}

 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
  dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing
  elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
  magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
  cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
  exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
  mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet,
  consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
  ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
  sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
  officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
  dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
  in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

A: You could use flexbox display mode.
Add these styles:
display: flex;
justify-content: center;

To the:
div.sechead {
      background-color: #F2EDE7;
      position: fixed;
      height: 4.18vh;
      z-index: 10;
      width: 100vw;
      text-align: center;
      display: flex;
      justify-content: center;
    }

More on flexbox here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Working snippet

div.secheadlogo {
  text-align: center;
  display: block;
  width: 10vh;
  margin-left: auto;
  margin-right: auto;
}

div.sechead {
  background-color: #F2EDE7;
  position: fixed;
  height: 4.18vh;
  z-index: 10;
  width: 100vw;
  text-align: center;
  display: flex;
  justify-content: center;
}

 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure

A: It works if you add the id/class to the specific image (not to its parent), set its margins to auto and remove the "fixed" position
So:

and
#artiststhumbnail a img {
    display : block;
    margin : auto;
}

Fiddle: https://jsfiddle.net/3tfn4aov/1/

A: In the HTML your logo has a style attribute with position:fixed on it. It doesn't need this to stick to the top of the page, because its parent is already fixed, so it will move along with the parent. The fixed positioning is what's preventing you from using auto margins.
Just remove the style attribute from your logo and add margin: 0 auto like so:

div.secheadlogo {
  text-align: center;
  display: block;
  width: 10vh;
  margin: 0 auto;
}

div.sechead {
  background-color: #F2EDE7;
  position: fixed;
  height: 4.18vh;
  z-index: 10;
  width: 100vw;
  text-align: center;
}

 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
  dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing
  elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
  magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
  cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
  exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
  mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet,
  consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
  ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
  sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
  officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
  dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
  in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

A: You use position fixed. that reason you should be use left, top, right and bottom CSS property.

div.secheadlogo {
  position: fixed;
  text-align: center;
  display: block;
  width: 10vh;
  left: -webkit-calc(50% - 5vh);
  left: -moz-calc(50% - 5vh);
  left: calc(50% - 5vh);
  margin-left: auto;
  top: 0;
}
/*.div.secheadlogo img{
display: block;
height: auto;
margin-left: atuo;
margin-right: auto;
max-width: 100%;
}*/

div.sechead {
  background-color: #F2EDE7;
  position: fixed;
  height: 4.18vh;
  z-index: 10;
  width: 100vw;
  text-align: center;
}

 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
  dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing
  elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
  magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
  cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
  exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
  mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet,
  consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
  velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
  ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
  sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
  officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
  dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
  in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


text:
Q: NullPointer Exception thrown with JavaFX My application is throwing a NullPointer exception when I call the variable empName.
            ResultSet result = stmnt.executeQuery("select FirstName, LastName from emp_info where EmployeeID "
                    + "= '" + empID + "'");

//            while(result.next()){
//                empName.setText("result.getString(1));
//            }
            empName.setText("asdf");
            rootLayout.setCenter(controlData);

            connection.close();
        }

    }

It should be able to run fine since I initialize the Text variable like so:
@FXML
public Text empName;

Also when I use scenebuilder, it sometimes shows the fx:id empName but when I exit out of it and reopen it doesn't show it.  I think that's where the problem is.  My xml file is:
<AnchorPane prefHeight="300.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="studentempsignin.MainPage_Controller">
   <children>
      <BorderPane prefHeight="300.0" prefWidth="500.0">
         <center>
            <Text fx:id="empName" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" BorderPane.alignment="CENTER" />
         </center>
      </BorderPane>
   </children>
</AnchorPane>

The exception I get is:
SEVERE: null
java.lang.NullPointerException
    at studentempsignin.MainPage_Controller.signingIn(MainPage_Controller.java:190)
    at studentempsignin.SignIn_Controller.lambda$0(SignIn_Controller.java:66)
    at studentempsignin.SignIn_Controller$$Lambda$143/575703892.handle(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)

Edit:
The method empIDAccess is being called when I click the signIn button:
signInBtn.setOnAction((e) -> {
            try {
                //used dbaseDriver...idk why
//                DBaseDriver connect = new DBaseDriver("jdbc:mysql://localhost:3306/AUStudentEmployees",
//                        "kheneahm", "kennygoham");
                String empID = empIDField.getText();
                MainPage_Controller empIDAccess = new MainPage_Controller();
                empIDAccess.signingIn(empID, invalidID, signInBtn);
            } catch (Exception ex) {
                Logger.getLogger(SignIn_Controller.class.getName()).log(Level.SEVERE, null, ex);
            }

        });

A: You're creating a new controller instance. The FXMLLoader creates a controller instance and initializes the @FXML-annotated fields in that instance, when you load the FXML file. Those fields won't be initialized in the new instance you create (and even if they were, they wouldn't refer to the same objects displayed in the UI).
You need to get a reference to the controller that is created when you load the FXML.


text:
Q: MikroC VS xc8 codes I have found this codes for controlling DC motor speed using PWM by connecting two switches to increase and decrease the PWM value. The problem is this codes is in MiKroc and my compiler is XC8. May i know what changes should i change for the codes to work in protues.
  #define _XTAL_FREQ 8000000L

 //#define RS RB0
 //#define EN RB1
 //#define D4 RD4
 //#define D5 RD5
 //#define D6 RD6
 //#define D7 RD7

#include <xc.h>

// BEGIN CONFIG
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit SerialProgramming Enable bit (RB3 is digital I/O, HV on MCLR must be used for   programming)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM   code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write   protection off; all program memory may be written to by EECON control)
     #pragma config CP = OFF // Flash Program Memory Code Protection bit   (Code    protection off)
     //END CONFIG

  int main()
  {
    short duty  = 0; //initial value for duty

  TRISD = 0xFF; //PORTD as input
  TRISC = 0x00; //PORTC as output
  TRISB = 0x00; //PORTB as output
  PORTB = 0x02; //Run motor in anticlock wise

  PWM1_Init(1000);  //Initialize PWM1
  PWM1_Start();  //start PWM1
  PWM1_Set_Duty(duty); //Set current duty for PWM1

  while (1)        // endless loop
  {
 if (RD0==0 && duty<250) //if button on RD0 pressed
 {
   __delay_ms(40);
    duty = duty + 10;  //increment current_duty
    PWM1_Set_Duty(duty);  //Change the duty cycle
 }
 if (RD1==0 && duty >0) //button on RD1 pressed
 {
  __delay_ms(40);
   duty = duty - 10;  //decrement duty
   PWM1_Set_Duty(duty);
 }
  __delay_ms(10);     // slow down change pace a little
 }
}

A: Your problem is that the three PWM-related functions are not declared nor defined anywhere:
PWM1_Init(1000);  //Initialize PWM1
PWM1_Start();  //start PWM1
PWM1_Set_Duty(duty); //Set current duty for PWM1

Presumably, the MikroC environment includes everything automatically, causing a lot of surprise when porting to less insane environments.
I don't know what MikroC is or does, but to make your code run, you need to declare and define the three functions PWM1_Init(), PWM1_Start(void), and PWM1_Set_Duty(). Perhaps you can copy them from MikroC.


text:
Q: Ubuntu return deinstalled package root@randevu:~# dpkg --get-selections | grep postfix
postfix     deinstall

Is it possible to return back deinstalled package? I'm wondering how could postfix be deinstalled. I haven't done it manually. Can apt-get or aptitude do it itself?
/etc/init.d/postfix start
/etc/init.d/postfix restart

returns nothing, just a silence.
Configs are in place inside /etc/postfix/.
root@randevu:~# dpkg -L postfix
/etc
/etc/init.d
/etc/init.d/postfix
/etc/ppp
/etc/ppp/ip-up.d
/etc/ppp/ip-up.d/postfix
/etc/ppp/ip-down.d
/etc/ppp/ip-down.d/postfix
/etc/network
/etc/network/if-up.d
/etc/network/if-up.d/postfix
/etc/network/if-down.d
/etc/network/if-down.d/postfix
/etc/postfix
/etc/postfix/postfix-script
/etc/postfix/post-install
/etc/postfix/postfix-files
/etc/resolvconf
/etc/resolvconf/update-libc.d
/etc/resolvconf/update-libc.d/postfix
/var/spool/postfix
/var/spool/postfix/usr
/var/spool/postfix/usr/lib
/var/spool/postfix/usr/lib/zoneinfo
/var/lib/postfix
root@randevu:~#

This is what is left from postfix. Maybe it's some kind of crash on whole partition?
Thanks

A: You can check /var/log/dpkg.log what had happend with postfix.
And than just make backups on your existing files and then reinstall the package.


text:
Q: How to get redirect log in Mechanize? In ruby, if you use mechanize following 301/302 redirects like this
require 'mechanize'

m = WWW::Mechanize.new
m.get('http://google.com')

how to get the list of the pages mechanize was redirected through? (Like http://google.com => http://www.google.com => http://google.com.ua)
OK, here is the code in mechanize responsible for redirection
 elsif res_klass <= Net::HTTPRedirection
        return page unless follow_redirect?
        log.info("follow redirect to: #{ response['Location'] }") if log
        from_uri  = page.uri
        raise RedirectLimitReachedError.new(page, redirects) if redirects + 1 > redirection_limit
        redirect_verb = options[:verb] == :head ? :head : :get
        page = fetch_page(  :uri => response['Location'].to_s,
                            :referer => page,
                            :params  => [],
                            :verb => redirect_verb,
                            :redirects => redirects + 1
                         )
        @history.push(page, from_uri)
        return page

but trying to m.history.map {|p| puts p.uri} shows 3 times the uri of last page..

A: The key here is to take advantage of the built in logging in Mechanize.  Here's a full code sample using the built in Rails logging facilities.

require 'mechanize'
require 'logger'
mechanize_logger = Logger.new('log/mechanize.log')
mechanize_logger.level = Logger::INFO
url = 'http://google.com'
agent = Mechanize.new
agent.log = mechanize_logger
agent.get(url)

And then check the output of log/mechanize.log in your log directory and you'll see the whole mechanize process including the intermediate urls.

A: I'm not certain, but here are a couple of things to try:

*

*see what's in m.history[i].uri after the get()

*You might need something like:

    for m.redirection_limit in 0..99
      begin
        m.get(url)
        break
        rescue WWW::Mechanize::RedirectLimitReachedError
          # code here could get control at
          # intermediate redirection levels
      end
    end


text:
Q: Is a relational database appropriate for SAS like processing? Currently I have a program that processes raw data in SAS, running queries like the following:
/*this code joins the details onto the spine, selecting the details
 that have the lowest value2 that is greater than value, or if there are none
 of those, then the highest value2*/
/*our raw data*/
data spine;
    input id value;
    datalines;
    1 5
    2 10
    3 6
;
run;

data details;
    input id value2 detail $;
    datalines;
    1 6 foo
    1 8 bar
    1 4 foobar
    2 8 foofoo
    2 4 barbar
    3 6 barfoo
    3 2 foobarfoo
;
run;

/*cartesian join details onto spine, split into highs and lows*/
proc sort data = spine;
by id;
run;

proc sort data= details;
    by id;
run;

data lows highs;
    join spine details;
    by id;
    if value2 ge value then output highs;
    else output lows;
run;

/*grab just the first/last of each set*/
proc sort data =lows;
by id value2;
run;

proc sort data = highs;
by id value2;
run;

data lows_lasts;
    set lows;
    by id;
    if last.id;
run;

data highs_firsts;
    set highs;
    by id;
    if first.id;
run;

/*join the high value where you can*/
data join_highs;
    merge spine(in = a)
    highs_firsts ;
    by id;
    if a;
run;

/*split into missing and not missng*/
data not_missing still_missing;
    set join_highs;
    if missing(value2) then output still_missing;
    else output not_missing;
run;

/*if it doesn't already have a detail, then attach a low*/
data join_lows;
    merge still_missing(in = a)
    lows_lasts ;
    by id;
    if a;
run;

/*append the record that had a high joined, and the record that had a low joined, together*/
data results;
    set not_missing join_lows;
run;

You get the picture. There are a lots of these kinds of data processing statements, which are run on a weekly basis, on new records.
Also doing data transformation (eg cleansing/parsing addresses).
Now - this kind of processing could be done using SQL.
The question is - would this be appropriate use of a relational database? Or should databases only be used for data storage and retrieval?
Consider that we are talking about tables with upto 10 million rows.

A: SAS is designed for operations like what you have mentioned! You definitely can do most of these processing in an RDBMS, but the analytical capabilities of a typical RDBMS are limited compared to SAS functions. There are some elegant structures also in SAS, for example an SQL alternative of SAS First and Last processing is more cumbersome. The codes can be organized and scheduled as flows easily in a weekly basis.
The main question is that why you would like to use an RDBMS, what advantage of it would you benefit of?
Two potential advantages came into my mind:

*

*Multiuser usage: RDBMS's built-in locking and transactions management allow multiple database users to access a database simultaneously. I think this is not the case in your situation.

*Loads of records: In case of billions of records, SAS data sets can have a size that can become difficult to handle even with COMPRESS option switched on (speed can be an issue also). In such cases, it can be a good practice to store data in RDBMS and access it through SAS/Access interface. I think this is not the case in your situation either.

If you go with an RDBMS from SAS solution, notice that you might have to rewrite some parts of your code, as some SAS functions does not work with RDBMS-s if you run them with the libname method. The use of FedSQL (SAS implementation of ANSI SQL:1999 core standard introduced in SAS 9.4) is solving this problem.
Also note that in some special cases, you can have different results using SAS to using an RDBMS.

A: As you have noted, this type of processing can be done in an RDBMS but not just about any RDBMS. You would need an RDMBS that is compliant with the latest ANSI SQL standard or at least support WINDOW functions with PARTITION feature. Ex: PostgreSQL, Teradata, SQL Server 2012 etc... note: MySQL is missing as it does not support WINDOW functions.


text:
Q: Sudden "no "ssl_certificate" is defined for the "listen ... ssl" error I have a config like this which has worked for years:
  server {
      listen 80;
      server_name www.domain.com domain.com;
      return 301 https://domain.com$request_uri;
  }

  # !!!!
  # line 10
  server {
      listen 443 ssl http2;
      server_name www.domain.com;
      return 301 https://domain.com$request_uri;
  }

  server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;

      server_name domain.com;

      ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;

      ssl_prefer_server_ciphers on;
      ssl_session_timeout 180m;
      ssl_session_cache builtin:1000 shared:SSL:10m;
      ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
      ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
      add_header Strict-Transport-Security 'max-age=31536000';

      # [.................]
  }

Now it's begun to fail due to the error:
no "ssl_certificate" is defined for the "listen ... ssl" directive in /etc/nginx/sites-enabled/domain.com:10

What has changed in nginx? How to fix it?

A: Your server block is missing ssl_certificate and ssl_certificate_key statements.
You can move these statements outside of any server block so that the same certificate is used by all server blocks (assuming that you just have the one certificate).
Nginx can be bit relaxed about 'no "ssl_certificate" is defined' errors. I suspect that if the server blocks were reversed, the error might mysteriously disappear. But for correctness, you should define a certificate for each server block that needs one, or in http block scope for all servers.


text:
Q: copy and paste a cell from one worksheet to another and multiply it by a value Worksheets(stockcode & "_CF_" & marketcode).Range("B11").Copy
Worksheets(stockcode & "_Stock ratio_" & marketcode).Range("D16").PasteSpecial

I am running this two lines of code to copy from one worksheet and pasting it onto another worksheet. In the midst of it, I want to multiply it by -1 before pasting onto the last worksheet. Any ways to do it?

A: As you just want to copy one cell and it (hopefully) is a number you just could write:
Worksheets(stockcode & "_Stock ratio_" & marketcode).Range("D16") = Worksheets(stockcode & "_CF_" & marketcode).Range("B11")* -1


text:
Q: Unable to instantiate fragment - InstantiationException I published a app on the play store and i am using ACRA for receiving crash reports.
I'm getting a lot of these crash reports listed below, which i have never seen before although i tested the app a lot on a lot of devices.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.app.fragments.InfoDetailFragment$1: make sure class name exists, is public, and has an empty constructor that is public
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2355)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2391)
        at android.app.ActivityThread.access$600(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:155)
        at android.app.ActivityThread.main(ActivityThread.java:5520)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
        at dalvik.system.NativeStart.main(Native Method)

Its always the fragment "InfoDetailFragment", which like all of my fragments subclasses a BaseFragment.
public static InfoDetailFragment createInstance(String title) {
    InfoDetailFragment frag = new InfoDetailFragment();
    Bundle args = new Bundle();
    args.putString(ARGS_TITLE, title);
    frag.setArguments(args);
    return frag;
}

public InfoDetailFragment() {
    super("InfoDetailFragment");
}

All my fragments are instantiated exactly the same, but the error only appears on this one. Any ideas or hints? Thanks a lot

A: Follow up: I updated my support library to rev.18, this seems to have solved the problem.

A: share my experience:
Add empty constructor and/or newInstance() both not work.
clue is class not found, and in my gradle
defaultConfig {
        multiDexEnabled true
    }
dependencies {
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
}

I trun off multiDexEnabled, instead of
defaultConfig {
        //multiDexEnabled true
    }
dependencies {
    //compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
}

(Android Studio 1.5.1, Android API23)


text:
Q: Mixed DML Operations in Test Methods - system.RunAs(user) - but why? Reading the documentation here, the advice is to run certain DML operations within a System.runAs(user) block.
I don't really understand why that needs to happen. I know that it works - as my unit test for creating an EmailTemplate is now working. But I don't really know why it has to be within a specified user context.
Can someone provide a clearer insight than the documentation as to why this needs to happen?

A: Follow the link to sObjects That Cannot Be Used Together in DML Operations
 to better understand (emphasis mine):

DML operations on certain sObjects, sometimes referred to as setup objects, can't be mixed with DML on other sObjects in the same transaction. This restriction exists because some sObjects affect the user's access to records in the org. You must insert or update these types of sObjects in a different transaction to prevent operations from happening with incorrect access-level permissions. For example, you can't update an account and a user role in a single transaction. However, deleting a DML operation has no restrictions.

The key with using system.runAs is that you create a separate transaction, and that enables you to work with both types of sObject.


text:
Q: How do you link one of your nav bar buttons to a sidebar that becomes visible? I have three buttons on top of my webpage. The Contact Me button is suppose to open a sidebar on the left side that is invisible until Contact Me is clicked. However, I can't make my sidebar appear when clicking Contact Me.
An example would be this: http://www.andrewmart.in/
When you click Contact, the sidebar appears.
Here is the three buttons for the home page:

Home

About Me

Contact Me

Here is the sidebar that remains invisible until Contact Me is clicked:

 Home

 About Me

 Contact Me

  ....

Here is the JQuery for toggling the sidebar invisible to visible:

Lastly, the CSS for the Sidebar Menu:
#sidebar{
  background: #151718;
  width: 200px;
  height: 100%;
  display: block;
  position: absolute;
  left: -200px;
  top: 0px;
  transition: left  0.3s  linear;
}
#sidebar.visible{
  left: 0px;
  transition: left 0.3s linear;
}

A: In your JQuery $('#sidebar').toggleClass('visble');your visible is spelt wrong.

A: Your spelling of the .visible class is wrong. Working fiddle: https://jsfiddle.net/a10d9hpf/
On another note, I would also use preventDefault() on your click function as follows:
$(document).ready(function(){
  $('#contacts').click(function(e){
    e.preventDefault();
    $('#sidebar').toggleClass('visible');
  });
});

Since you're not passing the value of href to your script to determine which element id is targeted when executed.


text:
Q: Zeros and poles of rational functions over elliptic curve On this page, the author states:

It turns out this definition can be extended to points of order 2, and also the point O (when we homogenize the functions and work over the projective plane). Moreover, every rational function has as many zeroes as poles counting multiplicities, because of the way we extend the definition to the point at infinity.

I'm interested as to why every rational function has as many zeros as poles. That seems to be caused by "homogenization", so how homogenization works and why do we need it?
Why do we need to worry about points of order 2?

A: Homogenization refers to the process of going from the "affine" to the "projective" plane, by adding "points at infinity".  It's easier to work over the projective plane because there aren't any "missing points"; for example, in the projective plane, every 2 distinct lines intersect at one point (instead of having to make an exception for parallel lines, as in the affine case).  In effect, for each class of parallel lines, we add a point at infinity to the plane, and 2 parallel lines will intersect at the point at infinity corresponding to their class; the set of all points at infinity from a line at infinity.
For the study of elliptic curves, adding these missing points is necessary because otherwise, the points of the curve will not form a group (you'll have some missing points, like the point $O$ in the article you linked to).
Here's how the process works.  I'll just show how it works in the plane; the same thing works in any number of dimensions.  In the usual ("affine") plane, a point is given by coordinates $(x,y)$.  In the projective planes, the coordinates will be written $(x:y:z)$.  However, unlike the affine case, not all sets of coordinates will be distinct points; in the projective plane,

*

*(0:0:0) is not a point.

*If 2 coordinates differ by a scalar multiple, we consider them the same point: $(x:y:z) \sim (ax:ay:az)$.  Here $a \ne 0$, and $x,y,z$ cannot all be 0, because of condition 1.

Just like in the affine case, we can write equations of curves using the projective coordinates $(x:y:z)$.  However, we have to be careful, because of the equivalence condition imposed by condition 2 above.  We cannot write a projective equation like $x+y+z=1$, because if we scale everything by a scalar $a$, we would get $ax+ay+az=1$, which is not equivalent to $x+y+z=1$.  Indeed, condition 2 limits us to equations of the form $f(x,y,z)=0$ where $f$ is a homogeneous polynomial, meaning all terms of the polynomial have the same degree.  For example, $y^2z - x^3 - 2xz^2 - z^3 = 0$ is a legitimate equation for a curve in the projective plane, because if we scale each coordinate by a scalar $a$, all the terms are multiplied by $a^3$, which can then be cancelled out (because $a \ne 0$ and the right-hand side is 0!).  You can "homogenize" an affine equation in coordinates $x,y$ by multiplying each term by an appropriate power of $z$.  That's what I did to get the equation above; starting with the affine elliptic curve equation $y^2 - x^3 - 2x - 1 = 0$, I homogenized each term to get the projective equation.
Because of condition 2, whenever we have a point $(x:y:z)$ and $z \ne 0$, we can normalize the $z$ coordinate to 1: $(x:y:z) \sim (x/z, y/z, 1)$.  So among the points with non-zero $z$ coordinate, we effectively have only 2 coordinates to worry about, and we are back in the affine case.  So the affine plane is contained in the projective plane: $(x,y) \mapsto (x:y:1)$.  But the projective plane also contains an additional set of points with $z$-coordinate 0.  These are the points at infinity.
In the affine plane, the lines $x+y=1$ and $x+y=2$ are parallel.  Homogenizing, we get $x+y=z$ and $x+y=2z$ in the projective plane, where they intersect at a point at infinity (1:-1:0).  (You can check that any other solution to this pair of equations is equivalent, via condition 2, to (1:-1:0), so there is only one intersection point in the projective plane.)  The point (1:-1:0) is the point at infinity corresponding to (affine) lines of slope 1.  We added one point an infinity for each possible slope (including $\infty$ for vertical lines); (1:m:0) for lines of slope $m$, and (0:1:0) for vertical lines.
In the elliptic curve case, homogenizing adds the point (0:1:0) to the curve, which is the point $O$ in the article linked in your original post; this point is usually taken to be the identity of the group.  As noted above, (0:1:0) is the point at infinity corresponding to vertical lines.  If you take an affine elliptic curve such as $y^2 - x^3 - 2x - 1 = 0$ and try to add the 2 points $(x,y)$ and $(x,-y)$, when you draw the line through them, they don't intersect the curve in a third point.  But in the projective plane, they do; $(x,y)$ and $(x,-y)$ lie on a vertical line and therefore the line through them contains the point (0:1:0).
The situation with rational functions is similar.  I'll switch down to 1 dimension since that illustrates the point more clearly.  In the affine line, with a single coordinate $x$, I can define the rational function $1/x$.  This has a pole at $x=0$ but no zeroes.  However, on the projective line (with projective coordinates $(x:y)$), I homogenize to the function $y/x$.  Now there is a pole (0:1) as before but there is also the zero (1:0).  There are the same number of zeroes as poles.  This is true for every rational function (not identically zero) on the projective line.  It is also true for elliptic curves and indeed for every projective curve.
Note: This answer may give the impression that the $z$-coordinate is somehow "special" in the projective plane.  This isn't really the case; it's an artifact coming from the way I chose to embed the affine plane into the projective plane, via $(x,y) \mapsto (x:y:1)$.  This is convenient for relating the projective plane back to the familiar case of the affine plane, but it's just a choice, sort of like choosing a basis for a vector space; I could also choose either of the other coordinates to be the special one, or even something crazy like $(x,y) \mapsto (x+y+1:2x+3y+4:4x+5y+7)$ (not that one would actually want do something like that, which would be like deliberately choosing a weird basis for a vector space).

A: Given a rational function $f$ on an elliptic curve (or a smooth projective curve) $E$, we have that $$\sum_{x\in E} \textrm{ord}_x(f) =0. $$ If $\textrm{ord}_x(f) >0$, we say that $f$ has a zero of order $\textrm{ord}_x(f)$ at $x$. If $\textrm{ord}_x(f)<0$, we say that $f$ has a pole of order $-\textrm{ord}_x(f)$ at $x$. The statement I just gave is usually phrased as "the degree of a principal divisor is zero".
Here $\textrm{ord}_x$ is the discrete valuation on (the fraction field of) the local ring of $E$ at $x$. If you want to compute it for a rational function $f$ which is regular on an open affine $U$ containing $x$ you can choose an element $\pi \in \mathcal{O}(U)$ which generates the maximal ideal of $\mathcal{O}_{X,x}$ and write $f= u \pi^n$ on $U$ with $u$ a unit in the local ring. Then $\textrm{ord}_x(f) = n$. In general, to compute the order of $f$ at $x$ one writes $f$ as a quotient of two regular functions in an open affine neighborhood of $x$.


text:
Q: invalid scope using oauth2 and server side python I'm getting an error when redirecting to google during authentication
The web page has:
Some requested scopes were invalid. {invalid=[https://www.googleapis.com/drive/v2/files]}
Learn more
Request Details
scope=https://www.googleapis.com/drive/v2/files
On my Drive SDK console, have two scopes enabled:
[https://www.googleapis.com/auth/drive]
and
[https://www.googleapis.com/drive/v2/files]
here is the url in question (with stuff redacted):
https://accounts.google.com/ServiceLogin?service=lso&passive=1209600&continue=https://accounts.google.com/o/oauth2/auth?response_type%3Dcode%26scope%3Dhttps://www.googleapis.com/drive/v2/files%26access_type%3Doffline%26redirect_uri%3Dhttps://www.myweb.com:8181/oauth2callback%26client_id%1111111.apps.googleusercontent.com%26hl%3Den-US%26from_login%3D1%26as%3D4d3393dc2133b68e&ltmpl=popup&shdf=&scc=1

A: The scope is:
https://www.googleapis.com/auth/drive

The other is the URL that you can make API requests to, it is not a scope.


text:
Q: xpath: Finding an element in the context of the element before it and after it I am using xpaths to run automation developed in C# using VB. I am having trouble finding an element in the context of two different elements. I need to do this because the element shares the same name with other elements on the page but the elements following and preceding it are unique.
I have also upload a file to help you understand, I want to find date in the context of whats before it and after it.
http://www.filedropper.com/example
<html>
<head>
</head>
<body>
<div> this is a test
   <div> <h1> test1 </h1> </div>
   <div> <h1> date </h1> </div>
   <div> <h1> time1 </h1> </div>
   <div> <h1> test2 </h1> </div>
   <div> <h1> date </h1> </div>
   <div> <h1> time2 </h1> </div>
</div>
</body>
</html>

A: This should do it:
/html/body/div/div/h1[../following-sibling::*[1]/h1/text() = " time2 " and ../preceding-sibling::*[1]/h1/text() = " test2 "]

following-sibling::*[1] return the first following sibling. As the div and h1 elements are nested, you have to go up one level in the hierarchy first.


text:
Q: Internal Server Error on FindItems for Public Folders I've a simple VB.NET application to get all items on a Public Contact Folder. I know that this code works for many years. We upgraded on our OnPremise Exchange 2013 to CU23 for a few month and installed the Hafnium patches (BTW: Our server was not compromised and is not attached directly to the internet).
I think after this upgrade (But I'm not pretty sure) we have the problem that the request "FindItems" on a PublicFolder "Kontakte (Global)" returns an Internal Server Error. Here is the code:
Dim objExchangeService As New ExchangeService

objExchangeService.Credentials = objCredentials
objExchangeService.Url = New Uri(strExchangeUrl)

Dim objFolderView As New FolderView(intBatchSize, intFoldersOffset)
Dim objFolders As FindFoldersResults = objExchangeService.FindFolders(WellKnownFolderName.PublicFoldersRoot, objFolderView)
Dim objGlobalContacts As Folder = objFolders.FirstOrDefault(Function(objFolder) "Kontakte (Global)".Equals(objFolder.DisplayName, StringComparison.InvariantCulture))

Dim objView As New ItemView(Int32.MaxValue)
objExchangeService.FindItems(objGlobalContacts.Id, objView) ' Exception here -> Internal Server Error

We got this Exception:
Microsoft.Exchange.WebServices.Data.ServiceResponseException: Interner Serverfehler. Fehler bei diesem Vorgang.
   bei Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException)
   bei Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
   bei Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
   bei Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
   bei Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems[TItem](IEnumerable`1 parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode)
   bei Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(FolderId parentFolderId, ViewBase view)

Has anybody an idea whats wrong?

A: What if you try to just get the last item in the folder eg
Dim objView As New ItemView(1)
objExchangeService.FindItems(objGlobalContacts.Id, objView)

You shouldn't be doing
Dim objView As New ItemView(Int32.MaxValue)

as throttling will stop you getting more then 1000 items by default anyways so you should be paging but I would first test just trying to get 1 item. You could also do some testing using the EWSEditor https://github.com/dseph/EwsEditor/releases outside of what your code is doing which is even easier then changing your code.

A: I tried it with ItemView(1) and got the same error. I used the EWSEditor but I cannot see any option to get items from the public folders.
In the meanwhile I checked the error log of the EWS folder. I got the exception:
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.GlobalServiceUrls.GetInternalUrl[Service](String serverFqdn)
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.HttpProxyBackEndHelper.GetBackEndServiceUrlByServer[ServiceType](BackEndServer backEndServer)
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.BackEndLocator.CallWithExceptionHandling[T](Func`1 actualCall)
   bei Microsoft.Exchange.Services.Core.EwsClientHelper.DiscoverEwsUrl(IMailboxInfo mailbox)
   bei Microsoft.Exchange.Services.Core.RemotePublicFolderOperations.Execute[T](Boolean writeOperation  CallContext callContext  RemoteExecute`1 executeEWSOperation)
   bei Microsoft.Exchange.Services.Core.RemotePublicFolderOperations.GetFolderReplica(CallContext callContext  Byte[] folderIdBytes)
   bei Microsoft.Exchange.Services.Core.Types.IdConverter.ServerInfoFromIdHeaderInformation(CallContext callContext  IdHeaderInformation header  Boolean isHierarchyOperations)
   bei Microsoft.Exchange.Services.Core.Types.ServiceObjectId.InitServerInfo(Boolean isHierarchicalOperation)
   bei Microsoft.Exchange.Services.Core.Types.BaseRequest.EvaluateMailboxMetrics(List`1 ids  Boolean isHierarchicalOperation)
   bei Microsoft.Exchange.Services.Core.Types.BaseRequest.Submit[T](AsyncCallback hostCallback  Object hostState)
   bei AsyncInvokeBeginBeginFindItem(Object   Object[]   AsyncCallback   Object )
   bei System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeBegin(Object instance  Object[] inputs  AsyncCallback callback  Object state)
   bei System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
   bei System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet);
   FaultInnerException=Microsoft.Exchange.Services.Core.Types.InternalServerErrorException: Interner Serverfehler.
   Fehler bei diesem Vorgang. --->

Microsoft.Exchange.Data.ApplicationLogic.VDirConfigurationMissingException:
   Das virtuelle Clientzugriffsverzeichnis-Objekt mit InternalUrl gestempelt für den -Dienst konnte nicht gefunden werden. Letzter überprüfter Server: EXCHANGE. (MEANS: Could not locate Client Access Virtual Directory object with InternalUrl stamped for service)

   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.GlobalServiceUrls.DiscoverUrlsIfNeeded()
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.GlobalServiceUrls.GetInternalUrl[Service](String serverFqdn)
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.HttpProxyBackEndHelper.GetBackEndServiceUrlByServer[ServiceType](BackEndServer backEndServer)
   bei Microsoft.Exchange.Data.ApplicationLogic.Cafe.BackEndLocator.CallWithExceptionHandling[T](Func`1 actualCall)
   bei Microsoft.Exchange.Services.Core.EwsClientHelper.DiscoverEwsUrl(IMailboxInfo mailbox)
   bei Microsoft.Exchange.Services.Core.RemotePublicFolderOperations.Execute[T](Boolean writeOperation  CallContext callContext  RemoteExecute`1 executeEWSOperation)
   bei Microsoft.Exchange.Services.Core.RemotePublicFolderOperations.GetFolderReplica(CallContext callContext  Byte[] folderIdBytes)
   bei Microsoft.Exchange.Services.Core.Types.IdConverter.ServerInfoFromIdHeaderInformation(CallContext callContext  IdHeaderInformation header  Boolean isHierarchyOperations)
   bei Microsoft.Exchange.Services.Core.Types.ServiceObjectId.InitServerInfo(Boolean isHierarchicalOperation)
   bei Microsoft.Exchange.Services.Core.Types.BaseRequest.EvaluateMailboxMetrics(List`1 ids  Boolean isHierarchicalOperation)
   bei Microsoft.Exchange.Services.Core.Types.BaseRequest.Submit[T](AsyncCallback hostCallback  Object hostState)

I think there must be something wrong with the Internal URLs and I checked our URLs with:
   Get-ActiveSyncVirtualDirectory (No Internal URL set)
   Get-AutodiscoverVirtualDirectory (No Internal URL set)
   Get-EcpVirtualDirectory (Internal URL set)
   Get-MapiVirtualDirectory (Internal URL set)
   Get-OabVirtualDirectory (Internal URL set)
   Get-OwaVirtualDirectory (Internal URL set)
   Get-PowerShellVirtualDirectory (Internal URL set)
   Get-WebServicesVirtualDirectory (Internal URL set)

Maybe this error belongs to: https://learn.microsoft.com/de-de/troubleshoot/dynamics-365/sales/issue-when-adding-to-outlook-error-when-deploying-dynamics-365-app-for-outlook - Because I got the same error. I will check the URLs today or tomorrow evening.

A: I found the solution. In my case the InternalURL of the ActiveSyncVirtualDirectory was not preset. That means if I enter "Get-ActiveSyncVirtualDirectory" it returns nothing.
I found the solution here: https://serverfault.com/questions/916154/virtual-directory-activesync-exchange-2010-its-there-its-not-there
In my Active Directory there was no object "Microsoft-Server-ActiveSync (Default Web Site)" but in the IIS the website exists. I cannot create a new virtual directory because there exists an orphaned configration.
I did this to remove the orphaned IIS configuration (https://serverfault.com/questions/916154/virtual-directory-activesync-exchange-2010-its-there-its-not-there - Second answer):
OK I finally have this one resolved, I want to share the solution in case someone else runs into it. Everything that follows here requires full Admin rights.

Please run from powershell (on the exchange server)

$Site = [ADSI]"IIS://localhost/W3SVC/1/Root/Microsoft-Server-ActiveSync"

and then run

$site

Result:
distinguishedName:
Path: {C:\Program Files\Microsoft\Exchange Server\V14\Client Access\Sync}

Next run:

$Site = [ADSI]"IIS://localhost/W3SVC/1/Root"
$site.Delete("IIsWebVirtualDir","Microsoft-Server-ActiveSync")
$site.SetInfo()

This will remove the phantom virtual directory.

Now run:

iisreset

Now run:

New-activesyncvirtualdirectory -websitename "Default Web Site"

it should recreate the new virtual directory.

Run iisreset again, and edit the internal and external URL's

Then go get yourself a cold one.

After these steps I got no errors on the "Apps" Tab and my code works. I think during this problem occurs during the CU update.
Best regards
Rainer


text:
Q: How to force Vimeo player to play inline using UIWebView? I am using following code to display Vimeo player in UIWebView:
_webView.delegate = self;
_webView.allowsInlineMediaPlayback = YES;
[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://player.vimeo.com/video/12536488"]]];

Now when I'm clicking play button, native iPhone movie player appears.
How to enable inline playback?
What I already was trying to do is to get acces to video element after page is loaded to set webkit-playsinline attribute. I wrote:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [_webView stringByEvaluatingJavaScriptFromString:@"var video = document.getElementsByTagName('video')[0];"];
}

But video variable appears to be undefined.
Any ideas would be appreciated.

A: After all we decided to use paid account. Vimeo provides direct links for videos stored on "Pro" accounts.


text:
Q: Entity framework multiple DbContext in single execution I have one master & detail in my 'db1' and there is one column named 'EntryByUserId' in master table.
User table is available in 'db2'.
When all the tables are available in one single database we can directly get user detail by using include function. But here my reference table is in another database so in my case user object will return null value. So anyone please help me to achieve this.
I have created multiple dbcontext in my project but don't know how to get this.
Below is the code we use when all tables are available in single database.
dbcontext1.tbl_Master.Include(m => m.tbl_Detail).Include(m => m.tbl_user)
                    .AsNoTracking().FirstOrDefault();

A: One option to accommodate this cleanly, especially for something as frequently accessed as a "User" reference for something like reporting on CreatedBy or ModifiedBy tracking on rows would be to implement a view within Db2 that lists the users from Db1. Then in your main application context you can map a User entity to the view rather than a table.  I would put guards in your DbContext and entities to discourage/prevent modifications to this User entity, and leave maintenance of users to a DbContext overseeing the Db1 tables.
If this is something like a multi-tenant system with a system database for authentication and separate DBs per tenant which are tracking things like CreatedBy against records, I would recommend considering a system to inspect and replicate users between the auth database and the respective tenant databases. The reason for this would be to help enforce referential integrity for the data and the user references. The issue with the view approach is that there is no constraint available to ensure that a UserId reference actually corresponds with a row in the Users table over in the other database. It can be indexed, but not constrained so you have to handle the possibility of invalid data.


text:
Q: Navbar is not working when resizing the browser windows on one WordPress theme and after adding the JS code mobile menu close button is not working I am trying a WP theme but when I'm resizing the browser windows size then the mobile menu is not working but in the same small windows after refreshing the browser page the menu is working.
As I don't know much about coding so if anyone can have a look and help me :)
Here's the link of that demo theme: https://demo.wptravelengine.com/travel-booking/
Someone helped me with this code
jQuery(document).ready(function( $ ){
jQuery("#toggle-button").click(function() {
    jQuery(".site-header .right").css("right","0");
})
jQuery(".btn-close-menu").click(function() {
    jQuery(".site-header .right").css("right","-540px");
}) })

But when I am using this code, it is not showing the close icon button and search form holder when opening it after resizing the web browser screen.
see the pic here: https://drive.google.com/file/d/1Il3UT1Wehcg0nAyCfW2smVSbdpCwPS0b/view?usp=sharing
Apart from that, when I am opening the site in the normal mobile close icon is not working after opening the menu.

A: Looking at your compiled js code I see that its wrapped in a condition so that the click does not fire unless the screen is less than 1024px. This check only fires onload so that is why you have to refresh when resizing the browser window (you have to load the window smaller than 1024).  You need to add a function to check on resize as well:
window.addEventListener('resize', (event) => {
// run same 1024 check to allow click after resizing to avoid having to refresh
});


text:
Q: for loop inside if condition in php I need to run set of code inside for-loop  only if certain condition is satisfied like:
@for($i = 0; $i <= $date_diffrence; $i++)
   @if(condition)
      $temp = $i;
      @for($multDayCount=0; $multDayCount<count($dayDifferenceArr); $multDayCount++)
         $i = $dayDifferenceArr[$multDayCount];

   @endif

<code_section>

   @if(condition)
      @endfor
       $i = $temp;
   @endif
 @endfor

I want the  to run regardless of the if- for condition. How can I loop like this? Any help would be greatly appreciated.

A: Your question as stated is self–answering — if you need to have if inside of a loop you just... can. :)
Looking at your code (which is not quite PHP looking?..) you also seem to want to terminate the loop conditionally?
In PHP loops can be controlled with break and continue. You example looks like it's trying to break the loop conditionally.


text:
Q: Having issues with a recursive program in C++ I am following along with Stanford's CS106B course by myself. One of the assignments is asking for a recursive algorithm which will pull all brackets and braces out of a string that is provided to a function. I have attached below my code. I have managed to get the function to pull out all the brackets and braces. I have not managed to get it to return anything. It runs endlessly. I am wondering how to get it to stop without using a single loop or global variable. I've been trying this all day, seen many people's solutions for similar assignments, read the textbook, and have listened to the lectures many times yet I cannot get it to return anything.
Also: str.insert inserts a string into the position requested.
isalpha finds if the character in question is an alphabet in a string.
isdigit finds if the character in question is a digit in a string.
These are all functions provided in the Stanford libraries but I do not believe they are native to C++.
/*
 * TODO: remove and replace this file header comment
 * You will edit and turn in this file.
 * Remove starter comments and add your own
 * comments on each function and on complex code sections.
 */
#include <iostream>    // for cout, endl
#include <string>      // for string class
#include "recursion.h"
#include "testing/SimpleTest.h"

using namespace std;
//string strTemp;
/*
 * TODO: Replace this comment with a descriptive function
 * header comment.
 */
string operatorsFrom(string str) {
    string strTemp;//Not working because this is defined everytime
    /* TODO: Implement this function. */
   // str.insert(str.length(),"strTemp");
    if(!isalpha(str[0])&&!isdigit(str[0])){
        strTemp = str[0];
        str.insert(str.length(),strTemp);
        operatorsFrom(str.erase(0,1));
    }

    if(isalpha(str[0])||isdigit(str[0])){
        operatorsFrom(str.erase(0,1));
    }
    return str;
}

/*
 * TODO: Replace this comment with a descriptive function
 * header comment.
 */
bool operatorsAreMatched(string ops) {
    /* TODO: Implement this function. */
    return false;
}

/*
 * The isBalanced function assumes correct implementation of
 * the above two functions operatorsFrom and operatorsMatch.
 * It uses operatorsFrom to extract the operator characters
 * from the input string and then confirms that those
 * operators are balanced by using operatorsMatch.
 * You should not modify the provided code in the isBalanced
 * function.  If the previous two functions have been implemented
 * correctly, the provided isBalanced will correctly report whether
 * the input string has balanced bracketing operators.
 */
bool isBalanced(string str) {
    string ops = operatorsFrom(str);
    return operatorsAreMatched(ops);
}

/* * * * * * Test Cases * * * * * */

PROVIDED_TEST("operatorsFrom on simple example") {
    EXPECT_EQUAL(operatorsFrom("vec[3]"), "[]");
}

PROVIDED_TEST("operatorsAreMatched on simple example") {
    EXPECT(operatorsAreMatched("{}"));
}

PROVIDED_TEST("isBalanced on example from writeup") {
    string example ="int main() { int x = 2 * (vec[2] + 3); x = (1 + random()); }";
    EXPECT(isBalanced(example));
}

PROVIDED_TEST("isBalanced on non-balanced examples from writeup") {
    EXPECT(!isBalanced("( ( [ a ] )"));
    EXPECT(!isBalanced("3 ) ("));
    EXPECT(!isBalanced("{ ( x } y )"));
}

I have tried to get this function to return the parentheses, brackets, etc. It does manage to pull those out of text very well, but it gets stuck in the first if loop and does not return anything. So far I have tried to figure out some sort of counter, but that seems impossible without either a global variable or a loop of some sort, which are not allowed.
Edit: I have added the entire program. The function that is the issue is the string operatorsFrom function.


text:
Q: Python encoding wrong after ubuntu localisation After i changed ubuntu localisation from EN to RU i faced problem that cause python console (when i debuging Odoo) prints some strange codes insted of russian text like this:
\u0414\u0435\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a \u0438:
\u042d\u043b\u0435\u043c\u0435\u043d\u0442 '' \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0432\u0438\u0434\u0435
Instead of this:
Детали ошибки:
  Элемент '' не может находится в родительском виде
What i can do to avoid such problem ?

A: Prepared by @APIuz team
#For python3

import json
import io
text = '\u0414\u0435\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438: \u042d\u043b\u0435\u043c\u0435\u043d\u0442 '' \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0432\u0438\u0434\u0435'

io.open("APIuz.txt", "w", encoding="utf-8").write(json.dumps(text, ensure_ascii=False))
print(open("APIuz.txt", "r").read())

#For python2

print(repr(u'\u0414\u0435\u0442\u0430\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438: \u042d\u043b\u0435\u043c\u0435\u043d\u0442 '' \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0432\u0438\u0434\u0435').decode('unicode-escape'))

#The code is just what you think

#>>> "Детали ошибки: Элемент  не может находится в родительском виде"


text:
Q: Which weapons count for "5 kills with stationary weapons" pin? I've have had something like 12 kills in a round with VADS, still didn't get the pin. So which weapons do count for this pin?

A: From the EA website, the following weapons are categorized as Stationary:

*

*Heavy MG X312

*Heavy MG Kord

*Stationary AT Korn

*Anti-Ait Gun ZU23

As they are not really up to date on their websites as always, expansions may add other weapons to the list.

A: I gained this pin achievement and other pin related achievements by using the mounted MGs -- particularly, especially the shielded MG next to objective B in Nelson Bay.
It great to  cover all enemy's approaches, resulting in a high numbers of kills.