text:
@import UIKit; // Needed for the UIApplication Notifications
@import CoreBluetooth;
@import CoreLocation;

#import "RABeaconManager.h"

#import "RABeacon.h"
#import "RAIBeacon.h"
#import "RABeaconService.h"
#import "RAIBeaconService.h"

#define BLOG_DEBUG 0

#if BLOG_DEBUG
#   define BLog(...) NSLog(__VA_ARGS__)
#else
#   define BLog(...)
#endif

NSString *BeaconManagerBeaconsDetectedChangedNotification = @"BeaconManagerBeaconsDetectedChangedNotification";
NSString *BeaconManagerIBeaconsDetectedChangedNotification = @"BeaconManagerBeaconsDetectedChangedNotification";
NSString *BeaconManagerStateChangedNotification = @"BeaconManagerStateChangedNotification";

NSString *kBeaconManagerDateKey = @"kBeaconManagerDateKey";
NSString *kBeaconManagerBeaconKey = @"kBeaconManagerBeaconKey";
NSString *kBeaconManagerMacAddrKey = @"kBeaconManagerMacAddrKey";

NSString *beaconBackgroundAdvertisingDefaultURL = @"https://www.hyperlocalcontext.com/events";

static NSString * const kStoredBeaconServicesKey = @"kStoredBeaconServicesKey";
static NSString * const kStoredIBeaconServicesKey = @"kStoredIBeaconServicesKey";

static NSTimeInterval const kRefreshTimeInterval = 2.f;
static NSTimeInterval const kBeaconExpiryAge = 60.f;

@interface RABeaconManager () <CBCentralManagerDelegate, CBPeripheralManagerDelegate, CLLocationManagerDelegate>

@property (strong, nonatomic) CBCentralManager *centralManager;
@property (strong, nonatomic) CBPeripheralManager *peripheralManager;

@property (strong, nonatomic) CLLocationManager *locationManager;

@property (assign, nonatomic) BOOL detectInBackground;
@property (assign, nonatomic) BOOL detectBeacons;
@property (assign, nonatomic) BOOL detectIBeacons;

@property (assign, nonatomic) BeaconManagerState state;

@property (strong, nonatomic) NSArray *beaconServices;
@property (strong, nonatomic) NSArray *iBeaconServices;
@property (strong, nonatomic) NSMutableArray *mutableDetectedBeacons;
@property (strong, nonatomic) NSMutableArray *mutableDetectedIBeacons;

@property (strong, nonatomic) NSTimer *refreshTimer;

@property (assign, nonatomic) BOOL debugIBeacon;

@end

@implementation RABeaconManager

+ (instancetype)sharedManager
{
    static id manager;
    static dispatch_once_t onceToken;

    dispatch_once(&onceToken, ^
                  {
                      manager = [[self alloc] init];
                  });
    return manager;
}

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        self.mutableDetectedBeacons = [[NSMutableArray alloc] init];
        self.mutableDetectedIBeacons = [[NSMutableArray alloc] init];

        [self loadBeaconServices];

        self.beaconExpiryAge = kBeaconExpiryAge;

        [self setAppNotfications:YES];
    }
    return self;
}

- (void)dealloc
{
    [self.refreshTimer invalidate];
    self.refreshTimer = nil;

    [self setAppNotfications:NO];
}

- (void)setState:(BeaconManagerState)state
{
    if (_state != state)
    {
        _state = state;

        [[NSNotificationCenter defaultCenter] postNotificationName:BeaconManagerStateChangedNotification
                                                            object:self];
    }
}

- (void)updateState
{
    if (self.locationManager == nil && self.centralManager == nil)
    {
        BLog(@"BeaconManagerStateOff");
        self.state = BeaconManagerStateOff;
    }
    else if (self.centralManager
             && self.detectBeacons
             && self.centralManager.state != CBCentralManagerStatePoweredOn)
    {
        BLog(@"BeaconManagerStateNeedBluetooth");
        self.state = BeaconManagerStateNeedBluetooth;
    }
    else if (self.locationManager
             && self.detectIBeacons
             && [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedAlways
             && [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedWhenInUse)
    {
        BLog(@"BeaconManagerStateNeedLocationServices");
        self.state = BeaconManagerStateNeedLocationServices;
    }
    else
    {
        BLog(@"BeaconManagerStateOn");
        self.state = BeaconManagerStateOn;
    }
}

- (void)setBeaconDetection:(BOOL)detectBeacons
                  iBeacons:(BOOL)detectIBeacons
              inBackground:(BOOL)detectInBackground
{
    self.detectInBackground = detectInBackground;

    if (detectBeacons == YES && self.detectBeacons == NO)
    {
        [self turnOnCentral];
    }
    else if (detectBeacons == NO && self.detectBeacons == YES)
    {
        [self turnOffCentral];
    }
    self.detectBeacons = detectBeacons;

    if (detectIBeacons == YES && self.detectIBeacons == NO)
    {
        [self turnOnLocation];
    }
    else if (detectIBeacons == NO && self.detectIBeacons == YES)
    {
        [self turnOffLocation];
    }
    self.detectIBeacons = detectIBeacons;

    if (detectBeacons || detectIBeacons)
    {
        if (self.refreshTimer == nil)
        {
            self.refreshTimer = [NSTimer scheduledTimerWithTimeInterval:kRefreshTimeInterval
                                                                 target:self
                                                               selector:@selector(refresh:)
                                                               userInfo:nil
                                                                repeats:YES];
        }
    }
    else
    {
        [self.refreshTimer invalidate];
        self.refreshTimer = nil;
    }
}

- (NSArray *)loadItemsForKey:(NSString *)key
{

    NSArray *storedItems = [[NSUserDefaults standardUserDefaults] arrayForKey:key];
    NSMutableArray *items = [[NSMutableArray alloc] init];

    if (storedItems.count > 0)
    {
        for (NSData *itemData in storedItems)
        {
            id item = [NSKeyedUnarchiver unarchiveObjectWithData:itemData];
            [items addObject:item];
        }
        return [[NSArray alloc] initWithArray:items];
    }
    return @[];
}

- (void)loadBeaconServices
{
    self.beaconServices = [self loadItemsForKey:kStoredBeaconServicesKey];
    self.iBeaconServices = [self loadItemsForKey:kStoredIBeaconServicesKey];
}

- (void)persistItems:(NSArray *)items forKey:(NSString *)key
{
    NSMutableArray *itemDataArray = [[NSMutableArray alloc] init];

    for (id <NSCoding> item in items)
    {
        NSData *itemData = [NSKeyedArchiver archivedDataWithRootObject:item];
        [itemDataArray addObject:itemData];
    }
    [[NSUserDefaults standardUserDefaults] setObject:itemDataArray forKey:key];
}

- (void)persistBeacons
{
    [self persistItems:self.beaconServices forKey:kStoredBeaconServicesKey];
    [self persistItems:self.iBeaconServices forKey:kStoredIBeaconServicesKey];
}

- (void)addBeaconService:(RABeaconService *)beaconService
{
    for (RABeaconService *aBeaconService in self.beaconServices)
    {
        if ([aBeaconService isEqualToBeaconService:beaconService])
        {
            return;
        }
    }

    [self refreshBeaconScanning];

    self.beaconServices = [self.beaconServices arrayByAddingObject:beaconService];

    [self persistBeacons];
}

- (void)addIBeaconService:(RAIBeaconService *)iBeaconService
{
    for (RAIBeaconService *aIBeaconService in self.iBeaconServices)
    {
        if ([aIBeaconService isEqualToIBeaconService:iBeaconService])
        {
            return;
        }
    }

    [self startMonitoringIBeaconService:iBeaconService];
    [self refreshBeaconScanning];

    self.iBeaconServices = [self.iBeaconServices arrayByAddingObject:iBeaconService];

    [self persistBeacons];
}

- (void)removeBeaconService:(RABeaconService *)beaconService
{
    NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(RABeaconService *evaluatedObject, NSDictionary *bindings)
                              {
                                  if ([evaluatedObject isEqualToBeaconService:beaconService])
                                  {
                                      return NO;
                                  }
                                  else
                                  {
                                      return YES;
                                  }
                              }];

    self.beaconServices = [self.beaconServices filteredArrayUsingPredicate:predicate];

    [self refreshBeaconScanning];

    [self persistBeacons];
}

- (void)removeIBeaconService:(RAIBeaconService *)iBeaconService
{
    [self stopMonitoringIBeaconService:iBeaconService];

    NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(RAIBeaconService *evaluatedObject, NSDictionary *bindings)
                              {
                                  if ([evaluatedObject isEqualToIBeaconService:iBeaconService])
                                  {
                                      return NO;
                                  }
                                  else
                                  {
                                      return YES;
                                  }
                              }];

    self.iBeaconServices = [self.iBeaconServices filteredArrayUsingPredicate:predicate];

    [self persistBeacons];
}

- (void)removeAllServices
{
    self.beaconServices = @[];

    [self refreshBeaconScanning];

    for (RAIBeaconService *iBeaconService in self.iBeaconServices)
    {
        [self stopMonitoringIBeaconService:iBeaconService];
    }
    self.iBeaconServices = @[];

    [self persistBeacons];
}

#pragma mark - App Notifications

