text:
Q: Amplify GraphQL API incompatible with iOS 14 deployment target? (flutter) When using the package amplify_api 0.1.0, if the deployment target is anything other than 9.0, iOS app will not build. Removing the API dependency or using ios: 9.0 in the podfile results in a successful build. Anyone know what's wrong or how to fix it?
Here's the output, which includes lots of errors, many of which seem repetitive.
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    /Users/USER/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio-0.6.9/darwin/Classes/UriAudioSource.m:25:84: warning: 'stringByReplacingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByRemovingPercentEncoding instead, which always uses the recommended UTF-8 encoding. [-Wdeprecated-declarations]
            item = [[IndexedPlayerItem alloc] initWithURL:[NSURL fileURLWithPath:[[uri stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] substringFromIndex:7]]];
                                                                                ^
    In module 'UIKit' imported from /Users/USER/APPS/APPNAME/ios/Pods/Target Support Files/just_audio/just_audio-prefix.pch:2:
    In module 'Foundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:596:1: note: 'stringByReplacingPercentEscapesUsingEncoding:' has been explicitly marked deprecated here
    - (nullable NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)enc API_DEPRECATED("Use -stringByRemovingPercentEncoding instead, which always uses the recommended UTF-8 encoding.", macos(10.0,10.11), ios(2.0,9.0), watchos(2.0,2.0), tvos(9.0,9.0));
    ^
    1 warning generated.
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:59:25: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
            return try data.withUnsafeBytes { (bytes:UnsafePointer<UInt8>) -> Data in
                            ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:29: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^~~~~~~
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:83:57: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
                strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                            ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:33: warning: initialization of 'UnsafeMutablePointer<UInt8>' results in a dangling pointer
                    strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: implicit argument conversion from '[UInt8]' to 'UnsafeMutablePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
                    strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                                ^~~~~~~
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:145:61: note: use the 'withUnsafeMutableBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
                    strm.next_out = UnsafeMutablePointer<UInt8>(&buffer)
                                                                ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/Compression.swift:140:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
            data.withUnsafeBytes { (ptr:UnsafePointer<UInt8>) -> Void in
                 ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:172:13: warning: 'SecTrustEvaluate' was deprecated in iOS 13.0: renamed to 'SecTrustEvaluateWithError(_:_:)'
                SecTrustEvaluate(trust,&result)
                ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:172:13: note: use 'SecTrustEvaluateWithError(_:_:)' instead
                SecTrustEvaluate(trust,&result)
                ^~~~~~~~~~~~~~~~
                SecTrustEvaluateWithError
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:220:9: warning: 'SecTrustEvaluate' was deprecated in iOS 13.0: renamed to 'SecTrustEvaluateWithError(_:_:)'
            SecTrustEvaluate(trust, &result)
            ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:220:9: note: use 'SecTrustEvaluateWithError(_:_:)' instead
            SecTrustEvaluate(trust, &result)
            ^~~~~~~~~~~~~~~~
            SecTrustEvaluateWithError
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:221:16: warning: 'SecTrustCopyPublicKey' was deprecated in iOS 14.0: renamed to 'SecTrustCopyKey(_:)'
            return SecTrustCopyPublicKey(trust)
                   ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/SSLSecurity.swift:221:16: note: use 'SecTrustCopyKey(_:)' instead
            return SecTrustCopyPublicKey(trust)
                   ^~~~~~~~~~~~~~~~~~~~~
                   SecTrustCopyKey
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:199:33: warning: 'SSLSetEnabledCiphers' was deprecated in iOS 13.0: No longer supported. Use Network.framework.
                        let resIn = SSLSetEnabledCiphers(sslContextIn, cipherSuites, cipherSuites.count)
                                    ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:200:34: warning: 'SSLSetEnabledCiphers' was deprecated in iOS 13.0: No longer supported. Use Network.framework.
                        let resOut = SSLSetEnabledCiphers(sslContextOut, cipherSuites, cipherSuites.count)
                                     ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:280:13: warning: 'SSLGetPeerDomainNameLength' was deprecated in iOS 13.0: No longer supported. Use Network.framework.
                SSLGetPeerDomainNameLength(sslContextOut, &peerNameLen)
                ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:282:30: warning: 'withUnsafeMutableBytes' is deprecated: use `withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R` instead
                let _ = peerName.withUnsafeMutableBytes { (peerNamePtr: UnsafeMutablePointer<Int8>) in
                                 ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:283:17: warning: 'SSLGetPeerDomainName' was deprecated in iOS 13.0: No longer supported. Use Network.framework.
                    SSLGetPeerDomainName(sslContextOut, peerNamePtr, &peerNameLen)
                    ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1326:14: warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead
            data.withUnsafeBytes { _ = CC_SHA1($0, CC_LONG(data.count), &digest) }
                 ^
    /Users/USER/APPS/APPNAME/ios/Pods/Starscream/Sources/Starscream/WebSocket.swift:1327:16: warning: 'init(bytes:)' is deprecated: use `init(_:)` instead
            return Data(bytes: digest).base64EncodedString()
                   ^
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    /Users/USER/APPS/APPNAME/ios/Pods/AppSyncRealTimeClient/AppSyncRealTimeClient/Connection/AppSyncConnection/AppSyncSubscriptionConnection+ErrorHandler.swift:9:8: error: compiling for iOS 9.0, but module 'Starscream' has a minimum deployment target of iOS 14.0: /Users/USER/APPS/APPNAME/build/ios/Debug-iphonesimulator/Starscream/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
    import Starscream
           ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

A: Adding this to the Podfile did the trick.
post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
+    target.build_configurations.each do |config|
+      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
+    end
   end
 end


text:
Q: You can vote to close two questions as duplicates of each other
Possible Duplicate:
Prevent circular close as exact duplicate loop

As I demonstrated with these two questions:

*

*https://meta.stackexchange.com/questions/61559/can-a-question-be-a-duplicate-of-a-duplicate-of-itself

*https://meta.stackexchange.com/questions/61562/can-a-question-be-a-duplicate-of-a-duplicate-of-itself
You can vote to close two questions as duplicates of each other.

A: I think it would be a bit strange if vote-to-close was disallowed. Consider e.g. voting to close A as a duplicate of B, then being subsequently convinced that B is the better master question. Now you can't give the (possibly final) close vote on B as we can't take back close-votes.
There should however be a check in place when the actual closing happens to prevent circles.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Floating nav buttons and margin 0 auto not displaying correctly I'm building a nav bar for my site. The site has 3 buttons. One on the left one on the center and one on the right. I have the left button floating left. The center button has margin: 0 auto to center it and the right button is floated right. There is a problem with the right button not sitting in the navigation bar. Its over flowing out of the bar. I have attached an image showing this.

A: I guess from your html markup that the right button is literally last, move it to be first, I.e before the left floated element, and it will sit as you expect


text:
Q: onblur event fires only on alternate input fields in Firefox After each form input element, I need to do a verification using the same script.
I used onblur=myFunction("name") (where name is the name= attribute for the form field) in each form element so when the user presses <tab> the cursor advances to the next entry field.
The problem is that Firefox (Linux 93.0 - 64 bit) fires the onblur event ONLY on odd-numbered form input fields. The even numbered ones lose focus without executing the event handler.
Sometimes, but not always, I can force the event to fire by clicking on a different form input field, or rotating out and back into the form. This is very consistent.
Here are two example sequential fields from the real form, 'fname' fires the event, 'lname' does not.
There is a total of 17 named input fields.  The style for these fields does not reflect the "unfocused" state after the cursor exits the field either.
First Name
<input type="text" class="shipping" name="fname" id="fname" maxlength=24 size=20 placeholder="First Name" autofocus onBlur=field_check("fname")>
Last Name
<input type="text" class="shipping" name="lname" id="lname" maxlength=48 size=30 placeholder="Last Name" required onBlur=field_check("lname")>

How to fix this issue?

A: Thank you to those who responded, even though nobody had an answer.  I did a lot of testing and found that the problem is interference between the CSS styles and the inline onBlur, onChange, etc.  When these are removed all works as expected although I can no longer determine when a field has been completed.  Testing, I found that Firefox (Linux and Windows) will respond to every second event, so alternate lines do not get styled and do not report data entry.  Chrome on Windows will hang after the third field is entered and the pop up cannot be dismissed without closing the browser.  An old version of Internet Explorer (!) worked exactly as expected but I couldn't test either Edge or Safari since I don't have them installed here.
Overall, there seems to be some disconnect between the documentation and the implementation on mainstream browsers but I have run out of time to try and find it so I'll have to find a "plan B".


text:
Q: Подгрузка контента без обновления страницы День добрый друзья. Есть одна проблема. Мне нужно сделать подгрузку контента без обновления страницы и c изменением адресной строки. Использовал history.js, но есть беда, у меня присутствуют еще и дополнительные ссылки в контенте, который подгружается. В конечном итоге они не работают. Мне посоветовали посмотреть в сторону pjax, но от него нету толку ибо мне нужно сымитировать обещение по средствам GET запросов, а там возможно только подгружать существующий файл.
Вот мой код ( пример ):

test | test2

и php
<?php
if(isset($_GET['test']))
{
    echo 'ff';
}elseif(isset($_GET['ll']))
{
    echo 'error';
}
?>

можете пожалуйста скинуть пример, мучаюсь уже 4й день, ничего немогу придумать, буду очень признателен


text:
Q: Why called CallVoidMethod throwed use of invalid jobject with JNI I'm a beginner on JNI,when I try to do this :
JNIEXPORT jstring JNICALL Java_com_example_kalexjune_digitalimage_MainActivity_getBalanceMatrix(JNIEnv *env,
                                                                      jobject instance) {
    // TODO
    jclass jcs;
    jmethodID mid;
    jstring arg;
    jobject mobj;
    mobj = (*env)->NewGlobalRef(env,instance);
    jcs = (*env)->GetObjectClass(env,instance);
    mid = (*env)->GetMethodID(env,jcs,"setMatrix","(Ljava/lang/String;)V");
    if(mid!=0){
        (*env)->CallVoidMethod(env,mobj,mid,arg);

        const char * ss = (*env)->GetStringUTFChars(env,arg,0);
        printf("from native: %s\n",ss);
    }

    return (*env)->NewStringUTF(env, "hello,i'm from native");
}

it's logged:
JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0x7f49b9dd2240
...
libart.so (art::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*,...
lib64/libart.so (art::CheckJNI::CallVoidMethod(_JNIEnv*, _jobject*, _jmethodID*, ...)+151)
digitalimage-1/lib/x86_64/libdigital-jni.so (Java_com_example_kalexjune_digitalimage_MainActivity_getBalanceMatrix+174)

My question is:
it means the param which named instance is invalid?
what could i do to fix my issue?
(forget my poor english.. :)

A: You seem to have a non-initialized jstring object, which could easily cause the JNI error. JNI function cannot use jstring as [out] parameter. Actually, java.lang.String parameter for any Java method is "immutable". You could rewrite your piece as
mid = (*env)->GetMethodID(env,jcs,"setMatrix","()Ljava/lang/String;");

arg = (*env)->CallObjectMethod(env, mobj, mid);
const char *ss = (*env)->GetStringUTFChars(env, arg, 0);

(and naturally this requires changes on the Java side, too).
Note that there are other problems in your code snippet: you must call ReleaseStringUTFChars(), and your printf output will go into void: you should use __android_log_print() instead.


text:
Q: Connecting to a SQLLite db with SqlBulkCopy I'm writing a unit test in c# for a function that is responsible for using System.Data.SqlClient.SqlBulkCopy to copy a DataTable to a database server.
I use SQLLite for unit tests, and wanted to connect to my SQLLite in memory database with SqlBulkCopy, and then bulk copy that test data into the SQLLite db.
However, I can't seem to get the connection string right.
I originally tried
var bcp = new SqlBulkCopy("FullUri=file::memory:?cache=shared")

Then
var bcp = new SqlBulkCopy("Data Source=:memory:;Cache=Shared")

Which didn't recognize Cache
So then I tried
var bcp = new SqlBulkCopy("Data Source=:memory:")

out of desperation, which simply timed out when attempting to connect to the database.
Is what I'm trying to accomplish here possible?  If it is, can someone please help me with the connection string?

A: The answer to this was that you cannot connect SqlBulkCopy to a SQLite instance.
What I did to solve my problem (unit test a part of the code that used SqlBulkCopy) was to create a wrapper around SqlBulkCopy that is implemented using SqlBulkCopy for production code, and with a mock bulk copy in test code.  Effectively decoupling the dependency on SqlBulkCopy itself.
Specifically, I created
public interface IBulkCopy : IDisposable {
    string DestinationTableName { get; set; }
    void CreateColumnMapping(string from, string to);
    Task WriteToServerAsync(DataTable dt);
}

Then, I implemented this as
public class SQLBulkCopy : IBulkCopy {

    private SqlBulkCopy _sbc;

    public string DestinationTableName {
        get { return _sbc.DestinationTableName; }
        set { _sbc.DestinationTableName = value; }
    }

    public SQLBulkCopy(IDBContext ctx) {
        _sbc = new SqlBulkCopy((SqlConnection)ctx.GetConnection());
    }

    public void CreateColumnMapping(string from, string to) {
        _sbc.ColumnMappings.Add(new SqlBulkCopyColumnMapping(from, to));
    }

    public Task WriteToServerAsync(DataTable dt) {
        return _sbc.WriteToServerAsync(dt);
    }

}

And in my test utilities I mocked out "bulk copy" with just inserts:
class MockBulkCopy : IBulkCopy {

    private IDBContext _context;

    public MockBulkCopyHelper(IDBContext context) {
        _context = context;
    }

    public string DestinationTableName { get; set; }

    public void CreateColumnMapping(string fromName, string toName) {
        //We don't need a column mapping for raw SQL Insert statements.
        return;
    }

    public virtual Task WriteToServerAsync(DataTable dt) {
        return Task.Run(() => {
            using (var cn = _context.GetConnection()) {
                using (var cmd = cn.CreateCommand()) {
                    cmd.CommandText = $"INSERT INTO {DestinationTableName}({GetCsvColumnList(dt)}) VALUES {GetCsvValueList(dt)}";
                    cmd.ExecuteNonQuery();
                }
            }
        });
    }

Where GetCsvColumnList and GetCsvValueList I implemented as helper functions.

A: You cannot use SqlBulkCopy for SQLite. SqlBulkCopy has been done for SQL Server.
Normally the trick to dramatically improve performance for SQLite is making sure a transaction is used.

Disclaimer: I'm the owner of .NET Bulk Operations
This library is not free but allows you to easily perform and customize all bulk operations:

*

*Bulk Insert

*Bulk Delete

*Bulk Update

*Bulk Merge

Example
// Easy to use
var bulk = new BulkOperation(connection);
bulk.BulkInsert(dt);
bulk.BulkUpdate(dt);
bulk.BulkDelete(dt);
bulk.BulkMerge(dt);

// Easy to customize
var bulk = new BulkOperation<Customer>(connection);
bulk.BatchSize = 1000;
bulk.ColumnInputExpression = c => new { c.Name,  c.FirstName };
bulk.ColumnOutputExpression = c => c.CustomerID;
bulk.ColumnPrimaryKeyExpression = c => c.Code;
bulk.BulkMerge(customers);

EDIT: Answer comment

I want to load a data table from SQLite then "bulk copy" it in other databases

This situation is possible but requires 2 connection
DbConnection sourceConnection = // connection from the source
DbConnection destinationConnection = // connection from the destination

// Fill the DataTable using the sourceConnection
dt = ...;

// BulkInsert using the destinationConnection
var bulk = new BulkOperation(destinationConnection);
bulk.BulkInsert(dt);


text:
Q: How do I require fixtures in a pytest plugin? I followed the pytest docs to create this very simple attempt at a plugin:
import pytest

@pytest.fixture
def derp():
    return 42

def pytest_collect_file(parent, path):
    if path.ext == ".cool":
        return CoolFile.from_parent(parent, fspath=path)

class CoolFile(pytest.File):
    def collect(self):
        for i in ['cool', 'dude']:
            yield CoolItem.from_parent(self, name=i)

class CoolItem(pytest.Item):
    def __init__(self, name, parent):
        super().__init__(name, parent)

    def runtest(self, derp):
        assert False

The only problem here is that runtest does not actually use the fixture. Instead I get FAILED foo.cool::cool - TypeError: runtest() missing 1 required positional argument: 'derp'
So... what do I need to do here in order to make my test take the fixture? If I try and call the fixture then I get an error with documentation that says that I shouldn't be calling it directly instead I should use it as a parameter... but that doesn't work either. Adding fixturenames as a property of CoolItem doesn't work. I've searched pytest plugins for examples, to no avail, and the project linked from the docs is dead.
What should I be doing in order to get my pytest.Item to correctly use fixtures?


text:
Q: MEDIA_BUTTON broadcast receiver doesn't receive headset button actions I use a MediaButtonEventReceiver Broadcast receiver for detecting headset button actions.
    ((AudioManager) getSystemService(AUDIO_SERVICE))
            .registerMediaButtonEventReceiver(new ComponentName(
                    getPackageName(), MediaButtonIntentReceiver.class
                            .getName()));

It's works fine in most phones, But in galaxy s4 when it's own music player plays my app gets ignored and it can't receive media button actions, and music player takes the control of headset button. I tried setting a high priority to my broadcast receiver in manifest file.
<receiver
        android:name=".MediaButtonIntentReceiver"
        android:enabled="true" >
        <intent-filter android:priority="100000000000000" >
            <action android:name="android.intent.action.MEDIA_BUTTON" />
        </intent-filter>
</receiver>

But it didn't worked. How can I solve this problem?


text:
Q: Consultas asíncronas a base de datos Buenas tengo un lío gordo con la programación asíncrona.
Cuando hago consultas a la API de una tienda online, siempre uso el operador await.
Cuando implemento estas en un método, siempre retorno el resultado con Task<T>.
Sin embargo, cuando intento realizar lo mismo con consultas a una base de datos, recibo el error:

Error CS1061  "int" no contiene una definición para "GetAwaiter" ni un
método de extensión accesible "GetAwaiter" que acepte un primer
argumento del tipo "int" (¿falta alguna directiva using o una
referencia de ensamblado?)
Un ejemplo de lo que intento hacer:

public async Task<Int32> ObteNumFills()
{
    Int32 nRegs = 0;
    string connectionString = Cconnexio.RetornaCadenaConnexio(BddParams);
    string query= "Select COUNT(codigo) FROM empleados where edad > 24;
    using (SqlConnection cn = new SqlConnection(connectionString))
    {
        cn.Open();
        SqlCommand cmd = new SqlCommand(query, cn);
        try
        {
            nRegs = await(Int32)cmd.ExecuteScalar();
        }
        catch (Exception e)
        {

            nRegs = 0;
        }
    }
    return nRegs;
}

Esta consulta es muy simple y no debería demorar más de unos milisegundos, pero como podría realizar esta tarea de forma asíncrona?

A: Tienes que utilizar los métodos asíncronos cn.OpenAsync() y cmd.ExecuteScalarAsync()
public async Task<Int32> ObteNumFills()
{
    Int32 nRegs = 0;
    string connectionString = Cconnexio.RetornaCadenaConnexio(BddParams);
    string query= "Select COUNT(codigo) FROM empleados where edad > 24";
    using (SqlConnection cn = new SqlConnection(connectionString))
    {
        //       |
        //       V
        await cn.OpenAsync();
        SqlCommand cmd = new SqlCommand(query, cn);
        try
        {
            //                         |
            //                         V
            nRegs = (Int32)(await cmd.ExecuteScalarAsync());
        }
        catch (Exception e)
        {

            nRegs = 0;
        }
    }
    return nRegs;
}


text:
Q: not able to search text by Browser's ctrl+F, using CanvasKit Flutter trying find workaround for Flutter web!
need Searchable text by Browser's ctrl+F
Preferred - How to use Skia / CanvasKit in Flutter Web?
To run with CanvasKit:
flutter run -d chrome --dart-define=FLUTTER_WEB_USE_SKIA=true

shortcut:
flutter run -d chrome --web-renderer canvaskit

check code snippet -


text:
Q: Make a copy of the first x characters in a column in a dataframe What is the best / easiest way of duplicating a column in a dataframe but to only keep the first x characters of the value.
e.g.
Column 1   New_Column
abcdef      abcd
bbhhsb      bbhh

Thank you for your help

A: We can use substr
df1$New_Column <- substr(df1$Column1, 1, 4)

Or with sub
df1$New_Column <- sub("^(....).*", "\\1", df1$Column1)


text:
Q: C# with Outlook...adding signature to an RTFBody email instead of an HTMLBody I have an email being generated by C# using Outlook Interop but I need to use RTFBody as it is RTF formatted, and not HTMLBody, which is where I see all the examples of being able to add the signatures in there.
I am attempting to do something similar but this is no working for me.  Any advice to get this working in Outlook 2016?
MyOutlook.Mailitem oMailItem =(MyOutlook.MailItem)oApp.CreateItem(MyOutlook.olItemType.olMailItem);
oMailItem.Display(oMailItem); //create the empty mail item
oMailItem.To = emailform.ToMain;
oMailItem.CC = ccStrings;
oMailItem.BCC = emailForm.BCC;
oMailItem.Subject = emailForm.Subject;
oMailItem.RTFBody = GetRTBText(); //function to get RTF byte array

private byte[] GetRTBText() {
   Clipboard.Clear();
   RTBBody.SelectAll();
   RTBBody.Copy();
   return Encoding.UTF8.GetBytes(Clipboard.GetText(TextDataFormat.Rtf));

}

UPDATE:
So it looks like I can get the signature to display when I do the similar trick to oMail.HTMLBody with the omail.RTFBody and concatentate something with it.  The problem now is that the original item doesn't display because it says you can't add byte[]. I either need to override the + operator for this instance or figure out how to add an empty byte arr to it...
So I've tried to concatenate the byte array being returned with an empty byte array. Throws an out of memory exception.  I've tried to concatenate with the oMailItem.RTFBody email item itself, same issue...
not sure what else to do...when I do this, even though it throws an error, the Signature appears, just the body of the email doesn't.

A: You can read RTF body into a hidden RTF control, load the RTF signature file data, then insert it into the RTF control - I used EM_EXSETSEL / EM_STREAMIN (SF_RTF | SFF_SELECTION) Windows API messages for that. You can then stream the resulting RTF out.

A: OK, I figured a workaround way to do this by displaying the email so the signature would show, then taking the HTMLBody of the mailItem, and putting it into a webbrowser document instance, and then copying and pasting that to the Rich Text Box, and then encoding the rich text box text into a byte array in the RTFBody.
It works to put the proper information in there but without proper fonts and colors.  If there is another way to use the actual HTMLBody instead I would like to know how...


text:
Q: Magento 1.9.4.1 Invoice emails are sent before the order confirmation emails are sent After placing an order in Magento 1.9.4.1, an order receives the status of 'Processing'. The funny thing is that Invoice emails are sent immediately, and a couple fo minutes later, the order confirmation emails are sent.
Both (order confirmations emails and order emails) are enabled. Has anyone had experienced these issues before? It should be the other way around (so order confirmation emails first, and then the invoice emails)

A: Later versions of magento 1 introduced an email queue mechanism. Caused more problems that it solved in my opinion.
Order emails cronjob Magento 1.9.0.1
But that's why


text:
Q: Enable user authentication in Mongo DB We are at Mongo 3.2. We deployed our first app with mongo without user authentication in db schema.
Now we want to enable authentication at db level but want to avoid application downtime doing the same.
Is it possible in Mongo that we enable this authentication at DB level to avoid anyone to log in and run commands through console.
Application should not take down time.

A: MongoDB 3.2 and earlier require downtime and a coordinated restart of your deployment and application to enable access control: all clients and members of a deployment must use authentication once enabled. There is a localhost exception that allows you to create the first user on the admin database after authentication is enabled.
With planning this can be a relatively quick process, but to minimize potential downtime I strongly recommend first testing in a representative staging environment.
Enabling access control and authentication is an obvious security measure but still leaves you vulnerable to other possible attacks. For example, you should also Configure TLS/SSL to secure your network communication and restrict remote network access via firewall or perhaps a VPN/VPC between your application servers and your MongoDB deployment.
For a full list of security measures and links to relevant tutorials, see the Security Checklist in the MongoDB manual.
There are several steps that you can test in a staging environment to help ensure the transition goes smoothly, including:

*

*Generate a valid keyfile or x.509 certificate for internal authentication between members of your replica set or sharded cluster.

*Write a JavaScript file to create the initial user administrator and any required user accounts/roles.

*Ensure that you have properly configured authentication by trying to login without any credentials as well as with valid/invalid credentials.

*Test external access to your deployment to confirm your firewall configuration.

*Make sure the MongoDB driver you are using has been updated to support MongoDB 3.2 and that your application is able to successfully login after you have enabled authentication and any other security measures.

MongoDB 3.4 --transitionToAuth
Another option worth mentioning for future consideration (although generally not the fastest path to enabling authentication on an existing deployment) would be upgrading to MongoDB 3.4.
MongoDB 3.4 includes a new --transitionToAuth option that enables a rolling upgrade to authentication; see: Enforce Keyfile Access Control in a Replica Set without Downtime.


text:
Q: Laravel 5 input old is empty My routes is here
Route::get('sign-up', ['as' => 'signUp', 'uses' => 'UserController@signUpGet']);
Route::post('sign-up', ['as' => 'signUpPost', 'uses' => 'UserController@signUpPost']);

Controller

return redirect('signUp')->withInput();

And View
    <form role="form" method="POST" action="{{route('signUpPost')}}">
        <input type="text" class="form-control" name="username" value="{{ old('username') }}">
</form>

The {{old()}} function return empty value.

EDIT

I took
NotFoundHttpException in RouteCollection.php line 145:

A: Your problem looks like you are not actually submitting the username in the first place:
<form role="form" method="POST" action="{{route('signUpPost')}}">
        <input type="text" class="form-control" name="username" value="{{ old('username') }}">
</form>

There is no 'submit' button inside the form. If you submit outside the form - then the username will not be included.
Add the submit button inside your form - then try again
<form role="form" method="POST" action="{{route('signUpPost')}}">
        <input type="text" class="form-control" name="username" value="{{ old('username') }}">
        <input type="submit" value="Submit">
</form>

Edit - also your controller is wrong. It should be this:
 return redirect()->route('signUp')->withInput();

A: All you are missing is to Flash the Input to the session. This is so it's available during the next request.
     $request->flash();

Do that just before calling to View your form.
Source: http://laravel.com/docs/5.1/requests#old-input

A: My problem here was caused by "data-prefill" in the input. Once I removed this, it worked.

A:
first('username')) has-error @endif">
              Enter user name
              <input type="text" name="username" class="form-control rtl basic-usage" id="username" placeholder="Enter user name" value="{!! old('username') !!}">
              {{$errors->first('username')}}

above form  field will show old value entered.
will show validation error (you have to specify error separately.)
have a place holder.
bootstrap to look better.(add bootstrap)

A: Your name in the register view should correspond with keys in create() and validate() method inside your RegisterController file.

A: You can try this: {{ Input::old('username') }}.


text:
Q: .NET 3.5 SP1 as a requirement (or should I try for 3.5 w/o SP1)? We're creating a WPF custom control targeted at .NET 3.5. It is very compelling to use StringFormat property in bindings, but this was only added in SP1.
So the question is: how many potential users will we be cutting off by changing the requirement from .NET 3.5 to .NET 3.5 SP1? Or is it safe to assume that more or less every user who has .NET 3.5 already has SP1 (or will have it in the not so distant future)?
Your opinions are highly appreciated. Thanks.

A: For large corporations, SP1 might still be slow to deploy to desktops - simply that it is a fair amount of testing etc, and unless you've got a good reason to do it, you'd be tempted not to.
And for individuals - it can be a big download unless you've got a fat pipe (which not everyone does).
For example, at my work we've deployed to the web-servers (since they need it), but not to user desktops. If I had a need to push SP1 I would, but I don't see much point until then.
You might also want to see if your code would run on Client Profile? This is then only a <30MB install away... although I've never actually seen anyone use Client Profile in anger (if you're going to have to do a deployment, heck: push the big one...).
So it really depends: who are the users of this app? Can you strong-arm them to upgrade? Or at least "encourage" them ;-p

A: How are you deploying your WPF application? If by installer then can you not just add SP1 as a prerequisite and let the installer sort the rest out?
You should be able to bundle SP1 with your installer (if you're sending out traditional media), or allow it to be downloaded.

A: .net 3.5 sp1 will be on Windows Updates for everyone with .net installed, so unless it's a big company with very slow deployment strategies I would say it shouldn't be a problem.
Also, in such a comapny with those deployment policies I wouldn't expect to find .net 3.5 at all.
I personally started selling a WPF application almost the moment .net 3.0 was released, everyone is always talking about the big download but I've never got a complaint about it from a real potential user, only from other developers or IT people in forums. (if your target audience has a lot of people still using dial-up then you have different problems, and probably no .net 3.5 either)


text:
Q: How can I compile a javascript library for the browser? I would like to use a library (handlebars-helpers) in the browser. I tried following the instructions for that, but  hey don't seem to work.
Most importantly though I'd like to know what I am doing, and not only copy-paste, also because the same problem will probably pop up again when I try using handlebars-intl.
What should I google for, in order to find a basic tutorial on what's supposed to go on under the hood here? It it browserify?

A: I think you can use hbsfy.
It compiles Handlebars templates to plain Javascript. The compiled templates only have one copy of the Handlebars runtime so they are lightweight and fast!
Please go through https://www.npmjs.com/package/hbsfy for more details.


text:
Q: Excel VBA to set Pivot Table filter with values between start and end value I am trying to set filters in pivot table. The pivot table filter values range from 1 to 16. If start value=5 and end value=10, the pivot filters should be set to select the 5,6,7,8,9,10. Here is the code I have. It is selecting filter values from 1 to 10. I want the code to select 5 to 10. Please help
Sub Macro1()
    s = CStr(Range("J1").Value) 'start
    e = CStr(Range("K1").Value) 'end
    With ActiveSheet.PivotTables("PivotTable1").PivotFields("WK")
        .ClearAllFilters
        .EnableMultiplePageItems = True
        For i = 1 To .PivotItems.Count
            MsgBox .PivotItems(i).Name
            If .PivotItems(i).Name < s And .PivotItems(i).Name > e Then
                .PivotItems(.PivotItems(i).Name).Visible = False
            End If
        Next i
    End With
End Sub

A: If PivotField "WK" is a Row or Column field, then you don't need to loop; you can simply apply a filter to the PivotField. It's also a good idea to qualify your range references with a worksheet.
Sub foo()
    Dim ws As Worksheet
    Set ws = ActiveSheet
    With ws.PivotTables("PivotTable1").PivotFields("WK")
        .ClearAllFilters
        .PivotFilters.Add2 _
            Type:=xlCaptionIsBetween, _
            Value1:=ws.Range("J1").Value, _
            Value2:=ws.Range("K1").Value
    End With
End Sub

If PivotField "WK" is a Page field, then you do need to loop - but you are confusing your data types, and you have applied an AND operator where you mean OR. You can try this:
Sub FilterPageField()
    Dim pt As PivotTable
    Dim pf As PivotField
    Dim pi As PivotItem
    Dim lPi As Long
    Dim lStart As Long
    Dim lEnd As Long

    lStart = CLng(ActiveSheet.Range("J1").Value)
    lEnd = CLng(ActiveSheet.Range("K1").Value)
    Set pt = Sheet1.PivotTables("PivotTable1")
    Set pf = pt.PivotFields("WK")

    pf.ClearAllFilters
    For Each pi In pf.PivotItems
        lPi = CLng(pi.Caption)
        pi.Visible = lPi >= lStart And lPi <= lEnd
    Next pi
End Sub

A: Im not sure if this is an answer exactly, it may be a solution...
What I usually do for this kind of problem is add a helper / filter column to the source data. Something to the effect of
if(and(source_data_col<j1,source_data_col>k1),true,false)

Then add that column to the pivot table filter.


text:
Q: Do not understand how loop is determining how many asterisks to print I am a beginner at learning Java. I have stumbled upon a problem that I can not figure out. How is the loop in the code determining how many asterisk to print out. I keep looking at this part of the code..
asterisk < myArray[counter]

Could someone please explain in the simplest of terms how this works, because every time I think of the counter, I see it as nothing but the index that it is pointing to at that time in the loop.
public class Main {

    public static void main(String[] args) {

        int[] myArray = {12, 7, 9, 11, 23};

        System.out.println("Value Distribution");

        //Start of outer for loop
        for( int counter = 0; counter < myArray.length; counter++){

            //Start of inner for loop
            for( int asterisk = 0; asterisk < myArray[counter]; asterisk++)

                System.out.print("*");

            System.out.println();

        }//End of outer for loop

A: Simply put
asterisk < myArray[counter]

Means that it's checking whether amount of asterisks is less than the value from myArray[counter].
So when you have
counter = 0
You also have
myArray[counter] = 12.
Which means in your inner for loop, it will print asterisks until asterisk is no longer lesser than 12. Thus, going from 0-11 will print 12 asterisks.

A: The line you have highlighted is testing that the loop index asterisk is less than the value in the myArray array an index counter.
Since counter is the index variable for the first loop, this will increase each time the outer loop executes.
So, in the first iteration of the outer loop, the inner loop repeats until asterisk is greater than or equal to 12 (the value of myArray at index 0).
In the second iteration of the outer loop, the inner loop repeats until asterisk is greater than or equal to 7 (the value of myArray at index 1).
And so on.
This is why the program outputs the following:
************
*******
*********
***********
***********************

A: In words...

*

*For each value X in {12, 7, 9, 11, 23}

*

*Print * X times

*Print new line

every time i think of the counter, i see it as nothing but the index that it is pointing to at that time in the loop

Correct. counter is the position of the myArray. You need that to access the value at myArray[counter] to determine how many asterisks to print.
However, the same result could be acheived without counter by using an enhanced for-loop
for (int howManyAsterisks : myArray) {
    for (int a = 0; a < howManyAsterisks; a++) System.out.print("*");
    System.out.println();
}

A: In simple terms, the first loop runs to the length of the array 'myArray' which in this case equals to 5. Then the second loop runs every time to length of the individual items in the 'myArray' (i.e. 12 times for the first time, 7 for the second time and so on).
Hope this helps you.


text:
Q: Make last children as first children using c# windows store app I want to manipulate children elements of my canvas to go back and bring to front
I have two buttons in my app

*

*Send to Back

*Bring to front

For Bring to front I am just removing it from canvas and adding it again it makes it to be in front.
DrawCanvas.Children.Remove(myimage);
DrawCanvas.Children.Add(myimage);

Now I want to make functionality of send to back. For this I had to make selected children as first element. How do I perform that?

A: Give the Insert method of the child collection a try:
DrawCanvas.Children.Remove( myimage );
DrawCanvas.Children.Insert( 0, myimage );

See: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.uielementcollection.aspx
Or even better:
DrawCanvas.Children.Move( DrawCanvas.Children.IndexOf( myimage ), 0 );

That should give better performance. Info at: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.uielementcollection.move.aspx


text:
Q: Inserting an inline icon in an .rst file I am trying to insert an inline image into an .rst file, with no success. I've tried replicating the syntax used by the previous tech writer, as follows:
|icon-copy|
The name of the image file referenced by the above syntax is studio_icon_copy. However, creating an image file called studio_icon_additional, and using the |icon-additional| syntax, doesn't work. I verified that this is the syntax used for all working instances of inline images.
I have also verified that the studio_icon_copy in the folder I'm using is indeed the right image by making a slight change to it and verifying that I see the change on the front end. I've also made sure that the new image I've created is in this same folder.
I've even tried copying and pasting the correct syntax in the desired place and simply replacing copy with additional, which didn't work either.
For what it's worth, I use Notepad++ and work in GitHub. After trying the above I have no clue how to insert it correctly, although I'm pretty sure I'm missing something.
Thank you.

A: Actual quote from https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#substitution-definitions says:
The |biohazard| symbol must be used on containers used to
dispose of medical waste.

.. |biohazard| image:: biohazard.png

This should be actually this way:
.. |biohazard| image:: biohazard.png

The |biohazard| symbol must be used on containers used to
dispose of medical waste.

Always declare |pic| before referencing to it. I think there were some changes to that and documentation wasn't actually updated. You can always add option to make it really small, then you've got certainty that it will look good next to text:
.. |biohazard| image:: biohazard.png
   :height: 25px


text:
Q: rake db:migrate conflicting with pre-loaded data on Heroku PostgreSQL I have an app on Heroku running on Postgres. The problem is: I needed to load some data on one of the tables, and I managed to do it using Heroku's pg:push command. The problem is that it only works after a pg:reset, which resets the database and pre-loads it's initial state, then I have to pre-load the data and then I must run the migrations. But the migrations won't work on this specific table, since it's already loaded with data.
So this is the situation I find myself in: my migrations fail because of this pre-loading, so I had to remove them - but I don't want to deal with these missing migrations everytime I must run them.
The question would be: is there any way to load data on Heroku's Postgres after the migrations have been executed?
Thanks!

A: Try this command:
heroku run rake db:migrate


text:
Q: Ruby program to create even_odd method that accepts the whole number I need help to write even_odd method that accepts an array of whole number.

*

*It should return an array of 2 arrays

*The first nested array should contain only the odd numbers

*The second nested array should contain only the even numbers

*If there are no even or odd numbers, the respective inner array should be empty

Output should look like this : -
even_odd([3, 5, 8, 2, 4, 6])
   [[3, 5], [2, 4, 6, 8]]

even_odd([3, 5])
   [[3, 5], []]

even_odd([2, 4])
   [[], [2, 4]]

I am new to ruby programming, I have tried below but not getting the result :-
def even_odd(numbers)
  arr1, arr2 = []
  idx = 0
  while idx < numbers.length
    if numbers[idx] % 2 == 0
    puts arr1[idx]
    elsif
    puts arr2[idx]
  end
  idx += 1
end
end
puts even_odd([2, 3, 6])

Error :-
main.rb:6:in `even_odd': undefined method `[]' for nil:NilClass (NoMethodError)
    from main.rb:13:in `<main>'

A: puts is a print statement in ruby, not an append one. It also doesn't run a function/method. You'll also want to call the index on the numbers array inside the if...else block.
This should do the trick:
def even_odd(numbers)
  arr1, arr2 = [], []
  idx = 0
  while idx < numbers.length
    if numbers[idx] % 2 == 0
      arr1 << numbers[idx]
    elsif
      arr2 << numbers[idx]
    end
  idx += 1
  end
  return arr1, arr2
end

arrays = even_odd([2, 3, 6])
puts arrays

A: I would do this
def even_odd(numbers)
  numbers.sort.partition(&:odd?)
end

even_odd([3, 5, 8, 2, 4, 6])
# => [[3, 5], [2, 4, 6, 8]]
even_odd([3, 5])
# => [[3, 5], []]
even_odd([2, 4])
# => [[], [2, 4]]


text:
Q: how to timeout the client session in asp.net I'm looking to include a behavior in the base page that, when the session times out (after say 20 min), makes a call back to the client, erases the session cookie, and redirects the user to a "your session has timed out" page.
Before I start coding, I was wondering if there's a functionality in the framework that already handles this.
Thanks.

A: try this
<script language='javascript'>
function SessionTimeOuts()
{
     self.setTimeout("RedirectToLogin();", 'any time period you wish to put here');
}

function RedirectToLogin()
{
     alert('Your session has expired.');
     window.location.href = 'login.aspx'

//any page where you want the redirection
}

</script>

<BODY onload=SessionTimeOuts()'>

A: ASP.NET MembershipProvider should handle this for you

A: Correct me if I am wrong but ASP.Net is already doing this. All you have to do just send an interval value to the client after each postback or ajax call. And with this interval you will also have to execute a timeout function that says "your session has expired" dialog as @geek mentioned below.


text:
Q: This method does not accept null for this parameter I wanted to make a game for a pet care for windows phone 7 but Im having problem whit this it tell me that I have a null method but I don't know why I have a enum From each State in the game.
here is a picture of the message: http://crystalnix.deviantart.com/art/XNa-Problem-396626207?ga_submit_new=10%253A1377747418
This is the main File.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
using Mochi_Mochi_Pets_Life.Script.Screen;

namespace Mochi_Mochi_Pets_Life
{

public class MainFile : Microsoft.Xna.Framework.Game
{
    GraphicsDeviceManager graphics;
    SpriteBatch spriteBatch;
    ScreenStates screentState;

    Rectangle TouchS_Y_X;

    Logo logo;
    Menu0 menu;
    Choose_Pets choose_pets;
    ScreenStates.CurrentGameState GameState;

    public MainFile()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
        Content.RootDirectory = "Script\\Screen";

        choose_pets = new Choose_Pets();

        this.screentState = new ScreenStates();
        this.logo = new Logo(GraphicsDevice);
        this.menu = new Menu0();
        // Frame rate is 30 fps by default for Windows Phone.
        TargetElapsedTime = TimeSpan.FromTicks(333333);

        // Extend battery life under lock.
        InactiveSleepTime = TimeSpan.FromSeconds(1);

        GameState = ScreenStates.CurrentGameState.Logo;

    }

    protected override void Initialize()
    {
        choose_pets.Initialize_choosepets();
        // TODO: Add your initialization logic here
        base.Initialize();
    }

    protected override void LoadContent()
    {
        TouchS_Y_X = new Rectangle(0, 0, 1, 1);
        // Create a new SpriteBatch, which can be used to draw textures.
        spriteBatch = new SpriteBatch(GraphicsDevice);

        if (GameState == ScreenStates.CurrentGameState.Logo)
            this.logo.Load(this.Content, this.GraphicsDevice);

        if (GameState == ScreenStates.CurrentGameState.Menu)
            this.menu.Load_Menu(GraphicsDevice, Content);

        if (logo.FadeOut_logo == true)
            GameState = ScreenStates.CurrentGameState.Menu;

        if (GameState == ScreenStates.CurrentGameState.CharactersChooser)
        this.choose_pets.Load_ChoosePet(this.Content, this.GraphicsDevice);
        // TODO: use this.Content to load your game content here
    }

    protected override void UnloadContent()
    {
        // TODO: Unload any non ContentManager content here
        //this.logo.Unload_logo(Content);
    }

    protected override void Update(GameTime gameTime)
    {

        // Allows the game to exit
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            this.Exit();

                    if (GameState == ScreenStates.CurrentGameState.Logo)
                logo.Update_logo(gameTime);

                    if (GameState == ScreenStates.CurrentGameState.CharactersChooser)
                    choose_pets.Update_petchoose(gameTime);

        // TODO: Add your update logic here

        base.Update(gameTime);
    }

    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.Black);

        spriteBatch.Begin();

                    if (GameState == ScreenStates.CurrentGameState.Logo)
                        logo.Draw(spriteBatch);

                    if (logo.FadeOut_logo == true)
                        menu.Draw_Menu(spriteBatch);

                    if (GameState == ScreenStates.CurrentGameState.CharactersChooser)
                        choose_pets.Draw_petChoose(spriteBatch);

        spriteBatch.End();
        base.Draw(gameTime);
    }
}
}

And This one is the Menu that is giving me the problems
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Content;

    namespace Mochi_Mochi_Pets_Life
    {
class Menu0
{
    Texture2D Text2D_Background;
    Rectangle Rec_Background;

    Texture2D ButtonText2DPlay;
    Rectangle ButtonRecPlay;

    public void Load_Menu(GraphicsDevice Graphics_Menu, ContentManager Content_Menu)
    {
        Content_Menu.RootDirectory = "Content";

        Text2D_Background = Content_Menu.Load<Texture2D>("UI\\MenuBack");
        Rec_Background = new Rectangle(0, 0, Graphics_Menu.Viewport.Width,                 Graphics_Menu.Viewport.Height);

        ButtonText2DPlay = Content_Menu.Load<Texture2D>("UI\\Buttons\\New Games");
        ButtonRecPlay = new Rectangle(Graphics_Menu.Viewport.Width, 400, 150, 40);
    }

    public void Draw_Menu(SpriteBatch Spritebatch_Menu)
    {
        Spritebatch_Menu.Draw(Text2D_Background, Rec_Background, Color.White);
        Spritebatch_Menu.Draw(ButtonText2DPlay, ButtonRecPlay, Color.White);
    }
}
    }

Ok what this does is that when my logo Fade is == true the Game State Jump to Main Manu but it never happen always error I will appreciate your help..

A: Loading_Menu is never called, so the texture Text2D_Background  is always null
You should realize that LoadContent is called only in game initalization, so comparing gamestate there is useless, because  only will load Logo content.
As solution you can load all content at initalization, or you can load it when gamestate changes if needed content  was not loaded before

A: I think your Text2D_Background is null, and that's because you never call Load_Menu.
You check gameState in LoadContent, and it returns false.
if (GameState == ScreenStates.CurrentGameState.Menu)

LoadContent is called only once, I can't understand why you check gameState value.


text:
Q: What does it mean when words are drawn blue in Mathematica? Here is what I mean:
alt text http://img63.imageshack.us/img63/7079/grwb3mmw2gq1bihvt1kb2dn.png
Sometimes I don't know why, I get the names of functions blue. Is there any special reason?

A: It's a form of syntax coloring and/or spell checking.   It means that a symbol named "SavePlogggts" has not yet been defined.  As soon as you evaluate that cell it will define the symbol and it will turn black.

A: It just means it's an as-yet-undefined symbol.


text:
Q: how to handle multiple occurrences for single digit in hive I want to format date coming from source file. I am handling junk values as this column may contain 0 (it could be 0 or 00 or 000 etc.)
select case when capture_date in ('','00','000') then NULL else from_unixtime(unix_timestamp(capture_date,'yyyyMMdd'),'yyyy-MM-dd') end as capt_dt from test_table;
instead of increasing junk values in the list I want to handle it in a generic way meaning if we receive any number of 0's it should populate as NULL .
any solution?

A: It seems there is no point dealing with illegal date literals since they will yield NULL values in any case (unless we might have 7 zeros or more)
hive> with test_table as (select stack(5,'','0','00','000','20170831') as capture_date)
    > select  from_unixtime(unix_timestamp(capture_date,'yyyyMMdd'),'yyyy-MM-dd') as capt_dt
    > from    test_table
    > ;
OK
capt_dt
NULL
NULL
NULL
NULL
2017-08-31

If 7 or more zeros are optional -
hive> with test_table as (select stack(5,'','0','00','000000000000','20170831') as capture_date)
    > select  from_unixtime(unix_timestamp(regexp_replace(capture_date,'^0+$',''),'yyyyMMdd'),'yyyy-MM-dd') as capt_dt
    > from    test_table
    > ;
OK
capt_dt
NULL
NULL
NULL
NULL
2017-08-31

or
hive> with test_table as (select stack(5,'','0','00','000000000000','20170831') as capture_date)
    > select  case
    >             when capture_date not rlike '^0+$'
    >             then from_unixtime(unix_timestamp(capture_date,'yyyyMMdd'),'yyyy-MM-dd')
    >         end as capt_dt
    >
    > from    test_table
    > ;
OK
capt_dt
NULL
NULL
NULL
NULL
2017-08-31


text:
Q: How to get "real-time" temperature from sensor? The following is LM35 Thermal response time in air

The following is temperature reading from LM35 sensor. Horizontal axis is time in sec.

So this is not "real-time" temperature graph. The question is having thermal response graph, how to best adjust real readings from sensor to get "real-time" values?

A: What you probably want to do is deconvolution. For that you need the impulse response function. What you have is the response to a step function. You need to deconvolve the respnse function you have with a step function to get the impulse response function of your instrument and then deconvolve your data with that.
One problem with deconvolution is that it can amplify noise, but I don't know if that will be a problem in your case.
Edit: Details on request.
Let $T(t)$ be the true temperature and $M(t)$ your measured temperature. They are related like this:
$$
M(t)=\int T(\tau)f(t-\tau)d\tau
$$
where $f(t)$ is the impulse response function. What you have is $F(t)$ given by:
$$
F(t)=\int H(\tau)f(t-\tau)d\tau
$$
where $H(t)$ is a Heaviside step function. Fortunately you don't need to deconvolute $F(t)$ as I said above. Simply differentiating $F(t)$ should do:
$$
f(t)=F'(t)
$$
Now, you have $M(t)$ sampled in a number of points $t_i$, let's call the the samples $M_i=M(t_i)$. Similarly, the true values at another set of time points $\tau_j$ can be called $T_j=T(\tau_j)$. The integral can now be approximated with a sum:
$$
M_i=\sum_j T_jf(t_i-\tau_j)\Delta\tau_j
$$
where $\Delta\tau_j$ is the distances between the $\tau_j$:s. This is now a linear equation system:
$$
M_i=\sum_j T_jA_{ij}
$$
with the coefficients given by:
$$
A_{ij}=f(t_i-\tau_j)\Delta\tau_j
$$
Solve it to for $T_j$ to get the true temperatures. The trickier parts might be to make sure $f(t)$ is correctly normalized and choosing your set of $\tau_j$. It should probably be similar to the set of $t_i$, but maybe they should be a bit sparser to make it more robust.
This is the basics. You might have do some tinkering. Also, there are probably more advanced algorithms for deconvolution that are less noise sensitive.

A: You would need to know the transfer function of your sensor, but as a first approximation the graph you have from the manufacturer seems compatible with something like:
$$\frac{dT_s}{dt}=k(T-T_s)$$
where $T$ is the outside temperature and $T_s$ the sensor reading. You could then estimate $T$ as
$$T=T_s+\frac{1}{k}\frac{dT_s}{dt}$$
To figure out $k$, notice that under a stationary $T$, i.e. what the manufacturer graph is showing, the response curve of $T_s$ would be
$$T_s-T_{s0} = T(1-e^{-kt})$$.


text:
Q: How big should my nvarchar column be to store a maximum 255 characters? I need to store 255 characters in a database column of type nvarchar. They characters are UTF-8 and can be multibyte. I am not the best with character encodings, so I'm not sure if that makes sense. I want to hold 255 characters that can be in any language, etc.

A: You can find some simple-to-understand background information about different Unicode encodings in this, which is a chapter I wrote in a manual for an open-source project. That background information will help you to understand some of the details in my answer.
The link to documentation about nvarchar provided by Simmo states that nvarchar is stored in UCS-2 format. Because of this, you will need to convert the UTF-8 strings into UCS-2 strings before storing them in the database. You can find C++ code to do that conversion here.
A subtle but important point is that the conversion code will actually convert into UTF-16, which is a superset of UCS-2 (UTF-16 supports the use of surrogate pairs, while UCS-2 doesn't). I don't use SQL Server so I don't know if it will complain if you try to insert some surrogate pairs into it. (Perhaps somebody else here can confirm whether or not it will).
If SQL Server disallows surrogate pairs, then there will be a limit on the range of languages your application can support, but at least you know that nvarchar(255) is sufficient for your needs.
On the other hand, if SQL Server allows the use of surrogate pairs, then you might want to use nvarchar(510) to allow for the (remote) possibility that every single character will be composed of surrogate pairs.

A: http://msdn.microsoft.com/en-us/library/ms186939.aspx
255 characters.


text:
Q: Hudson error: Unsupported Maven version: 3.0? I configured a local installation of Maven3 in Hudson, and when I tried to build my project using that Maven installation, I get the error: Unsupported Maven version: 3.0. I cannot find documentation that says Hudson does not support Maven v3. What is wrong with Hudson or my configuration?
[INFO] Checking Maven 3 installation environment
[workspace] $ C:\apache-maven-3.0\bin\mvn.bat --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.0
[ERROR] Failure: hudson.AbortException: Unsupported Maven version: 3.0
ERROR: Unsupported Maven version: 3.0

A: You should be using the freestyle project type and the maven 3 build step. Then you do not even need a local Maven 3 install and things will just work. Look at the free Hudson Book I wrote for more documentation on the Maven 3 integration.


text:
Q: How to derive a context which can be used after an inbound request has ended? From the documentation of func (r *Request) Context() context.Context in the net/http package:

For incoming server requests, the context is canceled when the client's connection closes, the request is canceled (with HTTP/2), or when the ServeHTTP method returns.

What is the correct thing to do if I want to complete work related to the request after the ServeHTTP method has returned, for example emitting notifications? I'd like to preserve the context chain in terms of values but simply passing the context originally returned by the above method to the message queue submission API doesn't work as the context may be cancelled before it completes.
Is there an easy way to derive just the values in a context chain without deadline or cancellation? I can manually copy values I have the keys for, but other things that rely on context continuity, like trace, will be absent.
Thanks in advance for any answers.

A:
Is there an easy way to derive just the values?

Out of the box, no.  There are two possibilities I can imagine:

*

*You could make a custom context, that swallows/ignores cancellations. Such a type would need a custom implementation of Done() and Err(), which detected a timeout/cancellation, and ignored it.
This approach has a possible drawback, that you may be referencing values which are expected to go out of scope at the end of a request. This could lead to race conditions or other data integrity issues.
I would advise against this method, although it's probably the closest to what you're asking for. Contexts should be used primarily for cancellation, so heavy use of values in context is an anti-pattern.

*Probably the safer and easier solution, to which you eluded in your question, would be to explicitly copy any values you still care about to a new context created with context.Background().


text:
Q: Reactive Cocoa - UITextView's rac_textSignal doesn't get called when programmatically setting text I'm implementing a chat UI, and using Reactive Cocoa to adjust the chat bubble's size as the user types. Currently, I'm updating the UI's layout based on the textview's rac_textSignal. Everything's working great - except for one bit: when the user sends the message, I programmatically clear the textfield:
_inputTextView.text = @"";

... but the textview's rac_textSignal doesn't activate. I hear this is a feature with ReactiveCocoa - but what's the proper way to build this? Do I need to have an NSString holding the currentlyTypedString, and drive the UI changes when that string updates?

A: Yep, that's correct.
Under MVVM, the view model should be considered the canonical source of UI data and events (which leads to a whole host of important benefits, like better testability). You'd store the typed NSString on the view model, then bind that to the UI.
With MVC, you'd have to use the controller or model instead, but the principle is the same: treat the view as transient data and do the important stuff elsewhere.

A: Just send action:

[self.inputTextView
  sendActionsForControlEvents:UIControlEventEditingChanged];

A: The following is a workaround that works:
[[RACSignal
  merge:@[self.inputTextView.rac_textSignal, RACObserve(self.inputTextView, text)]]
  subscribeNext:^(NSString* text) {
      // do something here
  }];

Thanks to startupthekid on GitHub.


text:
Q: Stop timer on specific Ajax response So I have this function that has a timer of 5 seconds and keeps repeating.
This timer executes a php script that checks for payments and if payment succeeded , it echos back to the main page as ajax response a 'transaction successful'.
The thing is that I want to stop that timer from executing when the 'msg' returns 'transaction successful' .
How can I achieve this? This is how my timer looks:
  var count = 5;
          setInterval(function () {
              count--;

              document.getElementById("fag").innerHTML = count;

              if (count === 0 ) {
                  count = 5;

                  $.ajax({
                      type: 'POST',
                      url: 'ajaxx.php',
                      data: {
                          'checkbalance': 'yes',
                          'email': '<?php echo $user->get_user_data()['email']; ?>',
                          'ip_taken': '<?php echo $_SERVER['REMOTE_ADDR']; ?>'

                      },
                      success: function (msg) {

                          document.getElementById("response").innerHTML = msg;
                      }
                  });

              }

          }, 1000);

A: First store the interval id and use clearInterval() when message has response you want
var interval = setInterval(function() {
  count--;

  $("#fag").text(count);

  if (count === 0) {
    count = 5;
  }
  $.ajax({
    type: 'POST',
    url: 'ajaxx.php',
    data: {
      'checkbalance': 'yes',
      'email': '<?php echo $user->get_user_data()['
      email ']; ?>',
      'ip_taken': '<?php echo $_SERVER['
      REMOTE_ADDR ']; ?>'

    },
    success: function(msg) {
      // clear interval when successful
      if (msg.trim() === 'transaction successful') {
        clearInterval(interval)
      }
      $("#response").html(msg);
    }
  });

}, 1000);


text:
Q: Vibration listener in Android Is it possible to listen for phone vibration in Android?
Basically, I need my background component to wake-up and do some stuff whenever the phone vibrates.

A:
Is it possible to listen for phone vibration in Android?

Sorry, no, not without custom firmware.


text:
Q: How to use caching for custom Twig extension I am working on a Symfony 2.8 project using Twig 1.31, and I would like to add a custom tag to Twig by creating an extension:
class AppExtension extends \Twig_Extension {
   ...
   public function getTokenParsers() {
       return array(new CustomTagTokenParser());
   }
}

class CustomTagTokenParser extends \Twig_TokenParser {
    ...

    public function parse(Twig_Token $token) {
        return new CustomTagNode(...);
    }

    public function getTag() {
        return `customtag`:
    }
}

class CustomTagNode extends \Twig_Node {
    ...
}

Now I can use the customtag within my templates:
{# some Twig template #}
{% customtag %}
    ...some content...
{% endcustomtag %}

This all works fine, and I can alter some content within the extension. However, this is done when rendering the template / when loading the page.
Since some content (as well as the updated result created by the extension) is static, this could easily be cached.
How to update the extension/tag to run only once, when building the cache and not on every page load?

A: According to the symfony doc:

Twig is fast because each template is compiled to a native PHP class and cached. But don't worry: this happens automatically and doesn't require you to do anything.
  And while you're developing, Twig is smart enough to re-compile your templates after you make any changes. That means Twig is fast in production, but easy to use while developing.

In short, Twig caches every templates and renews the cache automatically depending on the value of the kernel.debug and kernel.environment parameters.
If you need some more informations about the internal behavior of twig caching, you should have a look this part of the doc: http://twig.sensiolabs.org/doc/1.x/api.html#compilation-cache
If you need a more advanced strategy, I suggest you to have a look at https://github.com/asm89/twig-cache-extension which provides the ability to cache only given parts of twig templates through a lot of different strategies.

A: New updates released
This extension is not maintained anymore. Please use https://github.com/twigphp/cache-extra instead.
Cache the Entire Twig File and Data
Cache Extension
This package is a Twig extension that provides integration with the Symfony Cache component.
It provides a single cache tag that allows to cache template fragments.
source :
Performance/Caching


text:
Q: Permutation Of String of length n with A B C So I have to count the number of words of length N can be made with alphabets A B and C. (repetition allowed)
But condition is A's should not be together B'S should not be together.
and at-most m C's are allowed.
e.g For words of length n=2 and m=1 (c is allowed only 1 time) the following are allowed:
AB AC BA BC CA CB
Not allowed are AA BB CC (CC is not allowed because atmost 1 C is allowed).
Can anyone please help

A: The $C$s break the string into runs of $AB$s.  Each run has two choices because it can start with $A$ or $B$, then all the other letters are fixed.  I don't see an easy way to catalog them, but if $n=7,m=2$ you can have one run of $AB$, which happens if there are no $C$'s (one possibility), one $C$ at the end (two possibilities), or two $C$'s at the ends (three possibilities) for a total of $12$.  You can have two runs of $AB$ if there is one $C$ in the middle (five possibilities), one $C$ at the end and one in the middle (eight possibilities), or two $C$'s together in the middle (four possibilities) for a total of $48$.  You can have three runs of $AB$ if the two $C$'s are in the middle and separated (six possibilities) for $48$ total.  The grand total is then $108$


text:
Q: c# datagridview in virtual mode Let's say I got a DataTable with columns A,B,C,D,E.
I got a DataGridView that works in virtual mode because I had to add a column that is unbound with DataTable. This additional column is a combobox that combines columns A,B,D values into one, and after user selects an item, than I'd like to read this selected item value for further processing. In method DataGridView1_ValueChanged I try to read that value by:
DataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString()

and compiler shows exception that I should use operator new for initiating the object.
So, seems like I see new row is added visually but I can't access it.
I got stucked in here :(

A: I think you are asking why you can't compile something like this:
using System.Data;
using System.Windows.Forms;

namespace ZZZ
{
    class Program
    {
        private DataTable _table;
        private readonly DataGridView _view = new DataGridView();

        public void Setup()
        {
            CreateTable();
            _view.CellValueChanged += CellValueChanged;
        }

        private void CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            _view[e.ColumnIndex, e.RowIndex].Value.ToString();
        }

        private void CreateTable()
        {
            _table = new DataTable("Table");
            _table.Columns.Add("A");
            _table.Columns.Add("B");
            _table.Columns.Add("C");
            _table.Columns.Add("D");
            _table.Columns.Add("E");
            _table.Columns.Add("Combined");
        }

        static void Main(string[] args)
        {
            var p = new Program();
            p.Setup();
        }
    }
}

Which does seem odd. You should be able to compile that.


text:
Q: Using FOR loop in R to find and replace medians in .csv file I am new on here and new to R.
I have looked through the questions on here and cant find one that can help me.
So apologies here if I am just searching the wrong thing.
I am using the following code to help me find the medians of each column, there are 195 colums in the data.  I am using na.rm = True. Then trying to replace the NAs with the new calculated median.

I have used several different ways and keep getting stuck.  Any advise would be good.
dataset <- list.files(path = getwd(), pattern = "*.csv", all.files = T )
n <- length(dataset)

for (i in 1:n) {
  cat("\n",i)
  z <- median(dataset, na.rm = TRUE)
  dataset[is.na(dataset)] <- z
  return(dataset)
  write.csv(Filename, file = "Filename.csv")
}

Thanks in advance.

A: There is a far simpler way of doing this, using apply
apply(dataset, 2, median, na.rm = TRUE)

The 2 simply says apply your function to columns rather than rows

A: With tidyverse, no need for a loop :
data %>% mutate_all(funs(ifelse(is.na(.),median(.,na.rm=TRUE),.)))

Or shorter :
data %>% mutate_all(funs(coalesce(.,median(.,na.rm=TRUE))))

A: There are some issues with your code:
Your first command
dataset <- list.files(path = getwd(), pattern = "*.csv", all.files = T )

returns a list of filenames. Therefore, if you would want to process all your files you would need to call a function like read.csv inside your for loop. Your code example tries to calculate the median of the list of filenames.
Also, you specify the loop index i, but then you don't use it inside the for loop to access the right element of your filename list.
Inside your loop, you would therefore need a line like:
data <- read.csv(dataset[[i]])

Also, your to do the median imputation, you need to apply the median function row wise,
using a function like lapply or the tidyverse approach as in Nicolas2's answer.
Your return statement is not necessary as this is no function. Your write.csv function
expects a variable called "Filename", which is nowhere defined.
It should read like
write.csv(data, file = dataset[[i]]])

(provided you read in the files as "data" in your for loop).
All together, something like this should work:
dataset <- list.files(path = getwd(), pattern = "*.csv", all.files = T )
n <- length(dataset)

for (i in 1:n) {
  cat("\n",i)
  data <- read.csv(dataset[[i]])

  #from Nicolas2's answer
  data <- data %>% mutate_all(funs(ifelse(is.na(.),median(.,na.rm=TRUE),.)))

  # uncomment the following line only if you are sure that you have a backup
  # of your original files as this may overwrite the original files
  # write.csv(data, file = dataset[[i]])
}


text:
Q: EVO PDF Convertor: Can you download to PDF AND open the web page? I am using EVO PDF to combine multiple web pages into a single PDF.  The code below shows how it works...and it works.  If I comment out the section with System.Web.HttpResponse and just put Response.Write(htmlCodeToConvert); it will show both web pages on a single web page and there is no PDF download.
What I really want to do is both - I want to have the single, combined web page appear, and have the PDF download prompt appear as well.  I can get one or the other to work, but not both at the same time.  Is this possible?
  StringWriter htmlStringWriter = new StringWriter();

  Server.Execute("Page1.aspx", htmlStringWriter);
  Server.Execute("Page2.aspx", htmlStringWriter);

  string htmlCodeToConvert = htmlStringWriter.GetStringBuilder().ToString();
  htmlStringWriter.Close();

  // get the pdf bytes from html string
  byte[] pdfBytes = pdfConverter.GetPdfBytesFromHtmlString(htmlCodeToConvert);

  // send the PDF document as a response to the browser for download
  System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
  response.Clear();
  response.AddHeader("Content-Type", "application/pdf");
  response.AddHeader("Content-Disposition", String.Format("attachment; filename=MyFile.pdf; size={0}", pdfBytes.Length.ToString()));
  response.BinaryWrite(pdfBytes);
  response.End();

A: Can you initially open the only page with content, let it be page1.aspx, without download? And when it's loaded, start download with javascript like window.open("page2.aspx");


text:
Q: Pulpish SF Zombie Short Story/Novelette I am almost certain I read this SF story in one of Ultimate Publishing's magazines (Amazing, Fantastic, or one of their all-reprint digests) between 1965 and 1970.
What little I can remember: it takes place in a city or base that is covered by either a force-field or a physical dome of some kind. Some kind of fungi or growth (probably alien) is clinging to the underside of the dome. This growth somehow kills people and reanimates them as zombies who want to kill the living.
In one scene the MC is talking to another man via visiphone; suddenly someone grabs the man by the hair and pulls him out of camera range. There is a scream and then the face of a zombie appears on the screen; it goes 'Argh!'. (Even as a kid I thought it was ridiculous and over the top, but I still want to read this story again.)

A: This is 'The Sheeted Dead' by Richard Rohrer, published in the September 1964 Amazing.
"Aahhhhhhgghahh." said the thing on the wall. A thread of saliva dropped from its lower lip, and its hand reached out, and the screen went blank.


text:
Q: React: fetch() method breaks whole application I'm experiencing really weird issue and have tried everything (ChatGPT, asked my front-end colleagues) to find out what is going on, but nothing helped me so far. So, this place is my last hope.
Here is my Main.js file:
import React, { Component } from 'react';

export default class Main extends Component {

    constructor(props) {
        super(props);
        this.state = {
            step: 1
        };
        this.handleSubmit = this.handleSubmit.bind(this);
    }

    handleSubmit(event) {
        fetch('https://api.npms.io/v2/search?q=react')
            .then(response => response.json())
            .then(data => console.log(data));
    }

    render() {
        return (
            <div>
                Hello world
            </div>
        )
    }
}

The problem is that when I use fetch() method it simply breaks whole application and apparently React doesn't load at all (render method is not executed). I have no errors in console, neither on compilation.
Note: handleSubmit method is never called. It's just an example, where I use fetch() function. If I remove fetch() method everything works - page is loaded (render function is called). If I add it back - I see only empty page without errors.
Here is my index.js file:
import React from 'react';
import Main from "./Builder/Main";

import { createRoot } from 'react-dom/client';
const container = document.getElementById('invitation-builder');
const root = createRoot(container);

root.render(<Main />);

I'm using Symfony, Webpack Encore, Yarn, React 18.20.
Any ideas what is going on? Any help will be much appreciated.

A: use the '.catch' on the fetch function to see the error on the console :

handleSubmit(event) {
        fetch('https://api.npms.io/v2/search?q=react')
            .then(response => response.json())
            .then(data => console.log(data))
            .catch(error => console.log(error)) //the new addition
    }


text:
Q: A closed subset of a Lindelöf space is Lindelöf.
A closed subset of a Lindelöf space is Lindelöf.

Let $M\subseteq X$ be closed and $\left\{U_t\right\}_{t\in T}$ be a cover of $M$; that is,
$$M\subseteq\bigcup_{t\in T}U_t.$$
By definition of the relative topology, for every $t\in T$ there exists a $V_t\subseteq X$ for which $U_t = M\cap V_t$.
Notice $U_t = M\cap V_t\subseteq V_t$, so that
$$M\subseteq\bigcup_{t\in T}U_t\subseteq\bigcup_{t\in T}V_t.$$
Therefore, $\left\{V_t\right\}_{t\in T}$ is a cover of $M$.
As $\left\{X\setminus M\right\}$ is a cover of $X\setminus M$, the collection of sets $\left\{X\setminus M\right\}\cup\left\{V_t\right\}_{t\in T}$ is a cover of $X$. Since $X$ is Lindelöf, there exists a countable set $S\subseteq T$ so that
$\left\{X\setminus M\right\}\cup\left\{V_s\right\}_{s\in S}$ covers $X$; that is,
$$X\subseteq\bigcup_{s\in S}(X\setminus M)\cup(V_s).$$
However, from here the proof goes on to say that $\left\{M\cap V_s\right\}_{s\in S}$ covers $M$...how?

A: Simple: if $x \in M$, then
$$x \in X \subseteq (X \setminus M) \cup \bigcup_{s \in S} V_s.$$
Since $x \notin X \setminus M$, we must have
$$x \in \bigcup_{s \in S} V_s.$$
Thus $x \in V_{s'}$ for some $s' \in S$. Since $x \in M$ as well, we get
$$x \in V_{s'} \cap M \subseteq \bigcup_{s \in S} (V_s \cap M).$$
Hence,
$$M \subseteq \bigcup_{s \in S} (V_s \cap M).$$

A: Well, if $x \in M$ it is certainly not covered by the set $X\setminus M$ in the countable subcover $\{V_s\}_{s \in S} \cup \{X\setminus M\}$ for $X$, so it must be covered by one of the $V_s$, $s \in S$. So $x \in M \cap V_s$ for that $s$.
And this set equals $U_s$ by construction. So, in fact, any arbitrary $x \in M$ is covered by some $U_s$ for $s \in S$. Which finishes the proof that $M$ is Lindelöf.

A: The fact that $\{X\setminus M\}\cup\{V_s:s\in S\}$ covers $X$ means that
$$(X\setminus M)\cup\bigcup_{s\in S}V_s=X\,.$$
Of course this means that
$$M\subseteq (X\setminus M)\cup\bigcup_{s\in S}V_s\,,$$
since $M\subseteq X$. And $X\setminus M$ is disjoint from $M$, so it must be the case that
$$M\subseteq\bigcup_{s\in S}V_s\,,$$
i.e., that $\{V_s:s\in S\}$ covers $M$.