Why am I being followed by a political opponent in Twitter?

Why would an influential political figure follow me in Twitter, when I’m a nobody, and all I’ve done to date is opposed his party’s philosophy? He follows some 100k people, with a similar number of followers.

I’m almost certain it’s to benefit his party, his politics, and his own interests, rather than mine! But what is this actually achieving for him?

Surely he’d be better off following people of an aligned ideology! Otherwise he’d have 100k people filling his feeds with hate. (Actually, he probably does)

Selenium::WebDriver::Error::UnknownError causes socket hang up, followed by ECONNREFUSED 127.0.0.1:8200

I’m developing an automation script to exercise an app on a tablet. The script is written on a MacBook Pro with OS X v10.11.6 in RubyMine 2018.3.5 and connects via Wi-Fi to the tablet using Appium 1.12.1 and Gem selenium-webdriver 3.141.0.

The Capabilities declarations for Appium in RubyMine are

appiumVersion: ‘1.12.1’, platformName: ‘Android’, platformVersion: ‘7.0’, deviceType: ‘tablet’, deviceName: ‘10.124.41.103:5555’, app: ‘/Users/paulkmecak/Downloads/usa-mailing-qa-signed-686.apk’, appPackage: ‘com.pb.csdsenior’, appActivity: ‘com.pb.csdsenior.presentation.view.activity.StartupActivity -esa REDIRECT_ACTIVITY com.pb.csdsenior.presentation.view.activity.MailMainActivity’, newCommandTimeout: 480, noReset: true, fullReset: false, automationName: ‘UiAutomator2’

The Hipstreet Titan Turbo tablet runs Android 7.0

The script reads records with various parameters and enters them on the tablet app, making sure the results on screen 1 carry over to screen 2, etc, and back to the home screen.

At some random point, I get an error message

***Error Type: Selenium::WebDriver::Error::UnknownError, Error Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: socket hang up,