- (void)setAppNotfications:(BOOL)setNotifications
{
    if (setNotifications)
    {
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(appDidEnterBackgroundActive:)
                                                     name:UIApplicationDidEnterBackgroundNotification
                                                   object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(appWillEnterForegroundActive:)
                                                     name:UIApplicationWillEnterForegroundNotification
                                                   object:nil];
    }
    else
    {
        [[NSNotificationCenter defaultCenter] removeObserver:self
                                                        name:UIApplicationDidEnterBackgroundNotification
                                                      object:nil];
        [[NSNotificationCenter defaultCenter] removeObserver:self
                                                        name:UIApplicationWillEnterForegroundNotification
                                                      object:nil];
    }
}

- (void)appDidEnterBackgroundActive:(NSNotification *)notification
{
    BLog(@"appDidEnterBackgroundActive");
    if (self.detectInBackground == NO)
    {
        if (self.detectBeacons)
        {
            [self turnOffCentral];
        }

        if (self.detectIBeacons)
        {
            [self turnOffLocation];
        }
    }else if (self.detectBeacons && self.advertisePeripheralWhenBeaconDetected && self.peripheralServiceUUID != nil){

        // Need to call beginBackgroundTaskWithName to keep the app runing in background
        [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"fakeAdvertising" expirationHandler:^{}];

        // Start background task
        dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND,0), ^{
            [self advertisingBackgroundTask];
        });
    }
}

- (void) advertisingBackgroundTask
{
    UIApplicationState state = [[UIApplication sharedApplication] applicationState];

    if(state == UIApplicationStateBackground || state == UIApplicationStateInactive){

        if([self.mutableDetectedBeacons count] > 0){
            [self fakeAdvertisingRequest];
        }

        [NSThread sleepForTimeInterval:(5)];
        dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND,0), ^{
            [self advertisingBackgroundTask];
        });
    }
}

- (void) fakeAdvertisingRequest
{
    // Build NSData
    NSData *data = [self buildData];

    // Send request if build data succeeded
    if(data != nil){

        NSString *url = [self beaconBackgroundAdvertisingURL] != nil ? [self beaconBackgroundAdvertisingURL] : beaconBackgroundAdvertisingDefaultURL;

        @try {

            NSError *error = nil;
            NSURLResponse* response;

            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:url]
                                                                        cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60];
            [request setHTTPMethod:@"POST"];
            [request setValue:@"application/json" forHTTPHeaderField:@"content-type"];
            [request setHTTPBody:data];

            [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];

        } @catch (NSException *exception) {

            NSLog(@"Excepetion %@", exception);
        }

    }
}

-(NSData*) buildData
{
    NSString *perifUUID = self.peripheralServiceUUID;
    perifUUID = perifUUID != nil ? [perifUUID stringByReplacingOccurrencesOfString:@"-" withString:@""] : @"DEFAULT";

    NSMutableArray *tab = [NSMutableArray array];

    for (NSObject *o in self.mutableDetectedBeacons) {

        NSMutableDictionary *d = (NSMutableDictionary *)o;

        RABeacon *b = [(RABeacon *) d valueForKey:@"kBeaconManagerBeaconKey"];
        if( b != nil && b.systemID != nil){

            int theRssi = b.rssi != nil ? 0 : [b.rssi intValue];
            theRssi = [b.rssi intValue] > 0 ? [b.rssi intValue] -128 : [b.rssi intValue] + 128;

            NSMutableDictionary *id_dict = [NSMutableDictionary dictionary];
            [id_dict setObject:@"EUI-64" forKey:@"type"];
            [id_dict setObject:b.systemID forKey:@"value"];

            NSMutableDictionary *item_dict = [NSMutableDictionary dictionary];
            [item_dict setObject: [NSNumber numberWithInt:theRssi ] forKey:@"rssi"];
            [item_dict setObject:id_dict forKey:@"identifier"];

            [tab addObject:item_dict];
        }
    }

    NSMutableDictionary *advData = [NSMutableDictionary dictionary];
    [advData setObject:perifUUID forKey:@"complete128BitUUIDs"];

    NSMutableDictionary *advHeader = [NSMutableDictionary dictionary];
    [advHeader setObject:@"random" forKey:@"txAdd"];

    NSMutableDictionary *identifier = [NSMutableDictionary dictionary];
    [identifier setObject:@"ADVA-48" forKey:@"type"];
    [identifier setObject: [self getMacAddr] forKey:@"value"];
    [identifier setObject:advHeader forKey:@"advHeader"];
    [identifier setObject:advData forKey:@"advData"];

    NSMutableDictionary *tiraid = [NSMutableDictionary dictionary];
    [tiraid setObject:identifier forKey:@"identifier"];
    [tiraid setObject:[self getFormatedDate] forKey:@"timestamp"];
    [tiraid setObject:tab forKey:@"radioDecodings"];

    NSMutableDictionary *obj = [NSMutableDictionary dictionary];
    [obj setObject:@"appearance" forKey:@"event"];
    [obj setObject:tiraid forKey:@"tiraid"];

    // Convert to json
    NSData *json;

    // Dictionary convertable to JSON ?
    if ([NSJSONSerialization isValidJSONObject:obj])
    {
        // Serialize the dictionary
        NSError *error = nil;
        json = [NSJSONSerialization dataWithJSONObject:obj options:NSJSONWritingPrettyPrinted error:&error];
    }

    return json;
}

-(NSString*)getMacAddr
{
    if([[NSUserDefaults standardUserDefaults] valueForKey: kBeaconManagerMacAddrKey] == nil){

        NSString *addr = @"";

        for (int i =0; i < 6; i++) {
            int n = arc4random_uniform(254);
            addr = [addr stringByAppendingFormat:@"%02x",n];
        }

        [[NSUserDefaults standardUserDefaults] setValue:[addr lowercaseString] forKey:kBeaconManagerMacAddrKey];
    }

    return [[NSUserDefaults standardUserDefaults] valueForKey: kBeaconManagerMacAddrKey];
}

-(NSString*)getFormatedDate
{
    NSDate *d = [[NSDate alloc] init];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
    dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
    NSString *date = [dateFormatter stringFromDate: d];

    return date;
}

- (void)appWillEnterForegroundActive:(NSNotification *)notification
{
    BLog(@"appWillEnterForegroundActive");
    if (self.detectInBackground == NO)
    {
        if (self.detectBeacons)
        {
            [self turnOnCentral];
        }

        if (self.detectIBeacons)
        {
            [self turnOnLocation];
        }
    }
}

#pragma mark - CLLocationManagerDelegate

- (BOOL)turnOnLocation
{
    self.locationManager = [[CLLocationManager alloc] init];
    self.locationManager.delegate = self;

    if (self.detectInBackground)
    {
        [self.locationManager requestAlwaysAuthorization];
    }
    else
    {
        [self.locationManager requestWhenInUseAuthorization];
    }

    if ([CLLocationManager isMonitoringAvailableForClass:[CLBeaconRegion class]])
    {
        for (RAIBeaconService *iBeaconService in self.iBeaconServices)
        {
            [self startMonitoringIBeaconService:iBeaconService];
        }
    }
    else
    {
        BLog(@"Can't monitor beacon regions");

        [self updateState];

        return NO;
    }

    [self updateState];

    return YES;
}

- (void)turnOffLocation
{
    if ([CLLocationManager isMonitoringAvailableForClass:[CLBeaconRegion class]])
    {
        for (RAIBeaconService *iBeaconService in self.iBeaconServices)
        {
            [self stopMonitoringIBeaconService:iBeaconService];
        }
    }

    [self.locationManager stopUpdatingLocation];

    self.locationManager = nil;

    [self updateState];
}

- (void)startMonitoringIBeaconService:(RAIBeaconService *)iBeaconService
{
    CLBeaconRegion *beaconRegion = iBeaconService.beaconRegion;

    beaconRegion.notifyOnEntry = YES;
    beaconRegion.notifyEntryStateOnDisplay = YES;
    beaconRegion.notifyOnExit = YES;

    [self.locationManager startMonitoringForRegion:beaconRegion];
    [self.locationManager startRangingBeaconsInRegion:beaconRegion];
}

- (void)stopMonitoringIBeaconService:(RAIBeaconService *)iBeaconService
{
    CLBeaconRegion *beaconRegion = iBeaconService.beaconRegion;

    [self.locationManager stopMonitoringForRegion:beaconRegion];
    [self.locationManager stopRangingBeaconsInRegion:beaconRegion];
}

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
    BLog(@"Did enter region: %@", region);
}

- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region
{
    BLog(@"Did exit region: %@", region);
}

- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region
{
    BLog(@"Did determine state : %lld for region : %@", (long long)state, region);
}

- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region
{
    BLog(@"Did range beacons : %lld, %@", (long long)beacons.count, beacons);

    for (CLBeacon *beacon in beacons)
    {
        [self didDetectCLBeacon:beacon];
    }
}

