text:
Q: Unable to connect to SQL server after update I updated my server today with all pending update and after reboot I was unable to connect to SQL server. Prior to reboot I've also enabled the firewall but now it's disabled again and server is after another reboot. When I try to connect locally using
sqlcmd -S localhost

I get error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2749.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Server itself is up and running:
hyperqbe@slaro:/etc$ sudo systemctl status mssql-server
[sudo] hasło użytkownika hyperqbe:
● mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-08-08 15:06:28 CEST; 19min ago
     Docs: https://docs.microsoft.com/en-us/sql/linux
 Main PID: 7259 (sqlservr)
    Tasks: 158
   CGroup: /system.slice/mssql-server.service
           ├─7259 /opt/mssql/bin/sqlservr
           └─7288 /opt/mssql/bin/sqlservr

sie 08 15:06:38 slaro sqlservr[7259]: [95B blob data]
sie 08 15:06:38 slaro sqlservr[7259]: [91B blob data]
sie 08 15:06:38 slaro sqlservr[7259]: [145B blob data]
sie 08 15:06:38 slaro sqlservr[7259]: [61B blob data]
sie 08 15:06:39 slaro sqlservr[7259]: [96B blob data]
sie 08 15:06:39 slaro sqlservr[7259]: [66B blob data]
sie 08 15:06:40 slaro sqlservr[7259]: [96B blob data]
sie 08 15:06:40 slaro sqlservr[7259]: [100B blob data]
sie 08 15:06:40 slaro sqlservr[7259]: [71B blob data]
sie 08 15:06:40 slaro sqlservr[7259]: [124B blob data]

I'm unable to connect remotely from other machine as well:
TITLE: Connect to Server
------------------------------
Cannot connect to 192.168.1.141.
------------------------------
ADDITIONAL INFORMATION:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - Istniejące połączenie zostało gwałtownie zamknięte przez zdalnego hosta.) (Microsoft SQL Server, Error: 10054)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10054&LinkId=20476

As far as I know there were no errors during update process.
Here are the last entries from errorlog:
2019-08-08 15:06:34.89 Server      Microsoft SQL Server 2019 (CTP3.2) - 15.0.1800.32 (X64)
        Jul 17 2019 21:29:33
        Copyright (C) 2019 Microsoft Corporation
        Express Edition (64-bit) on Linux (Ubuntu 18.04.3 LTS) <X64>
2019-08-08 15:06:34.89 Server      UTC adjustment: 2:00
2019-08-08 15:06:34.89 Server      (c) Microsoft Corporation.
2019-08-08 15:06:34.89 Server      All rights reserved.
2019-08-08 15:06:34.89 Server      Server process ID is 32.
2019-08-08 15:06:34.89 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2019-08-08 15:06:34.89 Server      Registry startup parameters:
         -d /var/opt/mssql/data/master.mdf
         -l /var/opt/mssql/data/mastlog.ldf
         -e /var/opt/mssql/log/errorlog
2019-08-08 15:06:34.90 Server      SQL Server detected 1 sockets with 4 cores per socket and 4 logical processors per socket, 4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2019-08-08 15:06:34.90 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2019-08-08 15:06:34.90 Server      Detected 12800 MB of RAM. This is an informational message; no user action is required.
2019-08-08 15:06:34.90 Server      Using conventional memory in the memory manager.
2019-08-08 15:06:34.90 Server      Page exclusion bitmap is enabled.
2019-08-08 15:06:35.01 Server      Buffer pool extension is not supported on Linux platform.
2019-08-08 15:06:35.02 Server      Buffer Pool: Allocating 2097152 bytes for 1963331 hashPages.
2019-08-08 15:06:35.16 Server      Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
2019-08-08 15:06:35.69 Server      Buffer pool extension is already disabled. No action is necessary.
2019-08-08 15:06:35.99 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2019-08-08 15:06:36.01 Server      Query Store settings initialized with enabled = 1,
2019-08-08 15:06:36.07 Server      The maximum number of dedicated administrator connections for this instance is '1'
2019-08-08 15:06:36.07 Server      Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2019-08-08 15:06:36.11 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2019-08-08 15:06:36.17 Server      In-Memory OLTP initialized on lowend machine.
2019-08-08 15:06:36.37 Server      CLR version v4.0.30319 loaded.
2019-08-08 15:06:36.57 Server      [INFO] Created Extended Events session 'hkenginexesession'

