text:
Q: Appium IOSDriver times out, but launches iPhone simulator My AppiumDriver code is simple enough:
var options = new AppiumOptions();
                options.AddAdditionalCapability(MobileCapabilityType.PlatformName, "iOS");
                options.AddAdditionalCapability(MobileCapabilityType.DeviceName, "iPhone XR");
                options.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "13.0");
                options.AddAdditionalCapability(CapabilityType.BrowserName, "safari");
                options.AddAdditionalCapability(MobileCapabilityType.AutomationName, "XCUITest");

                var driver2 =
                    new IOSDriver<AppiumWebElement>(
                        new Uri($@"http://192.168.0.41:4723/wd/hub"),
                        options,
                        new TimeSpan(0, 2, 0));

Appium (running on Mac) launches an iPhone simulator on my Mac machine
appium -a 192.168.0.41 -p 4723

But the IOSDriver constructor never completes, it just times out with exception after 120 seconds (or whatever value I put in there).
This is the output from Appium
[Appium] Welcome to Appium v1.14.2
[Appium] Non-default server args:
[Appium]   address: 192.168.0.41
[Appium] Appium REST http interface listener started on 192.168.0.41:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"platformName":"iOS","deviceName":"iPhone XR","platformVersion":"13.0","browserName":"safari","automationName":"XCUITest"},"capabilities":{"firstMatch":[{"platformName":"iOS","browserName":"safari"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"iOS","deviceName":"iPhone XR","platformVersion":"13.0","browserName":"safari","automationName":"XCUITest"},null,{"firstMatch":[{"platformName":"iOS","browserName":"safari"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1568747029537 (14:03:49 GMT-0500 (Central Daylight Time))
[Appium] Could not parse W3C capabilities: 'deviceName' can't be blank
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The capabilities ["deviceName","platformVersion","automationName"] are not standard capabilities and should have an extension prefix
[Appium] Appium v1.14.2 creating new XCUITestDriver (v2.116.3) session
[Appium] Capabilities:
[Appium]   deviceName: iPhone XR
[Appium]   platformVersion: 13.0
[Appium]   automationName: XCUITest
[Appium]   platformName: iOS
[Appium]   browserName: safari
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"appium:dev... and MJSONWP desired capabilities {"platformName":"iOS","devi... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"appium:dev...
[BaseDriver] Session created with session id: 23f10772-5375-4c81-9536-5805132fc717
[debug] [XCUITest] Current user: 'patrick'
[XCUITest] iOS SDK Version set to '13.0'
[XCUITest] Simulator udid not provided
[XCUITest] Using desired caps to create a new simulator
[debug] [simctl] Creating simulator with name 'appiumTest-AA3CE20A-10E7-44EF-A669-2EE6D93D3047-iPhone XR', device type id 'iPhone XR' and runtime id 'com.apple.CoreSimulator.SimRuntime.iOS-13-0'
[iOSSim] Constructing iOS simulator for Xcode version 11.0 with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD'
[XCUITest] Created simulator with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD'.
[XCUITest] Determining device to run tests on: udid: '42D158FC-3300-43BF-81A3-5B18B783FEDD', real device: false
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1568747031680 (14:03:51 GMT-0500 (Central Daylight Time))
[XCUITest] Safari test requested
[debug] [BaseDriver] Event 'appConfigured' logged at 1568747031681 (14:03:51 GMT-0500 (Central Daylight Time))
[XCUITest] Continuing without capturing device logs: iOS Simulator with udid 42D158FC-3300-43BF-81A3-5B18B783FEDD is not running
[XCUITest] Setting up simulator
[debug] [iOSSim] Setting common Simulator preferences to {"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[debug] [iOSSim] Updated 42D158FC-3300-43BF-81A3-5B18B783FEDD Simulator preferences at '/Users/patrick/Library/Preferences/com.apple.iphonesimulator.plist' with {"DevicePreferences":{"42D158FC-3300-43BF-81A3-5B18B783FEDD":{"ConnectHardwareKeyboard":false}},"RotateWindowWhenSignaledByGuest":true,"ConnectHardwareKeyboard":false}
[iOSSim] Booting Simulator with UDID 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[iOSSim] Simulator with UDID 42D158FC-3300-43BF-81A3-5B18B783FEDD booted in 52 seconds
[debug] [IDB] Connecting idb service to '42D158FC-3300-43BF-81A3-5B18B783FEDD'
[XCUITest] idb will not be used for Simulator interaction. Original error: 'idb' has not been found in PATH. Is it installed? Read https://www.fbidb.io for more details
[debug] [BaseDriver] Event 'simStarted' logged at 1568747084509 (14:04:44 GMT-0500 (Central Daylight Time))
[debug] [XCUITest] Starting log capture for iOS Simulator with udid '42D158FC-3300-43BF-81A3-5B18B783FEDD', using 'xcrun simctl spawn 42D158FC-3300-43BF-81A3-5B18B783FEDD log stream --style compact'
[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1568747085347 (14:04:45 GMT-0500 (Central Daylight Time))
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[debug] [XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[debug] [XCUITest] Parsed BUILD_DIR configuration value: '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products'
[debug] [XCUITest] Got derived data root: '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy'
[debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key '/Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [XCUITest] WDA is not listening at 'http://localhost:8100/'
[debug] [XCUITest] WDA is currently not running. There is nothing to cache
[debug] [XCUITest] Trying to start WebDriverAgent 2 times with 10000ms interval
[debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1568747091183 (14:04:51 GMT-0500 (Central Daylight Time))
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/usr/local/bin/carthage'
[debug] [XCUITest] Killing running processes 'xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD, iproxy 8100, 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' for the device 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[debug] [XCUITest] 'pgrep -ifn xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn iproxy 8100' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/patrick/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy -destination id=42D158FC-3300-43BF-81A3-5B18B783FEDD IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[WD Proxy] Got an unexpected response: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [WD Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"state\" : \"success\",\n    \"os\" : {\n      \"name\" : \"iOS\",\n      \"version\" : \"13.0\",\n      \"sdkVersion\" : \"13.0\"\n    },\n    \"ios\" : {\n      \"simulatorVersion\" : \"13.0\",\n      \"ip\" : \"192.168.0.41\"\n    },\n    \"build\" : {\n      \"upgradedAt\" : \"1568745012654\",\n      \"time\" : \"Sep 17 2019 13:34:34\",\n      \"productBundleIdentifier\" : \"com.facebook.WebDriverAgentRunner\"\n    }\n  },\n  \"sessionId\" : \"27F6F5EA-539D-4088-9657-400A8686C4CA\",\n  \"status\" : 0\n}"
[debug] [WD Proxy] Determined that the downstream protocol for proxy is MJSONWP
[debug] [XCUITest] WebDriverAgent information:
[debug] [XCUITest] {
[debug] [XCUITest]   "state": "success",
[debug] [XCUITest]   "os": {
[debug] [XCUITest]     "name": "iOS",
[debug] [XCUITest]     "version": "13.0",
[debug] [XCUITest]     "sdkVersion": "13.0"
[debug] [XCUITest]   },
[debug] [XCUITest]   "ios": {
[debug] [XCUITest]     "simulatorVersion": "13.0",
[debug] [XCUITest]     "ip": "192.168.0.41"
[debug] [XCUITest]   },
[debug] [XCUITest]   "build": {
[debug] [XCUITest]     "upgradedAt": "1568745012654",
[debug] [XCUITest]     "time": "Sep 17 2019 13:34:34",
[debug] [XCUITest]     "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"
[debug] [XCUITest]   }
[debug] [XCUITest] }
[debug] [XCUITest] WebDriverAgent successfully started after 15687ms
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1568747107016 (14:05:07 GMT-0500 (Central Daylight Time))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.mobilesafari","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"18604E24-D247-4A43-A4A8-5B8F7FCB9D54","capabilities":{"device":"iphone","browserName":"Safari","sdkVersion":"13.0","CFBundleIdentifier":"com.apple.mobilesafari"}},"sessionId":"18604E24-D247-4A43-A4A8-5B8F7FCB9D54","status":0}
[debug] [WD Proxy] Determined that the downstream protocol for proxy is MJSONWP
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1568747113342 (14:05:13 GMT-0500 (Central Daylight Time))
[debug] [BaseDriver] Event 'wdaStarted' logged at 1568747113343 (14:05:13 GMT-0500 (Central Daylight Time))
[XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
[debug] [BaseDriver] Event 'orientationSet' logged at 1568747113345 (14:05:13 GMT-0500 (Central Daylight Time))

[debug] [iOS] Selecting by url: true (expected url: 'http://192.168.0.41:4723/welcome')
[RemoteDebugger] Remote Debugger version 4.4.1
[debug] [RemoteDebugger] useNewSafari --> false
[RemoteDebugger] Setting communication protocol: using Target-based communication
[debug] [RemoteDebugger] Connecting to remote debugger through unix domain socket: '/private/tmp/com.apple.launchd.Uf5EaEsH0s/com.apple.webinspectord_sim.socket'
[debug] [RemoteDebugger] Debugger socket connected
[debug] [RemoteDebugger] Sending connection key request
[debug] [RemoteDebugger] Sending '_rpc_reportIdentifier:' message to remote debugger (id: 0)
[HTTP] --> GET /welcome
[HTTP] {}
[debug] [HTTP] Sending welcome response with params: {"message":"Let's browse!"}
[HTTP] <-- GET /welcome 200 83 ms - 124
[HTTP]
[HTTP] <-- GET /favicon.ico 200 3 ms - 1150
[HTTP]
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:31843
[debug] [RemoteDebugger] Selecting app PID:31843 (try #1 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 1)
[debug] [RemoteDebugger] We were notified we might have connected to the wrong app. Using id PID:31846 instead of PID:31843
[debug] [RemoteDebugger] Notified that new application 'PID:31846' has connected
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:31846'
[debug] [RemoteDebugger] Using proxied app id 'PID:31846'
[debug] [RemoteDebugger] Error checking application: 'New application has connected'. Retrying connection
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]     Application: 'PID:31846'
[debug] [RemoteDebugger]         id: "PID:31846"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: 'Waiting for data'
[debug] [RemoteDebugger] Found app id key 'PID:31843' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Found separate bundleId 'process-com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:31846'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:31843, PID:31846
[debug] [RemoteDebugger] Selecting app PID:31843 (try #2 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 2)
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray:
[debug] [RemoteDebugger]           - id: 1
[debug] [RemoteDebugger]             title: "Appium/welcome"
[debug] [RemoteDebugger]             url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger]             isKey: false
[debug] [RemoteDebugger]     Application: 'PID:31846'
[debug] [RemoteDebugger]         id: "PID:31846"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: 'Waiting for data'
[debug] [RemoteDebugger] Page changed: {
[debug] [RemoteDebugger]   "1": {
[debug] [RemoteDebugger]     "WIRTitleKey": "Appium/welcome",
[debug] [RemoteDebugger]     "WIRTypeKey": "WIRTypeWeb",
[debug] [RemoteDebugger]     "WIRURLKey": "http://192.168.0.41:4723/welcome",
[debug] [RemoteDebugger]     "WIRPageIdentifierKey": 1
[debug] [RemoteDebugger]   }
[debug] [RemoteDebugger] }
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but listening for 'PID:31846'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31843' has been updated
[debug] [RemoteDebugger] Received response from socket send: '["PID:31843",{"1":{"WIRTitleKey":"Appium/welcome","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"http://192.168.0.41:4723/welcome","WIRPageIdentifierKey":1}}]'
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Received altered app id, updating from 'PID:31846' to 'PID:31843'
[debug] [RemoteDebugger] Waiting for 1 pages to be fulfilled
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray:
[debug] [RemoteDebugger]           - id: 1
[debug] [RemoteDebugger]             title: "Appium/welcome"
[debug] [RemoteDebugger]             url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger]             isKey: false
[debug] [RemoteDebugger]     Application: 'PID:31846'
[debug] [RemoteDebugger]         id: "PID:31846"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger] Page changed: {}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31846' but listening for 'PID:31843'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31846' has been updated
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray:
[debug] [RemoteDebugger]           - id: 1
[debug] [RemoteDebugger]             title: "Appium/welcome"
[debug] [RemoteDebugger]             url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger]             isKey: false
[debug] [RemoteDebugger]     Application: 'PID:31846'
[debug] [RemoteDebugger]         id: "PID:31846"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger] Finally selecting app PID:31843: [{"id":1,"title":"Appium/welcome","url":"http://192.168.0.41:4723/welcome","isKey":false}]
[debug] [iOS] Picking webview 'WEBVIEW_31843.1'
[debug] [iOS] Attempting to set context to 'WEBVIEW_31843.1'
[debug] [RemoteDebugger] Selecting page '1' on app 'PID:31843' and forwarding socket setup
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketSetup:' message to remote debugger (id: 3)
[debug] [RemoteDebugger] Sender key set
[debug] [RemoteDebugger] Target created: {"targetId":"page-6","type":"page"}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31843' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31843' has been updated
[debug] [RemoteDebugger] Notified that new application 'PID:31861' has connected
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:31843'
[debug] [RemoteDebugger]         id: "PID:31843"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray:
[debug] [RemoteDebugger]           - id: 1
[debug] [RemoteDebugger]             title: "Appium/welcome"
[debug] [RemoteDebugger]             url: "http://192.168.0.41:4723/welcome"
[debug] [RemoteDebugger]             isKey: false
[debug] [RemoteDebugger]     Application: 'PID:31846'
[debug] [RemoteDebugger]         id: "PID:31846"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger]     Application: 'PID:31861'
[debug] [RemoteDebugger]         id: "PID:31861"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "process-com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:31843"
[debug] [RemoteDebugger]         isActive: 1
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger] Page changed: {}
[debug] [RemoteDebugger] Received page change notice for app 'PID:31861' but listening for 'PID:31843'. Ignoring.
[debug] [RemoteDebugger] Notified that application 'PID:31861' has been updated
[debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to remote debugger (id: 4)
[XCUITest] Error: Remote debugger error with code '-32000': Target not found.
[XCUITest]     at Object.errorHandler (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:254:18)
[XCUITest]     at RpcMessageHandler.handleDataMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:194:9)
[XCUITest]     at RpcMessageHandler.handleMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:77:13)
[XCUITest]     at RemoteDebuggerRpcClient.handleMessage [as receive] (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:402:35)
[XCUITest]     at Socket.emit (events.js:209:13)
[XCUITest]     at addChunk (_stream_readable.js:305:12)
[XCUITest]     at readableAddChunk (_stream_readable.js:286:11)
[XCUITest]     at Socket.Readable.push (_stream_readable.js:220:10)
[XCUITest]     at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
[debug] [WD Proxy] Matched '/session/23f10772-5375-4c81-9536-5805132fc717' to command name 'deleteSession'
[debug] [WD Proxy] Proxying [DELETE /session/23f10772-5375-4c81-9536-5805132fc717] to [DELETE http://localhost:8100/session/18604E24-D247-4A43-A4A8-5B8F7FCB9D54] with no body
[debug] [RemoteDebugger] Application 'PID:31843' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is PID:31843
[debug] [RemoteDebugger] No longer have app id. Attempting to find new one.
[debug] [RemoteDebugger] Application 'PID:31846' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is undefined
[debug] [RemoteDebugger] Application 'PID:31861' disconnected. Removing from app dictionary.
[debug] [RemoteDebugger] Current app is undefined
[debug] [WD Proxy] Got response with status 200: "{\n  \"value\" : {\n\n  },\n  \"sessionId\" : \"33A93B5F-A13E-4C1B-B2DE-D243AEC0A4C4\",\n  \"status\" : 0\n}"
[debug] [XCUITest] Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] [XCUITest] Deleting simulator created for this run (udid: '42D158FC-3300-43BF-81A3-5B18B783FEDD')
[debug] [XCUITest] Killing running processes 'xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD, 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' for the device 42D158FC-3300-43BF-81A3-5B18B783FEDD...
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[debug] [XCUITest] 'pgrep -ifn xcodebuild.*42D158FC-3300-43BF-81A3-5B18B783FEDD' didn't detect any matching processes. Return code: 1
[debug] [XCUITest] 'pgrep -ifn 42D158FC-3300-43BF-81A3-5B18B783FEDD.*XCTRunner' didn't detect any matching processes. Return code: 1
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1568747136388 (14:05:36 GMT-0500 (Central Daylight Time))
[debug] [W3C] Encountered internal error running command: Error: Remote debugger error with code '-32000': Target not found.
[debug] [W3C]     at Object.errorHandler (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:254:18)
[debug] [W3C]     at RpcMessageHandler.handleDataMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:194:9)
[debug] [W3C]     at RpcMessageHandler.handleMessage (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-message-handler.js:77:13)
[debug] [W3C]     at RemoteDebuggerRpcClient.handleMessage [as receive] (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/remote-debugger-rpc-client.js:402:35)
[debug] [W3C]     at Socket.emit (events.js:209:13)
[debug] [W3C]     at addChunk (_stream_readable.js:305:12)
[debug] [W3C]     at readableAddChunk (_stream_readable.js:286:11)
[debug] [W3C]     at Socket.Readable.push (_stream_readable.js:220:10)
[debug] [W3C]     at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)
[HTTP] <-- POST /wd/hub/session 500 106926 ms - 615
[HTTP]

A: Encountered internal error running command: Error: Remote debugger error with code '-32000': Target not found.

That means that you did not provide app to start, your driver initialized successfully ( [debug] [XCUITest] WebDriverAgent successfully started after 15687ms ) but since there is no application to start, nothing happens. Add app capability to start application.


text:
Q: LaTeX error! Too many }'s. \color@endbox ->\color@endgroup I am trying to input r code using the listing package. However, at the moment my file will not compile and returns the following error:
! Too many }'s.
\color@endbox ->\color@endgroup \egroup