- (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error
{
    BLog(@"Failed monitoring region: %@", error);
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    BLog(@"Location manager failed: %@", error);
}

- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
    BLog(@"kCLAuthorizationStatusAuthorized : %lld", (long long)kCLAuthorizationStatusAuthorized);
    BLog(@"kCLAuthorizationStatusAuthorizedAlways : %lld", (long long)kCLAuthorizationStatusAuthorizedAlways);
    BLog(@"kCLAuthorizationStatusAuthorizedWhenInUse : %lld", (long long)kCLAuthorizationStatusAuthorizedWhenInUse);
    BLog(@"Authorization Statis did change : %lld", (long long)status);

    [self updateState];
}

#pragma mark - CBCentralManagerDelegate

- (BOOL)turnOnCentral
{
    self.centralManager = [[CBCentralManager alloc] initWithDelegate:self
                                                               queue:nil
                                                             options:@{
                                                                       CBCentralManagerOptionShowPowerAlertKey: @(YES)
                                                                       }];
    [self updateState];

    return YES;
}

- (void)turnOffCentral
{
    [self.centralManager stopScan];

    self.centralManager = nil;

    [self updateState];
}

- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
    BLog(@"-- central state changed: %lld", (long long)self.centralManager.state);
    if (central.state == CBCentralManagerStatePoweredOn) {
        [self refreshBeaconScanning];
    }

    [self updateState];
}

- (void)refreshBeaconScanning
{
    if (self.centralManager.state != CBCentralManagerStatePoweredOn)
    {
        BLog(@"Error Central Manager is not powered on : state %lld", (long long)self.centralManager.state);
        return;
    }

    if (self.beaconServices.count == 0)
    {
        [self.centralManager stopScan];
    }
    else
    {
        NSDictionary *scanOptions = @{
                                      CBCentralManagerScanOptionAllowDuplicatesKey: @(YES)
                                      };

        NSMutableArray *identifiers = [[NSMutableArray alloc] init];

        for (RABeaconService *beaconService in self.beaconServices)
        {
            BLog(@"UUID : %@", beaconService.serviceUUID.UUIDString);
            [identifiers addObject:[CBUUID UUIDWithNSUUID:beaconService.serviceUUID]];
        }

        if (identifiers.count > 0)
        {
            [self.centralManager scanForPeripheralsWithServices:identifiers
                                                        options:scanOptions];
        }
        else
        {
            [self.centralManager stopScan];
        }
    }
}

- (void)centralManager:(CBCentralManager *)central
 didDiscoverPeripheral:(CBPeripheral *)peripheral
     advertisementData:(NSDictionary *)advertisementData
                  RSSI:(NSNumber *)RSSI
{
    NSArray *uuids = advertisementData[CBAdvertisementDataServiceUUIDsKey];

    CBUUID *systemUUIDKey = [CBUUID UUIDWithData:[NSData dataWithBytes:"\x2A\x23" length:2]];
    NSDictionary *serviceData = advertisementData[CBAdvertisementDataServiceDataKey];
    NSString *sysIDString = nil;
    if (serviceData)
    {
        NSData *sysID = serviceData[systemUUIDKey];
        if (sysID && [sysID length] >= 8) {
            unsigned char *s = (unsigned char*)sysID.bytes;
            sysIDString = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x", s[7], s[6], s[5], s[4], s[3], s[2], s[1], s[0]];
        }
    }

    for (CBUUID *uuid in uuids)
    {
        [self didDetectServiceUUID:[[NSUUID alloc] initWithUUIDString:uuid.UUIDString] systemID:sysIDString rssi:RSSI];
    }

    BLog(@"Found Peripheral Name : %@ : %@ : %@", peripheral.name, peripheral.identifier.UUIDString, advertisementData);
}

#pragma mark - CBPeripheralManagerDelegate

- (void)turnOnPeripheral
{
    self.peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self
                                                                     queue:nil];
}

- (void)turnOffPeripheral
{
    [self.peripheralManager stopAdvertising];
    self.peripheralManager = nil;
}

- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral
{
    BLog(@"-- peripheral state changed: %lld", (long long)self.peripheralManager.state);
    if (peripheral.state == CBPeripheralManagerStatePoweredOn)
    {
        [self startAdvertising];
    }
}

- (void)setAdvertisePeripheralWhenBeaconDetected:(BOOL)advertisePeripheralWhenBeaconDetected
{
    if (self.peripheralServiceUUID.length == 0 || self.peripheralName.length < 1)
    {
        @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Need peripheral UUID and Name" userInfo:nil];
    }

    _advertisePeripheralWhenBeaconDetected = advertisePeripheralWhenBeaconDetected;

    [self advertisePeripheralIfNeeded];
}

- (void)startAdvertising
{
    if (self.peripheralManager.state != CBPeripheralManagerStatePoweredOn)
    {
        BLog(@"Error Peripheral Manager is not powered on : state %lld", (long long)self.peripheralManager.state);
        return;
    }

    if (self.debugIBeacon)
    {
        NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:self.peripheralServiceUUID];
        NSString *identifier = self.peripheralName;

        CLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid
                                                                               major:1
                                                                               minor:1
                                                                          identifier:identifier];

        NSDictionary *payload = [beaconRegion peripheralDataWithMeasuredPower:nil];

        [self.peripheralManager startAdvertising:payload];
    }
    else
    {

        CBMutableService *transferService = [[CBMutableService alloc] initWithType:[CBUUID UUIDWithString:self.peripheralServiceUUID]
                                                                           primary:YES];

        if (self.peripheralCaracteristicUUID.length > 0)
        {
            CBMutableCharacteristic *transferCharacteristic = [[CBMutableCharacteristic alloc] initWithType:[CBUUID UUIDWithString:self.peripheralCaracteristicUUID]
                                                                                properties:CBCharacteristicPropertyNotify
                                                                                value:nil
                                                                                permissions:CBAttributePermissionsReadable];
            transferService.characteristics = @[
                                                transferCharacteristic
                                                ];
        }

        [self.peripheralManager addService:transferService];

        [self.peripheralManager startAdvertising:@{
                                                   CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:self.peripheralServiceUUID]],
                                                   CBAdvertisementDataLocalNameKey: self.peripheralName
                                                   }];
    }
}

- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral
                                       error:(NSError *)error
{
    BLog(@"Did start advertising : %@ error : %@", peripheral, error);
}

- (void)peripheralManager:(CBPeripheralManager *)peripheral
            didAddService:(CBService *)service
                    error:(NSError *)error
{
    BLog(@"Did add service : %@ ; Error : %@", service, error);
}

#pragma mark - Debug

- (void)startDebuggingIBeacon
{
    self.debugIBeacon = YES;

    if (self.locationManager)
    {
        [self turnOffLocation];
    }

    if (self.centralManager)
    {
        [self turnOffCentral];
    }

    if (self.peripheralManager == nil)
    {
        [self turnOnPeripheral];
    }
    else if (self.peripheralManager.state == CBPeripheralManagerStatePoweredOn)
    {
        [self startAdvertising];
    }
}

- (void)startDebuggingBeacon
{
    if (self.locationManager)
    {
        [self turnOffLocation];
    }

    if (self.centralManager)
    {
        [self turnOffCentral];
    }

    if (self.peripheralManager == nil)
    {
        [self turnOnPeripheral];
    }
    else if (self.peripheralManager.state == CBPeripheralManagerStatePoweredOn)
    {
        [self startAdvertising];
    }
}

#pragma mark - Detected Beacons

- (void)didDetectServiceUUID:(NSUUID *)uuid systemID:(NSString*)sysIDString rssi:(NSNumber*)rssi
{
    for (RABeaconService *beaconService in self.beaconServices)
    {
        if ([beaconService.serviceUUID isEqual:uuid])
        {
            RABeacon *beacon = [[RABeacon alloc] initWithBeaconService:beaconService
                                                              systemID:sysIDString
                                                                  rssi:rssi];

            [self didDetectBeacon:beacon];
            break;
        }
    }
}

- (void)didDetectBeacon:(RABeacon *)beacon
{
    NSDictionary *dict = [self dictForBeacon:beacon];

    if (self.filterBeaconBlock && self.filterBeaconBlock(beacon) == NO)
    {
        return;
    }

    if (dict == nil)
    {
        BLog(@"Adding new Dict : %@", self.mutableDetectedBeacons);

        dict = @{
                 kBeaconManagerDateKey: [NSDate date],
                 kBeaconManagerBeaconKey: beacon
                 };

        [self.mutableDetectedBeacons addObject:dict];

        [self detectedBeaconsDidUpdate];
    }
    else
    {
        NSMutableDictionary *mutableDict = [[NSMutableDictionary alloc] initWithDictionary:dict];

        mutableDict[kBeaconManagerDateKey] = [NSDate date];

        NSUInteger index = [[self mutableDetectedBeacons] indexOfObject:dict];

        if (index != NSNotFound)
        {
            // Update to override rssi
            mutableDict[kBeaconManagerBeaconKey] = beacon;

            [self.mutableDetectedBeacons replaceObjectAtIndex:index withObject:[[NSDictionary alloc] initWithDictionary:mutableDict]];
        }
    }
}

- (void)didDetectCLBeacon:(CLBeacon *)clBeacon
{
    RAIBeaconService *tmpIBeaconService = clBeacon.iBeaconService;

    for (RAIBeaconService *iBeaconService in self.iBeaconServices) {

        if ([iBeaconService isEqualToIBeaconService:tmpIBeaconService])
        {
            RAIBeacon *iBeacon = [[RAIBeacon alloc] initWithBeacon:iBeaconService CLBeacon:clBeacon];

            [self didDetectIBeacon:iBeacon];
            return;
        }
    }
}