2019-08-08 15:06:36.58 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2019-08-08 15:06:36.59 Server      Total Log Writer threads: 2. This is an informational message; no user action is required.
2019-08-08 15:06:36.72 Server      clflushopt is selected for pmem flush operation.
2019-08-08 15:06:36.72 Server      Software Usage Metrics is disabled.
2019-08-08 15:06:36.97 spid11s     [1]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:06:36.98 spid11s     Starting up database 'master'.
2019-08-08 15:06:37.58 Server      Common language runtime (CLR) functionality initialized.
2019-08-08 15:06:37.77 spid11s     SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2019-08-08 15:06:37.78 spid11s     SQL Server Audit has started the audits. This is an informational message. No user action is required.
2019-08-08 15:06:38.05 Server      Failed to verify the Authenticode signature of 'C:\binn\secforwarder.dll'. Signature verification of SQL Server DLLs will be skipped. Genuine copies of SQL Server are signed. Failure to verify the Authenticode signature might indicate that this is not an authentic release of SQL Server. Install a genuine copy of SQL Server or contact customer support.
2019-08-08 15:06:38.11 spid11s     SQL Trace ID 1 was started by login "sa".
2019-08-08 15:06:38.27 spid11s     Server name is 'slaro'. This is an informational message only. No user action is required.
2019-08-08 15:06:38.29 spid29s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2019-08-08 15:06:38.29 spid29s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2019-08-08 15:06:38.30 spid11s     [4]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:06:38.30 spid11s     Starting up database 'msdb'.
2019-08-08 15:06:38.32 spid12s     [32767]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:06:38.32 spid12s     Starting up database 'mssqlsystemresource'.
2019-08-08 15:06:38.33 spid12s     The resource database build version is 15.00.1800. This is an informational message only. No user action is required.
2019-08-08 15:06:38.36 spid12s     [3]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:06:38.36 spid12s     Starting up database 'model'.
2019-08-08 15:06:38.40 Server      Failed to verify the Authenticode signature of 'C:\binn\msoledbsql.dll'. Signature verification of SQL Server DLLs will be skipped. Genuine copies of SQL Server are signed. Failure to verify the Authenticode signature might indicate that this is not an authentic release of SQL Server. Install a genuine copy of SQL Server or contact customer support.
2019-08-08 15:06:38.48 spid28s     A self-generated certificate was successfully loaded for encryption.
2019-08-08 15:06:38.51 Server      Error: 37308, Severity: 16, State: 1.
2019-08-08 15:06:38.51 Server      Loaded None enclave for always encrypted.
2019-08-08 15:06:38.51 spid28s     Server is listening on [ 192.168.1.141 <ipv4> 1433].
2019-08-08 15:06:38.54 spid28s     Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated administrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.
2019-08-08 15:06:38.54 spid28s     Error: 39002, Severity: 16, State: 1.
2019-08-08 15:06:38.54 spid28s     SQL failed to boot extensibility for error code 0x80070005.
2019-08-08 15:06:38.55 spid28s     InitializeXdbPkgLauncher failed. ErrorCode: 0x80004005.
2019-08-08 15:06:38.55 spid28s     SQL Server is now ready for client connections. This is an informational message; no user action is required.
2019-08-08 15:06:38.85 spid12s     Clearing tempdb database.
2019-08-08 15:06:39.88 spid12s     [2]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:06:39.89 spid12s     Starting up database 'tempdb'.
2019-08-08 15:06:40.26 spid29s     The Service Broker endpoint is in disabled or stopped state.
2019-08-08 15:06:40.26 spid29s     The Database Mirroring endpoint is in disabled or stopped state.
2019-08-08 15:06:40.27 spid29s     Service Broker manager has started.
2019-08-08 15:06:40.27 spid11s     Recovery is complete. This is an informational message only. No user action is required.
2019-08-08 15:27:16.30 spid55      [5]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.
2019-08-08 15:27:16.30 spid55      Starting up database 'ProgramMagazynowy'.
2019-08-08 15:27:16.53 spid55      Parallel redo is started for database 'ProgramMagazynowy' with worker pool size [2].
2019-08-08 15:27:16.73 spid55      Parallel redo is shutdown for database 'ProgramMagazynowy' with worker pool size [2].

It may have something to do with ODBC driver. I was able to enable logging and found this:
[ODBC][29210][1565333226.007247][SQLDriverConnectW.c][290]
                Entry:
                        Connection = 0x8c90e0
                        Window Hdl = (nil)
                        Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER={192.168.1.141};Trusted_Connection={YES};WSID={slaro};APP={SQLCMD};][length = 113 (SQL_NTS)]
                        Str Out = (nil)
                        Str Out Max = 0
                        Str Out Ptr = (nil)
                        Completion = 0
                UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UTF-16LE'

According to Documentation

If the ASCII character encoding is not UTF-8, there is more than one
  Driver Manager installed and your application is using the wrong one,
  or the Driver Manager was not built correctly.

In my case it's 'ANSI_X3.4-1968' so there has to be something wrong. I will further review the articles suggested in documentation but right now I don't know how to confirm that I indeed have two drivers installed and how to remove one.
EDIT:
odbcinst lists only one driver:
hyperqbe@slaro:/etc$ odbcinst -q -d
[ODBC Driver 17 for SQL Server]

This part seems to be fine. I'm not sure if I have my odbc.ini and odbcinst.ini defined correctly.
hyperqbe@slaro:/etc$ cat odbc.ini
[slaro]
Driver='ODBC Driver 17 for SQL Server'
Servername=192.168.1.141

hyperqbe@slaro:/etc$ cat odbcinst.ini
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.4.so.1.1
UsageCount=1
Trace=Yes
TraceFile=/home/hyperqbe/odbc.log

=======================================
EDIT ((ufw details per request)):
hyperqbe@slaro:~$ sudo ufw status
[sudo] hasło użytkownika hyperqbe:
Stan: aktywny

Do                         Działanie   Z
--                         ---------   -
27                         ALLOW       Anywhere
1433                       ALLOW       Anywhere
1434                       ALLOW       Anywhere
8686                       ALLOW       Anywhere
27 (v6)                    ALLOW       Anywhere (v6)
1433 (v6)                  ALLOW       Anywhere (v6)
1434 (v6)                  ALLOW       Anywhere (v6)
8686 (v6)                  ALLOW       Anywhere (v6)

22/tcp                     REJECT OUT  Anywhere
22/tcp (v6)                REJECT OUT  Anywhere (v6)

hyperqbe@slaro:~$ sudo iptables --list
Chain INPUT (policy DROP)
target     prot opt source               destination
ufw-before-logging-input  all  --  anywhere             anywhere
ufw-before-input  all  --  anywhere             anywhere
ufw-after-input  all  --  anywhere             anywhere
ufw-after-logging-input  all  --  anywhere             anywhere
ufw-reject-input  all  --  anywhere             anywhere
ufw-track-input  all  --  anywhere             anywhere