I have worked backwards and figured out that the error only occurs when I use a style file given to us by my department. I have copied the .sty file that causes the error and I have also attached an example that shows the error in action. You will notice if you take out the
    \usepackage[y4project]{edmaths}
that the error will disappear.
I have searched but couldn't get the following fix to work. http://www.latex-community.org/forum/viewtopic.php?f=45&p=18575
Here is the MWE (IF YOU RUN THIS IT WILL PRODUCE THE ERROR):
\documentclass[12pt]{report}
\usepackage{amssymb,amsmath,amsthm}
\usepackage[y4project]{edmaths} %%%% REMOVE THIS TO FIX ERROR

\usepackage{listings}
\usepackage{color}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\lstset{ %
  backgroundcolor=\color{white},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
  basicstyle=\footnotesize,        % the size of the fonts that are used for the code
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  breaklines=true,                 % sets automatic line breaking
  captionpos=b,                    % sets the caption-position to bottom
  commentstyle=\color{mygreen},    % comment style
  deletekeywords={...},            % if you want to delete keywords from the given language
  escapeinside={\%*}{*)},          % if you want to add LaTeX within your code
  extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  frame=single,                    % adds a frame around the code
  keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  keywordstyle=\color{blue},       % keyword style
  language=Octave,                 % the language of the code
  morekeywords={*,...},            % if you want to add more keywords to the set
  numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)
  numbersep=5pt,                   % how far the line-numbers are from the code
  numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
  showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  showstringspaces=false,          % underline spaces within strings only
  showtabs=false,                  % show tabs within strings adding particular underscores
  stepnumber=2,                    % the step between two line-numbers. If it's 1, each line will be numbered
  stringstyle=\color{mymauve},     % string literal style
  tabsize=2,                       % sets default tabsize to 2 spaces
  title=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title
}