- (void)didDetectIBeacon:(RAIBeacon *)iBeacon
{
    NSDictionary *dict = [self dictForIBeacon:iBeacon];

    if (self.filterIBeaconBlock && self.filterIBeaconBlock(iBeacon) == NO)
    {
        return;
    }

    if (dict == nil)
    {
        BLog(@"Adding new Dict : %@", self.mutableDetectedIBeacons);

        dict = @{
                 kBeaconManagerDateKey: [NSDate date],
                 kBeaconManagerBeaconKey: iBeacon
                 };

        [self.mutableDetectedIBeacons addObject:dict];

        [self detectedIBeaconsDidUpdate];
    }
    else
    {
        NSMutableDictionary *mutableDict = [[NSMutableDictionary alloc] initWithDictionary:dict];

        mutableDict[kBeaconManagerDateKey] = [NSDate date];

        NSUInteger index = [[self mutableDetectedIBeacons] indexOfObject:dict];

        if (index != NSNotFound)
        {
            [self.mutableDetectedIBeacons replaceObjectAtIndex:index withObject:[[NSDictionary alloc] initWithDictionary:mutableDict]];
        }
    }
}

- (NSDictionary *)dictForBeacon:(RABeacon *)beacon
{
    for (NSDictionary *dict in self.detectedBeacons)
    {
        if ([dict[kBeaconManagerBeaconKey] isEqual:beacon])
        {
            return dict;
        }
    }
    return nil;
}

- (NSDictionary *)dictForIBeacon:(RAIBeacon *)iBeacon
{
    for (NSDictionary *dict in self.detectedIBeacons)
    {
        if ([dict[kBeaconManagerBeaconKey] isEqual:iBeacon])
        {
            return dict;
        }
    }
    return nil;
}

- (void)detectedBeaconsDidUpdate
{
    [[NSNotificationCenter defaultCenter] postNotificationName:BeaconManagerBeaconsDetectedChangedNotification object:self];

    [self advertisePeripheralIfNeeded];
}

- (void)detectedIBeaconsDidUpdate
{
    [[NSNotificationCenter defaultCenter] postNotificationName:BeaconManagerIBeaconsDetectedChangedNotification object:self];

    [self advertisePeripheralIfNeeded];
}

- (void)advertisePeripheralIfNeeded
{
    if (self.advertisePeripheralWhenBeaconDetected)
    {
        if (self.mutableDetectedBeacons.count == 0 && self.mutableDetectedIBeacons.count == 0)
        {
            if (self.peripheralManager)
            {
                BLog(@"Turning Peripheral Off");
                [self turnOffPeripheral];
            }
        }
        else
        {
            if (self.peripheralManager == nil)
            {
                BLog(@"Turning Peripheral On");
                [self turnOnPeripheral];
            }
        }
    } else {

        if (self.peripheralManager)
        {
            BLog(@"Turning Peripheral Off");
            [self turnOffPeripheral];
        }
    }

}

- (void)refresh:(NSTimer *)timer
{
    BLog(@"Refreshing Beacons List");
    if ([self refreshDetectedBeacons:self.mutableDetectedBeacons])
    {
        [self detectedBeaconsDidUpdate];
    }

    BLog(@"Refreshing iBeacons List");
    if ([self refreshDetectedBeacons:self.mutableDetectedIBeacons])
    {
        [self detectedIBeaconsDidUpdate];
    }
}

- (BOOL)refreshDetectedBeacons:(NSMutableArray *)detectedBeacons
{
    NSUInteger removed = 0;

    for (NSUInteger i = 0; i < detectedBeacons.count; )
    {
        NSDictionary *dict = detectedBeacons[i];

        NSDate *date = dict[kBeaconManagerDateKey];

#if BLOG_DEBUG
        id beacon = dict[kBeaconManagerBeaconKey];

        if ([beacon isKindOfClass:[RABeacon class]])
        {
            RABeacon *beacon = beacon;

            BLog(@"Beacon expires in : %lf", (double)(self.beaconExpiryAge - date.timeIntervalSinceNow * -1));
        }
        else if ([beacon isKindOfClass:[RAIBeacon class]])
        {
            RAIBeacon *beacon = beacon;

            BLog(@"iBeacon expires in : %lf", (double)(self.beaconExpiryAge - date.timeIntervalSinceNow * -1));
        }
#endif

        if (date.timeIntervalSinceNow * -1 > self.beaconExpiryAge)
        {
            removed++;
            [detectedBeacons removeObjectAtIndex:i];
        }
        else
        {
            i++;
        }
    }

    if (removed > 0)
    {
        return YES;
    }
    return NO;
}

- (NSArray *)detectedBeacons
{
    return self.mutableDetectedBeacons;
}

- (NSArray *)detectedIBeacons
{
    return self.mutableDetectedIBeacons;
}

@end


The term "joyflation" (joy + deflation/inflation) was coined by Oxford Economics Ltd. in December 2014. "Joyflation" referred to the oil-driven slowdown in inflation and accelerating economic growth—things that bring joy to an economy.
Britain is heading for its most joyful year in the last quarter of a century, according to a group of economists.
Oxford Economics, a consultancy, says that the UK's "misery index," a combination of unemployment and inflation, will tumble to a multi-decade low in 2015.
There has been a lot of concern expressed in Europe about the risks of deflation and the threats it poses to economic stability. But falling oil prices offer the prospect of "good deflation" for the UK—giving people and companies more cash to spend and so supporting economic growth and jobs. It's like we've had a big tax cut, but one paid for by the oil-producing nations overseas rather than by the Treasury.
How long before Gidiot and Call Me Dave take credit for "joyflation" in 2015?
That's the term coined by Oxford Economics Ltd. to describe the combination of the oil-driven slowdown in inflation and accelerating economic growth. It's enough to force the Misery Index—a measure of an economy's health generated by adding the rates of unemployment and inflation—to its lowest since at least 1989 when consumer-price data became available.


Traveling through Italy's biggest cities at any time of the year, doesn't have to be daunting. With many travelers stopping by just for a couple of days on short trips, or in summer en route to the beach, it can feel overwhelming to find unique things to do off the beaten tourist track. If you like traveling local, here's a quick guide that features the three cool and unique things to do (and where to stay) in Rome, Florence and Milan.
In a tourist city like Rome where everyone comes to eat and just about every restaurant or food outlet claims to be real-deal, let Eating Italy Food Tours light the way! On their walking food tours around the pretty village-like Trastevere and working class foodie hun neighbourhood of Testacioo, they show you how Romans shop and eat. With around 8 tastings at Rome's bars, market stands, bakeries, restaurants and gelaterie, there's no better way to experience Rome like a local.
Rome isn't short of a church, but the Capuchin Crypt near Piazza Barberini, is one of the most quirky and unique. The crypt is hauntingly decorated with the bones of former Capuchin friars – over 4,000 of them! It's a cultural and spiritual experience not to be missed.
Seeing Rome from above is a must for all visitors. Walk up to Gianicolo or Janiculum Hill for expansive views of the eternal city. The buildings, pines and domes spread out before your eyes and the surround walkways are just as pretty.
Because: It's nothing but decadent luxury on the famed Via Veneto – home of La Dolce Vita. Boasting over 100 rooms, each with elegant art-deco touches (and many with balcony views), the hotel remains family run to this day. The Baglioni brand has become synonymous with Italian design and class. It features award-winning dining options and a fully appointed day spa on site and the concierge team are beyond helpful, treating every guest like a VIP.
Oltarno literally means beyond the Arno river and features a series of neighborhoods like Santo Spirito, your classic gentrified neighborhood that offers cool bars and restaurants and the Borgo San Frediano filled with Florence artisans. Take the Other Side of Florence Food Tour for the best way to explore this lesser known and more local part of Florence (and eat your heart out!). Try the famous Lampredotto (cow tripe) which is Florence's most historic street food, visit a 3rd generation baker and try some of the best gelato you'll ever taste.
Indulge in a green oasis right in the heart of the city. Featuring sculptures from the 16th-18th centuries, the Boboli Gardens were the original and main seat of the dukes of the Medici family. Check out the fountain of Neptune and the lovely views of the city. And why not bring a picnic lunch and make a day of it.
Florence is home to the best leather makers in the world. It's artisan history is alive and well today and the city remains a hub for design including handmade leather goods such as clothing, jewellery, bags and accessories. Visit the Scuola del Cuoio (Leather School) in an old Friars monastery and see the art in motion or book in for a class and make your own bag even; a uniquely Florentine thing to do! Popular site Lost in Florence (www.lostinflorence.it) regularly publishes profiles about the city's artisans and where to sample their ware.
Because: How many times in your life can you say you slept in an old palace with frescoes on the viewings? Located right by the Santa Croce Basilica, the hotel has a boutique feel with around 25 rooms. The Guelfi and Ghibellini restaurant showcases the best of local Tuscan cuisine and with its 3 Michelin stars, the Enoteca Pinchiorri is the ultimate in Florentine fine dining.
In 2015, the famous Italian fashion house moved into new digs about a half hours drive south of the city center. As stylish and flashy as one would expect, it features a museum and exhibition space, cafe and one of the buildings in the complex is casually covered in 24 carat gold leafs.
One might avoid this terrace right because of its proximity to Milan's centerpiece, the Duomo, but that would be a mistake! For about €15, at the Aperol Bar and Terrace, you can have the best view of it with a risotto Milanese and sip on your Aperol spritz too.
Venice may be Italy's true canal city, but did you know that Milan has a few as well? Just south of the city center this area of the city, complete with what used to be a 5 canal water way, comes alive especially in the evenings with restaurants and bars. You'll see locals sitting along the waters edge especially in the summer months.
Because: Located in the high end fashion district, the hotel is a Milan institution. Facing on to the prestigious Via della Spiga, the hotel features original art pieces throughout and following a recent refurbishment, the rooms are either Art Deco or classically styled. The restaurant Il Baretto is not only popular with hotel guests, but you'll find locals here dining for business or pleasure, testament to the quality of food and wine offering. For a more casual affair, Caffè Baglioni is your place.
An unabashed romantic, Maria created HeartRome because of her love of Rome and writing. In Rome you'll find her walking the streets of Trastevere, checking out the latest bar for an aperitivo or dining with friends. Find more of Maria's Italy travel tips on her Twitter, Instagram and Facebook.
Thanks hotelscombined for sharing my Italy travel experiences!
This is very nice. I like it!