Chain FORWARD (policy DROP)
target     prot opt source               destination
ufw-before-logging-forward  all  --  anywhere             anywhere
ufw-before-forward  all  --  anywhere             anywhere
ufw-after-forward  all  --  anywhere             anywhere
ufw-after-logging-forward  all  --  anywhere             anywhere
ufw-reject-forward  all  --  anywhere             anywhere
ufw-track-forward  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ufw-before-logging-output  all  --  anywhere             anywhere
ufw-before-output  all  --  anywhere             anywhere
ufw-after-output  all  --  anywhere             anywhere
ufw-after-logging-output  all  --  anywhere             anywhere
ufw-reject-output  all  --  anywhere             anywhere
ufw-track-output  all  --  anywhere             anywhere

Chain ufw-after-forward (1 references)
target     prot opt source               destination

Chain ufw-after-input (1 references)
target     prot opt source               destination
ufw-skip-to-policy-input  udp  --  anywhere             anywhere             udp dpt:netbios-ns
ufw-skip-to-policy-input  udp  --  anywhere             anywhere             udp dpt:netbios-dgm
ufw-skip-to-policy-input  tcp  --  anywhere             anywhere             tcp dpt:netbios-ssn
ufw-skip-to-policy-input  tcp  --  anywhere             anywhere             tcp dpt:microsoft-ds
ufw-skip-to-policy-input  udp  --  anywhere             anywhere             udp dpt:bootps
ufw-skip-to-policy-input  udp  --  anywhere             anywhere             udp dpt:bootpc
ufw-skip-to-policy-input  all  --  anywhere             anywhere             ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