%  End of preamble

\author{TESTING }
\title{TEST FILE}
\begin{document}
\maketitle
\tableofcontents
\chapter{Introduction}

\begin{table}[h]
\centering
    \begin{tabular}{clll}
    Sig. level      & 1$\%$ & 5$\%$ & 10$\%$ \\ \hline
    $\tau$ & -3.90 & -3.34 & -3.04  \\ \hline
    \end{tabular}
\end{table}

\begin{lstlisting}
#include <stdio.h>
#define N 10
/* Block
 * comment */
int main()
\end{lstlisting}

\end{document}

Here is the .sty file for edmaths:
%%  Package `edmaths' (26.8.2008)
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{edmaths}[2007/02/05 Edinburgh maths thesis/report style v0.95]

\RequirePackage{calc,ifthen,setspace,amsmath,amsthm,amscd,amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up the page size and margins %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\paperheight}{297mm}    % A4 Paper
\setlength{\paperwidth}{210mm}     %
\setlength{\oddsidemargin}{14.6mm} %  Left/Inside: 4.0cm (rel. -1in)
\setlength{\evensidemargin}{-.4mm} %  Right/Outside: 2.5cm (rel. -1in)
\setlength{\topmargin}{-17.4mm}    % \
\setlength{\headheight}{6mm}       % | Top: 2.0cm (rel. -1in), out of which 6mm for the header
\setlength{\headsep}{6mm}          % /
\setlength{\textwidth}{145mm}      % Margins: 2.5cm + 4cm
% Textheight delayed until we know the line spacing.

% The following is removed in favour of the `report' class options "oneside/twoside".
%\@twosidefalse \@mparswitchfalse  % Single-sided by default

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Provide some fancy option        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newboolean{with-fourier}           % Use the `fourier' package for Adobe Utopia font
\newboolean{with-hyperref}          % Use the `hyperref' package for clickable links and bookmarks, all black
\newboolean{with-colour}            % Add sane colours to the hyperref links
\newboolean{with-fancyhdr}          % Use the `fancyhdr' package to provide header and footer

\ifthenelse{\isundefined{\degreetext}}{\newcommand{\degreetext}{Specify a degree option!}}{}
\ifthenelse{\isundefined{\stretchfactor}}{\newcommand{\stretchfactor}{1}}{}
\DeclareOption{fourier}{\setboolean{with-fourier}{true}}
\DeclareOption{hyperref}{\setboolean{with-hyperref}{true}}
\DeclareOption{colour}{\setboolean{with-colour}{true}}
\DeclareOption{fancyhdr}{\setboolean{with-fancyhdr}{true}}

\DeclareOption{phd}{\renewcommand{\degreetext}{Doctor of Philosophy}}
\DeclareOption{firstyear}{\renewcommand{\degreetext}{First-Year Report\\Graduate School of Mathematics}}
\DeclareOption{secondyear}{\renewcommand{\degreetext}{Second-Year Report\\Graduate School of Mathematics}}
\DeclareOption{thirdyear}{\renewcommand{\degreetext}{Third-Year Report\\Graduate School of Mathematics}}
\DeclareOption{y4project}{\renewcommand{\degreetext}{Year 4 Project\\School of Mathematics}}
\DeclareOption{masterph}{\renewcommand{\degreetext}{Master of Philosophy}}
\DeclareOption{mastersc}{\renewcommand{\degreetext}{Master of Science by Research}}

\DeclareOption{single}{\renewcommand{\stretchfactor}{1}}
\DeclareOption{onehalf}{\renewcommand{\stretchfactor}{1.5}}
\DeclareOption{double}{\renewcommand{\stretchfactor}{2}}

%\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}  % Single-sided by default
%\DeclareOption{twosides}{\@twosidetrue \@mparswitchtrue}

\ProcessOptions

\ifthenelse{\boolean{with-fourier}}
  { \RequirePackage{cmap}
    \RequirePackage{fourier}
    \RequirePackage[T1]{fontenc}
    \RequirePackage{microtype}
  } {}

\ifthenelse{\boolean{with-hyperref}}
  {
    \RequirePackage[dvipsnames]{xcolor}
    \RequirePackage[pdftitle={\@title}, pdfauthor={\@author}, pdfcreator={PDFLaTeX with edmaths}, pdfpagelayout=OneColumn, colorlinks=true, linkcolor=black, urlcolor=black, citecolor=black]{hyperref}
  \ifthenelse{\boolean{with-colour}}
    {
      \hypersetup{linkcolor=Sepia, urlcolor=NavyBlue, citecolor=Sepia}
    } {}
  } {}

\ifthenelse{\boolean{with-fancyhdr}}
  {
    \RequirePackage{fancyhdr}
    \pagestyle{fancy}
    \fancyhf{}
    \fancyhead[RO,LE]{\thepage}
    \fancyfoot[RO,LE]{\thepage}
    \fancyhead[LO]{\it\@title}
    \fancyhead[RE]{\@author}
    \fancyfoot[RE,LO]{}
  } {}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up the text body height      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% For the text height, we calculate the largest number of lines that gives us no more than 4cm bottom margin.
% This depends on the line spacing, which we need first.

\setstretch{\stretchfactor}

% Debug only: In the next line, \XXXfactor contains the number of lines on a text-only page.
%\newlength{\XXXunit}\setlength{\XXXunit}{1pt}\newlength{\XXXfactor}\setlength{\XXXfactor}{1pt + ((672pt - \topskip) / \baselineskip) * \XXXunit}
\newlength{\scratchlength}\setlength{\scratchlength}{\topskip + ((672pt - \topskip) / \baselineskip) * \baselineskip + \baselineskip}
\setlength{\textheight}{\scratchlength}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Make the title page etc          %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\maketitle}{%
  \begin{titlepage}
    \singlespacing
    \addtolength{\oddsidemargin}{-0.75cm}
    \begin{center}
    \null\vskip 4.1cm
    \begin{minipage}[t][7.6cm]{10.5cm}
      \begin{center}
      {\LARGE\textbf{\@title}\par}\vfill
      {\Large\textit{\@author}\par}
      \end{center}
    \end{minipage}
    \vfill
    {\Large\degreetext \par University of Edinburgh \par\@date \par}
    \end{center}
  \end{titlepage}
  \if@twoside
    \thispagestyle{empty}
    \cleardoublepage
  \else
    \addtocounter{page}{1}
  \fi
}

\newcommand{\declaration}{%
  \chapter*{Declaration}
  \begin{singlespace}
  I declare that this thesis was composed by myself
  and that the work contained therein is my own,
  except where explicitly stated otherwise in the text.
  \end{singlespace}

  {\raggedleft\vspace{2cm}(\textit{\@author})

  }
}

\renewenvironment{abstract}{\chapter*{\abstractname}}{\addcontentsline{toc}{chapter}{\abstractname}}

\newcommand{\dedication}[1]{%
  \clearpage
  \thispagestyle{plain}
  \vspace*{7cm}
  \begin{center}
    \Large\it #1
  \end{center}
}

%% A special declaration for Year 4 reports
\newcommand{\yfourdeclaration}[1]{%
 \vfill
 \noindent
 This project report is submitted in partial fulfilment of the requirements for the degree of
 \textit{#1}.
}

A: (don't vote I'll delete later but too long for a comment)
I get no error. Add \listfiles and then check the file dates in the list shown at the end of your run.
 *File List*
  report.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 amssymb.sty    2013/01/14 v3.01 AMS font symbols
amsfonts.sty    2013/01/14 v3.01 Basic AMSFonts support
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  amsthm.sty    2004/08/06 v2.20
 edmaths.sty    2007/02/05 Edinburgh maths thesis/report style v0.95
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
setspace.sty    2011/12/19 v6.7a set line spacing
   amscd.sty    1999/11/29 v2.0
listings.sty    2013/08/26 1.5b (Carsten Heinz)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
 lstmisc.sty    2013/08/26 1.5b (Carsten Heinz)
listings.cfg    2013/08/26 1.5b listings configuration
   color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
lstlang1.sty    2013/08/26 1.5b listings language file
supp-pdf.mkii
    umsa.fd    2013/01/14 v3.01 AMS symbols A
    umsb.fd    2013/01/14 v3.01 AMS symbols B
  omlcmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions
  omscmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions
 ***********

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is it possible to run tidy at google app engine PHP It seems like google app engine php doesn't have tidy extension, my question is , is there any way to use tidy on google app engine php?
Thanks,

A: The tidy extension is bundled with PHP 5 and greater, and is installed using the --with-tidy configure option. So if phpinfo() does not mention tidy I guess there's no (easy) way to be able to use it.
App Engine includes the PHP 5.4 standard library. You can include other pure PHP libraries with your application by putting the code in your application directory. If you make a symbolic link to a module's directory in your application directory, appcfg.py will follow the link and include the module in your app. Maybe this approach would work with the (old) PECL tidy package, although I'm not really sure about that.

A: Unfortunately you can't use tidy package at all in Google App Engine. You can see all enabled extensions from  https://cloud.google.com/appengine/docs/standard/php/runtime#enabled_extensions
Few extensions you can enable though but tidy is not one of them. I would recommend to find some alternatives of tidy. You can also take a look at An alternative to php tidy?


text:
Q: C# ComboBox SelectedIndex is always at 0 once Items are added EDIT This has nothing to do with SelectedIndex property... If the default combobox text is "ABCD" and there's an item that starts with "ABCD", the combobox will find that item and select it.
How do I prevent that from happening?
Original
When I click ComboBox1 (Windows Forms - Visual Studio), the system will search the database for information to insert into a ComboBox (string[,] Intel is where this information is stored). Before the Click event is called, the ComboBox is with SelectedIndex = -1. This is how it adds Intel into this specific combobox:
for (int Dim1 = 0; Dim1 < Intel.GetLength(0); Dim1++)
{
    ComboBox1.Items.Add(Intel[Dim1, 1]);
}

My problem is: Once I add the first item, ComboBox1.SelectedIndex is set to 0. Even if I use ComboBox1.SelectedIndex = -1;, it still assumes it as 0. Same with ComboBox1.SelectedValue = null; or ComboBox1.Text = null;. By TextBox1.Text = ComboBox1.SelectedIndex;, TextBox1.Text will display -1.
I've done this with another ComboBox, and it works... It does set the selectedindex at -1, and the user will see the default text I want, which is not included in the items - and it can't. So, I'm thinking this must be some property I've set wrong.

A: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox.selectedindex?redirectedfrom=MSDN&view=netcore-3.1#remarks
To deselect the currently selected item, set the SelectedIndex to -1. You cannot set the SelectedIndex of a ComboBox item to -1 if the item is a data-bound item.
See this image:


text:
Q: SQL Management Studio can't drag table / object from Explorer to Query Editor Ok guys, SQL Management Studio can't drag table / object from Explorer to Query Editor
I tried , and I don't know where to enable this future again :( Tried options menu... Aaaaa... Some one please save my day!

A: First... does drag drop still work on other programs that aren't SSMS?  I doubt that this is a feature you can turn on/off within SSMS.  It probably is something deeper in the OS.
If so - is the shift key or ctrl key on your keyboard stuck down?  I would also check options in the start menu.  Disabling drag/drop and right/click can be done at the system level or by group policy - but again it would affect more than just SSMS.
I've also heard of various viruses disabling drag/drop but again, it seems strange it would only affect SSMS.

A: In SSMS 2012 (maybe other versions too), go to "Tools|Options|Text Editor|General" and click "Drag & Drop text editing".  That should do the trick.

A: Fixed by hitting the ESC key a couple of times in my case.

A: If you open SSMS in 'Run as Administrator' mode then Drag Drop file won't work.
Close SSMS and open SSMS normally.
Drag-drop file feature will work.

A: I was copying a large file in the background which seems to mess this up.  When the file was finished copying, drag and drop worked again.

A: Interestingly enough, I went to download ShellExview as a previous post displayed.
http://www.nirsoft.net/utils/shexview.html#DownloadLinks
I found that different versions of the Office libraries were loaded in memory, for me it happened as I am loading Visio 2010 and 2016 at different times.
A reboot fixed the issue.
(Exported the list before reboot when the issue was present and after reboot)


text:
Q: xamarin app crashes because of xamforms.controls.calendar I just updated my MAC system and all packages in my Xamarin Project, now the App always crashes due to the following exception:
Object reference not set to an instance of an object
at XamForms.Controls.iOS.CalendarButtonRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0004a] in :0
  at (wrapper delegate-invoke) .invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:350
  at Xamarin.Forms.BindableObject.ClearValue (Xamarin.Forms.BindableProperty property, System.Boolean fromStyle, System.Boolean checkAccess) [0x000c6] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:96
  at Xamarin.Forms.BindableObject.ClearValue (Xamarin.Forms.BindableProperty property) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:48
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Dispose (System.Boolean disposing) [0x0007d] in <db18f72e3204406988680543da513ace>:0
  at Xamarin.Forms.Platform.iOS.ViewRenderer2[TView,TNativeView].Dispose (System.Boolean disposing) [0x0005c] in :0
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.Dispose (System.Boolean disposing) [0x00064] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ButtonRenderer.cs:66
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:71
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:39
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Dispose (System.Boolean disposing) [0x00058] in <db18f72e3204406988680543da513ace>:0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:71
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:39
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Dispose (System.Boolean disposing) [0x00058] in :0
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildRemoved (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:124
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:161
  at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x00007] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:334
  at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:750
  at Xamarin.Forms.TemplatedView.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:92
  at Xamarin.Forms.Layout.OnInternalRemoved (Xamarin.Forms.View view) [0x00012] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:473
  at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002b] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:436
  at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <429bba1022b24f41b20fdc67c7554c2d>:0
  at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <429bba1022b24f41b20fdc67c7554c2d>:0
  at System.Collections.ObjectModel.ObservableCollection1[T].RemoveItem (System.Int32 index) [0x00021] in <429bba1022b24f41b20fdc67c7554c2d>:0
  at System.Collections.ObjectModel.Collection1[T].RemoveAt (System.Int32 index) [0x00027] in :0
  at Xamarin.Forms.TemplateUtilities.OnContentChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00018] in D:\a\1\s\Xamarin.Forms.Core\TemplateUtilities.cs:63
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311
  at Xamarin.Forms.ContentView.set_Content (Xamarin.Forms.View value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:11
  at XamForms.Controls.Calendar+<>c__DisplayClass89_0.b__0 () [0x00027] in <78f786ab622940c1b06f4cfd4c30dce1>:0
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSAction.cs:152
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:86
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65
  at myproject.iOS.Application.Main (System.String[] args) [0x00001] in /Users/lin/Projects/myProject/iOS/Main.cs:12


text:
Q: How to maximize a desktop application using TestStack.White after it is minimized I have a code to minimize a desktop application using a minimize button at the top right button of the application.
But once it is minimized i have to do some operations with the browser and again switch back to desktop application. I face code issue here, where i need to click the application button in the task bar to maximize it.
Can anyone please help me on this or any other way to maximize the minimized application? i shouldn't close or reopen it, as some uploading will be in-progress.

A: WinPattern is no longer public. Instead, you can use a DisplayState property.
E. g.:
wnd.DisplayState= DisplayState.Maximized;

A: So after looking into how White exposes the WindowPattern I was able to find a public property on the Window class called WinPattern which returns a WindowPattern. After getting the window pattern you should be able to call WindowPattern.SetWindowVisualState.
The link to the WindowPattern.SetWindowVisualState has some good example code for how to use this pattern. I added the code that is most relevant with the use of White here since White handles getting the pattern for you.
///--------------------------------------------------------------------
/// <summary>
/// Calls the WindowPattern.SetVisualState() method for an associated
/// automation element.
/// </summary>
/// <param name="windowPattern">
/// The WindowPattern control pattern obtained from
/// an automation element.
/// </param>
/// <param name="visualState">
/// The specified WindowVisualState enumeration value.
/// </param>
///--------------------------------------------------------------------
private void SetVisualState(WindowPattern windowPattern,
    WindowVisualState visualState)
{
    try
    {
        if (windowPattern.Current.WindowInteractionState ==
            WindowInteractionState.ReadyForUserInteraction)
        {
            switch (visualState)
            {
                case WindowVisualState.Maximized:
                    // Confirm that the element can be maximized
                    if ((windowPattern.Current.CanMaximize) &&
                        !(windowPattern.Current.IsModal))
                    {
                        windowPattern.SetWindowVisualState(
                            WindowVisualState.Maximized);
                        // TODO: additional processing
                    }
                    break;
                case WindowVisualState.Minimized:
                    // Confirm that the element can be minimized
                    if ((windowPattern.Current.CanMinimize) &&
                        !(windowPattern.Current.IsModal))
                    {
                        windowPattern.SetWindowVisualState(
                        WindowVisualState.Minimized);
                        // TODO: additional processing
                    }
                    break;
                case WindowVisualState.Normal:
                    windowPattern.SetWindowVisualState(
                    WindowVisualState.Normal);
                    break;
                default:
                    windowPattern.SetWindowVisualState(
                    WindowVisualState.Normal);
                    // TODO: additional processing
                    break;
            }
        }
    }
    catch (InvalidOperationException)
    {
        // object is not able to perform the requested action
        return;
    }
}


text:
Q: Times when inline functioning cannot be used Im studying inline functions in C++ and have come to a section concerning limitations of its use. It says:

The compiler also cannot perform
  inlining if the address of the
  function is taken implicitly or
  explicitly.

Can someone explain to me, perhaps with an example of some sort, what exactly this means?

A: You can mark any function as inline. Even a virtual function, even a recursive function, even a veeery veery long function, even if its address is taken. The main difference between an inline and non-inline function is that the definition of the former must appear in every translation unit (aka source file) in which it is used ( that's why inline functions are usually defined in the .h file), whereas the latter must be defined only once. You can use the inline function in every way that you can use a non-inline one.
The actual inlining part is up to the compiler. It can ignore your request, if, for example, your function is recursive or too long. On the other hand, the compiler may choose to inline a function which you haven't actually marked as inline.

A: There are two somewhat separate decisions the compiler makes concerning function inlining:

*

*whether a particular function call is inlined;

*whether a non-inline version of the function exists.

The first is decided by the compiler on a case-by-case basis, if inlining is possible at that point. It won't be possible if the function is virtual, or called through a function pointer, and it can't determine at compile time which function is to be called. It won't be possible if the definition is not available to the compiler, perhaps because it is defined in a different translation unit and the compiler does not do "whole program optimisation". The decision may, or may not, be influenced by whether the function is declared inline, and other factors such as its size and how often it is called.
The second depends on whether a non-inline version is required. It will be required if any call to it is not inlined. It will also (as per your quotation) be required if anything needs the address of the function, as then it must have an address. This can happen either directly (for example by assigning the address to a function pointer), or indirectly (for example, virtual functions will need their address stored somewhere to look up at runtime according to the object's dynamic type).
The existence of the non-inline version will not prevent any particular call to the function from being inlined, although it's possible that it might influence the compiler's decision, particularly if it's configured to optimise for code size.
To summarise, your quotation is simplistic and not entirely accurate; the compiler can still "perform inlining" if the address is taken, it just can't omit the non-inline version.

A: It's just wrong: ability to inline a function call is not affected by computing 2+2 or by taking the address of the function somewhere.
Which book or article are you reading?
On the other hand, if the address is taken then it might be practically impossible to remove the separate machine code function.
Cheers & hth.,


text:
Q: Prevent arrow keys input numbers in Python (Tkinter) I use the keyboard library and after giving  on_press_key  to my numpad, the arrow keys give the following values:
left - 4
Up - 8
Right - 6
Down - 2
How can I prevent this?
It looks like the arrow keys share the same event as those corresponding numeric keys


text:
Q: Kivy Canvas redrawing after touch event
I wanna make a small game, but I need some help... I'm pretty newbie both in python and in kivy. I'm using python 3.4 and kivy 1.8.0.
The game will have some drawn elements which will be draggable and/or disappering:
-if you click on a point you could drag it
- if you click anywhere one point will disappear
I've tried to make the disappearing part of it, but I got stuck.
I made a dummy code with some points on the canvas, where you could see how I wanted to approach the problem:
--> draw some points
--> remove / reposition one of point
--> clear canvas
--> redraw

Somehow I cannot redraw it. But I managed to clear the canvas... Could you help me?
Also I would like to get help/ideas how to make it draggable...
Thank you, here's my code:
from kivy.app import App
from kivy.graphics import Ellipse
from kivy.uix.boxlayout import BoxLayout
import random

class CustomLayout(BoxLayout):

    def __init__(self, **kwargs):
        super(CustomLayout, self).__init__(**kwargs)
        self.a = []
        self.points_pos()
        with self.canvas.after:
            self.draw_points()

    def points_pos(self):
        i=0
        x = random.sample(range(800), 10)
        y = random.sample(range(640), 10)
        for i in range(10):
            pos = [0,0]
            pos[0]=x[i]
            pos[1]=y[i]
            self.a.append(pos)
        print(self.a)

    def draw_points(self):
        i = 0
        for i in range(len(self.a)):
            self.circle = Ellipse(
                size = (25,25),
                pos =  (self.a[i][0],self.a[i][1])
                )

    def random_remove(self):
        point = self.a[random.randint(0,len(self.a)-1)]
        self.a.remove(point)

    def update(self):
        self.parent.canvas.clear()
        with self.canvas:
            self.draw_points()

    def on_touch_down(self, touch):
        self.random_remove()
        self.update()

class MainApp(App):

    def build(self):
        root = CustomLayout()
        return root

if __name__ == '__main__':
    MainApp().run()

A: def update(self):
    self.parent.canvas.clear()
    with self.canvas:
        self.draw_points()

You clear the parent's canvas, which includes the canvas of your BoxLayout. After that it doesn't matter how many things you draw on the BoxLayout, they won't ever be displayed.
To fix this you probably want to simply do self.canvas.clear() instead, but actually this is very inefficient and isn't a good way to work with kivy's canvases (though it will work fine for small numbers of instructions). It is much better to keep references to all your canvas instructions and only remove the specific one(s) you no longer want, with self.canvas.remove(...).

A: As this question got more views as I excepted, I leave here a working example:
from kivy.app import App
from kivy.logger import Logger
from kivy.graphics import Color, Ellipse, Line
from kivy.uix.boxlayout import BoxLayout

class CustomLayout(BoxLayout):

    def __init__(self, **kwargs):
        super(CustomLayout, self).__init__(**kwargs)

        self.canvas_edge = {}
        self.canvas_nodes = {}
        self.nodesize = [25, 25]

        self.grabbed = {}

        #declare a canvas
        with self.canvas.after:
            pass

        self.define_nodes()
        self.canvas.add(self.canvas_nodes[0])
        self.canvas.add(self.canvas_nodes[1])
        self.define_edge()
        self.canvas.add(self.canvas_edge)

    def define_nodes(self):
        """define all the node canvas elements as a list"""

        self.canvas_nodes[0] = Ellipse(
            size = self.nodesize,
            pos =  [100,100]
            )

        self.canvas_nodes[1] = Ellipse(
            size = self.nodesize,
            pos =  [200,200]
            )

    def define_edge(self):
        """define all the edge canvas elements as a list"""

        self.canvas_edge = Line(
            points =  [
                self.canvas_nodes[0].pos[0] + self.nodesize[0] / 2,
                self.canvas_nodes[0].pos[1] + self.nodesize[1] / 2,
                self.canvas_nodes[1].pos[0] + self.nodesize[0] / 2,
                self.canvas_nodes[1].pos[1] + self.nodesize[1] / 2
                ],
            joint = 'round',
            cap = 'round',
            width = 3
            )

    def on_touch_down(self, touch):

        for key, value in self.canvas_nodes.items():
            if (value.pos[0] - self.nodesize[0]) <= touch.pos[0] <= (value.pos[0] + self.nodesize[0]):
                if (value.pos[1] - self.nodesize[1]) <= touch.pos[1] <= (value.pos[1] + self.nodesize[1]):
                    touch.grab(self)
                    self.grabbed = self.canvas_nodes[key]
                    return True

    def on_touch_move(self, touch):

        if touch.grab_current is self:
            self.grabbed.pos = [touch.pos[0] - self.nodesize[0] / 2, touch.pos[1] - self.nodesize[1] / 2]
            self.canvas.clear()
            self.canvas.add(self.canvas_nodes[0])
            self.canvas.add(self.canvas_nodes[1])
            self.define_edge()
            self.canvas.add(self.canvas_edge)
        else:
            # it's a normal touch
            pass

    def on_touch_up(self, touch):
        if touch.grab_current is self:
            # I receive my grabbed touch, I must ungrab it!
            touch.ungrab(self)
        else:
            # it's a normal touch
            pass

class MainApp(App):

    def build(self):
        root = CustomLayout()
        return root

if __name__ == '__main__':
    MainApp().run()


text:
Q: No gnome shell on xrandr new display OS: Ubuntu 20.04.3 x86_64
Kernel: 5.11.0-36-generic
CPU: Intel Celeron B800 (2) @ 1.5GHz
Graphics: Intel HD Graphics
I forced xrandr to output into VGA-1 and it works but what doesn't is gnome in that display, I can move my mouse there, I can drag windows there but there's no background and nothing. It is also not detected by Gnome Settings.
I used xrandr --output VGA-1 --mode 1920x1080_60.00 --right-of LVDS-1
xrandr output is
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192
LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
   1366x768      59.99*+  40.00
   1360x768      59.80    59.96
   1280x720      60.00    59.99    59.86    59.74
   1024x768      60.04    60.00
   960x720       60.00
   928x696       60.05
   896x672       60.01
   1024x576      59.95    59.96    59.90    59.82
   960x600       59.93    60.00
   960x540       59.96    59.99    59.63    59.82
   800x600       60.00    60.32    56.25
   840x525       60.01    59.88
   864x486       59.92    59.57
   800x512       60.17
   700x525       59.98
   800x450       59.95    59.82
   640x512       60.02
   720x450       59.89
   700x450       59.96    59.88
   640x480       60.00    59.94
   720x405       59.51    58.99
   684x384       59.88    59.85
   680x384       59.80    59.96
   640x400       59.88    59.98
   576x432       60.06
   640x360       59.86    59.83    59.84    59.32
   512x384       60.00
   512x288       60.00    59.92
   480x270       59.63    59.82
   400x300       60.32    56.34
   432x243       59.92    59.57
   320x240       60.05
   360x202       59.51    59.13
   320x180       59.84    59.32
   2560x1440_60.00  60.00
   2432x1368_60.00  60.00
   2176x1224_60.00  60.00
   1920x1080_60.00  60.00
   1664x936_60.00  60.00
   1600x900_60.00  60.00
   1536x864_60.00  60.00
   1440x810_60.00  60.00
VGA-1 disconnected 1920x1080+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1920x1080_60.00  60.00*
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
  a1920x1080_60.00 (0x161) 172.800MHz -HSync +VSync
        h: width  1920 start 2040 end 2248 total 2576 skew    0 clock  67.08KHz
        v: height 1080 start 1081 end 1084 total 1118           clock  60.00Hz


text:
Q: Application gives the error as null pointer exception during TestNG //Class1 Code
int TestCaseID;
public  WebDriver driver =null;

@Parameters({ "browser" })
@BeforeMethod
public void BrowserOpen(String browser) throws Exception {
    BaseClass Base = new BaseClass();
    this.driver = Base.OpenBrowser(browser);
}

//Base class
public WebDriver driver = null;

    public WebDriver OpenBrowser(String browser) throws Exception
    {
        if(browser.equalsIgnoreCase("Chrome"))
        {
            System.setProperty("webdriver.chrome.driver", ReadPropertyFile.ReadProperty("ChromePath"));
            driver=new ChromeDriver();
            driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
            driver.get(ReadPropertyFile.ReadProperty("URL"));

        }

        if(browser.equalsIgnoreCase("Firefox"))
        {
            driver=new FirefoxDriver();
            driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
            driver.get(ReadPropertyFile.ReadProperty("URL"));
            driver.manage().window().maximize();

        }

        if(browser.equalsIgnoreCase("IE"))
        {
            System.setProperty("webdriver.ie.driver", ReadPropertyFile.ReadProperty("IEPath"));
            driver=new InternetExplorerDriver();
            driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
            driver.get(ReadPropertyFile.ReadProperty("URL"));
            driver.manage().window().maximize();

        }
        return driver;

    }

I am invoking web driver in another class and returns driver from that class.
But issue happening is when code goes out of the @BeforeMethod it gives exception as null pointer exception as below.I have added both the base class code and actual code.
java.lang.NullPointerException
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:212)
    at org.openqa.selenium.support.ui.FluentWait.<init>(FluentWait.java:102)
    at org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:71)
    at org.openqa.selenium.support.ui.WebDriverWait.<init>(WebDriverWait.java:45)
    at commonLibrary.BaseClass.SafeInput(BaseClass.java:83)
    at pageFactoryMethods.LoginPageMethod.fnLogin(LoginPageMethod.java:32)
    at pageFactoryTestCases.LoginPageTestCases.TC1(LoginPageTestCases.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1137)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:753)
    at org.testng.TestRunner.run(TestRunner.java:607)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:368)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:363)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:321)
    at org.testng.SuiteRunner.run(SuiteRunner.java:270)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1209)
    at org.testng.TestNG.runSuites(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1096)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)


text:
Q: Is there something wrong with my disk partition? # fdisk -l
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758    41940991    20719617    5  Extended
/dev/sda5          501760    41940991    20719616   8e  Linux LVM

Disk /dev/mapper/a--vm--vg-swap_1 doesn't contain a valid partition table

Is there a overlap between sda2 and sda5 in terms of start/end?
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/a--vm--vg-root 18180876 3424464 13809828 20% /

My initial disk is 20G, then I expended a LVM partition but it didn't seem to work?
Command (m for help): v
Remaining 41949182 unallocated 512-byte sectors

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders, total 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00094bdb

A: The structure of Master Boot Record only allows to have four primary partitions. There are cases when one needs more than four partitions and for those extended partitions are used. Extended partitions allow having logical volumes within them.

Your sda2 is an extended partition and sda5 is located within sda2. This is perfectly normal. I don't think the word "overlapp" applies here. In your case sda5 occupies all of sda2 space, and is the only logical volume, so it might be questionable if such layout is rational. But it is definitely valid.
To expand sda5, you would need to expand sda2 first, provided you have enough unpartitioned  disk space around it.
If you are not very confident with what you are doing I would totally recommend to backup all data first and start using partitioning tool with graphical interface - it will make things easier and more visual. Try using gparted or similar software.


text:
Q: Rust io::stdin to get set directory I'm new to Rust and have been fighting with this for a while now and I'm sure there's just something about the language that I'm missing. So please excuse me if this obvious.
I'm using the io::stdin().read_line() to get a path/directory inputed from the user and then use that to loop through the files and/or directories in that entered path.
I'm also setting default path for if the user doesn't enter anything. For this I'm using env::current_dir(). When I use this default value fs::read_dir() works fine, but when I try to use the variable set by the user input the system does a panic while running.
let current_directory = env::current_dir().unwrap().display().to_string();
let mut new_directory = String::new();

io::stdin().read_line(&mut new_directory)
    .expect("Failed to read line");

let dir = if new_directory == "\n" {
    current_directory
} else {
    new_directory
};

let paths = fs::read_dir(dir).unwrap();

for path in paths {
    println!("Name: {}", path.unwrap().path().display());
}

As I mentioned I get a panic when it hits the fs::read_dir(dir) line while the program is running not during while it's compiling.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/libcore/result.rs:860:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

and just incase it helps, here's with the backtrace:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/libcore/result.rs:860:4
stack backtrace:
  0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
  1: std::panicking::default_hook::{{closure}}
  2: std::panicking::default_hook
  3: std::panicking::rust_panic_with_hook
  4: std::panicking::begin_panic_new
  5: std::panicking::begin_panic_fmt
  6: rust_begin_unwind
  7: core::panicking::panic_fmt
  8: core::result::unwrap_failed
  9: <core::result::Result<T, E>>::unwrap
  10: quad_videos::main
  11: __rust_maybe_catch_panic
  12: std::rt::lang_start
  13: main

Thanks in advance


text:
Q: How to add thousand separator in react native
*

*I have used balance.toLocalString but it's not working in Android

*balance.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); not working proper in android(also formating decimal values like 12.2364 to 12.2,364)

A: For this, I have found two solutions

*

*Fixed the decimal value
return balance.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");

*Spit the balance and after formatting rejoin the balance
`
function thousandFormatter(number) {
const THOUSAND_FORMATTER = new RegExp(/\B(?=(\d{3})+(?!\d))/g);
     if (!Boolean(number)) {
         return;
     }
     const numberSplitter = ".";
     if (number.includes(numberSplitter)) {
         const numberToFormat = number.split(numberSplitter);
         return [numberToFormat[0].replace(THOUSAND_FORMATTER, ","), numberToFormat[1]]
             .join(numberSplitter)
             .trim();
     }
     return number.replace(THOUSAND_FORMATTER, ",");
 }