Polyfoam, also known as polyethylene (PE) foam.
Size: 1200mm width x 100M length roll of 2mm thickness Polyfoam wraps's soft texture makes it the ideal packaging solution for highly polished surfaces as well as providing cushioning against shock for fragile items.
*The prices given here are for one roll and GST exclusive.


text:
Q: Executing multiple commands using winexe ./bin/winexe -U <username>%<password> //<ip> "cmd.exe /c net use x: \\\\<ip>\\share    /user:<user> <password>"

This command works fine, but for me to run another command to use this mapped drive, another run of /bin/winexe gives me access denied.
I cannot run multiple commands like below using a semicolon
./bin/winexe -U <username>%<password> //<ip> "cmd.exe /c net use x: \\\\<ip>\\share    /user:<user> <password> ; cmd.exe /c copy X:\something c:"

But if i do this, it works. but i cannot automate this:
./bin/winexe -U <username>%<password> //<ip> "cmd.exe"
C:\Windows\system32> net use x: \\\\<ip>\\share    /user:<user> <password>
C:\Windows\system32> copy x:\something c:

My requirement is to install a msi package which is on a network share using winexe. Using expect is my last option

A: You can use "&" instead of semicolon.
The correct way to execute multiple commands via cmd:
dir & echo foo

redpajama_set_name: RedPajamaStackExchange


Last week I used the two day fall break that the University of Michigan now offers to visit New York city with Jeremy. Jeremy's friend Kyle, who worked for him on the web lecture archive project, is getting his MFA studying film at Columbia and offered us a place to stay.
We had an incredible time overall, though there were some frustrations. The first day we tried to take the ferry to Ellis Island, but we arrived just as the last boat was leaving (3:40pm, so early!). On the last day we planned to walk around Central Park, but on that day, after three days of perfect weather, it rained continuously. But, we did eventually get to Ellis Island, and instead of seeing the park I was able to buy some shoes I desperately needed and hang out with Jeremy at a very nice cafe.
Other things worked out perfectly. I eventually found the Crumpler store that I wanted to visit, and though they didn't have the bag I wanted in the color I wanted, the woman working there was very helpful. I ordered the bag online that night. Jeremy got some shoes that he is now obsessed with. We visited the MoMA and I saw all the parts I missed the last time plus the new temporary exhibit. Saturday, Jeremy and I had a light meal and tea at Teany, and Sunday morning we had tea with Steve and Emily, who just happened to visiting that weekend. Steve took us to a place that had very good tea and sandwiches, Alice's Teapot, though the girly decor was so extereme that Jeremy and I are certain we would never have stepped foot in the place on our own. We also took a couple long walks, once wondering all the way up from the tip of downtown to Times Square, another time circling the Village with Kyle looking for a bar. On that second trip we eventually ended up at an excellent caviar/martini bar a little bit outside the village on the edge of SoHo called Pravda. The pear martini I started off with was probably my favorite, and Kyle had one with strawberries that was also excellent, the ingrediants always tasted as fresh as they could be.


Conely Did his 2001 FXDXT back in 2008 With a O.E.M. FXR-P Fairing and still has it to this day. Look for it out there at the shows.
It will be trailing with Dan the Bickers Choice Truck Driver for 2016. Conely's USA makes the strongest fiberglass on the market.
We us Vacuum Molds. Not the Cheap old school had laid way witch leaves air or a ruff finish in the parts.
MADE IN THE USA. All Conely's fairings are made with (6) layers of fiberglass to give you the Best part and a very smooth Finish inside and out.
Our fairing is all molded in 1 piece, unlike the OEM which was molded in two pieces and bonded together and out of plastic.
They are black powder coated. Comes with 10" smoked windshield and smoked headlight cover, all the rubber trim for the light and the Glass.
All black coated and stainless cap nut bolts.
The fairing comes Unassembled, please mock up and drill all holes prior to painting. This fairing should be fitted to your machine BEFORE paint just as if you were going to ride it that way. This means the fairing should be mocked up and marked before cutting/drilling any holes. Only after all holes have been marked and you are sure the placements are correct, cut/drill the holes and mount the fairing to your bike. This is to ensure proper fitment and will save you time and hassle down the road.
Contact J&P Cycles or your local Biker's Choice dealer or at your local Dealer around the world.
You can order Conely's Parts from your local Harley Dealer around the world.
Or Call Conely's at 619-498-1102 for more info.
YOU NEED ONE DON'T WAIT THE BEST. GRATE CUSTOMER SERVICE. FAST SHIPPING. I GOT THE FAIRING BAGS LOWERS AND REAR FENDER.I HAD THEM PAINT MY PARTS FIRST. I WILL KEEP ORDERING FROM CONELYS. THE PAINT MATCH WAS EXCELLENT. VERY GOOD RESPONSE FROM THEM.
Was well worth buying Conleys Fairing and lowers.


Khartoum / Dardib / Abu Jubeiha — According to Sudan's Central Bureau of Statistics the inflation rate in the country in March reached 55.60 per cent; up from 54.34 per cent in February. Public transport prices nearly doubled last week.
In particular, the prices of basic commodities reached record levels. "With a contribution of 56.80 per cent, food and beverages turned out to be the largest group [of commodities] contributing to the inflation rate," the Central Bureau of Statistics said on Thursday.
The shortage of hard currency in Sudan in addition to the devaluation of the Sudanese Pound in early January has negatively affected the import of various consumer goods, including wheat and medicines. The fuel and gas shortages that rapidly grew last year are exacerbating the financial crisis in the country.
The prices of vegetables and fruits however decreased in the past month.
The inflation rate in rural areas reached 60.71 per cent in March, compared to 59.59 per cent in February. El Gezira state, south of Khartoum, recorded the highest inflation rate: 82.28 percent; Khartoum state the lowest at 47.64 per cent.
Last week, travellers in Sudan complained to Radio Dabanga about soaring ticket prices.
"Many people cannot afford to visit their relatives in another part of the country anymore," one of them said.
According to the sources, the price of a bus ticket from Khartoum to El Fasher, capital of North Darfur, almost doubled as it jumped from SDG 350 ($ 19*) to SDG 550 ($ 30), from Khartoum to Nyala in South Darfur from SDG 550 to SDG 750, and from Khartoum to the North Kordofan capital of El Obeid from SDG 150 to SDG 270.
Bus owners explained that apart from skyrocketing fuel prices, the authorities raised the extension of a bus license from SDG 15,000 ($ 823) to SDG 33,000 ($1,817).
"Even the price of the stamp on the ticket was increased," a bus owner reported. "We now have to pay SDG 25 for each stamp."
People in Dardib, on the Kassala-Red Sea state border, are suffering from an acute shortage of both drinking water and petrol.
"The fuel crisis pushed the black market price of petrol up with 250 per cent," journalist Osman Hashim told Radio Dabanga. "One of the town's water tanks broke down as well," he said. "People are now paying SDG 60 ($ 3.30) instead of SDG 40 for two barrels of water from the donkey cart."
Residents of eastern South Kordofan are complaining about the scarcity of fuel as well.
"Transport between the various districts and the market or the schools has halted," a car owner told this station from Abu Jubeiha town. "The price of a gallon of petrol reached SDG 300 on the black market," he said. "A bus ticket from Abu Jubeiha to Um Rawaba rose from SDG 400 to SDG 500 last week."