find_element_by_locator( COD ), Error Type: Selenium::WebDriver::Error::UnknownError, Error Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: connect ECONNREFUSED 127.0.0.1:8200 undefined method `click’ for # (NoMethodError)***

This occurs after as few as 45 records or as many as 189 records. Unfortunately, there are over 1600 records I need to process.

Sudden high CPU usage followed by Input/Output error

First a little bit of information about my system:

OS: Ubuntu 18.04 with encryption while installing

DE: i3wm (probably doesn’t have to with this, because the same problem appears in Gnome)

Hardware: Lenovo T470

Since about three days I’m encountering the problem, that all of a sudden the CPU usage rises to about 100% (sometimes 98%). Shortly after the rise nothing works anymore and bash returns an “Input/Output error” and I have to power off by removing the battery…

Now I know Input/Output errors usually happen because the hard drive is full, but mine isn’t even remotely full (at about 7% – checked with df).

Here is the output of journalctl of the last two boots: Journal

I don’t understand what’s going on and I already had to repeat some work because of this, so any help is appreciated.

Using Ito’s Lemma to compute the process followed by a function

I have the following process $ $ dS_t = \mu S_t dt + \sigma S_t dz_t $ $ and the function $ $ f(S) = S^2$ $ where

$ $ \frac{\partial f}{\partial t} = 0, \frac{\partial f}{\partial S} = 2S, \frac{\partial^2 f}{\partial S^2} = 2, df = 2SdS + \frac{1}{2}2 \cdot dSdS$ $

I have that using Ito’s Lemma: $ $ df_t = 2S_t(\mu S_td_t + \sigma S_tdz_t) + \frac{1}{2}2\cdot \sigma S_tdz_t \cdot \sigma S_tdz_t = (2 \mu S_t^2 + \sigma^2 S_t^2)dt + 2 \sigma S_t^2dz_t$ $ or $ $ df_t = (2 \mu + \sigma^2)f_t dt + 2\sigma f_tdz_t. $ $ Can someone explain how this works for this specific example for me? I realise that $ $ df = \left( \frac{\partial f}{\partial t} + \mu \frac{\partial f}{\partial s} + \frac{1}{2}\sigma^2 \frac{\partial^2f}{\partial S^2} \right) dt + \sigma \frac{\partial f}{\partial s}dz_t $ $ but i cant understand how $ $ df = 2SdS + \frac{1}{2}2 \cdot dSdS$ $ was obtained from that expression? Also, i don’t understand how the larger first expression for $ df_t$ was constructed? Any help would be great, thanks!

Mac Mini screen glitch followed by fan noise then reboot

My Mac Mini 2014 has been glitching recently. I don’t know whether its releated to the recent OSX update. Without any sign, the screen would blur as the image bellow.

enter image description here

The keyboard and mouse has no response. Then, there is a lot of fan noise, and later the screen goes black and then the system is rebooted.

It was able recover after reboot. However, after this issues happened several times, it cannot recover now. When power on, the fan keeps making noise, and the screen is black. There is no signal in the monitor.

Is this a graphics card issue? Can I fix it by replacing the logic board?

avoid if-else block in favor of default assignment followed by if

A colleague, and frankly better software engineer that me, is telling me that this pattern

let variable = someDefaultVariable(); if (some_boolean) {     variable = someOtherValue(); } 

is better than this pattern

let variable if (some_boolean) {     variable = someOtherValue(); } else {     variable = someOtherValue(); } 

My doubt about this is that the initial instantiation is going to involved a waterfall of function calls before the if block is hit, although he seems convinced that the first appraoch is better.

Speaking specifically about Javascript, which of these patterns is more better and more secure. Is this the same for C?

Batch scripting first attempt, looking for where best practises are not followed

The following is my first real attempt at batch scripting, and I’m new to it so I’m not sure whether what I’ve done is to best practice. The code works, and I’m open to suggestions.

Basically the following code allows someone to download Node.js and npm per project, a requirement we have so that we can run multiple versions of Node and npm at the same time. The script also means that setting up development environments is easier, so there are a few goals this script is trying to achieve.

@ECHO OFF  REM Need to test on Azure DevOps, CruiseControl.NET, etc. REM Test with spaces in paths...  SETLOCAL  SET "NPM_REGISTRY=https://registry.npmjs.org" SET "ZIP_DOWNLOAD_URL=https://chocolatey.org/7za.exe"  SET "NODE_EXE_ARCH=x64" SET "NODE_PACKAGE_VERSION=11.10.0" SET "NPM_PACKAGE_VERSION=6.8.0"  SET "DOWNLOAD_CACHE_PATH=%temp%\NpmScratch" SET "ZIP_EXE_DOWNLOAD=%DOWNLOAD_CACHE_PATH%za.exe"  SET "NODE_PACKAGE_PATH=%~dp0." SET "NODE_MODULES_PATH=%NODE_PACKAGE_PATH%\node_modules" SET "NPM_PACKAGE_PATH=%NODE_MODULES_PATH%\npm"  SET "NODE_EXE=%NODE_PACKAGE_PATH%\node.exe" SET "NPM_CLI_JS=%NPM_PACKAGE_PATH%\bin\npm-cli.js"  SET "DELETE_NODE_MODULES=" SET "DOWNLOAD_NODE=" SET "DOWNLOAD_NPM="  IF NOT EXIST "%NODE_EXE%" (   SET DOWNLOAD_NODE=1 )  IF NOT EXIST "%NPM_CLI_JS%" (   SET DELETE_NODE_MODULES=1   SET DOWNLOAD_NPM=1 )  ECHO DELETE_NODE_MODULES=%DELETE_NODE_MODULES% ECHO DOWNLOAD_NODE=%DOWNLOAD_NODE% ECHO DOWNLOAD_NPM=%DOWNLOAD_NPM%  IF DEFINED DELETE_NODE_MODULES (   CALL :clean_dir %NODE_MODULES_PATH% )  SET "NODE_PACKAGE_FILENAME=node-win-%NODE_EXE_ARCH%-%NODE_PACKAGE_VERSION%.tgz" SET "NODE_PACKAGE_DOWNLOAD_PATH=%DOWNLOAD_CACHE_PATH%\%NODE_PACKAGE_FILENAME%" SET "NODE_DOWNLOAD_CACHE_PATH=%DOWNLOAD_CACHE_PATH%\nodejs-%NODE_PACKAGE_VERSION%" SET "NODE_EXE_DOWNLOAD_CACHE_PATH=%NODE_DOWNLOAD_CACHE_PATH%\bin\node.exe" IF DEFINED DOWNLOAD_NODE (   CALL :create_dir %DOWNLOAD_CACHE_PATH%   IF NOT EXIST "%DOWNLOAD_CACHE_PATH%" (     ECHO "Cache directory missing"     EXIT %ERRORLEVEL%   )    CALL :download %ZIP_DOWNLOAD_URL% %ZIP_EXE_DOWNLOAD%   IF NOT EXIST "%ZIP_EXE_DOWNLOAD%" (     ECHO "Zip download failed"     EXIT %ERRORLEVEL%   )    CALL :download %NPM_REGISTRY%/node-win-%NODE_EXE_ARCH%/-/%NODE_PACKAGE_FILENAME% %NODE_PACKAGE_DOWNLOAD_PATH%   IF NOT EXIST "%NODE_PACKAGE_DOWNLOAD_PATH%" (     ECHO "Node.js download failed"     EXIT %ERRORLEVEL%   )    IF NOT EXIST "%NODE_EXE_DOWNLOAD_CACHE_PATH%" (     CALL :extract_archive %ZIP_EXE_DOWNLOAD% %NODE_PACKAGE_DOWNLOAD_PATH% %DOWNLOAD_CACHE_PATH%     IF NOT EXIST "%DOWNLOAD_CACHE_PATH%\package\bin\node.exe" (       ECHO "Extracting Node,js package failed"       EXIT %ERRORLEVEL%     )      CALL :delete_dir %NODE_DOWNLOAD_CACHE_PATH%     IF EXIST "%NODE_DOWNLOAD_CACHE_PATH%" (       ECHO "Failed to delete %NODE_DOWNLOAD_CACHE_PATH%"       EXIT %ERRORLEVEL%     )      CALL :move %DOWNLOAD_CACHE_PATH%\package %NODE_DOWNLOAD_CACHE_PATH%     IF NOT EXIST "%NODE_EXE_DOWNLOAD_CACHE_PATH%" (       ECHO "Renaming Node.js package directory failed"       EXIT %ERRORLEVEL%     )   )    IF NOT EXIST "%NODE_EXE_DOWNLOAD_CACHE_PATH%" (     ECHO "Cached Node.js package directory missing"     EXIT %ERRORLEVEL%   )    CALL :delete_file %NODE_EXE%   IF EXIST "%NODE_EXE%" (     ECHO "Failed to delete %NODE_EXE%"     EXIT %ERRORLEVEL%   )    CALL :copy_file %DOWNLOAD_CACHE_PATH%\nodejs-%NODE_PACKAGE_VERSION%\bin\node.exe %NODE_EXE%   IF NOT EXIST "%NODE_EXE%" (     ECHO "Copying Node exe failed"     EXIT %ERRORLEVEL%   ) )  SET "NPM_PACKAGE_FILENAME=npm-%NPM_PACKAGE_VERSION%.tgz" SET "NPM_PACKAGE_DOWNLOAD_PATH=%DOWNLOAD_CACHE_PATH%\%NPM_PACKAGE_FILENAME%" SET "NPM_CLI_JS_DOWNLOAD_CACHE_PATH=%DOWNLOAD_CACHE_PATH%\npm-%NPM_PACKAGE_VERSION%\bin\npm-cli.js" IF DEFINED DOWNLOAD_NPM (   CALL :create_dir %DOWNLOAD_CACHE_PATH%   IF NOT EXIST "%DOWNLOAD_CACHE_PATH%" (     ECHO "Cache directory missing"     EXIT %ERRORLEVEL%   )    CALL :download %ZIP_DOWNLOAD_URL% %ZIP_EXE_DOWNLOAD%   IF NOT EXIST "%ZIP_EXE_DOWNLOAD%" (     ECHO "Zip download failed"     EXIT %ERRORLEVEL%   )    CALL :download %NPM_REGISTRY%/npm/-/%NPM_PACKAGE_FILENAME% %NPM_PACKAGE_DOWNLOAD_PATH%   IF NOT EXIST "%NPM_PACKAGE_DOWNLOAD_PATH%" (     ECHO "npm download failed"     EXIT %ERRORLEVEL%   )    CALL :extract_archive %ZIP_EXE_DOWNLOAD% %NPM_PACKAGE_DOWNLOAD_PATH% %NPM_PACKAGE_PATH%\..   IF NOT EXIST "%NODE_MODULES_PATH%\package\bin\npm-cli.js" (     ECHO "Extracting npm package failed"     EXIT %ERRORLEVEL%   )    CALL :delete_dir %NPM_PACKAGE_PATH%   IF EXIST "%NPM_PACKAGE_PATH%" (     ECHO "Failed to delete %NPM_PACKAGE_PATH%"     EXIT %ERRORLEVEL%   )    CALL :move %NPM_PACKAGE_PATH%\..\package %NPM_PACKAGE_PATH%   IF NOT EXIST "%NPM_PACKAGE_PATH%" (     ECHO "Renaming npm package directory failed"     EXIT %ERRORLEVEL%   ) )  EXIT /B %ERRORLEVEL%  :clean_dir IF EXIST "%~1" (   ECHO "Cleaning directory %~1"   CALL CMD /C "MKDIR %temp%\.empty 2>NUL"   CALL CMD /C "ROBOCOPY %temp%\.empty %~1 /MIR >NUL" ) EXIT /B 0  :delete_file IF EXIST "%~1" (   CALL ECHO "Deleting file %~1"   CALL DEL "%~1" ) EXIT /B 0  :delete_dir IF EXIST "%~1" (   ECHO "Deleting directory %~1"   CALL :clean_dir "%~1" >NUL   CALL RMDIR "%~1" ) EXIT /B 0  :create_dir IF NOT EXIST "%~1" (   ECHO "Creating directory %~1"   CALL MKDIR "%~1" ) EXIT /B 0  :move IF NOT EXIST "%~2" (   ECHO "Moving %~1 to %2"   CALL MOVE "%~1" "%~2" ) EXIT /B 0  :copy_file IF NOT EXIST "%~2" (   ECHO "Copying %~1 to %~2"   CALL COPY "%~1" "%~2" ) EXIT /B 0  :copy_dir IF NOT EXIST "%~2" (   ECHO "Copying %~1 to %2"   CALL robocopy "%~1" "%~2" /E >NUL ) EXIT /B 0  :download IF NOT EXIST "%~2" (   ECHO "Downloading %~1 to %~2"   CALL bitsadmin.exe /transfer "Download" %~1 "%~2" ) EXIT /B 0  REM %~1 = %ZIP_EXE_DOWNLOAD% REM %~2 = %NODE_PACKAGE_DOWNLOAD_PATH% REM %~3 = %DOWNLOAD_CACHE_PATH% :extract_archive   ECHO "Extracting %~2 to %~3"   CALL CMD /C "%~1 x %~2 -so | %~1 x -aoa -si -ttar -o"%~3"" EXIT /B 0