text:
Q: How can I print out the int values from the array? The code below shows my progress, but I cannot print the numbers that were entered. I don't know where to put println("you entered the following numbers") in the loop so that it'll show up when the loop stops.
import java.util.Scanner;

public class aufgabe5 {
    public static void main(String[] args) {

        int x;
        Scanner input = new Scanner(System.in);
        System.out.println("How much numbers do you want to enter?");
        x = input.nextInt();
        int j = 1;
        Scanner scanner = new Scanner(System.in);
        int[] numbers = new int[x];
        for (int i = 0; i < numbers.length; i++) {
            System.out.println("Enter the " + j++ + ". number:");
            numbers[i] = scanner.nextInt();

        }
        System.out.println("You entered following numbers");
        System.out.println(x);
    }
}

A: Change x like
System.out.println(x);

to Arrays.toString(int[]) like
System.out.println(Arrays.toString(numbers));

Edit
To print the array reversed,
String str = Arrays.toString(numbers).replace(", ", " ,");
str = str.substring(1, str.length() - 1);
System.out.println(new StringBuilder(str).reverse().insert(0, "[")
            .append("]"));

A: Intialize the String before the loop, then keep adding the values to it.
After the loop finishes you can print the whole thing.
String someVar="You entered following numbers: ";
for(int 1=0;i<array.length;i++)
{
    someVar=someVar+numbers[i]+",";
}
System.out.println(someVar);