» Lost 03/28/07 NoHo Ink.
i'd like to hear anyone's thoughts on last night's episode. it was a strange episode, one that tried to shake things up a bit, like when the X-Files used to do the funny episodes, like "Clyde Bruckman's Final Repose" or "Jose Chung's 'From Outer Space'", although executed with less skill.i enjoyed the trickery employed with flashbacks from "dead" people. part of me wishes that they would have been actually dead, not paralyzed, because that would set an interesting precedent of what they can now do with flashbacks. i'm not saying that it wouldn't have annoyed me a little if they allowed us to look into dead people's pasts, but it definitely would have changed the way that they can tell stories.
i also enjoyed that the show was essentially a whodunit? a very simple one, but a whodunit, nonetheless.
the thing that simultaneously pissed off and pleased me was the planning that went into the episode. it's obvious that the producers have been planning on doing SOMETHING with these two since they popped up at the beginning of the season: Paulo using the bathroom in the Pearl was too random an occurance for it not to have been part of their plan to have him hiding something in there (dear god, i hope).
however, they also went to a lot of effort to make it look like Nikki and Paulo had been there all along, cruising around on the sidelines, not getting involved because they were looking for their bag. i'm sorry, but they weren't. i'm all for them introducing new characters (otherwise it's kinda hard to keep the show going, since they keep killing people), but i'd much rather they delved into Desmonde's ex-fiance who's searching for him or Juliet, Ben and Tom. they killed / captured all the tailies, so they should really focus with what they already have on their plates, instead of continuing to introduce the expendable day-players so they can kill them (or bury them alive). they kill off too many Artz Nikki and Paulos, and they're gonna turn into Star Trek.
the episode as a whole was about as frustrating to me as "The Other 48 Days" was. in my opinion, if it takes 24 episodes to tell you what happened on one side of the island, then it isn't very smart to try and cram what happened on the OTHER side of the island into a single episode. the same thing goes for these two: there was just TOO MUCH ground to cover in that one sitting. if you have more than one flashback per act (the space between each commercial break), then you have too many flashbacks. any thing going on in the present seems too slow and stilted, anything in the past feels too rushed. it's a lose / lose situation, man.
ultimately, i think that the show is moving in a good direction: they're trying new things, working out kinks, and spacing out the focus so that they don't burn out any of the plot lines. however, having just been picked up for a fourth season, they need to make a decision about when this thing is going to end, and whether or not they have enough ideas to get there. supposedly, ABC agreed to an end date for the series. let's hope it's not set for May of 2010.