Chain ufw-after-logging-input (1 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

Chain ufw-after-logging-output (1 references)
target     prot opt source               destination

Chain ufw-after-output (1 references)
target     prot opt source               destination

Chain ufw-before-forward (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere             icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere             icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere             icmp parameter-problem
ACCEPT     icmp --  anywhere             anywhere             icmp echo-request
ufw-user-forward  all  --  anywhere             anywhere

Chain ufw-before-input (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ufw-logging-deny  all  --  anywhere             anywhere             ctstate INVALID
DROP       all  --  anywhere             anywhere             ctstate INVALID
ACCEPT     icmp --  anywhere             anywhere             icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere             icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere             icmp parameter-problem
ACCEPT     icmp --  anywhere             anywhere             icmp echo-request
ACCEPT     udp  --  anywhere             anywhere             udp spt:bootps dpt:bootpc
ufw-not-local  all  --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251          udp dpt:mdns
ACCEPT     udp  --  anywhere             239.255.255.250      udp dpt:1900
ufw-user-input  all  --  anywhere             anywhere

Chain ufw-before-logging-forward (1 references)
target     prot opt source               destination

Chain ufw-before-logging-input (1 references)
target     prot opt source               destination

Chain ufw-before-logging-output (1 references)
target     prot opt source               destination

Chain ufw-before-output (1 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ufw-user-output  all  --  anywhere             anywhere

Chain ufw-logging-allow (0 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 10 LOG level warning prefix "[UFW ALLOW] "

Chain ufw-logging-deny (2 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere             ctstate INVALID limit: avg 3/min burst 10
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

Chain ufw-not-local (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere             ADDRTYPE match dst-type LOCAL
RETURN     all  --  anywhere             anywhere             ADDRTYPE match dst-type MULTICAST
RETURN     all  --  anywhere             anywhere             ADDRTYPE match dst-type BROADCAST
ufw-logging-deny  all  --  anywhere             anywhere             limit: avg 3/min burst 10
DROP       all  --  anywhere             anywhere

Chain ufw-reject-forward (1 references)
target     prot opt source               destination

Chain ufw-reject-input (1 references)
target     prot opt source               destination

Chain ufw-reject-output (1 references)
target     prot opt source               destination

Chain ufw-skip-to-policy-forward (0 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere

Chain ufw-skip-to-policy-input (7 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere

Chain ufw-skip-to-policy-output (0 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain ufw-track-forward (1 references)
target     prot opt source               destination

Chain ufw-track-input (1 references)
target     prot opt source               destination

Chain ufw-track-output (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             ctstate NEW
ACCEPT     udp  --  anywhere             anywhere             ctstate NEW

Chain ufw-user-forward (1 references)
target     prot opt source               destination

Chain ufw-user-input (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:27
ACCEPT     udp  --  anywhere             anywhere             udp dpt:27
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ms-sql-s
ACCEPT     udp  --  anywhere             anywhere             udp dpt:ms-sql-s
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ms-sql-m
ACCEPT     udp  --  anywhere             anywhere             udp dpt:ms-sql-m
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8686
ACCEPT     udp  --  anywhere             anywhere             udp dpt:8686

Chain ufw-user-limit (0 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             limit: avg 3/min burst 5 LOG level warning prefix "[UFW LIMIT BLOCK] "
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain ufw-user-limit-accept (0 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain ufw-user-logging-forward (0 references)
target     prot opt source               destination

Chain ufw-user-logging-input (0 references)
target     prot opt source               destination

Chain ufw-user-logging-output (0 references)
target     prot opt source               destination

Chain ufw-user-output (1 references)
target     prot opt source               destination
REJECT     tcp  --  anywhere             anywhere             tcp dpt:ssh reject-with tcp-reset

I've found post suggesting that problem might be caused by python.

A: Please check this link, this worked for me. It seems to be a problem with openssl version, something that was fixed by microsoft on CU10 for MSSQL and gives back with CU16.

A: I also could not connect to my SQL server anymore suddenly. It was because of missing space. So I made space free and restartet the apache2 service (or restart the whole server if it does not work).


Target areas: Digital Drilling, Improved Oil Recovery and Plug & Abandonment.
IRIS Energy contributes to efficient and safe energy production. Our core activities are within petroleum research but we also apply our competence within renewable energy and CCS research.
IRIS Energy focuses on research and development of new technologies related to safe and environmentally sound exploration and exploitation of oil and gas, sustainable energy, and storage of carbon dioxide. Additional research areas include smart energy systems, natural gas based power generation, energy systems based on new fuels and geothermal energy.
IRIS Energy, along with its national and international research partners, is heavily engaged in long-term applied and theoretical R&D programs sponsored by the Research Council of Norway, the petroleum industry and the European Commission. Many of these R&D programs are open and can welcome new industrial participants and sponsors.


text:
Q: Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': The callback provided as parameter 2 is not an object On the "Go Make Great Things" blog by ChrisFerdinandi there is a great post about creating a "Vanilla JS" version of the .on() method from the jQuery library.
var on = function (event, elem, callback, capture) {
    if (typeof (elem) === 'function') {
        capture = callback;
        callback = elem;
        elem = window;
    }
    capture = capture ? true : false;
    elem = typeof elem === 'string' ? document.querySelector(elem) : elem;
    if (!elem) return;
    elem.addEventListener(event, callback, capture);
};

Am I wrong that a ternary or some conditional is needed because addEventListener takes a string to set the bubbling or capturing?
capture = capture ? true : false;
capture = capture  === true ? 'true' : 'false';

So I am trying to utilize the code above to create a rollover but I'm getting,
Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': The callback provided as parameter 2 is not an object.

Here is the markup:

Here is the script:
var on = function(event, elem, callback, capture) {
  if (typeof elem === 'function') {
    capture  = callback;
    callback = elem;
    elem     = window;
  }
    console.log(capture)

  capture = capture ? true : false;
  capture = capture  === true ? 'true' : 'false';

  console.log(capture)

  elem = typeof elem === 'string' ? document.querySelector(elem) : elem;
  if (!elem) return;
  elem.addEventListener(event, callback, capture);
};

function rollOver(elem){
  if (document.querySelector(elem).getAttribute('src', 'https://staging.elizabetharden.pfsweb.demandware.net/on/demandware.static/-/Sites-JuicyCoutureBeauty-Library/default/dw685f8968/images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1.jpg?$staticlink')) {
  return document.querySelector(elem).getAttribute('src', 'https://staging.elizabetharden.pfsweb.demandware.net/on/demandware.static/-/Sites-JuicyCoutureBeauty-Library/default/dw685f8968/images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1.jpg?$staticlink')
  }
   return document.querySelector(elem).getAttribute('src', 'https://staging.elizabetharden.pfsweb.demandware.net/on/demandware.static/-/Sites-JuicyCoutureBeauty-Library/default/dw685f8968/images/home-page/desktop/EYES_ON_YOU_desktop_HP_NO_HOVER_1.jpg?$staticlink');
}

on('mouseover', '.color-palette', rollOver('.color-palette'));

redpajama_set_name: RedPajamaStackExchange


After three weeks traveling through Arizona, New Mexico, Colorado and Utah, I am safely home again at Casa Carrie in Simi Valley, California. Over the years, I have learned that any visit to the Four Corners States will be an adventure. This extended visit to the High Southwest was no exception.
After one night at the Mojave National Preserve, I drove into Needles, California for some service on my trailer. To many travelers, a stop for repairs in Needles is a recipe for disaster. For me, it is always a pleasure. Although my first visit to the Desert View Mobil Station in Needles was of necessity, not choice, over the ensuing years I have stopped there often. After my first visit, I realized that it was not just a gas station in the desert. Instead, I found that their prices for tires and repairs were fair and that their service was exemplary. Since then, I always try to stop there for trailer tires, fuel or repairs.
In 2008, when I purchased four tires and replaced the suspension links on my Pioneer trailer, Desert View Mobil offered me a lifetime warranty on their work. In February 2009, when I last required brake service on my travel trailer, regular gasoline was $2.89 per gallon. In May 2011, when I pulled in, regular gasoline was $4.89 per gallon. With failing brakes on my coach, I hoped that their warranty was still in effect. As I pulled in, Ricky the mechanic came out to the service island and surveyed my rig. Although we both looked a couple of years older, we recognized each other immediately. After describing my problem, he invited me to pull around the station for a 'look see'.
Two hours later, I was on the road again, confident that my rig was up to the task of a two thousand mile trip. During my brief stay, Ricky diagnosed and fixed my brake system, while others in the crew balanced my wheels and replaced one valve stem. Then, Ricky lubricated all of the fittings on the suspension links he had installed three years prior. Upon completion, I expected to pay for the wheel balancing, the valve stem and the lubrication. After completing his work, Ricky washed up, came out front and surprised me by saying, "No Charge". And that is why Desert View Mobil, in Needles, California continues to earn my business.


text:
KYTHERA(R) Biopharmaceuticals Submits Marketing Authorization Application in the European Union for ATX-101 as First-in-Class Treatment for the Reduction of Submental Fat
Submission Supported by Four Pivotal Phase III Trials Conducted in Europe and North America With More Than 1,500 Patients
WESTLAKE VILLAGE, Calif., Aug. 18, 2015 (GLOBE NEWSWIRE) -- KYTHERA Biopharmaceuticals, Inc. (NASDAQ:KYTH) announced today it has submitted a Marketing Authorization Application (MAA) in the European Union (EU), seeking approval for ATX-101 (deoxycholic acid) injection as a treatment for the reduction of submental fat when the presence of submental fat has a psychological impact for the patient. The MAA was submitted via the Decentralized Procedure with Sweden as the Reference Member State and is supported by results from four pivotal Phase III trials conducted in Europe and North America. More than 1,500 patients participated in these trials with 757 patients treated with ATX-101.
Submental fullness, also referred to as double chin, is a common yet under-treated condition that can detract from an otherwise balanced and harmonious facial appearance[i] – leading to an older and heavier look.[ii]
"The submission in the European Union reflects our commitment to make ATX-101 broadly available and marks a key milestone for the global development program," said Keith Leonard, President and Chief Executive Officer of KYTHERA. "Submental fullness, which can occur regardless of a person's weight, is a condition that can impact both appearance and emotional well-being. We look forward to the review of our application and to the potential approval of ATX-101 in Europe as a non-surgical treatment for women and men seeking an improved chin profile."
ATX-101 is supported by a global clinical development program that includes over 20 clinical studies with more than 2,600 patients worldwide, of which over 1,600 have been treated with ATX-101.[iii] In the pivotal Phase III trials conducted in Europe, more ATX-101-treated patients (63.8 percent) showed at least a 1-grade improvement on the clinician's submental fullness rating scale than did placebo-treated patients (28.6 percent). Additionally, more ATX-101-treated patients reported satisfaction with outcome (65.4 percent) and a greater reduction in the psychological impact of submental fullness (44.7 percent) than did placebo-treated patients (29 percent and 14.1 percent, respectively).iii In the pivotal Phase III trials conducted in North America, 68.2 percent of patients responded to ATX-101 based on a composite of validated physician and patient measurements compared to 20.5 percent in the placebo group.[iv] Patients also reported improvement in the psychological impact of submental fat when asked how happy, bothered, self-conscious, embarrassed, old and overweight they felt following treatment in relation to the amount of their submental fat.
ATX-101 is administered by injections into the fat under the chin, customized to the overall treatment goals of the patient and the physician. Patients are assessed before each treatment session; this includes ensuring there is sufficient submental fat. Many patients experienced results in two to four treatments.[v] Up to six treatments may be administered. Once the desired response is achieved, retreatment is not expected.
In the clinical trials, the most frequently reported side effects of ATX-101 included injection site pain, oedema, swelling, anaesthesia, nodule, bruising, paraesthesia, induration, erythema, haemorrhage, discomfort, warmth, discolouration, nerve injury and pruritus.
About Submental Fullness
Submental fullness, also referred to as double chin, is a common yet under-treated condition that can detract from an otherwise balanced and harmonious facial appearance[vi]. Submental fullness can affect adults – both women and men – of all ages, weight and gender. Influenced by multiple factors including aging and genetics, submental fullness is often resistant to diet and exercise.
About ATX-101
ATX-101 was approved by the U.S. Food and Drug Administration in April 2015 (under the name KYBELLA™), and received authorization from Health Canada in July 2015 (under the name BELKYRA™). In addition to the regulatory filing for ATX-101 in the European Union, KYTHERA has submitted regulatory filings in Switzerland and Australia. Find more information at www.kythera.com.
ATX-101 (deoxycholic acid) injection – where approved – is used in adults to improve the appearance and profile of moderate to severe amounts of fat under the chin, ATX-101 is a non-human and non-animal formulation of deoxycholic acid, a naturally-occurring molecule in the body that aids in the breakdown and absorption of dietary fat.[vii] When injected into subcutaneous fat, ATX-101 causes the destruction of fat cells. Once destroyed, those cells cannot store or accumulate fat.[viii]
The safe and effective use of ATX-101 for the treatment of subcutaneous fat outside the submental region or for patients with mild or extreme submental fat has not been established and is not recommended.
About KYTHERA®
KYTHERA Biopharmaceuticals, Inc. is a biopharmaceutical company focused on the discovery, development and commercialization of novel prescription products for the aesthetic medicine market. KYTHERA's longer-term strategy is to leverage its biotechnology and aesthetics experience to expand its product portfolio and pipeline.
To the extent that statements contained in this press release are not descriptions of historical facts regarding KYTHERA, they are forward-looking statements reflecting the current beliefs and expectations of management made pursuant to the safe harbor provisions of the Private Securities Litigation Reform Act of 1995 including potential approval of ATX-101 in Europe as a non-surgical treatment, the potential of ATX-101 as a treatment for the reduction of submental fat when the presence of submental fat has a psychological impact for the patient; and the ability of ATX-101 to be a less-invasive, non-surgical option for the treatment of submental fullness, and to shape the chin profile, expectations regarding the lack of a need for retreatement once the desired response with ATX-101 is achieved, and expectations regarding our longer-term strategy. Such forward-looking statements involve substantial risks and uncertainties that could cause our clinical development programs, future results, performance or achievements to differ significantly from those expressed or implied by the forward-looking statements. Such risks and uncertainties include, among others, the uncertainties inherent in the clinical drug development process, including the regulatory approval process, our substantial dependence on ATX-101, and other matters that could affect the availability or commercial potential of our drug candidate. KYTHERA undertakes no obligation to update or revise any forward-looking statements. For a further description of the risks and uncertainties that could cause actual results to differ from those expressed in these forward-looking statements, as well as risks relating to the business of KYTHERA in general, see KYTHERA's reports filed with the Securities and Exchange Commission, including its Annual Report on Form 10-K for the year ended December 31, 2014 and its Quarterly Report on Form 10-Q for the quarter ended June 30, 2015.
[i] Swift A, Remington K. BeautiPHication: a global approach to facial beauty. Clin Plast Surg. 2011; 38:347-77.
[ii] Dayan S. Neck rejuvenation. In: Hirsch, Aesthetic Rejuvenation: A Regional Approach. 1st ed. New York, NY: McGraw Hill Professional Publishing; 2008: 123-147.
[iii] ATX-101 Data on file.
[iv] Dayan SH, Jones DH, Carruthers J, et al. A Pooled Analysis of the Safety and Efficacy Results of the Multicenter, Double-Blind, Randomized, Placebo-Controlled Phase 3 REFINE-1 and REFINE-2 Trials of ATX-101, a Submental Contouring Injectable Drug for the Reduction of Submental Fat. Plastic and Reconstructive Surgery. 2014;134(4S-1):123.
[v] KYBELLA Prescribing Information April 2015.
[vi] Swift A, Remington K. BeautiPHication: a global approach to facial beauty. Clin Plast Surg. 2011; 38:347-77.
[vii] Stryer L, ed. Biochemistry. 4th Edition. New York, NY: WH Freeman and Co.; 1995: 691-707.
[viii] FDA Approved Package Insert April 2015.
Ashley Cadle
Jonathan Falcone
Heather Rowe
Tel: +1 (818) 587- 4559

redpajama_set_name: RedPajamaCommonCrawl


text:
All Topics Arts, Culture and Entertainment (41) Books and Publishing (77) Business (76) Children (3) Crime and Violence (42) Current Events (19) Education (133) Environment (2) Ethics (27) Foreign Affairs (65) Free Speech (41) Gender and Feminism (30) Government (139) Health (63) History (244) Human and Civil Rights (48) Law (93) Media and the Press (211) Medicine and Health (158) Philanthropy (22) Politics and Public Affairs (249) Religion (29) Science and Technology (25) Sociology (31)
SELECT DATE RANGE
January February March April May June July August September October November December 12345678910111213141516171819202122232425262728293031	 1954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014	 January February March April May June July August September October November December 12345678910111213141516171819202122232425262728293031	 1954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014
Browse by History
FDR and the Jews
VTR Date: September 7, 2013
Oliver Stone, Peter Kuznick
History as "An act of faith" or as "Bunk," Part I
VTR Date: August 17, 2013
Tom Wicker
In Memoriam: Tom Wicker, 1926 – 2011
VTR Date: April 27, 2013
Baseball as a Road to God
VTR Date: March 23, 2013
Robert Caro's "The Years of Lyndon Johnson – The Passage of Power" (Part III)
VTR Date: February 23, 2013
Robert Caro's "The Years of Lyndon Johnson – The Passage of Power" (Part II)
Robert A. Caro
Robert Caro's "The Years of Lyndon Johnson – The Passage of Power" (Part I)
VTR Date: February 9, 2013
Harold Holzer
The Great Emancipator
Kim Phillips-Fein
The Businessmen's Crusade Against The New Deal
William vanden Heuvel
Franklin D. Roosevelt and his Four Freedoms
VTR Date: November 19, 2011
Julie Salamon
Julie Salamon and the Uncommon Life of Wendy Wasserstein
VTR Date: September 24, 2011
Farewell to Gutenberg?
VTR Date: May 7, 2011
David Callahan
The Rise of the Liberal Rich and the Remaking of America
VTR Date: April 9, 2011
Medicalizing Poor Political Leadership, Part II
Eric Foner
The Historian as Public Intellectual
VTR Date: January 29, 2010
HERO – Lawrence of Arabia, Part I
Jeff Shesol
Nine Old (and Young) Men (and Women), Part II
VTR Date: December 3, 2010
Kenneth B. Clark
Kenneth Clark and Brown v. Board of Education
VTR Date: October 29, 1982
Mario Cuomo … On Values and Politics
Roger Mandle
Americans and the Arts
FTED: Editors' Roundtable
Needed – A New Social Contract
VTR Date: June 3, 2005
Mark Zauderer
The Legal Brain-Scape: Neuroscience and the Law
Privacy Policy | Pledge | Feedback
Produced by ©2020 WNET, All Rights Reserved.


text:
Блупер (шутер, бигбой, подветренный спинакер) () — дополнительный передний парус, устанавливаемый на крейсерно-гоночных яхтах. Отличается высоко расположенным шкотовым углом. «Пузатый» стаксель со свободной (без карабинов) шкаториной. Галсовый угол крепят за ту же оковку, что и стаксель. Поднимают на втором спинакер-фале.

Ставят вместе со спинакером (с подветренной стороны от него), для уравновешивания тяги спинакера и для увеличения скорости, на курсах бакштаг. Встречается другое его название — «подветренный спинакер».

См. также

 Геннакер

Примечания

Литература

Ссылки
 Спинакер и блупер, картинки на Яндексе

Косой парус
Морские термины

redpajama_set_name: RedPajamaWikipedia


An Access Token controls Participant identity and Room permissions in your Programmable Video application. Read below to learn more.
A Twilio Account SID, which is the public identifier of the Twilio account associated with the Access Token.
An API Key SID, which is the public identifier of the key used to sign the token.
An Identity grant, which sets the Twilio user identifier for the client holding the token.
The API Key Secret associated with the API Key SID is used to sign the Access Token and verify that it is associated with your Twilio account.
A mandatory Video grant, which indicates the holder of the Access Token can access Programmable Video services.
Optionally, a Room grant (contained within the Video grant) for a specific Room name, which indicates the holder of the Access Token may only connect to the indicated Room.
Access Tokens are based on the JSON Web Token standard (RFC 7519).
When an Access Token contains a grant for a specific Room, Twilio will only permit the client holding that Access Token to connect to the Room with the specified UniqueName.
For example, if the Access Token contains a Room grant for DailyStandup, the client holding this Access Token will only be allowed to connect to the Room with the UniqueName property DailyStandup.
See below for working examples.
Note: If the Room Grant is scoped to a Room that has been created using the REST API with the EnableTurn property set to true, then media may be relayed over TURN servers, if required.
You can generate an Access Token in any of the following ways.
Use the Testing Tools page in the Twilio Console to generate an Access Token. This is useful when prototyping a new application or learning how Access Tokens work.
Visit the Testing Tools page in the Twilio Console.
Enter a value for the token's Identity field.
Optionally enter a Room name, which will limit the holder of this token's access to the specified Room.
Copy and paste the generated token into your application.
These sample applications demonstrate the generation of Access Tokens in different programming languages.


text:
using System;
using System.Runtime.InteropServices;

namespace NuGetConsole
{
    internal static class NativeMethods
    {

        // Size of VARIANTs in 32 bit systems
        public const int VariantSize = 16;

        [DllImport("Oleaut32.dll", PreserveSig = false)]
        public static extern void VariantClear(IntPtr var);

        [DllImport("user32.dll")]
        public static extern short VkKeyScanEx(char ch, IntPtr dwhkl);

        [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern IntPtr GetKeyboardLayout(int dwLayout);
    }
}

redpajama_set_name: RedPajamaGithub


When I read bible stories I try to imagine the experience.
Here is Elijah, a prophet, camping beside a river and trusting God for his provision. But the river starts to dry up because of the drought. Elijah is smart enough to know eventually there will be no water, yet he hears nothing from God.
Did he get nervous? It doesn't say. It does say when the water ran out God had another place for him to go and that's what I hold on to. It may look like things are dying up, and they may, but God always has another place, another task, another opportunity.
Faith needs additives1 to encourage growth and Peter lists seven (7) with the promise if they are present the believer will never fall, nor be barren and unfruitful.
bears little fruit. Those who add cheerful endurance to self control will see difficulties turn out to be a blessing for themselves and those around.


If you're a fan of DJs like Tiesto and David Guetta, then there's a good chance you'll want to know how to DJ house music sets at some point in your DJ career. Before you can master the genre, however, you'll need to get yourself into the right mindset to understand what goes into making house music and what makes it different from other genres. So to get you started on your quest to become a great house DJ, here are some beginners tips on how to DJ house music sets.
The philosophy of house music differs greatly from the philosophy of other electronic music genres like hip-hop, which is the last genre we discussed on the blog. While hip-hop involves a lot of fast cuts, house music is all about slow, smooth transitions; while hip-hop DJs will change up the mood in a split second, house DJs want to keep a fairly consistent mood that evolves slowly throughout the night.
When you're learning how to DJ house music sets, the key thing to keep in mind is that you want to keep people dancing at all costs. To do this, it will help to develop a solid understanding of how house tracks are built and how they fit together.
While every house song has its own distinctive sound, virtually every one shares the same basic structure. This structure usually starts simply with a few musical elements built around a four on the floor beat. From there, the structure will change every 8 to 16 bars or so as new elements are either added in or taken away.
A good way to learn to DJ house music is to take a few house tracks you like and spend some time analyzing them. As you listen to your favourite house tracks, take note of things like what BPM the song uses, how often new elements are added or taken away, when the climax hits, how long it takes before you get to the climax, and how long it takes for the song to die down after the climax has hit.
Once you have the basic structure of house music mapped out in your head, you'll have a better idea of how different songs will fit together. As mentioned previously, house music is all about slow, smooth transitions, which means that good beatmatching skills are essential if you want to master the art of how to DJ house music. Typically with house music, you'll want to start mixing in one song after the climax of the previous song as the energy of the first song is slowly dying down. Often it can take up to a minute or more to move from one song to the next, so getting your beatmatching right and choosing complimentary songs is key for this genre.
If you haven't mastered the art of beatmatching yet, take a look at some of our beatmatching lessons in our online DJ school. Once you've mastered that basic skill, you're ready for some more advanced house DJ tricks, which we'll discuss in the next part of this series, so keep an eye on the blog in the coming weeks for the next part in this three-part series.


The Arvigo Techniques of Maya Abdominal Therapy are founded on the ancient Mayan technique of abdominal massage which is an external non-invasive manipulation that repositions internal organs that have shifted, thereby restricting the flow of blood, lymph, nerve and chi.
The Arvigo Techniques of Maya Abdominal Therapy address position and health of the pelvic and abdominal organs. The work is best known for the correction of the prolapsed, fallen, or tilted uterus and for the prevention and treatment of benign prostate enlargement in men, and for relief of many common digestive disorders.


text:
Q: "Send some pictures from the nice place that you're in." In this context is it ok to end with a preposition?

"Send some pictures from the nice place that you're in."

A: Sometimes a "place" can be a location or a facility, such as a hotel. If context makes it clear where or what this "place" is, nothing else is needed.

*

*Send us pictures of the nice place where you're in.

Sometimes the preposition changes if the place is a building, in which case:

*Send us pictures of the hotel where you're staying (at)

*Send pictures of the city/town/seaside (or) mountain resort you're in

The antiquated rule about not ending a sentence with a preposition is just that, antiquated and unnecessary. But there's nothing wrong with writing

*

*At which hotel are you staying?

instead of

*

*Which hotel are you staying at?

or

*Through that one tweet, some of the most dedicated followers in India had determined which conference I was speaking at, and therefore at which hotel I would be staying.

A: The sentence is clear and most English speakers do not mind ending a sentence with a preposition.
My advice is only to avoid ending a sentence with a preposition in formal writing, such writing assignments and cover letters.


By building a model and following these best practices for your remote consulting business, you can avoid problems and reduce costs.
rowing product companies constantly face the challenge of scaling their consulting practices. Besides organic growth, that depends on several macro and micro economic factors, these companies look for partners to whom they can outsource their consulting needs to some degree. Alternatively, these companies seek to build a remote offshore consulting model that can help them with cost efficiency and quality delivery. Each solution comes with its own set of advantages and disadvantages.
This article focuses on building a remote consulting practice. Challenges are abundant: quality of work, processes, travel, synchronization, strategy, etc. After reading this article, you should have a firm grasp of how to create a successful low-cost consulting group that remotely complements a local group in the region.
Table 1. RACI Chart: This RACI chart shows the people and their level of involvement for each step.
The RACI chart provides a good reference for various local and remote stakeholders associated with the delivery or the project.


text:
106.7 The Fan Stephen Jones on potential Odell Beckham Jr. signing: 'This year is our priority'
Stephen Jones on potential Odell Beckham Jr. signing: 'This year is our priority'
By Logan Mullen, Audacy
The Dallas Cowboys' months of planning and courtship have led them to Monday: their highly-anticipated meeting with Odell Beckham Jr.
The star wideout is doing a free agency tour, eyeing a contender to join for at least the stretch run, but likely on a multi-year deal. He is recovering from an ACL tear sustained in the Super Bowl, but the fact that he's taking meetings now suggests he's close to, if not already, fully healthy.
Dating as far back as October, the Cowboys and Beckham have been linked to each other. During his weekly appearance on the "K&C Masterpiece," on Monday, Cowboys executive VP Stephen Jones was jokingly asked if Beckham was in the car with him.
"He wouldn't be in the car with me doing this, I can assure you," Jones quipped. "You don't have long with these guys when they come in to visit. He's got a busy schedule, and we look forward to our visit with him, Jerry and I do. I know there are a lot of people -- from medical staff to our leadership counsel to our coaching staff, right on down the line -- that are going to be visiting with him. And we'll just see where things go."
The Cowboys' drubbing of the Colts on Sunday Night Football was another reminder that Dallas has a high-end group that could make a deep run this postseason. But Beckham is coming off a major injury, resulting in theories that signing the wideout is a move more with an eye to the future than this season.
At least in the Cowboys case, that isn't where the focus is at.
"I think this year is our priority, as we sit here right now," Jones said. "No question about it, I think everybody recognizes we've got a really solid football team that can compete to win a championship this year, and certainly that's our focus. Obviously, we've done our planning and we understand how future years work as well, but our No. 1 priority is to win football games right now."
The Cowboys have made clear they want Beckham, and have been candid about that desire to an almost unprecedented level. Now is when things get serious, but Jones wasn't going to get into where his confidence is at.
"It's like doing contracts, as I've always said, I never suggest and never guess are we close, are we a long ways out – nothing is ever done until it's done, and a lot of times it doesn't get done," Jones said. "So we'll just see where this thing takes us, we look forward to the next 24-to-36 hours spending time with Odell, and we'll see where it takes us."
Jones' brother, Cowboys owner Jerry Jones, said Sunday night he was willing to do something uncomfortable with Beckham.
"I'd probably do something uncomfortable with him," Jones said. "I could possibly do something uncomfortable with him. I'm going to have to because he's coming back from an injury."
Stephen Jones said he didn't really know what Jerry meant.
"I didn't hear it, so it's hard for me to comment on," Jones said. "But I think anytime you stretch to make yourself better and you're trying to make a deal, then you can be uncomfortable. Usually, the best deals are when both sides are a little uncomfortable, and it ends up working out. So we'll just see, but I'm not exactly sure what he meant by that."
Beckham met with the New York Giants last week, and also is expected to meet with the Bills. Maybe there will be others, but the Cowboys seem zeroed in on making sure the receiver lands with them.
Odell Beckham Jr.
Featured Image Photo Credit: Andy Lyons/Getty Images


text:
Q: How to integrate bing_translator-gem into rails? I'm trying to make a simple translation forum using Rails 4 and relrod's bing_translator gem.
I'm very much a rookie but have managed to get a site working with posts, comments, voting of comments, but am having difficulty making the translator part work. When I run the following code in the console, the app works and translates as described by the gem documentation.
translator = BingTranslator.new('#####', '##########')
translated = translator.translate('this is what's being translated', :to => 'es')

What i cannot figure out though is how I could go about integrating this into my show page? @post.translation is supposed to be translated and placed into @post.translated?
Any help is appreciated, thanks!
routes.rb
Rails.application.routes.draw do
devise_for :users
get 'welcome/index'
  resources :posts do
   post 'translated'
  resources :comments do
    member do
      post 'vote_up'
    end
  end
end
root "welcome#index"
end

show.html.haml
#post_show
    %h1= @post.title
    %p.username
        Posted by
        = @post.user.name
        about
        = time_ago_in_words(@post.created_at)
    %p
        Task :
        %br
        =@post.task
    %p
        Translation :
        %br
        =@post.translation
        %br
        =@post.translated

post.rb
    def translate
        @post= Post.find(params[:id])
        translator = BingTranslator.new('######', '########')
        @post.translated = translator.translate(@post.translated, :from => 'en', :to => 'fr')

    end


Remember the part where she just kissed him and he woke up?
Imagine a moment where he missed her and he spoke up.
Would you suddenly forget yourself, like a terrible mistake occurred and take it slow?
You think you know	I think I know….
Remember the part when she just kissed him and he woke up?


Hands-on exhibitions in the areas of science and technology, history and culture, health and human development, and the arts.
Next Monday, Houstonians have the chance to view the partial solar eclipse from many different parts of town.
It's not easy to amuse the little ones for a whole week, but these places should help.