text:
Q: How to properly handle applicationWillTerminate in an iPhone app? I'm currently experimenting with writing an iPhone app and am having some trouble with understanding how to exit an app properly.
Basically, I have a view controller that is displaying a table of data to the user.  At the same time, when the application launches, it spins a new thread to retrieve data from the server and update the table in the background.  The data is being written to a local sqlite db.
My concern is that without proper cleanup and termination, it is entirely possible that the worker thread could be terminated at a nasty spot (like, during a write) and leave the sqlite db corrupted.  I would like to signal the thread to exit cleanly if the app is asked to terminate.  But, as far as I can tell, dealloc isn't even called for most of my objects, so nothing actually exits cleanly.  Right now, I'm trying to handle applicationWillTerminate and possibly calling some sort of custom finalize method on one or two important classes.
So...

*

*Is there a guaranteed window of time that I have to respond and exit cleanly with applicationWillTerminate is called?

*Are there other suggestions for exiting cleanly?

A: when applicationWillTerminate called, you have 5 sec to do all, that you want
If your application takes more than 5 seconds to quit, the system may terminate it outright.
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ApplicationEnvironment/ApplicationEnvironment.html


text:
Q: Windows 8 Activation behind a proxy How to activate windows 8 behind the college proxy server? Error code : 0x8004fe33
I've tried netsh winhttp to configure the system proxy but no success.