text:
Adolescent and young adult oncology training for health professionals: A position statement
Brandon Hayes-Lattin, Beth Mathews-Bradshaw, Stuart Siegel
We outline here the essential elements of training for health care professionals who work with adolescent and young adult (AYA) patients with cancer. Research is emerging that a number of cancers manifest themselves differently in the AYA population, both in terms of biology and treatment response. In addition, there are a number of issues uniquely experienced by the AYA population that are critical for health care professionals working within AYA oncology (AYAO) to understand. The LIVESTRONG Young Adult Alliance, a Lance Armstrong Foundation program and a result of the Adolescent and Young Adult Oncology Progress Review Group cosponsored by the Lance Armstrong Foundation and the National Cancer Institute, assembled a group of experts representing relevant medical, psychosocial, and advocacy disciplines to create a blueprint for the training and development of health care professionals caring for AYA patients with cancer. The Alliance recommends that all health care professionals working in AYAO receive training that provides expertise in the following three critical areas: AYA-specific medical knowledge; care delivery specific to AYAs relative to pediatric and older adult populations; and competency in application and delivery of AYA-specific practical knowledge. These three areas should form the foundation for curricula and programs designed to train health care professionals caring for AYAO patients.
Journal of Clinical Oncology
https://doi.org/10.1200/JCO.2010.30.5508
Published - Nov 10 2010
National Cancer Institute (U.S.)
Hayes-Lattin, B., Mathews-Bradshaw, B., & Siegel, S. (2010). Adolescent and young adult oncology training for health professionals: A position statement. Journal of Clinical Oncology, 28(32), 4858-4861. https://doi.org/10.1200/JCO.2010.30.5508
Adolescent and young adult oncology training for health professionals : A position statement. / Hayes-Lattin, Brandon; Mathews-Bradshaw, Beth; Siegel, Stuart.
In: Journal of Clinical Oncology, Vol. 28, No. 32, 10.11.2010, p. 4858-4861.
Hayes-Lattin, B, Mathews-Bradshaw, B & Siegel, S 2010, 'Adolescent and young adult oncology training for health professionals: A position statement', Journal of Clinical Oncology, vol. 28, no. 32, pp. 4858-4861. https://doi.org/10.1200/JCO.2010.30.5508
Hayes-Lattin B, Mathews-Bradshaw B, Siegel S. Adolescent and young adult oncology training for health professionals: A position statement. Journal of Clinical Oncology. 2010 Nov 10;28(32):4858-4861. https://doi.org/10.1200/JCO.2010.30.5508
Hayes-Lattin, Brandon ; Mathews-Bradshaw, Beth ; Siegel, Stuart. / Adolescent and young adult oncology training for health professionals : A position statement. In: Journal of Clinical Oncology. 2010 ; Vol. 28, No. 32. pp. 4858-4861.
@article{d13591dafee34fd8b06b9a53f80e6255,
title = "Adolescent and young adult oncology training for health professionals: A position statement",
abstract = "We outline here the essential elements of training for health care professionals who work with adolescent and young adult (AYA) patients with cancer. Research is emerging that a number of cancers manifest themselves differently in the AYA population, both in terms of biology and treatment response. In addition, there are a number of issues uniquely experienced by the AYA population that are critical for health care professionals working within AYA oncology (AYAO) to understand. The LIVESTRONG Young Adult Alliance, a Lance Armstrong Foundation program and a result of the Adolescent and Young Adult Oncology Progress Review Group cosponsored by the Lance Armstrong Foundation and the National Cancer Institute, assembled a group of experts representing relevant medical, psychosocial, and advocacy disciplines to create a blueprint for the training and development of health care professionals caring for AYA patients with cancer. The Alliance recommends that all health care professionals working in AYAO receive training that provides expertise in the following three critical areas: AYA-specific medical knowledge; care delivery specific to AYAs relative to pediatric and older adult populations; and competency in application and delivery of AYA-specific practical knowledge. These three areas should form the foundation for curricula and programs designed to train health care professionals caring for AYAO patients.",
author = "Brandon Hayes-Lattin and Beth Mathews-Bradshaw and Stuart Siegel",
doi = "10.1200/JCO.2010.30.5508",
journal = "Journal of Clinical Oncology",
publisher = "American Society of Clinical Oncology",
T1 - Adolescent and young adult oncology training for health professionals
T2 - A position statement
AU - Hayes-Lattin, Brandon
AU - Mathews-Bradshaw, Beth
AU - Siegel, Stuart
N2 - We outline here the essential elements of training for health care professionals who work with adolescent and young adult (AYA) patients with cancer. Research is emerging that a number of cancers manifest themselves differently in the AYA population, both in terms of biology and treatment response. In addition, there are a number of issues uniquely experienced by the AYA population that are critical for health care professionals working within AYA oncology (AYAO) to understand. The LIVESTRONG Young Adult Alliance, a Lance Armstrong Foundation program and a result of the Adolescent and Young Adult Oncology Progress Review Group cosponsored by the Lance Armstrong Foundation and the National Cancer Institute, assembled a group of experts representing relevant medical, psychosocial, and advocacy disciplines to create a blueprint for the training and development of health care professionals caring for AYA patients with cancer. The Alliance recommends that all health care professionals working in AYAO receive training that provides expertise in the following three critical areas: AYA-specific medical knowledge; care delivery specific to AYAs relative to pediatric and older adult populations; and competency in application and delivery of AYA-specific practical knowledge. These three areas should form the foundation for curricula and programs designed to train health care professionals caring for AYAO patients.
AB - We outline here the essential elements of training for health care professionals who work with adolescent and young adult (AYA) patients with cancer. Research is emerging that a number of cancers manifest themselves differently in the AYA population, both in terms of biology and treatment response. In addition, there are a number of issues uniquely experienced by the AYA population that are critical for health care professionals working within AYA oncology (AYAO) to understand. The LIVESTRONG Young Adult Alliance, a Lance Armstrong Foundation program and a result of the Adolescent and Young Adult Oncology Progress Review Group cosponsored by the Lance Armstrong Foundation and the National Cancer Institute, assembled a group of experts representing relevant medical, psychosocial, and advocacy disciplines to create a blueprint for the training and development of health care professionals caring for AYA patients with cancer. The Alliance recommends that all health care professionals working in AYAO receive training that provides expertise in the following three critical areas: AYA-specific medical knowledge; care delivery specific to AYAs relative to pediatric and older adult populations; and competency in application and delivery of AYA-specific practical knowledge. These three areas should form the foundation for curricula and programs designed to train health care professionals caring for AYAO patients.
U2 - 10.1200/JCO.2010.30.5508
DO - 10.1200/JCO.2010.30.5508
JO - Journal of Clinical Oncology
JF - Journal of Clinical Oncology
10.1200/JCO.2010.30.5508

redpajama_set_name: RedPajamaCommonCrawl


Phyllis Irene Wentworth, 88, passed away on Wednesday, November 14, 2018 in the presence of her loving family in Dallas, Texas. She will forever be known for her love and dedication to family. She had three children, Steve Wentworth (wife Karen), Martha Farquharson (husband Robbie) and Marla Byrne (husband Brian), 7 grandchildren and 4 great grandchildren. She was preceded in death by her husband of 47 years, E. J. (Gene) Wentworth and a grandson, Kevin Wentworth.
She traveled the western United States as the wife of an oil and gas landman, living in Bartlesville, Oklahoma; Denver, Colorado (three times); Casper Wyoming (three times); Bakersfield, California (twice); Billings, Montana; Anchorage, Alaska; Roswell, New Mexico; Midland, Texas (twice); and finally, Dallas, Texas. She worked for the Federal Housing Administration and the Social Security Administration and later in life took over her mother's business, Irene's Antiques of Distinction.
A graveside service will be held at 11:00 AM on Monday, November 19 at Sunnyside Cemetery in Caney, Kansas, under the direction of Potts Chapel. In lieu of flowers, contributions may be made to the Alzheimer's Association or the ALS Association. To leave the family a special message of condolence, please visit www.pottsfuneralhome.com.
Martha I have thought often of your mother since she stopped coming to the antique shows. I was blessed to have known her. She was a beautiful, precious lady. So very sorry for your loss. My prayers and thoughts are with you and your family. Peace and blessings to you all.
Thinking of you and the celebration of Phyllis' life and legacy. I remember her kindness, dedication, hard work and joy in life and I see these things passed down in the succeeding generations. May the Lord comfort you with good memories and His presence.
We are so sorry for your loss. We are grateful for the memories of the special times we had with Phyllis. May God bring you comfort and peace during this time.


text:
Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ
Nikolay Burnaevskiy, Thomas G. Fox, Daniel A. Plymire, James M. Ertelt, Bethany A. Weigele, Andrey S. Selyunin, Sing Sing Way, Steven M. Patrie, Neal M. Alto*
Protein N-myristoylation is a 14-carbon fatty-acid modification that is conserved across eukaryotic species and occurs on nearly 1% of the cellular proteome. The ability of the myristoyl group to facilitate dynamic protein-protein and protein-membrane interactions (known as the myristoyl switch) makes it an essential feature of many signal transduction systems. Thus pathogenic strategies that facilitate protein demyristoylation would markedly alter the signalling landscape of infected host cells. Here we describe an irreversible mechanism of protein demyristoylation catalysed by invasion plasmid antigen J (IpaJ), a previously uncharacterized Shigella flexneri type III effector protein with cysteine protease activity. A yeast genetic screen for IpaJ substrates identified ADP-ribosylation factor (ARF)1p and ARF2p, small molecular mass GTPases that regulate cargo transport through the Golgi apparatus. Mass spectrometry showed that IpaJ cleaved the peptide bond between N-myristoylated glycine-2 and asparagine-3 of human ARF1, thereby providing a new mechanism for host secretory inhibition by a bacterial pathogen. We further demonstrate that IpaJ cleaves an array of N-myristoylated proteins involved in cellular growth, signal transduction, autophagasome maturation and organelle function. Taken together, these findings show a previously unrecognized pathogenic mechanism for the site-specific elimination of N-myristoyl protein modification.
10.1038/nature12004
Dive into the research topics of 'Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ'. Together they form a unique fingerprint.
proteins INIS 100%
Protein Biochemistry, Genetics and Molecular Biology 74%
antigens INIS 62%
plasmids INIS 62%
Antigen Immunology and Microbiology 62%
modifications INIS 37%
signals INIS 25%
host INIS 25%
Burnaevskiy, N., Fox, T. G., Plymire, D. A., Ertelt, J. M., Weigele, B. A., Selyunin, A. S., Way, S. S., Patrie, S. M., & Alto, N. M. (2013). Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ. Nature, 496(7443), 106-109. https://doi.org/10.1038/nature12004
Burnaevskiy, Nikolay ; Fox, Thomas G. ; Plymire, Daniel A. et al. / Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ. In: Nature. 2013 ; Vol. 496, No. 7443. pp. 106-109.
@article{ce9c52bf53b24df0bc9afa9f0da7873f,
title = "Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ",
abstract = "Protein N-myristoylation is a 14-carbon fatty-acid modification that is conserved across eukaryotic species and occurs on nearly 1% of the cellular proteome. The ability of the myristoyl group to facilitate dynamic protein-protein and protein-membrane interactions (known as the myristoyl switch) makes it an essential feature of many signal transduction systems. Thus pathogenic strategies that facilitate protein demyristoylation would markedly alter the signalling landscape of infected host cells. Here we describe an irreversible mechanism of protein demyristoylation catalysed by invasion plasmid antigen J (IpaJ), a previously uncharacterized Shigella flexneri type III effector protein with cysteine protease activity. A yeast genetic screen for IpaJ substrates identified ADP-ribosylation factor (ARF)1p and ARF2p, small molecular mass GTPases that regulate cargo transport through the Golgi apparatus. Mass spectrometry showed that IpaJ cleaved the peptide bond between N-myristoylated glycine-2 and asparagine-3 of human ARF1, thereby providing a new mechanism for host secretory inhibition by a bacterial pathogen. We further demonstrate that IpaJ cleaves an array of N-myristoylated proteins involved in cellular growth, signal transduction, autophagasome maturation and organelle function. Taken together, these findings show a previously unrecognized pathogenic mechanism for the site-specific elimination of N-myristoyl protein modification.",
author = "Nikolay Burnaevskiy and Fox, {Thomas G.} and Plymire, {Daniel A.} and Ertelt, {James M.} and Weigele, {Bethany A.} and Selyunin, {Andrey S.} and Way, {Sing Sing} and Patrie, {Steven M.} and Alto, {Neal M.}",
note = "Funding Information: Acknowledgements We thank our colleagues at University of Texas Southwestern Medical Center, specifically K. Orth, Y. M. Chook and J. Seeman, for discussions in preparing this manuscript. We are particularly indebted to L. Kinch, N. Grishin, D.Mitchel,X.Guo, D.Trudgianand S.Perelmanfor their contributions.Weacknowledge the services of the University of Texas Southwestern Medical Center proteomics core, supported by a Cancer Prevention and Research Institute of Texas grant RP120613. A.S.S. was supported by the Howard Hughes Medical Institute International Student Research fellowship. B.A.W. was supported by a National Institutes of Health training grant (NIAID; 5T32AI007520) and S.S.W. by the Burroughs Wellcome Fund. This work was supported by grants from the National Institutes of Health (NIAID; RO1AI083359 and NIGMS; R01GM100486), the Welch Foundation (I-1704) and the Burroughs Wellcome Fund to N.M.A.",
doi = "10.1038/nature12004",
Burnaevskiy, N, Fox, TG, Plymire, DA, Ertelt, JM, Weigele, BA, Selyunin, AS, Way, SS, Patrie, SM & Alto, NM 2013, 'Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ', Nature, vol. 496, no. 7443, pp. 106-109. https://doi.org/10.1038/nature12004
Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ. / Burnaevskiy, Nikolay; Fox, Thomas G.; Plymire, Daniel A. et al.
T1 - Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ
AU - Burnaevskiy, Nikolay
AU - Fox, Thomas G.
AU - Plymire, Daniel A.
AU - Ertelt, James M.
AU - Weigele, Bethany A.
AU - Selyunin, Andrey S.
AU - Way, Sing Sing
AU - Patrie, Steven M.
AU - Alto, Neal M.
N1 - Funding Information: Acknowledgements We thank our colleagues at University of Texas Southwestern Medical Center, specifically K. Orth, Y. M. Chook and J. Seeman, for discussions in preparing this manuscript. We are particularly indebted to L. Kinch, N. Grishin, D.Mitchel,X.Guo, D.Trudgianand S.Perelmanfor their contributions.Weacknowledge the services of the University of Texas Southwestern Medical Center proteomics core, supported by a Cancer Prevention and Research Institute of Texas grant RP120613. A.S.S. was supported by the Howard Hughes Medical Institute International Student Research fellowship. B.A.W. was supported by a National Institutes of Health training grant (NIAID; 5T32AI007520) and S.S.W. by the Burroughs Wellcome Fund. This work was supported by grants from the National Institutes of Health (NIAID; RO1AI083359 and NIGMS; R01GM100486), the Welch Foundation (I-1704) and the Burroughs Wellcome Fund to N.M.A.
N2 - Protein N-myristoylation is a 14-carbon fatty-acid modification that is conserved across eukaryotic species and occurs on nearly 1% of the cellular proteome. The ability of the myristoyl group to facilitate dynamic protein-protein and protein-membrane interactions (known as the myristoyl switch) makes it an essential feature of many signal transduction systems. Thus pathogenic strategies that facilitate protein demyristoylation would markedly alter the signalling landscape of infected host cells. Here we describe an irreversible mechanism of protein demyristoylation catalysed by invasion plasmid antigen J (IpaJ), a previously uncharacterized Shigella flexneri type III effector protein with cysteine protease activity. A yeast genetic screen for IpaJ substrates identified ADP-ribosylation factor (ARF)1p and ARF2p, small molecular mass GTPases that regulate cargo transport through the Golgi apparatus. Mass spectrometry showed that IpaJ cleaved the peptide bond between N-myristoylated glycine-2 and asparagine-3 of human ARF1, thereby providing a new mechanism for host secretory inhibition by a bacterial pathogen. We further demonstrate that IpaJ cleaves an array of N-myristoylated proteins involved in cellular growth, signal transduction, autophagasome maturation and organelle function. Taken together, these findings show a previously unrecognized pathogenic mechanism for the site-specific elimination of N-myristoyl protein modification.
AB - Protein N-myristoylation is a 14-carbon fatty-acid modification that is conserved across eukaryotic species and occurs on nearly 1% of the cellular proteome. The ability of the myristoyl group to facilitate dynamic protein-protein and protein-membrane interactions (known as the myristoyl switch) makes it an essential feature of many signal transduction systems. Thus pathogenic strategies that facilitate protein demyristoylation would markedly alter the signalling landscape of infected host cells. Here we describe an irreversible mechanism of protein demyristoylation catalysed by invasion plasmid antigen J (IpaJ), a previously uncharacterized Shigella flexneri type III effector protein with cysteine protease activity. A yeast genetic screen for IpaJ substrates identified ADP-ribosylation factor (ARF)1p and ARF2p, small molecular mass GTPases that regulate cargo transport through the Golgi apparatus. Mass spectrometry showed that IpaJ cleaved the peptide bond between N-myristoylated glycine-2 and asparagine-3 of human ARF1, thereby providing a new mechanism for host secretory inhibition by a bacterial pathogen. We further demonstrate that IpaJ cleaves an array of N-myristoylated proteins involved in cellular growth, signal transduction, autophagasome maturation and organelle function. Taken together, these findings show a previously unrecognized pathogenic mechanism for the site-specific elimination of N-myristoyl protein modification.
U2 - 10.1038/nature12004
DO - 10.1038/nature12004
Burnaevskiy N, Fox TG, Plymire DA, Ertelt JM, Weigele BA, Selyunin AS et al. Proteolytic elimination of N-myristoyl modifications by the Shigella virulence factor IpaJ. Nature. 2013 Apr 4;496(7443):106-109. doi: 10.1038/nature12004


text:
Q: The updated ggforce with facet_zoom2() functions fails to be installed I'm trying to install an updated ggforce package with facet_zoom2() function to change the position of the zoomed area in my R Studio, version 4.1.2 on my windows10. And as the kindly reference solution How to change the position of the zoomed area from facet_zoom()? suggested, I wrote following test code devtools::install_github("thomasp85/ggforce", ref = '4008a2e')
But I'm getting an error message as follows
Downloading GitHub repo thomasp85/ggforce@4008a2e
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: colorspace (2.0-2 -> 2.0-3) [CRAN]
5: vctrs      (0.3.8 -> 0.4.1) [CRAN]
6: glue       (1.5.0 -> 1.6.2) [CRAN]
7: fansi      (0.5.0 -> 1.0.3) [CRAN]
8: magrittr   (2.0.1 -> 2.0.3) [CRAN]
9: dplyr      (1.0.7 -> 1.0.8) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
colorspace (2.0-2 -> 2.0-3) [CRAN]
vctrs      (0.3.8 -> 0.4.1) [CRAN]
glue       (1.5.0 -> 1.6.2) [CRAN]
fansi      (0.5.0 -> 1.0.3) [CRAN]
magrittr   (2.0.1 -> 2.0.3) [CRAN]
dplyr      (1.0.7 -> 1.0.8) [CRAN]
Installing 6 packages: colorspace, vctrs, glue, fansi, magrittr, dplyr
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/colorspace_2.0-3.zip'
Content type 'application/zip' length 2650776 bytes (2.5 MB)
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/vctrs_0.4.1.zip'
Content type 'application/zip' length 1572492 bytes (1.5 MB)
downloaded 1.5 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/glue_1.6.2.zip'
Content type 'application/zip' length 171859 bytes (167 KB)
downloaded 167 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/fansi_1.0.3.zip'
Content type 'application/zip' length 365622 bytes (357 KB)
downloaded 357 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/magrittr_2.0.3.zip'
Content type 'application/zip' length 238609 bytes (233 KB)
downloaded 233 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/dplyr_1.0.8.zip'
Content type 'application/zip' length 1382542 bytes (1.3 MB)
downloaded 1.3 MB

package 'colorspace' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'colorspace'
Warning: restored 'colorspace'
package 'vctrs' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'vctrs'
Warning: restored 'vctrs'
package 'glue' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'glue'
Warning: restored 'glue'
package 'fansi' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'fansi'
Warning: restored 'fansi'
package 'magrittr' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'magrittr'
Warning: restored 'magrittr'
package 'dplyr' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'dplyr'
Warning: restored 'dplyr'

The downloaded binary packages are in
    C:\Users\T3431-4\AppData\Local\Temp\RtmpuEvVjh\downloaded_packages
√  checking for file 'C:\Users\T3431-4\AppData\Local\Temp\RtmpuEvVjh\remotes44e433847982\thomasp85-ggforce-4008a2e/DESCRIPTION' ...
-  preparing 'ggforce':
√  checking DESCRIPTION meta-information ...
-  cleaning src
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
-  building 'ggforce_0.1.1.tar.gz'

* installing *source* package 'ggforce' ...
** using staged installation
** libs

*** arch - i386
"C:/RBuildTools/4.0/mingw32/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
"C:/RBuildTools/4.0/mingw32/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c bSpline.cpp -o bSpline.o
"C:/RBuildTools/4.0/mingw32/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c bezier.cpp -o bezier.o
"C:/RBuildTools/4.0/mingw32/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c deBoor.cpp -o deBoor.o
"C:/RBuildTools/4.0/mingw32/bin/"gcc  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c ggforce_init.c -o ggforce_init.o
C:/RBuildTools/4.0/mingw32/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o ggforce.dll tmp.def RcppExports.o bSpline.o bezier.o deBoor.o ggforce_init.o -LD:/R-4.1.2/bin/i386 -lR
installing to D:/R-4.1.2/library/00LOCK-ggforce/00new/ggforce/libs/i386

*** arch - x64
"C:/RBuildTools/4.0/mingw64/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
"C:/RBuildTools/4.0/mingw64/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c bSpline.cpp -o bSpline.o
"C:/RBuildTools/4.0/mingw64/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c bezier.cpp -o bezier.o
"C:/RBuildTools/4.0/mingw64/bin/"g++ -std=gnu++11  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c deBoor.cpp -o deBoor.o
"C:/RBuildTools/4.0/mingw64/bin/"gcc  -I"D:/R-4.1.2/include" -DNDEBUG  -I'D:/R-4.1.2/library/Rcpp/include'        -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c ggforce_init.c -o ggforce_init.o
C:/RBuildTools/4.0/mingw64/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o ggforce.dll tmp.def RcppExports.o bSpline.o bezier.o deBoor.o ggforce_init.o -LD:/R-4.1.2/bin/x64 -lR
installing to D:/R-4.1.2/library/00LOCK-ggforce/00new/ggforce/libs/x64
** R
** byte-compile and prepare package for lazy loading
Error: object 'as.units' is not exported by 'namespace:units'
Execution halted
ERROR: lazy loading failed for package 'ggforce'
* removing 'D:/R-4.1.2/library/ggforce'
* restoring previous 'D:/R-4.1.2/library/ggforce'
Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\colorspace\libs\x64\colorspace.dll to D:\R-4.1.2\library\colorspace\libs\x64\colorspace.dll: Permission denied
2: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\vctrs\libs\x64\vctrs.dll to D:\R-4.1.2\library\vctrs\libs\x64\vctrs.dll: Permission denied
3: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\glue\libs\x64\glue.dll to D:\R-4.1.2\library\glue\libs\x64\glue.dll: Permission denied
4: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\fansi\libs\x64\fansi.dll to D:\R-4.1.2\library\fansi\libs\x64\fansi.dll: Permission denied
5: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\magrittr\libs\x64\magrittr.dll to D:\R-4.1.2\library\magrittr\libs\x64\magrittr.dll: Permission denied
6: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying D:\R-4.1.2\library\00LOCK\dplyr\libs\x64\dplyr.dll to D:\R-4.1.2\library\dplyr\libs\x64\dplyr.dll: Permission denied
7: In i.p(...) :
  installation of package 'C:/Users/T3431-4/AppData/Local/Temp/RtmpuEvVjh/file44e43ead4915/ggforce_0.1.1.tar.gz' had non-zero exit status

I think this error may have caused the updated ggforce to fail to install
** R
** byte-compile and prepare package for lazy loading
Error: object 'as.units' is not exported by 'namespace:units'
Execution halted
ERROR: lazy loading failed for package 'ggforce'
* removing 'D:/R-4.1.2/library/ggforce'
* restoring previous 'D:/R-4.1.2/library/ggforce'

Although it has restored the previous ggforce, it is still the old version package without facet_zoom2().
I tried installing the units package and made sure that as.units() worked, but that still didn't solve the problem.
I have no idea about this. Can you please help me to resolve the issue?


Q.1: How to improve our educational system to ensure that we break away from patriarchal norms?
Q.2: How can we engage men to be equal partners in the gender equality movement?
Q.3: Should youth icons and public personalities be held responsible for sexist comments and how can these comments be reduced?
Q.4: How can we ensure gender parity at workplaces?
Q.5: How can we ensure equal representation from #AllGenders in the political system?
This particular blog is best viewed on a laptop or a desktop. In case you have problems in viewing, please visit the facebook page of PWDVA for individual quotes of the panelists.