text:
Q: Flutter: iphone app not running in simulator I am very stuck with this error, when i am make build of android it is working fine, but when i am running my app in IOS simulator, it is show me this error. i am unable to find out what is the actual problem in my code. please help me to figure out this situation.
my flutter sdk version is 1.22.4

Running Xcode build...
Xcode build done.                                           117.6s
Failed to build iOS app
Error output from Xcode build:
↳
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h" is a
member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will
be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropOverlayView.h" is a member of
multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will be
preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h" is a
member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will
be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropScrollView.h" is a member of
multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will be
preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropToolbar.h" is a member of
multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will be
preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Views/TOCropView.h" is a member of multiple
groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but
membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/TOCropViewController.h" is a member of
multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups will be
preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the
same path.
2020-11-24 15:07:27.120 xcodebuild[84915:1186687] warning:  The file reference for "Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h"
is a member of multiple groups ("TOCropViewController" and "TOCropViewController"); this indicates a malformed project.  Only the membership in one of the groups
will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference
to the same path.
** BUILD FAILED **

Xcode's output:

1 warning generated.
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+14/ios/Classes/FLTImagePickerPlugin.m:149:20: warning:
'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert
instead [-Wdeprecated-declarations]
[[[UIAlertView alloc] initWithTitle:@"Error"
^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIAlertView.h:27:12: note: 'UIAlertView' has been explicitly marked deprecated here
@interface UIAlertView : UIView
^
1 warning generated.
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+14/ios/Classes/FLTImagePickerPhotoAssetUtil.m:17:44:
warning: 'UIImagePickerControllerReferenceURL' is deprecated: first deprecated in iOS 11.0 - Will be removed in a future release, use PHPicker.
[-Wdeprecated-declarations]
NSURL *referenceURL = [info objectForKey:UIImagePickerControllerReferenceURL];
^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIImagePickerController.h:62:51: note:   'UIImagePickerControllerReferenceURL' has been explicitly marked deprecated here
UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerReferenceURL API_DEPRECATED("Will be removed in a future release, use PHPicker.",
ios(4.1, 11.0)) API_UNAVAILABLE(tvos); // an NSURL that references an asset in the AssetsLibrary framework
^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+14/ios/Classes/FLTImagePickerPhotoAssetUtil.m:21:47:
warning: 'fetchAssetsWithALAssetURLs:options:' is deprecated: first deprecated in iOS 11 - Will be removed in a future release [-Wdeprecated-declarations]
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithALAssetURLs:@[ referenceURL ]
^
In module 'Photos' imported from
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+14/ios/Classes/FLTImagePickerPhotoAssetUtil.h:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/Photos.framework/He
aders/PHAsset.h:74:1: note: 'fetchAssetsWithALAssetURLs:options:' has been explicitly marked deprecated here
+ (PHFetchResult<PHAsset *> *)fetchAssetsWithALAssetURLs:(NSArray<NSURL *> *)assetURLs options:(nullable PHFetchOptions *)options API_DEPRECATED("Will be removed
in a future release", ios(8, 11), tvos(8, 11)) API_UNAVAILABLE(macos);
^
2 warnings generated.
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/geocoder-0.2.1/ios/Classes/GeocoderPlugin.m:75:36: warning:
'addressDictionary' is deprecated: first deprecated in iOS 11.0 - Use @properties [-Wdeprecated-declarations]
NSArray *lines = placemark.addressDictionary[@"FormattedAddressLines"];
^
In module 'CoreLocation' imported from
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/geocoder-0.2.1/ios/Classes/GeocoderPlugin.h:3:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/CoreLocation.framew
ork/Headers/CLPlacemark.h:73:63: note: 'addressDictionary' has been explicitly marked deprecated here
@property (nonatomic, readonly, copy, nullable) NSDictionary *addressDictionary API_DEPRECATED("Use @properties", macos(10.8, 10.13), ios(5.0, 11.0), watchos(1.0,
4.0));
^
1 warning generated.
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:13:5: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
UILocalNotification *_launchNotification;
^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>
^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:295:4: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
- (UILocalNotification *)buildStandardUILocalNotification:(NSDictionary *)arguments {
^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>
^

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject
           ^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:285:76: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings
[-Wdeprecated-declarations]
        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
                                                                           ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject
           ^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:286:44: warning: 'registerUserNotificationSettings:' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's
-[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]
[-Wdeprecated-declarations]
        [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
                                           ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIApplication.h:250:1: note: 'registerUserNotificationSettings:' has been explicitly marked deprecated here
- (void)registerUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_DEPRECATED("Use UserNotifications Framework's
-[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]", ios(8.0, 10.0))
API_UNAVAILABLE(tvos);
^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:296:5: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
    UILocalNotification *notification = [[UILocalNotification alloc] init];
    ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>
           ^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:296:63: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
    UILocalNotification *notification = [[UILocalNotification alloc] init];
                                                              ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:18:12: note: 'UILocalNotification' has been explicitly marked deprecated here
@interface UILocalNotification : NSObject<NSCopying, NSCoding>
           ^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:335:34: warning: 'UILocalNotificationDefaultSoundName' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's +[UNNotificationSound
defaultSound] [-Wdeprecated-declarations]
        notification.soundName = UILocalNotificationDefaultSoundName;
                                 ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UILocalNotification.h:62:30: note: 'UILocalNotificationDefaultSoundName' has been explicitly marked deprecated here
UIKIT_EXTERN NSString *const UILocalNotificationDefaultSoundName API_DEPRECATED("Use UserNotifications Framework's +[UNNotificationSound defaultSound]", ios(4.0,
10.0)) API_UNAVAILABLE(tvos);
                             ^
/Users/gajendrabhati/Library/Android/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-3.0.1+5/ios/Classes/FlutterLocalNotificationsPlugi
n.m:351:9: warning: 'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest
[-Wdeprecated-declarations]
        UILocalNotification * notification = [self buildStandardUILocalNotification:arguments];
        ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support
Files/flutter_local_notifications/flutter_local_notifications-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
                                                         ^
2 warnings generated.
2 warnings generated.
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/AppAuth/Source/AppAuth/iOS/OIDExternalUserAgentIOS.m:168:58: warning: 'openURL:' is deprecated: first
deprecated in iOS 10.0 [-Wdeprecated-declarations]
    openedUserAgent = [[UIApplication sharedApplication] openURL:requestURL];
                                                         ^~~~~~~
                                                         openURL:options:completionHandler:
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/AppAuth/AppAuth-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
- (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
^
1 warning generated.
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/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:418:67: error: 'topLayoutGuide' is deprecated: first
deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor [-Werror,-Wdeprecated-declarations]
        return CGRectGetHeight(UIScreen.mainScreen.bounds) - self.topLayoutGuide.length - self.bottomLayoutGuide.length;
                                                                  ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/BraintreeDropIn/BraintreeDropIn-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:480:58: note: 'topLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> topLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.topAnchor instead of
topLayoutGuide.bottomAnchor", ios(7.0,11.0), tvos(7.0,11.0));
                                                         ^
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:444:21: error: 'bottomLayoutGuide' is deprecated:
first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor [-Werror,-Wdeprecated-declarations]
        return self.bottomLayoutGuide.topAnchor;
                    ^
In module 'UIKit' imported from /Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/Target Support Files/BraintreeDropIn/BraintreeDropIn-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/Hea
ders/UIViewController.h:481:58: note: 'bottomLayoutGuide' has been explicitly marked deprecated here
@property(nonatomic,readonly,strong) id<UILayoutSupport> bottomLayoutGuide API_DEPRECATED("Use view.safeAreaLayoutGuide.bottomAnchor instead of
bottomLayoutGuide.topAnchor", ios(7.0,11.0), tvos(7.0,11.0));
                                                         ^
4 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOActivityCroppedImageProvider.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropOverlayView.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCroppedImageAttributes.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropScrollView.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropToolbar.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Views/TOCropView.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/TOCropViewController.h (in target
'TOCropViewController' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase:
/Users/gajendrabhati/mukesh/flutter/3Edge/ponde/ios/Pods/TOCropViewController/Objective-C/TOCropViewController/Models/TOCropViewControllerTransitioning.h (in
target 'TOCropViewController' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.
(in target 'Runner' from project 'Runner')

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

A: I think it has to do with your podfile, try removing the podfile & podfile.lock (move it elsewhere so you can move it back if needed), it will build itself again. I also wouldn't ignore all the deprecated warnings in your stead.

A: Have you had the opportunity to try building on a physical device?
Try changing the flutter channel and cleaning the project and pods. It usually works for me when I can't build for iOS.


text:
Q: When is a set equal to empty set in contrary to being equal to a set containing only empty set as an element? I'm having trouble understanding the difference between following two statements:
$$\{X\subset \{a, b\} | \forall w \in X : |w| = 2\} = \{\emptyset \},$$
$$\{X \subset \{a, b\} | \exists w \in X : |w| = 2\} = \emptyset.$$
Why is one equal to a set having only empty set as an element, whereas the other one is equal to empty set itself? I mean neither one contains elements that fulfill the condition $|w| = 2$, so why aren't both just equal to $\emptyset$?

A: This question in general seems to depend on what $a$ and $b$ are, for example if $a$ and $b$ both happen to have cardinality 2, then $\{X\subset \{a, b\} | \forall w \in X : |w| = 2\}$ is not empty (in that scenario it would be $\{\varnothing,\{a\},\{b\},\{a,b\}\}$.) But as you mentioned you know neither $a$ nor $b$ has cardinality 2, it's possible to give a definitive answer.

*

*$Y=\{X\subset \{a, b\} | \forall w \in X : |w| = 2\}$ is a set of subsets of $\{a,b\}$. There are four subsets of $\{a,b\}$: $\varnothing$, $\{a\}$, $\{b\}$, and $\{a,b\}$. Since neither $a$ nor $b$ have cardinality 2, only one of these subsets is an $X$ where all members of $X$ have cardinality 2: $\varnothing$. For every member of $\varnothing$ (there are none), that member has cardinality 2. When said about the empty set, this is a vacuous truth, like the statement "I am undefeated in professional boxing". But for the other subsets $\{a\}$, $\{b\}$, and $\{a,b\}$, they all contain an element that fails to have cardinality 2, making the condition false. As a result, since the whole $Y=\{X\subset \{a, b\} | \forall w \in X : |w| = 2\}$ just contains the subsets where this condition is true, and $\varnothing$ is the only subset where this condition is true, $Y$ is the set containing just $\varnothing$, so $Y=\{\varnothing\}$.

*With $Z=\{X \subset \{a, b\} | \exists w \in X : |w| = 2\}$, this is again a set of subsets of $\{a,b\}$, but this time no set satisfies that property. There is no such thing as a vacuous truth for existence statements, if $X$ is empty then we know there certainly doesn't exist a $w\in X$ with any property whatsoever. None of the other subsets have any members with cardinality 2 either. So overall $Z=\{X \subset \{a, b\} | \exists w \in X : |w| = 2\}$ contains no subsets of $\{a,b\}$ (not even $\varnothing$), namely $Z$ is $\{\}$.

redpajama_set_name: RedPajamaStackExchange


text:
Q: If results of lookuprows are all 'false' - do something? I'm running a LookupRows in Marketing Cloud from a CloudPage:
%%[
if @drowcount > 0 then
set @drow = row(@drows,@i)
for @i = 1 to @drowcount do
set @dstatus = Field(@drow,"creativeRecieved")
]%%

%%=v(@dstatus)=%%

%%[next @i endif]%%

(Note this is part of a bigger loop) it's finding rows on a data extension matching it with a master record using email address. It's returning 'true' or 'false' for a certain field, for as many lines as it finds. For example, if it finds 4 lines matching this emailAddress, it loops through 4 times and finds 4 trues or falses.
I would like to be able to do something if all of these come back as 'true'. What's the easiest way to do this? Can I save them as a temporary recordset and then run IndexOf over it?

A: The two simplest ways to accomplish this are:
Using a string and CONCAT each result
Example below:
%%[ if @drowcount > 0 then
set @drow = row(@drows,@i)
for @i = 1 to @drowcount do
set @dstatus = Field(@drow,"creativeRecieved")

IF EMPTY(@statusString) THEN

  SET @statusString = @dstatus

ELSE

  SET @statusString = CONCAT(@statusString, " | ", @dstatus)

ENDIF
]%%

%%=v(@dstatus)=%%

%%[

NEXT @i

IF INDEXOF(@statusString, "True") == 0 THEN

  /* FALSE only actions */

ELSEIF INDEXOF(@statusString, "False") == 0 THEN

  /* TRUE only actions */

ELSE

  /* Default actions */

ENDIF

endif
]%%

Using a Var to track status
Example below:
%%[ if @drowcount > 0 then
set @drow = row(@drows,@i)
for @i = 1 to @drowcount do
set @dstatus = Field(@drow,"creativeRecieved")

IF @tStatus != "Mixed" THEN

  IF EMPTY(@tStatus) THEN

    SET @tStatus = @dstatus

  ENDIF

  IF @tStatus != @dstatus THEN

    SET @tStatus = "Mixed"

  ENDIF

ENDIF

]%%

%%=v(@dstatus)=%%

%%[

NEXT @i

IF @tStatus == "False" THEN

  /* FALSE only actions */

ELSEIF @tStatus == "True" THEN

  /* TRUE only actions */

ELSE

  /* Default actions */

ENDIF

endif
]%%

A: %%[
if @drowcount > 0 then
    set @allTrue = true
    for @i = 1 to @drowcount do
    set @drow = row(@drows,@i)
    set @dstatus = Field(@drow,"creativeRecieved")

    if @dstatus == false then
        set @allTrue = false
    endif
]%%

%%=v(@dstatus)=%%

%%[
    next @i

    if @allTrue == true then
        //do something
    endif
endif
]%%

A: Thanks for the suggestions folks. In the end I simplified and went with doing two different lookuprows:
%%[
set @email = Field(@row,"emailAddress")
set @erows = LookupRows("CC_B2B_Email","emailAddress",@email)
set @erowcount = Rowcount(@erows)
]%%
Rowcount for Email: %%=v(@erowcount)=%%

%%[
set @email = Field(@row,"emailAddress")
set @erowst = LookupRows("CC_B2B_Email","emailAddress",@email,"creativeReceived","True")
set @erowcountt = Rowcount(@erowst)
]%%
Rowcount for Email Done: %%=v(@erowcountt)=%%

Then compared the two rowcounts - if they were the same, then I could mark them as true.


text:
Q: jQuery .hide() button when another button active I have a "Load More" button that has a class named .btn.btn-primary.ng-scope. When we have some items to show and class .btn.btn-primary.ng-scope.ng-hide when all units loaded.
My problem is that I have another button "Show All Available Units" with class .btn.btn-primary.custom. I need to show button "Show ALL Units" ONLY when button "Load More" has class .ng-hide
jQuery(document).ready(function() {
  if (jQuery('.btn.btn-primary.ng-hide')) {
    jQuery('.btn.btn-primary.custom').show();
  }

  if (jQuery('.btn.btn-primary.ng-show')) {
    jQuery('.btn.btn-primary.custom').hide();
  }
});


text:
Q: How to hide iframe with FB Like button on click? I'm using this code (standard FB Like):

I need to hide the complete div (or iframe) when the user clicks on it.
I tried the onclick event but it didn't work inside iframe.
How can I do this?

A: You could do something like this:
HTML:

Javascript:
document.getElementById('facebookFrame').contentWindow.document.body.onclick =
function() {
  // hide your iframe here or do whatever
  document.getElementById('facebookFrame').style.display = "none";
  alert("iframe was clicked");
}

A: I havent done it yet. Just found a good resource http://softwareas.com/cross-domain-communication-with-iframes
maybe like that
parent.frames[1].location.href -> set to own url plus #anyanchor

so it wont be reloaded, then access the js function of main window
document.getElementById('facebookFrame').style.display = "none";

A: Realistically I think that your best bet is to place another, this time transparent, div over the iframe. Set your click handler on that.

A: You can also try this solution:
FB.Event.subscribe('edge.create', function(href, widget) {
        your call back function to hide the iframe
});


text:
Q: Core Data: Query for objects which have a relationship with another Let's say I have a 3 core data entities: Patient, Therapeut, Event, where as a patient can have many Event objects, which in turn have a single Therapeut object.
So, this code is valid:
NSSet *events = patient.events;
NSSet *events = therapeut.events;
Therapeut *therapeut = event.therapeut;
Patient *patient = event.patient

Now, I want retrieve all events with a given patient AND a given therapeut. Is this possible WITHOUT executing a fetch request against the database? I find a round-trip is expensive, and I got a handle on a given therapeut and a given patient already.
Is this possible?

A: If they have inverse to-many properties, you can iterate through patient.events and check if the events have the given therapeut
NSMutableArray *matches = [NSMutableArray array];
for(Event *event in patient.events) {
    if(event.therapeut == my_therapeut)
        [matches addObject event];
}

This still involves iteration over all of a patients events, but it is more efficient than a new fetch
If you just have a therapeut identifier you can use :
[event.therapeaut.identifier isEqual:<identifier> ];


text:
Q: Backspace inside INPUT element causes fixed position DIV to relocate to cursor Yeah.  Sounds weird.
I have a PhoneGap 2.1.0 app running on iOS6 (iPhone5), and unfortunately I cannot test on another device (I'll check simulator when I get home).
Use case:
User types text data into an INPUT element that spans beyond the visible width of the INPUT element, and must backspace to correct an error in typing.
Expected:
Last character is deleted.
Actual:
Last character is deleted, and only if the text deleted is beyond the visible bounds of the INPUT element, the "position:fixed;" application header relocates to the text input cursor's position.
Here's a screen: (sorry stack won't let me post imgs yet)
issue screenshot
Anyone have any ideas?  If you need a specific portion of the HTML and/or CSS that renders this, let me know and I'll post it ASAP.
Worthy to note:

*

*The input elements have been re-skinned.

*The "-webkit-appearance" property is set to "none" for the input elements.

*This issue is consistent across ALL input elements (type=text, search, number, phone, or email), even ones in different forms/screens/pages.  I speculate this property has something to do with it - but I can't imagine what.  I've used this property in the past, with no issue.

*The backspace event functions as expected so long as the character being deleted in the input element does not reside beyond the visible bounds of the element.

*There are other fixed-position DIV elements in the site as well, but only the topnavbar/header is relocating.

Ideas?

A: This workaround works for me.
Add these to the affected inputs:
-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
-webkit-transform-style: flat;

A: You can circumvent this using Jquery by hiding the header each time a backspace is pressed and then show it immediately after again.
$('#input_field').keyup(function(e) {
  if (e.keyCode === 8) {
    return $('#header').hide(0, function() {
      return $(this).show();
    });
  }
});

A: My team had a similar issue with backspace in IOS6 + fixed header moving.  We couldn't find a real solution, but as a workaround we used modernizr to test for overflow content scrolling and applied position absolute to the header while applying the scrolling to the app-page div.
    Modernizr.addTest('overflowscrolling', function(){
            return Modernizr.testAllProps("overflowScrolling");
    });

css
.overflowscrolling .app-header {
   position: absolute;
}

.overflowscrolling #app-page {
overflow: scroll;
position:absolute;
top:0px;
bottom: 0px;
left: 0px;
right: 0px;
-webkit-overflow-scrolling: touch;

}


text:
Q: If I have a list of numbered questions, how can I align my questions to the right of the number? I'm editing a paper with a bunch of questions numbered from 1 to 10.  In the example that my professor gave me, he had it formatted so that the number of the question would be listed, and then the question itself would be aligned with it's own margin next to the number. I know in Microsoft Word, for example, it aligns itself automatically, but I don't know how to do that in TeXStudio.
Is there some command that I don't know about?

A: A simple enumerate environment seems to be what you need (or do you want some other alignment for the labels?):
\documentclass{article}

\begin{document}

\begin{enumerate}
\item Question 1.
\item Question 2.
\item Question 3.
\item Question 4.
\item Question 5.
\item Question 6.
\item Question 7.
\item Question 8.
\item Question 9.
\item Question 10.
\end{enumerate}

\end{document}


text:
Q: TypeError: __init__() missing 1 required positional argument: 'model' Beginner question. I have this class that basically relates a post to the user:
class Post(Model):
    timestamp = DateTimeField(default=datetime.datetime.now)
    user = ForeignKeyField(
        rel_model=User,
        related_name='posts'
        )
    content = TextField()

class Meta:
    database = DATABASE
    order_by = ('-timestamp',)

I get this error when it hits the 'related_name='posts' line:
Traceback (most recent call last):
File "app.py", line 5, in <module>
import forms
File "/dev/forms.py", line 2, in <module>
from models import User
File "/dev/models.py", line 41, in <module>
class Post(Model):
File "/dev/models.py", line 45, in Post
related_name='posts'
TypeError: __init__() missing 1 required positional argument: 'model'

The database I'm using is Sqlite (with Peewee). I don't understand why it's asking for a positional argument 'model', when Model is a parent class. What am I missing?

A: If you're using Peewee 3.x, then:
class Post(Model):
    timestamp = DateTimeField(default=datetime.datetime.now)
    user = ForeignKeyField(
        model=User,
        backref='posts')
    content = TextField()

    class Meta:
        database = DATABASE

Note: Meta.order_by is not supported in Peewee 3.x.

A: model=model.DO_NOTHING
try this hope this work


text:
Q: Content Spinning using PHP? Can anyone please help me? Say if I had this text or a smaller section stored in a variable, how can I randomise the words in the '{ }' ?
For example, the first one is "{important|essential|crucial|critical|vital|significant}" how can I make PHP choose one of those words randomly and then echo it? Thanks for helping me. :)

A: http://webarto.com/62/random-sentence-spinning-function
function get_random($matches)
{
    $rand = array_rand($split = explode("|", $matches[1]));
    return $split[$rand];
}

function show_randomized($str)
{
    $new_str = preg_replace_callback('/\{([^{}]*)\}/im', "get_random", $str);
    if ($new_str !== $str) $str = show_randomized($new_str);
    return $str;
}

Applied on your text file... http://ideone.com/rkuf6

A: *

*strip off initial and ending curly braces, you can use trim()

*explode the resulting string on | using explode()

*use array_rand() for the array you had in last step

A: Will not work with nested({a|x {b|c} y|z})!
function doStuff($from){
    $to="";
    while(($pos=strpos($from,'{'))!==false){
        $to.=substr($from,0,$pos);
        $from=substr($from,$pos);
        $closepos=strpos($from,'}');
        $arr=explode('|',substr($from,1,$closepos-1));
        $to.=$arr[array_rand($arr)];
        $from=substr($from,$closepos+1);
    }
    return $to.$from;
}


text:
Q: Win2012 Won't run scheduled task to sleep any more - but does after login This has got me stumped. A very reliable long time Win2012 server - suddenly stops running scheduled tasks. The server is run headless - and I remote into with Remote Desktop. Admin account is logged in all the time.
I run a scheduled task to make the server sleep at night. Scheduled Tasks just won't initiate it any longer. I've tried all the options. None work. I've tried different dedicated sleep apps (such as Wise Auto Shutdown and Z-Cron) with the same results.
All attempts will work when:

*

*on demand

*or when I log back into the server with Remote Desktop right after the task was meant to be run. It seems that triggers the event.

What is strange is that other scheduled events continue to work as normal - such as the scheduled wake up task.
I've checked permissions, and as much as I can - with no fix.
I've not been able to find anyone else with the same issue. Any hints would be appreciated. But again, this is not isolated to Windows Scheduler - as the same thing happens with other apps. The server just doesn't want to sleep (or hibernate) on it's own any longer (after doing so for many years).
Thanks (first post here).


text:
Q: Roots for f' - polynomial function with degree 3 For this function: $f: \mathbb{R} \rightarrow \mathbb{R}$,  $f(x)=(x-1)\cdot(x-2)\cdot(x-3)\cdot(x-4)$ , proof that $f'(x)$ (the first derivate) have 3 distinct real roots.
How can I solve this without brute force? (open parentheses).
$f$ is polynomial function with degree 4. After derivation, it will have degree 3 so $f'$ it will have 3 roots (because $f'$ have degree 3), but no 100% distincts or real.
Also, I could use Rolle theorem on $f'(x)$ but in this way I need to open parentheses and then would be a lot of work.
Is there an easy way to solve this problem?

A: You could find the critical points $z_1,z_2$ such that $f''(z_i) = 0$ and then use the second derivative test $\left( f'''(z_i) > 0\text{ or }f'''(z_i) <0\right)$ and evaluation (of $f'$) towards infinity to find that you have three roots, one  less than $z_1$, one between $z_1,z_2$, and one greater than $z_2$, where I've assumed $z_1<z_2$
Although that seems like an awful lot just to find an 'elegant' way to do it.
You could also use Sturm's Theorem

A: HINT
Since $f(1) = 0 = f(2)$, by Rolle's Theorem, $f'$ must have a root on $(1,2)$. Similarly, argue $f'$ must have a root on $(2,3)$ and $(3,4)$. Since the intervals are disjoint, so are the roots distinct.


text:
Q: Avoid repeated calls to Interpolation I want to interpolate a function in mathematica.
The function depends on a parameter a, in fact it is the inverse of a function F which also depends on a, so I build my approximation as follows,
approx = Interpolation[Table[{F[0.1 n, a], 0.1 n}, {n, -100, 100}]]

now I can simply call approx[x] to evaluate the inverse function at a point.
Instead I would like to do something like this: Define a function which takes a parameter,
G[x_,a_] = "construct the interpolating function,
            and return the value of the function at x"

Then write G[x,a] to evaluate the function. Otherwise I would have to repeat the interpolation for all the parameters I am interested in and have lots of variables lying around. I have tried putting the Interpolation[] call inside a module but that just constructs the interpolation every time I call G[x,a]! How would I avoid this?
Thanks for reading.

A: Try something along these lines:
G[a_]:=G[a]=Interpolation[Table[{F[0.1 n, a], 0.1 n}, {n, -100, 100}]]

G[0.2]  (* particular value of G[a] *)

G[0.2][0.3] (* the value you want *)

You will only evaluate G the first time you call it for each particular value of a.

A: You could use the definition of CacheIndex I posted in What is in your Mathematica tool bag?. One good thing about using this function is that you can cache values or portions of code without having to define a new function (although we do here to be in line with the example).
G[x_,a_] :=
   CacheIndex[a,
      Pause[3];
      Interpolation[Table[{F[0.1 n,a],0.1 n},{n,-100,100}]]
   ][x];

I added Pause[3] just to make it clear that the definition of Interpolation is cached for each a after it has been computed once.
You could then delete the cached Interpolation values in CacheIndex using
DeleteCachedValues[CacheIndex] (*or*)
DeleteCachedValues[CacheIndex,1].

I adapted my Cache and CacheIndex functions to make them compatible with the idea of WReach of using a separate symbol defined in a Block. One thing not practical here is that you have to define Hold attributes to the symbol used as cache, but the idea is still interesting.
Here is the definition of CacheSymbol
SetAttributes[CacheSymbol,HoldAll];
CacheSymbol[cacheSymbol_,expr_]:=cacheSymbol[expr]/.(_cacheSymbol:>(cacheSymbol[expr]=expr));

You can test this implementation using the following instructions, in a real example cache would be defined in a Block.
ClearAll[cache]
SetAttributes[cache,HoldFirst]
CacheSymbol[cache,Pause[3];2+2]
?cache
CacheSymbol[cache,Pause[3];2+2]

Here is the definition of CacheSymbolIndex
SetAttributes[CacheIndexSymbol,HoldAll];
CacheIndexSymbol[cacheSymbol_,index_,expr_]:=cacheSymbol[index,expr]/.(_cacheSymbol:>(cacheSymbol[index,expr]=expr));

You can test this implementation using the following instructions, in a real example cache would be defined in a Block.
ClearAll[cache]
SetAttributes[cache,HoldRest]
CacheIndexSymbol[cache,2+2,Pause[3];2+2]
?cache
CacheIndexSymbol[cache,2+2,Pause[3];2+2]

and similarly to the example of WReach we would have
G[x_,a_] :=
   CacheIndexSymbol[cache,a,
      Print["Caching"];
      Interpolation[Table[{F[0.1 n,a],0.1 n},{n,-100,100}]]
   ][x]

Block[{cache},
   SetAttributes[cache,HoldRest];
   Table[G[x, a], {x, 0, 5}, {a, 0, 1, 0.1}]
]

A: The first step is to parameterize approx with a:
approx[a_] := Interpolation[Table[{F[0.1 n,a],0.1 n},{n,-100,100}]]

With this definition, G can then be defined thus:
G[x_, a_] := approx[a][x]

But, as observed in the question, this ends up reconstructing the interpolation every time G is called.  One way to avoid this is to redefine approx using memoization:
m: approx[a_] := m = Interpolation[Table[{F[0.1 n,a],0.1 n},{n,-100,100}]]

Now, approx will save the interpolation function for any given a, avoiding reconstruction in subsequent calls with the same a.  Of course, this uses up memory so if there are a large number of distinct values of a then memory could run short.  It is possible to localize the cache used by approx by associating the saved values with another symbol (cache in this case):
approx[a_] := cache[a] /.
  _cache :> (cache[a] = Interpolation[Table[{F[0.1` n,a],0.1` n},{n,-100,100}]])

With this version of approx, cache can be localized using Block, e.g.:
Block[{cache}
, Table[G[x, a], {x, 0, 5}, {a, 0, 1, 0.1}]
]

The interpolation functions are still temporarily stored for each distinct value of a, but now those saved definitions are released after the Block exits.
For more information about functions with memory in Mathematica, see the SO questions:
The best way to construct a function with memory
Dynamic Programming in Mathematica: how to automatically localize and / or clear memoized function's definitions


text:
Q: Java8 program output and scala 2.12.4 REPL show different value for Max Memory On my Macbook Pro 16GB model, when I ran a java program and scala repl command to print out the max heap memory stat, I found them to be different (and the difference is 10 times)
I am just wondering why there is this difference.
Here is my java program and output:
1. Java Program

import org.apache.commons.io.FileUtils

class Test {

    public static void main(String[] args) {

         Runtime rt = Runtime.getRuntime();

         System.out.println("Max M: " + FileUtils.byteCountToDisplaySize(rt.maxMemory()) + "\n");
    }
}

Output:
Max M: 3GB

2. Scala Repl

    scala> val rt = Runtime.getRuntime
    rt: Runtime = java.lang.Runtime@5b20706

    scala> println("Max M: " + FileUtils.byteCountToDisplaySize(rt.maxMemory) + "\n")
    Max M: 228 MB


text:
Q: Can't resize the image in navbar Hi I'm making a site for a project and can't resize or change anything in a logo that I have.
I don't really know what am I doing wrong.
Here's the part with html and when I try to select the logo in css , it won't change in any way.( I've tried to change it's position to the right of navbar,but it still sticks to the left)

*{
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;

}

.logo {
  float: right;

}

header {
background-color: #c4c4c4;
}

nav {
  float: right;
}

nav ul {
  margin: 0,auto;
  padding: 0,auto;
  list-style: none;
}

nav li {
  display: inline-block;
  margin-right: 2ex;
  padding: 5ex;

}

nav a {
  color: #ffffff;
  font-weight: 600;
  font-size: 4ex;
  text-decoration: none;
}

            <meta charset="UTF-8">
            <link rel="stylesheet" href="testsite.css">

                <home>

Home

About Me

Skills

Contact

                </home>

A: I think your .logo class is missing from img

A: give img tag logo class


text:
Q: Asymptotic expansion of $(ix+a)^{q}$ as $x\rightarrow\infty$ let $a>0$ be fixed and $q\in\mathbb{C}$. I would like to know the asymptotic expansion as $x\rightarrow\infty,$ $x\in\mathbb{R}$ of
$$f(x):=(ix+a)^{q}$$
This function looks so natural that I would expect this as known. For example, is there something similar to $f(x)=x^{q}(1+O(1/x))$?
Best wishes

A: As you've nearly said yourself already, this is $$i^qx^q(1+\frac{a}{ix})^q\text,$$ or, packing away some of the constant stuff to make it clearer, $$Ax^q(1+\frac{B}{x})^q\text.$$ So, apart from a constant factor of $A=i^q$, your answer looks right. Or am I missing something obvious here?


text:
Q: Iterating over an array and updating value. error: '@lvalue $T5' is not identical to 'Int' I have the following syntax in Swift:
func basicFunction(anArray:[Int], aValue:Int) -> Int {
    for (var i = 0; i<5; ++i)
    {
        if anArray[i] == 0
        {
            anArray[i] = aValue  //I get an error in XCode
        }
    }
    return 1
}

I get the following Xcode error: '@lvalue $T5' is not identical to 'Int'

What am I doing wrong?

A: Function arguments are immutable by default, and the Swift compiler gives terrible error messages.
Anyway, because anArray is immutable, you cannot modify it.  That's why you get an error message.   Declare it inout:
func basicFunction(inout anArray:[Int], aValue:Int) -> Int {
    for (var i = 0; i<5; ++i) {
        if anArray[i] == 0 {
            anArray[i] = aValue
        }
    }
    return 1
}

Call it with an & in front of the array argument:
basicFunction(&someArray, 99)


text:
Q: Resample raster to a higher resolution with ArcPy I am looking for a way to upsample a raster to a higher resolution without interpolating in ArcGIS and arcpy (because I have geoprocessing script which treats a lot of rasters).
For example if I have a 10m resolution raster such as in the schematic attached below on the left I would like to achieve a higher resolution of 2m but with all the same values in the single cells such as on the right side of the schematic below. All the resampling techniques (cubic and bilinear) with arcpy.Resample_management I tried so far are interpolating between the values, however I would like to have a higher resolution with same values per 10m cell (basically what I am looking for is a inversion of the Aggregate Tool in ArcGIS).

I found a solution which works for a single raster by using ArcGIS Export Raster Data, but I am looking for a solution in arcpy because I have a lot of rasters to process and a manual export is not an option. I am looking for a solution specifically in ArcPy/ArcGIS as I have no admin rights on my computer at work and cannot install additional packages/software (I am aware that there is a GDAL command that does this, e.g. here).

A: The resample tool does have a method which produces the output you need, NEAREST.
ratio = some_number
cell_y = str(input_raster.meanCellHeight * ratio)
cell_x = str(input_raster.meanCellWidth * ratio)
arcpy.Resample_management( 'input_raster', 'output_raster', cell_x + ' ' + cell_y, "NEAREST")

If your input raster cells are square, you can omit defining cell_x and just call cell_y twice in the Resample statement.
As long as your value in ratio evenly subdivides your input raster cells, you'll get the output you want.


text:
Q: Constrained optimization using psudoinverse references? $(y-y_0)'*B*(y-y_0)=G , Ay=B$ In the problem I have, there is a function that I'd like to minimize:
$$(y-y_0)'*C*(y-y_0)=G\text{ subject to }Ay=B$$
I know there is a straightforward analytical solution to this using the psudoinverse. When I look up references I may look at I get a lot of stuff on gradient descent and numerical solutions to constrained optimization. My question is what are some good references(books, YouTube videos, websites) that explain the ideas surrounding how to solve this problem using the psudoinverse?

A: The problem you are describing is known as a quadratic program - see, e.g., the Wikipedia page (in particular, the section on equality constraints) or any convex optimization textbook (Boyd and Vandenberghe's book is widely considered to be the bible on the subject).


text:
Q: In php, using GET command for same parameter multiple times and php tags First of all, I heard some web-servers allow you to reach parameter with $a instead of $_GET[a], this is not the case here.
Anyway, I have to reach a multiple times, so instead of doing $a = $_GET[a], I instead use $_GET[a] everytime. In single php tag as in <?php ?>, is that an issue, should I absolutely use variables? does it matter?
Another thing is my php file is really scrambled in my html, I wonder if does it matter with multiple gets?(should not, im just worried)
Thanks.

A: What you refer of using just $a instead of $_GET['a'] (or $_POST['a'] too) is an old feature known as register_globals. This feature was dangerous and leading to messy code, so it was considered deprecated in PHP 5.3 and finally removed in PHP 5.4.
Then, using $_GET['a'] everywhere in your scripts may lead to problems, because you should never trust user input (all things coming from $_GET, $_POST, $_REQUEST, $_COOKIE and some from $_FILES or $_SERVER). It is recommended to do something like $a = sanitize($_GET['a']); (the sanitize function does not exist, depending on what type of value are you expecting, you should check that what you get is an integer, or a valid date, or whatever, depending on your needs). From now on you should stop referencing $_GET['a'] and use instead the new sanitized variable you have just created $a. Because if you were using always $_GET['a'], chances are that you forget to sanitize it someplace.
Also, before sending this sanitized variable into a SQL query, you should escape it or use it inside a prepared statement to avoid SQL injections. Before outputting it to an html for the user to see, use htmlspecialchars to avoid XSS attacks.
And finally, about having multiple php blocks mixed with html blocks, this is only bad for maintenance reasons, because in the long run it will be a complete mess. Try to separate the html you send the user from the php code. Try to read something about the MVC pattern (Model-View-Controller) (this link is probably too complicated or maybe you don't see the utility right now for you that are just beginning with php (at least I didn't see how it was way better than mixing html with php, for all the complexity needed), but try to grasp the idea behind it) .

A:
First of all, I heard some web-servers allow you to reach parameter with $a instead of $_GET[a], this is not the case here.

This is a PHP config setting called register_globals. It is insecure and should NOT be used. See this question for more information.
You can access an element in the $_GET array as many times as you like, it will not cause problems. However if you are printing an element of the $_GET array (or any other user submitted data) to the page, you should run it through htmlspecialchars() or the like before printing it out to prevent XSS vulnerabilities.

A: using a variable is a preference for you to decide it does not matter. but variable is the way forward if you use the same one multiple times.
<?php echo htmlspecialchars($_GET['a']);?>

using a variable means that it reusable again especially if you have added extra code, which mean just editing one variable for all instances.
<?php $a = htmlspecialchars($_GET['a']);

echo $a;
echo $a;
echo $a;
echo $a;

?>


text:
Q: just want to ask if my declaration is correct in my android application I just want to ask if I have set the right value in the int result because whenever I run the application my textview wont output the product of ans*ans2.
TextView tv2 = (TextView) findViewById(R.id.tv2);
EditText et1 = (EditText) findViewById(R.id.first);
EditText et2 = (EditText) findViewById(R.id.second);
String temp = et1.getText().toString();
String temp2 = et2.getText().toString();
int ans = Integer.parseInt(temp);
int ans2 = Integer.parseInt(temp);
int result = ans * ans2;

tv2.setText("" + result);

A: I'm guessing that problem is related with line
int ans2 = Integer.parseInt(temp);

where you are parsing value from temp instead of temp2 so try changing it to
int ans2 = Integer.parseInt(temp2);

A: This should probably work for you.
tv1.setText(String.format("%d", result));

A: tv1.setText(int) refers to a resource id - like R.string.myText
tv1.setText(String) is what you're expecting to call, with Java autoboxing the int to a String.
try:
tv1.setText(""+result)

A: TextView tv2 = (TextView) findViewById(R.id.tv2);
EditText et1 = (EditText) findViewById(R.id.first);
EditText et2 = (EditText) findViewById(R.id.second);
String temp = et1.getText().toString();
String temp2 = et2.getText().toString();
int ans = Integer.parseInt(temp);
int ans2 = Integer.parseInt(temp2 );
int result = ans * ans2;

tv2.setText("" + result);


text:
Q: Import sample project into eclipse I know it may be a rookie question but I haven't done this before. How do I import android sample project like: https://developer.android.com/training/location/retrieve-current.html
to eclipse that have only res, src and manifest. I wish to know the right way and not copy - paste, also import project does not work here.

A: This is very easy:
Unzip the code, now you have the folder "LocationUpdates" containing the Manifest.xml file, /src and /res folders.
In Eclipse Go to: File > import > select Android Folder, Existing Android Code Into Workspace >
Browse to the directory where your project to import is located, and check the option Copy projects into workspace > Next > Change if you want the project name in New Project Name > Finish
Refresh F5 and Build your project
In other situations where we only have /res and /src folder, the only way is creating a new project.

A: I guess you should create a new Android application project , and copy paste the all the res,source and manifest will be only solution


text:
Q: Saving the selected rows by checkbox to database in php I have a query to display all the records of the ebooks table from the database.
I displayed it in a table with a checkbox from the first column.
I'm trying to save the rows from the selected checkbox in the table width the Name of School but I don't have any idea.
I'm just a beginner in php, any help is appreciated. Here is my codes:
HTML codes:

$result1 = mysql_query("SELECT * FROM school GROUP BY SCHOOL_NAME");

while($row1=mysql_fetch_array($result1)) {
?>
    <option><?php echo $row1['SCHOOL_NAME'];?></option>
<?php } ?>
</select>

        Ebook Title
        Category
        File Name

    <?php
    $result = mysql_query("SELECT * from ebooks ORDER BY EBOOK_TITLE");
    $count = mysql_num_rows($result);
    while($row=mysql_fetch_array($result)) {
    ?>

                <input type="checkbox" name="check[]" >

            <input type="" name="ebookname[]" value="<?php echo $row['EBOOK_TITLE'];?>">
            <input type="" name="ebookcategory[]" value="<?php echo $row['EBOOK_CATEGORY'];?>">
            <input type="label" name="ebookfilename[]" value="<?php echo $row['EBOOK_FILENAME'];?>">

    <?php } //end of while loop ?>

<button type="submit" class="btn btn-hg btn-primary" name="AddEbooks">Submit</button>

I want to save the rows selected by the checkbox to database:

*

*Table: school_management

*Columns: ID_NUMBER, SCHOOL, EBOOK, FILE_NAME, DATE_ASSIGN

*Values (from the HTML table to database): ('','$school_ebook','$ebookname','$ebookfilename','')
Here is the screenshot:

A: First, you will need to assign an ID number to the checkboxes so that you can differentiate each record.  Using the ID_NUMBER would be ideal here.  In your current script where you are displaying the checkbox, your line that reads this:
<input type="checkbox" name="check[]" >

Should include the ID_NUMBER like this in the name.  Additionally, a value should be assigned to the checkbox so we can verify later.
<input type="checkbox" name="check[<?php echo $row['ID_NUMBER'];?>]" value="1">

Now you can go ahead and set up something that gets triggered when your form is submitted.  You can essentially loop through each record and check it against the "check[ID_NUMBER]" checkbox to see if the value is 1.  If the value is 1 then the record had been checked to save and you can then carry on saving the record.
How you want to handle the form is up to you - you could do AJAX to avoid reloading the entire page or you could do a simple form action="page_name_here.php" and handle the submission there.  If you go about doing a simple form post without AJAX, it could be something like this -
Current page form tag:
<form name="" action="page_name_here.php" method="POST">

If you want to use the school_ebook var you need to assign the select options for the school_ebook a value:
<option value="<?php echo $row1['SCHOOL_NAME']'?>">

page_name_here.php:
<?php
    /* Get the school name */
    $school_ebook=$_POST["school_ebook"];
    /* Query your books DB to get the records */
    $result=mysql_query("SELECT * from ebooks ORDER BY EBOOK_TITLE");
    $count=mysql_num_rows($result);
    while($row=mysql_fetch_array($result)) {
        $bookID=$row['ID_NUMBER'];
        /* Get the Book ID and now we have to fetch from $_POST the value from the form */
        if (array_key_exists($bookID, $_POST["check"])) {
            $ischecked=$_POST["check"][$bookID];
            /* See if this has a value of 1.  If it does, it means it has been checked */
            if ($ischecked==1) {
                /* It is checked, so now in this area you can finish the code to retrieve the data from the row and save it however you like */
            }
        }
    }
?>

Once completed with your inserts, etc., it should accomplish what you need.


text:
Q: Crossdomain ServiceWorker load balancing I'm trying to implement smth like crossdomain load balancing with ServiceWorker API.
My concept is:

*

*After install on every request on fetch event I try to access main domain (https://example.com/)

*If success I should return this to user with like event.respondWith(__response);

*If failed (timed out or any other exception) I make CORS request to other server (https://balancer.com/) which returns other accessible domain (https://mirror1.example.com) and browser is redirected;

And I'm stucked on redirection step(((
So my current code is here
self.oninstall = function (event) {
    event.waitUntil(self.skipWaiting());
};

self.onactivate = function (event) {
    event.waitUntil(self.clients.claim());
};

self.initialUrl = false;
self.onfetch = async function (event) {
    if (!self.initialUrl)
        self.initialUrl = event.request.url;

    if (self.initialUrl) {
        event.respondWith(self.tryAccess(event))
    } else {
        event.respondWith(fetch(event.request));
    }
};

self.tryAccess = async (event) => {
    return new Promise(async (resolve, reject) => {
        self.clients
            .matchAll({type: 'window'})
            .then(async (clients) => {
                for (var i in clients) {
                    var _c = clients[0];
                    if (_c.url === event.request.url) {
                        try {
                            let __tryResponse = await fetch(event.request);
                            resolve(__tryResponse);
                            return;
                        } catch (e) {
                            let __json = await (await fetch("https://balancer.com/")).json();
                            return _c.navigate(__json.path).then(client => client.focus());
                        }
                    } else {
                        resolve();
                    }
                }
            });
    });
};

A: Getting a reference to a WindowClient and forcibly changing its URL from inside of a fetch handler isn't the right way to redirect.
Instead, inside of your fetch handler, you can respond with a redirection response created by Response.redirect(). From the perspective of the browser, this will be treated just like any other redirection that might have originated from the server.
One thing to note is that if you initially request a subresource via a same-origin URL that results in a redirect to a cross-origin response, you might run into some issues. If your original requests are for cross-origin URLs and your potential redirects are also to cross-origin URLs, I think you'll be fine.
self.addEventListener('fetch', (event) => {
  const fetchWithRedirection = async () => {
    try {
      // Use fetch(), caches.match(), etc. to get a response.
      const response = await ...;

      // Optional: also check response.ok, but that
      // will always be false for opaque responses.
      if (response) {
        return response;
      }

      // If we don't have a valid response, trigger catch().
      throw new Error('Unable to get a response.');
    } catch (error) {
      // Use whatever logic you need to get the redirection URL.
      const redirectionURL = await ...;

      if (redirectionURL) {
        // HTTP 302 indicates a temporary redirect.
        return Response.redirect(redirectionURL, 302);
      }

      // If we get to this point, redirection isn't possible,
      // so just trigger a NetworkError.
      throw error;
    }
  };

  // You will probably want to wrap this in an if() to ensure
  // that it's a request that you want to handle with redirection.
  if (/* some routing criteria */) {
    event.respondWith(fetchWithRedirection());
  } else {
    // Optionally use different response generation logic.
    // Or just don't call event.respondWith(), and the
    // browser will proceed without service worker involvement.
  }
});


text:
Q: Rewrite get parameter URL I have a page which have link www.example.com/Test/Leisure-Tours.php?location=15.
I want to rewrite the url to www.example.com/Test/Leisure-Tours/Africa.
Where 15 is the id of Africa

A: The best solution for this is encrypt id of africa using base64_encode() php function and send it as an url parameter. On the receiving end you can decypt it back using base64_decode() php function.

A: Mod_rewrite's not going to be able to help you out without access to the server's config files and creating either a mapping outside of your data tier.
There is no way, a rule in an htaccess file is going to know that "Africa" means "15". You'll better off adding some code in the top of the Leisure-Tours.php file, detect when a request is made directly to the php file and then redirect the browser to "Africa". Then, you can use htaccess to pass "Africa" back to the php script, and it'll have to determine the ID from that.

A: RewriteCond %{QUERY_STRING}  ^location=15$ [NC]
RewriteRule ^Test/Leisure-Tours.php$ Test/Leisure-Tours/Africa [R=301,NE,NC,L]


text:
Q: How to use Etag with sailsjs I'm trying to improve the cache capabilities on my sails application.
Sails generate a Etag with its response but when I try to do a GET request with a header 'if-None-Match' containing the Etag from the previous answer I can't get a 304 not Modified response from the server (the response is indeed not Modified and the Etag I receive is the same as the previous one).
I'm using POSTMAN to test the server responses.
Is there a way for a sails server to send such status code on unmodified responses ? I can't find any resource for Etag usage in sails doc.
Thank you.

A: Sails.js is based on Express.js and the ETags are generated by Express.js. And according to this answer, weak ETags are generated using CRC32 (source), strong ETags are generated using MD5 (source).
I use DHC - REST/HTTP API Client with If-None-Match header, it works perfect (return 304 Not Modified).
And I found that's because POSTMAN send NO-CACHE header to the server for testing purpose
'cache-control': 'no-cache',

You can follow this answer and turn off this feature then everything will be fine.


text:
Q: Error creating a function on Dart as a parameter import 'dart:math';

 main() {
var minhaFnPar = () => print("O valor e par!");
var minhaFnImPar = () => print("O valor e impar!")

 executar(fnPar: minhaFnPar, fnImpar: minhaFnImpar);
}

void executar({Function fnPar, Function fnImpar}) {
  Random().nextInt(10) % 2 == 0 ? fnPar() : fnImpar();
}

The mistake its in minhaFnImpar, that its showing blue and red lines,blue one saying that isn't used,
red line saying its undefined name.
I've tried to create if & else, and put Random there, but still not working, what am i doing wrong?

A: The error was due to spelling mistake of minhaFnImPar which you had misspelled as minhaFnImpar. Please see the correct code below :
import 'dart:math';

main() {
  var minhaFnPar = () => print("O valor e par!");
  var minhaFnImPar = () => print("O valor e impar!");

  executar(fnPar: minhaFnPar, fnImpar: minhaFnImPar);
}

void executar({Function fnPar, Function fnImpar}) {
  Random().nextInt(10) % 2 == 0 ? fnPar() : fnImpar();
}


text:
Q: How get values from array in React? I'm developing a simple ecommerce store. Product information is stored in DynamoDB (NoSQL).
Items in Product table has an "image" attribute with a single URL, and also an "images" attribute which store multiple strings. I just added the "items" attribute to test if I can store multiple URLs (which point to images in S3 bucket)
In my function component, I get the data from Graphql API and set the state correctly. In my template I use {image} to render it. However if I try to use {images[0]} or {images[1]}, the page is not rendered and I got the following error: "images is undefined".
In React Developers Tools I can see the "images" variable correctly displaying 3 urls. The query to the API also works correctly.
Why does my app works correctly when using {image} but not when using {images[0]}?

A: You need to change,
{images[0]}

To,
{images && images[0] ? images[0] : null}

Reason for the above code is, the images array doesn't gets populated in template as it is async(as you are fetching from api).
So at initial stage it will be empty array and you are trying to access the first index value using, images[0] which is undefined.
So to wait for the data to get loaded, you could check the condition like,
1) Let us confirm we have images value first.
2) If the condition is met then proceed with images[0].
3) If both condition is satisfied, then render images[0] until then keep it null.
Also the reason that {image} gets loaded without any error is, as it is a string, it checks the condition straight a way, so it only render if {image} has value which happens behind the scenes..
When you are trying to access the value from undefined, then you will get that error.

A: Looks like you are accessing the array before the data is populated.
You need to check the loading flag if you are using react-apollo query component. And if loading is false then only you need to render your component.
Alternately you can try this
{images && Array.isArray(images) && images.length ? images[0] : null}


text:
Q: Nginx redirect requests to non existent sub directories and files to the root dir I want to redirect all requests for non-existent subdirectories and non-existent files and files within non-existent subdirectories back to the root page.
Ex. sampledomain.com/jahsdjksf/sfhsafh.php
or sampledomain.com/jahsdjksf/sdfsndf/sfhsafh.php
or sampledomain.com/sfhsafh.php

all back to sampledomain.com
currently I have the following added to my rules
root   /home/nginx/domains/randwebsite.com/public/;
index  index.php;

and
try_files    $uri $uri/ /index.php;

but the issue is when I try any random non-existent sub dirs it loads the main page under that url and its broken as the css etc is using that url with the non-existent sub dir however only works perfectly with non-existent files with no sub dir added
ex. sampledomain.com/sdlfsdlfsf.php

A: If you want to force a redirect, you could use a named location. Something along these lines might work for you:
root /home/nginx/domains/randwebsite.com/public;
index index.php;

location / {
    try_files $uri $uri/ @redirect;
}
location ~ \.php$ {
    try_files $uri @redirect;
    ...
}
location @redirect {
    return 301 /index.php;
}

See this document for more.


text:
Q: The operator && is undefined for the argument String,boolean on JAVA? I'm a junior java Developer, entrusted with a Java Tool.
I have the following problem:
This tool takes in input 2 CSV files with specific fields.
The tool then generates 2 csv files as Output. First and Second Output.
Both Output files have the same fields, the first Output is based on some conditions and the second output on some other.
These 2  Output files contain different reconciliations for some data.Some records of the file have the same ID.
Example:
record1 = ID10-name One,
record2 = ID10-Blue Two,
record3 = ID10-name Three

One of the conditions is as follows:
if (line.getName (). toLowerCase (). contains ("Blue" .toLowerCase ())
|| line.getName (). equalsIgnoreCase ("Orange")) {
return true;

The method who implement this is  a boolean  ,and all the logic of the tool it's based on  this logic.The tool scrolls/processing  line by line .
  Iterator <BaseElaboration> itElab = result.iterator ();
    while (itElab.hasNext ()) {
    BaseLine Processing = itElab.next ();

On the SECOND OUTPUT file,I find a line/record  that has the name beginning with Blue.The tool rightly, it takes the line and inserts it in the Second Output File,cause all record who has name (getName), with Blue or Orange go on it
I should instead clump all the lines for the same ID even if only one of them has the name with blue.
Currently the tool do this :
FIRST FILE OUTPUT
record1 = ID10-name
record3 = ID10-name Three

SECOND FILE OUTPUT
record2 = ID10-Blue Two

The expected output is
FIRST FILE OUTPUT
nothing cause one of the group of IDs,cointains a name with Blue
SECOND FILE OUTPUT
record1 = ID10-name
record2 = ID10-Blue Two
record3 = ID10-name Three

i think something like this,but doesnt work
if (line.getID() && line.getCollector().toLowerCase().contains("Blue".toLowerCase())
                    || line.getName().equalsIgnoreCase("black")) {
                return true;

How to group in java lines for lined  for the same ID,and do the esclusione on the noutput
CODE
Output
private void creaCSVOutput() throws IOException, CsvDataTypeMismatchException, CsvRequiredFieldEmptyException, ParseException {
        Writer writerOutput = new FileWriter(pathOutput);
        Writer writerEsclusi = new FileWriter(pathOutputEsclusi);

        StatefulBeanToCsv<BaseElaborazione> beanToCsv = new StatefulBeanToCsvBuilder<BaseElaborazione>(writerOutput)
                .withSeparator(';').withQuotechar('"').build();

        StatefulBeanToCsv<BaseElaborazione> beanToCsvEsclusi = new StatefulBeanToCsvBuilder<BaseElaborazione>(writerEsclusi)
                .withSeparator(';').withQuotechar('"').build();

        beanToCsv.write(CsvHelper.genHeaderBeanBase());
        beanToCsvEsclusi.write(CsvHelper.genHeaderBeanBase());

        Iterator<BaseElaborazione> itElab = result.iterator();
        while (itElab.hasNext()) {
            BaseElaborazione riga = itElab.next();

some set if and condition  ecc

esclusi.add(riga);
                itElab.remove();
            }
        }

        for (BaseElaborazione riga : result) {
            if(riga.getNota() == null || riga.getNota().isEmpty()) {
                riga.setNota(mapNota.get(cuvNota.get(riga.getCuv())));
            }
            beanToCsv.write(riga);
        }

        for (BaseElaborazione riga : esclusi) {
            if(riga.getNota() == null || riga.getNota().isEmpty()) {
                riga.setNota(mapNota.get(cuvNota.get(riga.getCuv())));
        }
            beanToCsvEsclusi.write(riga);
        }

        writerOutput.close();
        writerEsclusi.close();
    }

The method for the esclusi( 2 output)
 private boolean checkPerimetroJunk(BaseElaborazione riga) {

        if (riga.getMercato().toLowerCase().contains("Energia Libero".toLowerCase())) {
            if (riga.getStrategia().toLowerCase().startsWith("STRATEGIA FO".toLowerCase())
                    || (riga.getStrategia().toLowerCase().contains("CREDITI CEDUTI".toLowerCase())
                    || (riga.getAttivita().equalsIgnoreCase("Proposta di Recupero Stragiudiziale FO")
                    ||  (riga.getAttivita().toLowerCase().contains("Cessione".toLowerCase())
                    || (riga.getLegalenome().equalsIgnoreCase("Euroservice junk STR FO")
                    || (riga.getLegalenome().equalsIgnoreCase("Euroservice_FO"))))))) {

                    onlyCUV=true;
                }

                     else if(Collections.frequency(storedIds,riga.getCuv()) >= 1 ){
                 onlyCUV = true;
                   }

        return onlyCUV;
    }
         else if (riga.getMercato().equals("MAGGIOR TUTELA")) {

                    if(riga.getCollector().toLowerCase().contains("Cessione".toLowerCase())
                    || (riga.getCollector().equalsIgnoreCase("Euroservice_Fo"))
                    || (riga.getAttivitaCrabb().toLowerCase().contains("*FO".toLowerCase())
                    ||  (riga.getaNomeCluster().equalsIgnoreCase("Full Outsourcing")))) {

                onlyCUV = true;
            }

             else if(Collections.frequency(storedIds,riga.getCuv()) >= 1 ){
                 onlyCUV = true;

        }

        return onlyCUV;
    }
        return false;
    }

WHERE riga=lines
cessione ecc are people who have black ecc its an example
Now the part of MAGGIOR TUTELA ITS WORKING,but not working the part of LIBERO.I dont know why.


text:
Q: seek(), then read(), then write() in python When running the following python code:
>>> f = open(r"myfile.txt", "a+")
>>> f.seek(-1,2)
>>> f.read()
'a'
>>> f.write('\n')

I get the following (helpful) exception:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 0] Error

The same thing happens when openning with "r+".
Is this supposed to fail? Why?
Edit:

*

*Obviously, this is just an example, not what I am actually trying to execute. My actual goal was to verify that the files ends with "\n", or add one, before adding the new lines.

*I am working under Windows XP, and they problem exists in both Python 2.5 and Python 2.6.

*I managed to bypass the problem by calling seek() again:

f = open(r"myfile.txt", "a+")
      f.seek(-1,2)
      f.read()
      'a'
      f.seek(-10,2)
      f.write('\n')

The actual parameters of the 2nd seek call don't seem to matter.

A: This appears to be a Windows-specific problem - see http://bugs.python.org/issue1521491 for a similar issue.
Even better, a workaround given and explained at http://mail.python.org/pipermail/python-bugs-list/2005-August/029886.html, insert:
f.seek(f.tell())

between the read() and write() calls.

A: the a+ mode is for appending, if you want to read & write, you are looking for r+.
try this:
>>> f = open("myfile.txt", "r+")
>>> f.write('\n')

Edit:
you should have specified your platform initially... there are known problems with seek within windows. When trying to seek, UNIX and Win32 have different line endings, LF and CRLF respectively. There is also an issue with reading to the end of a file. I think you are looking for the seek(2) offset for the end of the file, then carry on from there.
these articles may be of interest to you (the second one more specifically):
http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-08/2512.html
http://mail.python.org/pipermail/python-list/2002-June/150556.html

A: Works for me:
$ echo hello > myfile.txt
$ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open('myfile.txt', 'r+')
>>> f.seek(-1, 2)
>>> f.tell()
5L
>>> f.read()
'\n'
>>> f.write('\n')
>>> f.close()

Are you on windows? If so, try 'rb+' instead of 'r+' in the mode.


text:
Q: How to change font on definition's optional title, but not on theorem's optional titles? My preamble is the following:
\newtheorem{teo}{Theorem}[subsection]
\theoremstyle{definition}
\newtheorem{defi}{Definition}[subsection]

The default is set so
\begin{defi}[Some defi]
\end{defi}

\begin{teo}[Some theorem]
\end{teo}

Outputs both titles [Some xxx] between parentheses. I want to change only the definition title to bold and remove its parentheses. I have tried the following:
\makeatletter
\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont\textbf{#3}}}}
\let\thmhead\thmhead@plain
\makeatother

Which correctly changes the title font to bold and removes parentheses, but in all cases. I have also tried,
\makeatletter
\def\th@definition{%
  \thm@notefont{}% same as heading font
  \normalfont % body font
}
\makeatother

Which leaves theorem titles as they are, changes definition title font to bold but keeps parentheses.
Finally I tried,
\makeatletter
\def\thmhead@definition#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \thmnote{ {\the\thm@notefont\textbf{#3}}}}
\let\thmhead\thmhead@plain
\makeatother

Which doesn't work at all. Any idea on how to proceed?

A: The following code uses \pdfstrcmp to condition on whether \thmhead is called as a definition or a theorem. That way you can format things to suit your needs based on the environment:

\documentclass{article}

\usepackage{amsthm}

\newtheorem{teo}{Theorem}[subsection]
\theoremstyle{definition}
\newtheorem{defi}{Definition}[subsection]

\makeatletter
\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
  \ifnum\pdfstrcmp{#1}{Definition}=0
    \thmnote{ {\the\thm@notefont\textbf{#3}}}%
  \else
    ~\thmnote{{\the\thm@notefont (#3)}}%
  \fi
  }
\let\thmhead\thmhead@plain
\makeatother

\begin{document}

\section{A section}

\subsection{A subsection}

\begin{defi}[Some defi]
\end{defi}

\begin{teo}[Some theorem]
\end{teo}

\end{document}


text:
Q: An invalidated form does not get its validity recalculated when offending element removed from DOM I use ctrl.$setValidity within one of my directives to invalidate a form. However, there is a method residing elsewhere which could remove this element from the DOM under a different set of conditions. What happens when I invalidate the form with $setValidity and then remove the offending element is that the form remains invalid, while what I would like it to do is to recalculate its validity based on its new Inputfield set.
Please note that I am not simply looking for a ctrl.$setValidity true, (other input fields in the form may or may not be valid), I simply want the form to recalculate.
Below is the directive code:
 app.directive('dir', function() {
   return {
      restrict: 'C',
      require: "ngModel",
      link: function(scope, element, attrs, ctrl) {
      someValue = scope.someValue;
      someField = element.find(".some-class");

      monitorField = function(newValue, oldValue){
        console.log("whee");
        scope.someFunction(newValue);
        if(newValue =="Invalidate NOW!"){
        ctrl.$setValidity('someClass', false);
        } else if (oldValue == "Invalidate NOW!"){
           angular.element(document.querySelector('.some-class')).remove();
        } else {
          ctrl.$setValidity('someClass', true);
       }
    }
    scope.$watch("someValue", monitorField, true);
   }
 }
});

Which operates on:
   <FORM class="dir" ng-model="someValue">
     <INPUT type="text" class="some-class" ng-model="someValue"/>
     <INPUT type="text" class="some-other-class"/>
   </FORM>

(Yes it is a somewhat contrived example).
The problem is reproduced here: http://jsfiddle.net/kTuAY/
In my actual code, I populate the input fields based on an array of objects, which gets populated via Service, and remove elements via array.splice. The example given in the jsfiddle is merely there for simplicity.
Another interesting condition of failure can be seen in this fiddle:
http://jsfiddle.net/JACAv/
Specifically, if one of the inputs depends on non collision of value with the other, and is thusly invalidated, whereafter the other fields value is changed, validity remains incorrect.
Temporary not quite functioning fiddle while I go to work:
http://jsfiddle.net/yQpHL/
Thanks!

A: Removal of a DOM element that is linked to part of your model should be done by removing the part of the $scoped object the model is pointing at if possible. Think of the basic ngRepeat, if you remove an item from the array, it removes an element from the DOM. Your form should work the same way. This will prevent that from happening. All of the validation information is contained on the model in your $scope... like so:  $scope.myForm.model.$error.required for example. If you remove the $scope property or array item that the model is pointing at (e.g. $scope.foo or $scope.items.splice(2,1), Angular will know (presumably during the next $digest) to get rid of the model as well as it's validation information.
It doesn't matter if you remove the item in a controller or in a directive, but it should be removed from the $scope, then a digest needs to occur for the UI and validation to update.
I hope that helps, because I feel like I stumbled over what I was trying to say...

A: I do not think the problem is in the directive, it is in the 'other' code
If the DOM element removal is done n response to 'native' events - i.e. drag'n drop events, ajax events or something, the angular framework would  not know to run the recalculation by itself. In this code after you are done updating you have to call $scope.$apply() on a proper scope.
Oh I see your fiddle... ok. How about making life a little easier - instead of removing your DOM element why do not you decorate it with a ng-show attribute and let angular take care of the rest?

A: The way I ended up solving this was:

Put a separate watch expression on the array being ng-repeated over.
Within that watch expression, construct a hash of all the values currently present in input fields that match the relevant directive.
Reset the value of those fields forcefully with .val(), and then call $compile on the inner fields to retrigger the inner watch expression
Within the function adding the input field values on the controller (the function that gets called just before ctrl.$setValidity from the inner directive:
Verify that he number of times the value is entered is 1
Reset the array being ng-repeated over to contain the values of the hash

The good:

When an element is removed,the outer watch (the one on the entire array) triggers, the hash is recomputed, the values of each field are reset and revalidated
When a collision is detected, it will bubble correctly, marking all colliding fields as invalid, when the collision is removed, all fields are re-validated

The bad:

 Calling $compile on every field every time the array changes is computationally inefficient
As the inner watch expression will trigger once when the value changes, and once when the outer watch expression calls compile, effectively the number of $digest's is doubled

I'll put together a code example just as soon as I sanitize the code.


text:
Q: How do I fill in a 2D array in Python? This is my code:
empty = ' '
board = [[empty, empty, empty], [empty, empty, empty], [empty, empty, empty]]

def print_board():
    for idx, val in enumerate(board):
        print(val)

def board_update(x,y,player):
    board[x:y] = player;

game_is_running = True
player = 'x'
print_board()

while game_is_running:
    if player == 'x':
        print ('x turn')
        ver = int(input('input vertical of x '))
        hor = int(input('input horizontal of x '))
        board_update(ver, hor, player)
        player = 'o'
    print_board()

    if player == 'o':
        print ('o')
        vertical = int(input('input vertical of o '))
        horizontal = int(input('input horizontal of o '))

Whenever I run the code, it just places the letter like this:
[' ', ' ', ' ']

x

[' ', ' ', ' ']

[' ', ' ', ' ']

How do I make it look like this:
[' ', ' ', ' ']

[' ', x ,  ' ']

[' ', ' ', ' ']

A: The problem here is in line
board[x:y] = player;

the [x:y] notation is for assigning ranges while what you really need is probably
board[x][y] = player

Normally you would get an error because assigning single value to a range will throw TypeError. In this case you are assigning string which python treats as a list of characters let's say.

A: board[x:y] is slicing syntax. In your case, you seem to have tried board[1:1] = "x". Let's see what that does:
board[1:1] refers to the part of the list from index 1 to index 1 (an empty part, but a part nonetheless):
  ['','',''], ['','',''], ['','','']
0            1           2          3
             ⇈

Since you set that slice to "x" (and a string is a sequence), the list now becomes:
  ['','',''], 'x', ['','',''], ['','','']
0            1    2           3          4

What you want to do instead is access the second list inside the list (board[1]), and the 1st element of that inner list (board[1][1]):
board[x:y] = player


text:
Q: Error: More than one package matched with specified pattern Azure Function Release Pipeline in Azure DevOps I have successfully configured build pipeline configuration for my Azure Function in Azure DevOps. Now I am configuring a release pipeline with Azure App Service Deploy task and I am always getting an error as "Error: More than one package matched with specified pattern: d:\a\r1\a\**\*.zip. Please restrain the search pattern."

Anyone faced this issue? Any help is really appreciated.

A: Finally I was able to figure out the issue. The reason behind this is, that your solution has many projects in it and each projects will be having its own zip folder in the artifacts, so to fix this we should specify our Azure Function Project in the Package section of our pipeline task.
Click on the Azure App service Deploy task and the go to the Package or Folder section and then click on the three dots.

Now you should have an option to select the right zip file.

Now Create the release again and you should see that the release is successful.

Hope it helps.


text:
Q: Rails - Query has_many Association without Duplicating Myself We have 3 models in our application: Trips, Destinations, and CountryReferences (reference table).
Our associations description is as follows:

*

*A Trip has_many Destinations

*A Destination has_one CountryReference

*A Trip has_many CountryReferences through Destinations
The CountryReference table is a reference that maps each country to a region and sub region using the ISO_2 code as key. For example, Thailand would have a region of Asia and a sub region of South-east Asia. All the association are tested and working properly. Each Trip also has a column 'Views'.
The Goal
We are trying to create a method that returns an array with the the 6 most popular (# of views) trips in each region. We want to avoid duplicating a trip, that is, if a trip spans multiple regions, we only want to add it to the array once.
Our Code
 #returns a an array of trips, this array should contain at least 'num_per_region' trips per region
  def self.popular_by_region(num_per_region)
    regions = []
    regions.push 'Asia'
    regions.push 'Europe'
    regions.push 'Africa'
    regions.push 'Central America and the Caribbean'
    regions.push 'South America'
    regions.push 'Australia and Oceania'
    regions.push 'North America'

    trips_array = []
    trips_hash = {} #used to figure out if trip has already been added to array

    #load 6 most popular trips per region
    regions.each do |region|
      region_trips = Trip.joins(:country_references).where('country_references.region' => region, 'published' => true).order(views: :desc).limit(num_per_region*3)
      region_trips.each do |trip|
        if trips_hash[trip.id].nil?
          trips_hash[trip.id] = 1
          trips_array.push trip
        end
      end
    end

    return trips_array

  end

The Problem
The ActiveRecord query Trip.join... returns once trip per destination. That is, if my trip has 5 destinations, all in Asia, then that same trip will be returned 5 times. How can we adjust this query so that each trip is only returned once?
Thanks in advance for the help!

A: please try this.
Trip.joins(:country_references).where('country_references.region' => region, 'published' => true).group('trips.id').order(views: :desc).limit(num_per_region*3)


text:
Q: Update statement not working within Cursor & While block I am trying to execute an Update statement on a table. This statement is placed within Cursor and While block. I have checked in debugger and the values are coming into the statements and variable, still the update is not putting values into the table fields. Please advise what am I doing wrong here.
ALTER PROCEDURE SP_PO1  @P1 int

AS
BEGIN

    SET NOCOUNT ON;

    DECLARE @DOC AS INT;
    DECLARE @CASH AS FLOAT;
    DECLARE @TENTYPE AS VARCHAR(100);
    DECLARE @UDF AS VARCHAR(100);
    DECLARE @COUNTER AS INT;
    DECLARE @SQL AS VARCHAR(500);

    SELECT @DOC=DOCTYPE FROM InvNum WHERE AutoIndex = @P1;
    IF @DOC = 6
        BEGIN
            SET @COUNTER = 1;
            DECLARE Cur_Tender CURSOR FOR
                SELECT Tender.TenderNo FROM Tender;

            OPEN CUR_TENDER;
            FETCH NEXT FROM CUR_TENDER INTO @TENTYPE;

            WHILE @@FETCH_STATUS = 0
            BEGIN

            SELECT    @CASH = ISNULL(_btblPOSTenderTx.fTxAmount,0) FROM _btblPOSTenderTx INNER JOIN Tender ON _btblPOSTenderTx.iTenderID = Tender.IdTender INNER JOIN _btblPOSXZTable ON _btblPOSTenderTx.iPOSXZTableID = _btblPOSXZTable.IDPOSXZTable WHERE (_btblPOSXZTable.iTillTxType = 7) and (_btblPOSXZTable.IDPOSXZTable = (select Max(IDPOSXZTable) from [dbo].[_btblPOSXZTable])) AND (TenderNo = @TENTYPE);

                SET @UDF = 'ufIDPOSInvTENDER' + CONVERT(VARCHAR(2),@COUNTER);

                UPDATE InvNum SET @UDF=@CASH WHERE AutoIndex = @P1;

                SET @COUNTER = @COUNTER + 1;

                FETCH NEXT FROM CUR_TENDER INTO @TENTYPE;
            END
        END
    CLOSE CUR_TENDER
    DEALLOCATE CUR_TENDER
END
GO

A: You update variable
 UPDATE InvNum SET @UDF=@CASH WHERE AutoIndex = @P1;

update table column
 UPDATE InvNum SET <column>=@CASH WHERE AutoIndex = @P1;

if you want a dynamic column name - use dynamic sql
 EXEC('UPDATE InvNum SET ' + @UDF + '=' + CAST(@CASH as VARCHAR(50) + ' WHERE AutoIndex = ' + CAST(@P1 as VARCHAR(5) ' );


text:
Q: Detect a dataChange while app is not running I am developing a social media app that has calling using the Agora SDK and so the way I detect if a user is being called is using Firebase RTDB and I wanted to ask if there was a way I can detect if a person is being called all while the app is closed so I can display the screen much like how Instagram, Whatsapp does it.

A: You can use Android ConnectionService to push notification when receiving a call. https://developer.android.com/reference/android/telecom/ConnectionService


text:
Q: How to find out what codec is being used in a video How can i see what codec was used in a video (Audio/Video) and extra information about what to use to reproduce the same compression/quality to the video.

A: You can get information about Audio/Video Codecs and additional information by installing mediainfo. Both GUI (Graphical User Interface) and command-line utilities are available. Use these commands to install:
sudo apt-get update
sudo apt-get install mediainfo

If you want to install GUI,
sudo apt-get install mediainfo-gui

for reference visit mediainfo

A: The hard to find 'midenitfy' script. An ancient copy looks like:
#!/bin/sh
#
# This is a wrapper around the -identify functionality.
# It is supposed to escape the output properly, so it can be easily
# used in shellscripts by 'eval'ing the output of this script.
#
# Written by Tobias Diedrich <ranma+mplayer@tdiedrich.de>
# Licensed under GNU GPL.

if [ -z "$1" ]; then
        echo "Usage: midentify <file> [<file> ...]"
        exit 1
fi

 mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null |
        sed -ne '/^ID_/ {
                           s/[]()|&;<>`'"'"'\\!$" []/\\&/g;p
                        }'

A: One way of doing this is by using VLC. Open the file in question, right click on it in the playlist and you'll see something like this:

I'm on OS X but the idea is the same.
Another way is to open a terminal, navigate to the directory containing the file and do:
file foo.avi

This doesn't provide a great deal of information but it is a start.

A: Another command line option with less "harsh" information:
ffprobe -show_streams "file.mp4"

Even with better output, it's still hard to a regular guy understand. If you need samples of several file formats to test it:
Video Format Examples