A: The most common cause of that error code is a proxy requiring basic authentication but not configured to whitelist some specific URLS needed for activation. The suggested work-around for the user (in opposition to the proxy owner) is to use phone activation, by running "slui 4".


text:
Q: Avoid installing SharePoint 2010 on host I'm running Windows 8 with Hyperv on a laptop that has 16GB ram. I have two virtual machines, one running DC and one running SharePoint Ent. Now, does anyone have experience in using Visual Studio on the HOST instead of in the guest for SharePoint development. It would be great to use Visual Studio and other dev tools in the HOST as it's so much faster.
Thanks.

A: To run it on the host, SharePoint would have to be installed on the host.  With the resources allocated properly things should perform ok.  I develop on local VMs on my laptop with only 16GB of ram.  SSD drives will help, but I get by without them currently.

A: I normally program on my host's copy of Visual Studio unless the client explicitly requires the use of the Built in Visual Studio SharePoint projects. (SharePoint is not installed on the host)
You need to create a backup of the SharePoint assemblies found in the 12/14 hive on your host most can be found in the ISAPI folder. You can then reference the assemblies with in Visual Studio from this local location. Visual Studio includes Assembly Location hints that are sent to the compiler.
It is also worth while coping the XML schema so you can get intellisense with in xml files, but you will have to add the schema to your Visual Studio.
As you are unable to use the "Magic" Visual SharePoint project types you will ether need to have a hand crafted WSP build script using MakeCab and the relevant Manafest.xml file or use one of the WSP communality solutions (E.G. WSP builder ect. though many are not being maintained any more).
It becomes a bit more complicated for Remote Debugging, there are issues with cross domain debugging so this can take some time to configure. You need to store the PDB files on the target, but it is all quite possible. Note there are security issues with Remote Debugging across domains so be sure to only enable this on your Host to VM network only as you user name and password are transmitted unencrypted.
Alternatively you could just access your source control and do any debugging on the VM's copy of Visual Studio.
I would recommend build scripts in powershell that copy the WSP and deploy it as well as copying the relevant PDB files.
Have a look at Chris O'Brian's Continuous Integration posts to help with the automation of moving the Wsp from the Host to the VM.
I have used this approach for 5 years and have had no issues.


text:
Q: Reading data from a binary file in C I am new to C and trying to write some data into a binary file and read from it. There are character arrays and integers as the members of structure. When I run my code and open the binary file through notepad, I can only see the strings are being read by the program. Here is my code:
#include <stdio.h>
#include <stdlib.h>

typedef struct{
    unsigned int sample_offset;
    char receiver_name[20];
    double sample_rate;
    unsigned int channel;
    unsigned int bits;
    char file_type[11];
    unsigned int freq_band;
    double channel_bandwidth;
    double firmwire_version;
    double header_version;
}sampleInfo;

int main(){
    // Writing into the file
    FILE * fw;
    sampleInfo data = {64, "Gadfly", 51.2, 2, 4, "Spreadsheet", 1,24, 1.0,1.0 }, read_data;

    fw = fopen("test.bin","wb");
    if (!fw)
    {
        printf("Unable to open the file\n");
        exit(1);
    }
    else{
        fprintf(fw,"Sample offset: %u bytes\n\n", data.sample_offset)
        fprintf(fw,"Receiver's name: %s\n\n", data.receiver_name);
        fprintf(fw,"Sample rate: %.2lf Mega-samples per second\n\n", data.sample_rate);
        fprintf(fw,"Number of channels used: %u\n\n", data.channel);
        fprintf(fw,"Number of bits per I and Q sample: %u\n\n", data.bits);
        fprintf(fw,"File type: %s\n\n", data.file_type);
        fprintf(fw,"Frequency band per channel: L%u\n\n",data.freq_band);
        fprintf(fw,"Channel Bandwidth: %.1lfMHz\n\n", data.channel_bandwidth);
        fprintf(fw,"Firm-wire version: %.1lf\n\n",data.firmwire_version);
        fprintf(fw,"Header version: %.1lf\n\n",data.header_version);
    }
    fwrite(&data,sizeof(sampleInfo),1, fw);
    fclose (fw);

    // Reading from the file
    FILE * fr;
    fr = fopen("test.bin", "rb");
    if (! fr){
        printf("Unable to open the file\n");
        exit(1);
    }
    else
    {
        fread(&read_data,sizeof(sampleInfo),1, fr);
        fscanf(fr,"Sample offset: %u bytes\n", &(read_data.sample_offset));
        fscanf(fr,"Receiver's name: %s\n", read_data.receiver_name);
        fscanf(fr,"Sample rate: %lf Mega-samples per second\n", &(read_data.sample_rate));
        fscanf(fr,"Number of channels used: %u\n", &(read_data.channel));
        fscanf(fr,"Number of bits per I and Q sample: %u\n",&(read_data.bits));
        fscanf(fr,"File type: %s\n", read_data.file_type);
        fscanf(fr,"Frequency band per channel: L%u\n", &(read_data.freq_band));
        fscanf(fr,"Channel Bandwidth: %lf MHz\n", &(read_data.channel_bandwidth));
        fscanf(fr,"Firm-wire version: %lf\n", &(read_data.firmwire_version));
        fscanf(fr,"Header version: %lf\n\n\n", &(read_data.header_version));
    }
    fclose(fr);
    return 0;
}

And this is what I am getting as output:
Output
I can't figure out why the program is showing only the print statements as output and not reading all the data from the file properly. I have tried using the fread() function outside the else statement as well and got the same result.
Any suggestions?

A: you're writing the data struct in binary after the human readable version, but you're reading the binary data struct first and then the human readable version.
Ignoring the fact that you're writing the information twice in the file (human readable, then binary), if you write/read in the same order it should work.
Here is a 'fixed' version:
#include <stdio.h>
#include <stdlib.h>

typedef struct{
  unsigned int sample_offset;
  char receiver_name[20];
  double sample_rate;
  unsigned int channel;
  unsigned int bits;
  char file_type[11];
  unsigned int freq_band;
  double channlel_bandwidth;
  double firmwire_version;
  double header_version;
} sampleInfo;

int main(){
  // Writing into the file
  FILE * fw;
  sampleInfo data = {64, "Gadfly", 51.2, 2, 4, "Spreadsheet", 1,24, 1.0,1.0 };
  sampleInfo read_data;

  fw = fopen("test.bin","wb");
  if (!fw)
    {
      printf("Unable to open the file\n");
      exit(1);
    }
  else
    {
      fprintf(fw,"Sample offset: %u bytes\n\n", data.sample_offset);
      fprintf(fw,"Receiver's name: %s\n\n", data.receiver_name);
      fprintf(fw,"Sample rate: %.2lf Mega-samples per second\n\n", data.sample_rate);
      fprintf(fw,"Number of channels used: %u\n\n", data.channel);
      fprintf(fw,"Number of bits per I and Q sample: %u\n\n", data.bits);
      fprintf(fw,"File type: %s\n\n", data.file_type);
      fprintf(fw,"Frequency band per channel: L%u\n\n",data.freq_band);
      fprintf(fw,"Channel Bandwidth: %.1lfMHz\n\n", data.channlel_bandwidth);
      fprintf(fw,"Firm-wire version: %.1lf\n\n",data.firmwire_version);
      fprintf(fw,"Header version: %.1lf\n\n",data.header_version);
      fwrite(&data,sizeof(sampleInfo),1, fw);
      fclose (fw);
    }

  // Reading from the file
  FILE * fr;
  fr = fopen("test.bin", "rb");
  if (!fr)
    {
      printf("Unable to open the file\n");
      exit(1);
    }
  else
    {
      fscanf(fr,"Sample offset: %u bytes\n\n",&(read_data.sample_offset));
      fscanf(fr,"Receiver's name: %s\n\n", read_data.receiver_name);
      fscanf(fr,"Sample rate: %lf Mega-samples per second\n\n", &(read_data.sample_rate));
      fscanf(fr,"Number of channels used: %u\n\n", &(read_data.channel));
      fscanf(fr,"Number of bits per I and Q sample: %u\n\n",&(read_data.bits));
      fscanf(fr,"File type: %s\n\n", read_data.file_type);
      fscanf(fr,"Frequency band per channel: L%u\n\n", &(read_data.freq_band));
      fscanf(fr,"Channel Bandwidth: %lf MHz\n\n", &(read_data.channlel_bandwidth));
      fscanf(fr,"Firm-wire version: %lf\n\n", &(read_data.firmwire_version));
      fscanf(fr,"Header version: %lf\n\n", &(read_data.header_version));
      fread(&read_data,sizeof(sampleInfo),1, fr);
      fclose(fr);
    }
  return 0;
}

For efficiency, get rid of the fprintf/fscanf lines and just keep the compact binary version. Open the file in notepad and verify it is not human readable.
Here is the optimized binary version:
#include <stdio.h>
#include <stdlib.h>

typedef struct{
  unsigned int sample_offset;
  char receiver_name[20];
  double sample_rate;
  unsigned int channel;
  unsigned int bits;
  char file_type[11];
  unsigned int freq_band;
  double channlel_bandwidth;
  double firmwire_version;
  double header_version;
} sampleInfo;

int main(){
  // Writing into the file
  FILE * fw;
  sampleInfo data = {64, "Gadfly", 51.2, 2, 4, "Spreadsheet", 1,24, 1.0,1.0 };
  sampleInfo read_data;

  fw = fopen("test.bin","wb");
  if (!fw)
    {
      printf("Unable to open the file\n");
      exit(1);
    }
  else
    {
      fwrite(&data,sizeof(sampleInfo),1, fw);
      fclose (fw);
    }

  // Reading from the file
  FILE * fr;
  fr = fopen("test.bin", "rb");
  if (!fr)
    {
      printf("Unable to open the file\n");
      exit(1);
    }
  else
    {
      fread(&read_data,sizeof(sampleInfo),1, fr);
      printf("Sample offset: %u bytes\n\n", read_data.sample_offset);
      printf("Receiver's name: %s\n\n", read_data.receiver_name);
      printf("Sample rate: %.2lf Mega-samples per second\n\n", read_data.sample_rate);
      printf("Number of channels used: %u\n\n", read_data.channel);
      printf("Number of bits per I and Q sample: %u\n\n", read_data.bits);
      printf("File type: %s\n\n", read_data.file_type);
      printf("Frequency band per channel: L%u\n\n", read_data.freq_band);
      printf("Channel Bandwidth: %.1lfMHz\n\n", read_data.channlel_bandwidth);
      printf("Firm-wire version: %.1lf\n\n", read_data.firmwire_version);
      printf("Header version: %.1lf\n\n", read_data.header_version);
      fclose(fr);
    }
  return 0;
}


text:
Q: How to convert Row to Column using Pivot? I am trying to convert rows to column
This is my table records
Records
SrID    ProID   Year    Qty   Months
-------------------------------------
4444    112112  2019    22    THREE
4444    112112  2019    44    FOUR
4444    112112  2019    20    FIVE
2244    112112  2019    17    SIX
5555    112112  2019    16    SEVEN

4444    222111  2019    5     ONE
4444    222111  2019    4     FOUR
4444    222111  2019    55    FIVE
2244    222111  2019    20    SIX

Expected Result
SrID    ProID   One   Two    Three    Four    Five   Six   Seven
----------------------------------------------------------------
4444    112112  null  null   22       44      20     null  null
2244    112112  null  null   null     null    null   17    null
5555    112112  null  null   null     null    null   null  16

4444    222111  5     null   null     4       55     null  null
2244    222111  null  null   null     null    null   20    null

I tried like below
SELECT
    SrID,ProID,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN
FROM
    Records rec
PIVOT
(
    MAX(rec.Qty)
    FOR Months IN (ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN)
)AS P

But I got the result in a wrong way, like
SrID    ProID   One   Two    Three    Four    Five   Six   Seven
----------------------------------------------------------------
4444    112112  null  null   22       null    null   null  null
4444    112112  null  null   null     44      null   null  null
4444    112112  null  null   null     null    20     null  null

can give me solution with how it works.

A: Everything looks good to me:
CREATE TABLE [dbo].[myTable](
    SrID[numeric](10),
    ProID[numeric](10),
    Year[numeric](10),
    Qty[numeric](10),
    Months[varchar](20) NULL)

INSERT INTO [myTable] VALUES
(4444,   112112, 2019 ,   22    ,'THREE'),
(4444,   112112, 2019 ,   44    ,'FOUR'),
(4444,   112112, 2019 ,   20    ,'FIVE'),
(2244,   112112, 2019 ,   17    ,'SIX'),
(5555,   112112, 2019 ,   16    ,'SEVEN'),
(4444,   222111, 2019 ,   5     ,'ONE'),
(4444,   222111, 2019 ,   4     ,'FOUR'),
(4444,   222111, 2019 ,   55    ,'FIVE'),
(2244,   222111, 2019 ,   20    ,'SIX')

--select * from [myTable]

SELECT
    SrID,ProID,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN
    FROM [dbo].[myTable] rec
    PIVOT
    (
        MAX(rec.Qty)
        FOR Months IN (ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN)
    )AS P
order by 2,1

/*
Result:
SrID    ProID   ONE TWO THREE   FOUR    FIVE    SIX SEVEN
2244    112112  NULL    NULL    NULL    NULL    NULL    17  NULL
4444    112112  NULL    NULL    22  44  20  NULL    NULL
5555    112112  NULL    NULL    NULL    NULL    NULL    NULL    16
2244    222111  NULL    NULL    NULL    NULL    NULL    20  NULL
4444    222111  5   NULL    NULL    4   55  NULL    NULL
*/

Can you see any diference with your table/data/query?


text:
Q: Is there any way to find the width of a character in a fixed-width font, given the size, style, etc.? Is there any way to find the width of a character (the distance between the beginning of a character to the beginning of the next character) in a given fixed width font in a given size, style, etc. (e.g. Courier New, Bold, size 16)?
Basically I need to determine what the width of a TextBox should be for n characters per line (the Font is only known at runtime so I cannot simply hardcode the numbers).
What is the best way to find the width of a character? Or is there a better way to determine the width of the TextBox?

A: I once wrote an extension method for strings to get its screen size depending on the font family, size etc.
public static Size GetScreenSize(this string text, FontFamily fontFamily, double fontSize, FontStyle fontStyle, FontWeight fontWeight, FontStretch fontStretch)
{
    fontFamily = fontFamily ?? new TextBlock().FontFamily;
    fontSize = fontSize > 0 ? fontSize : new TextBlock().FontSize;
    var typeface = new Typeface(fontFamily, fontStyle, fontWeight, fontStretch);
    var ft = new FormattedText(text ?? string.Empty, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, fontSize, Brushes.Black);
    return new Size(ft.Width, ft.Height);
}

You can use it this way:
"Hello World".GetScreenSize(fontFamily, 12, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);

You can also use the default style of TextBlock:
"Hello World".GetScreenSize(null, 0, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);

You can also have a look at extensionmethod.net for the same information.
Edit:
If you have a fixed-width font, you could calculate the width using an arbitrary character like this:
double width = "X".GetScreenSize(fontFamily, 12, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal) * numbersOfCharacters;


text:
Q: node automation for files move into another folder
*

*Is it possible to write the same shell script file in node js

*

*providing my code below

cd /home/webapps/project1/folder1
for f in *.csv
do
   cp -v $f /home/webapps/project1/folder2/${f%.csv}$(date +%m%d%y).csv
done

*

*what I am trying to achieve is given below

I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones. So want to take a back up for this data. How can i copy all these files in to a another folder by renaming the files with current date while copying.

A: Here is a working example using fs
var fs = require('fs'),
    input_path = '/home/webapps/project1/folder1/',
    output_path = '/home/webapps/project1/folder2/';

fs.readdir(input_path, function(err, files) {
    var date = new Date();

    date = ('0' + (date.getMonth()+1)).slice(-2) + ''
         + ('0' + date.getDate()).slice(-2) + ''
         + ('0' + (date.getFullYear())).slice(-2);

    files.forEach(function(file) {
        var name, extension;

        // Check for *.CSV files
        if (file.toLowerCase().indexOf('.csv') !== file.length - 4) return;

        name = file.substr(0, file.length - 4);
        extension = file.substr(-4);

        // Copy file
        fs.createReadStream(input_path + file).pipe(fs.createWriteStream(output_path + name + date + extension));
    });
});


text:
Q: keep "session only" cookies, iOS I'm creating an app that connects to a website, and I don't want the user to need to enter their user credentials every time the app loads. The website returns a session cookie (no expiry date set). Is there any problem with me holding on to that cookie indefinitely? If I just reload it when the app starts, it seems to work.
Thanks!

A: Each application has its own cookie store. So if there is no expiration on the cookie, and you don't delete it, and the app isn't deleted, then there's no problem with using it for as long as you like.

EDIT Here are some links for more opinions and insight:

*

*Persisting Cookies In An iOS Application?"

*iPhone: NSHTTPCookie is not saved across app restarts
My opinion on the matter is that the mobile environment is fundamentally different from the desktop environment. "Quitting" a mobile application is in no way similar to quitting a desktop application. Quitting a mobile application is similar to switching focus on a desktop. You would not expect to re-authenticate every time you pressed Cmd-Tab.
Limiting the life of session tokens is a valuable security precaution, but is correctly implemented on the server side, not the client side. If the server is designed to allow a session to persist indefinitely (because the desktop app is never quit), then there is no reason to not continue the session on a mobile platform in a similar way.
Note that there are other solutions, such as storing the user credentials in keychain so that you can reuse them. This is appropriate in many cases, but it actually is a lower-security solution than persisting the session token indefinitely. If you're going to hold onto an authentication credential forever, it's better that it be a single-purpose token (i.e. a session cookie) rather than a multi-use username and password.

A: There is no problem in you allowing this cookie to be set, each application has a cookie store from which you can if you need to check the cookies, however I assume that since this is only a session cookie, you will only need to allow it's existence and let the user leverage the web service until such time the user logs out.
I have done this with some of my apps also.
Good luck.


text:
Q: How to integrate a usb signature pad with my UWP application? In my UWP application i have to show the signature which is captured by a usb connected signature pad(model Scriptel - ST1501).
After some research I have found that this model uses EasyScript Device Interface.
But i don't understand how to integrate this with my application project.
Thanks in advance.