text:
#import "AppDelegate.h"
#import <Pyze/Pyze.h>
#import <UserNotifications/UserNotifications.h>

@interface AppDelegate () <UNUserNotificationCenterDelegate>

@end

@implementation AppDelegate

#pragma mark -
#pragma mark - Launch setup

-(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Initialise Pyze with <YOUR APP KEY>
    [Pyze initialize:@"<YOUR APP KEY>" withLogThrottling:PyzelogLevelAll];
    return YES;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    if (@available(iOS 10, *)) {
        [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:(UNAuthorizationOptionSound |
                                                                                UNAuthorizationOptionAlert |
                                                                                UNAuthorizationOptionBadge)
                                                                            completionHandler:^(BOOL granted, NSError * _Nullable error) {

                                                                                if (!error) {

                                                                                //If the app make use of default notification categories provided by Pyze call 'getPyzeDefaultNotificationCategories' method to get the categories and set it.
                                                                                // You can also include the custom categories defined along with these, if any.
                                                                                NSSet *pyzeDefaultCategorySet = [PyzeNotification getPyzeDefaultNotificationCategories];
                                                                                [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:pyzeDefaultCategorySet];

                                                                                dispatch_async(dispatch_get_main_queue(), ^{
                                                                                [application registerForRemoteNotifications];
                                                                                });

                                                                                }

                                                                            }];
        [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

    } else if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]) {

        UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert
                                                        | UIUserNotificationTypeBadge
                                                        | UIUserNotificationTypeSound);

        // If the app make use of default notification categories provided by Pyze call 'getPyzeDefaultNotificationCategories' method to get the categories and set it.
        // You can also include the custom categories defined along with these, if any.
        NSSet *categories = [PyzeNotification getPyzeDefaultNotificationCategories];
        UIUserNotificationSettings *userNotificationSettings = [UIUserNotificationSettings
                                                                settingsForTypes:userNotificationTypes categories:categories];
        [application registerUserNotificationSettings:userNotificationSettings];

        dispatch_async(dispatch_get_main_queue(), ^{
            [application registerForRemoteNotifications];
        });

    }

    return YES;
}

#pragma mark -
#pragma mark - Registering to remote notifications

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

    //Send device token obtained from APNS to Pyze
    [Pyze setRemoteNotificationDeviceToken:deviceToken];
}

-(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    NSLog(@"\n\nFailed to register to remote notifications\nError : %@\n\n",error.localizedDescription);
}

#pragma mark -
#pragma mark - Handling recieved push notifications
#pragma mark - iOS 10 and above

-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler NS_AVAILABLE_IOS(10_0) {

    // This method will get called when
    // - app is in BACKGROUND or TERMINATED state
    // - for iOS 10 and above devices
    // - for both 'interactive action' and 'default notification tap'
    // -------------------------------------------------------------------------------------------------------------------

    /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------
     Possible ways to handle the recieved payload using Pyze SDK

     // Option 1 : */

    [PyzeNotification handlePushNotificationResponseWithUserinfo:response.notification.request.content.userInfo actionIdentifier:response.actionIdentifier];

    /*
     // The above method does the following:
     // a. If the action selected is of type 'Share text', above method call will present a share dialog.
     // b. If the action selected is of type 'Follow Deeplink', above method call will process payload and give callback to the method :
             func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {}
             So implement this in your AppDelegate to handle it further
     // c. If the action selected is of type 'Open Webpage' the respective url will open in Safari.
     ----------------------------------------------------------------------------------------------------------------------------------------------------------------- */

    /*

     // Option 2 :

    [PyzeNotification parsePushNotificatoinResponseWithUserinfo:response.notification.request.content.userInfo actionIdentifier:response.actionIdentifier
                                              completionHandler:^(PyzeNotificationContent *pyzePushObject) {

                                                  if (pyzePushObject) {
                                                      if (pyzePushObject.selectedAction) {

                                                          switch (pyzePushObject.selectedAction.buttonActionType) {

                                                              case ePyzeNotificationActionTypeShare: {
                                                                  if (pyzePushObject.selectedAction.shareText && pyzePushObject.selectedAction.shareText.length) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.shareText);
                                                                  }
                                                              }
                                                                  break;
                                                              case ePyzeNotificationActionTypeDeepLink: {
                                                                  if (pyzePushObject.selectedAction.deepLinkURL && pyzePushObject.selectedAction.deepLinkURL) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.deepLinkURL);
                                                                  }
                                                              }
                                                                  break;
                                                              case ePyzeNotificationActionTypeWebLink: {
                                                                  if (pyzePushObject.selectedAction.webPageURL && pyzePushObject.selectedAction.webPageURL) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.webPageURL);
                                                                  }
                                                              }
                                                                  break;

                                                              case ePyzeNotificationActionTypeHome: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                  break;
                                                              case ePyzeNotificationActionTypeNone: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                  break;

                                                              default:
                                                                  break;
                                                          }
                                                      }
                                                  }

    }];

      */

    completionHandler();
}

-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler NS_AVAILABLE_IOS(10_0) {

    // This method will get called when
    // - app is in ACTIVE state
    // - for iOS 10 and above devices
    // ----------------------------------------------------------------------------------------------------------------------------------
    completionHandler(UNNotificationPresentationOptionAlert); // This line of code will make iOS show the notification as alert even if the application is in foreground.
}

#pragma mark -
#pragma mark - iOS 8 and 9

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {

    // This method gets called
    // - when user taps on notification (not interactive action) and when app is ACTIVE
    // - for iOS 8 and 9 devices
    // ----------------------------------------------------------------------------------------------------------------------------------

    switch (application.applicationState) {
        case UIApplicationStateActive: {
            NSLog(@"App in foreground");

            /*
             - Since app is in foreground, there will be no action identifier. So can call below method to get the payload parsed.
             - Call 'PyzeNotification.parsePushNotificatoinResponse' without any action identifier, where Pyze will just parse the payload and return 'PyzeNotificationContent' object.
             - As no 'actionIdentifier' is passed here, 'selectedAction' will be 'nil'.
             */

            [PyzeNotification parsePushNotificatoinResponseWithUserinfo:userInfo completionHandler:^(PyzeNotificationContent *pyzePushObject) {

                NSLog(@"\n\n******************************************************");
                NSLog(@"\n\n******************************************************");
                NSLog(@"*** Pyze Push Notification Objsect ***");

                NSLog(@"Title : %@",pyzePushObject.title);
                NSLog(@"SubTitle : %@",pyzePushObject.subTitle);
                NSLog(@"Body : %@",pyzePushObject.body);

                NSLog(@"******************************************************\n");

            }];
        }
            break;

        default: {

            /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------
             Possible ways to handle the recieved payload using Pyze SDK

             // Option 1 : */

            [PyzeNotification handlePushNotificationResponseWithUserinfo:userInfo actionIdentifier:k_PyzeDefaultNotificationAction];

            // 'k_PyzeDefaultNotificationAction' is the default action which can be used when notification is tapped

            /*
             // The above method does the following:
             // a. If the action selected is of type 'Share text', above method call will present a share dialog.
             // b. If the action selected is of type 'Follow Deeplink', above method call will process payload and give callback to the method :
                     func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {}
                     So implement this in your AppDelegate to handle it further
             // c. If the action selected is of type 'Open Webpage' the respective url will open in Safari.
             ----------------------------------------------------------------------------------------------------------------------------------------------------------------- */

            /*

             // Option 2 :

            [PyzeNotification parsePushNotificatoinResponseWithUserinfo:userInfo actionIdentifier:k_PyzeDefaultNotificationAction
                                                      completionHandler:^(PyzeNotificationContent *pyzePushObject) {

                                                          if (pyzePushObject) {
                                                              if (pyzePushObject.selectedAction) {

                                                                  switch (pyzePushObject.selectedAction.buttonActionType) {

                                                                      case ePyzeNotificationActionTypeShare: {
                                                                          if (pyzePushObject.selectedAction.shareText && pyzePushObject.selectedAction.shareText.length) {
                                                                              NSLog(@"%@",pyzePushObject.selectedAction.shareText);
                                                                          }
                                                                      }
                                                                          break;
                                                                      case ePyzeNotificationActionTypeDeepLink: {
                                                                          if (pyzePushObject.selectedAction.deepLinkURL && pyzePushObject.selectedAction.deepLinkURL) {
                                                                              NSLog(@"%@",pyzePushObject.selectedAction.deepLinkURL);
                                                                          }
                                                                      }
                                                                          break;
                                                                      case ePyzeNotificationActionTypeWebLink: {
                                                                          if (pyzePushObject.selectedAction.webPageURL && pyzePushObject.selectedAction.webPageURL) {
                                                                              NSLog(@"%@",pyzePushObject.selectedAction.webPageURL);
                                                                          }
                                                                      }
                                                                          break;

                                                                      case ePyzeNotificationActionTypeHome: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                          break;
                                                                      case ePyzeNotificationActionTypeNone: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                          break;

                                                                      default:
                                                                          break;
                                                                  }
                                                              }
                                                          }

                                                      }];
             // The above method will parse the payload and return 'PyzeNotificationContent' object. from which the required info can be obtained.
             ----------------------------------------------------------------------------------------------------------------------------------------------------------------- */

        }
            break;
    }
}

-(void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler {

    // This method will get called when
    // - app is in BACKGROUND or TERMINATED state
    // - for iOS 8 and 9 devices
    // - for both 'interactive actions'
    // -------------------------------------------------------------------------------------------------------------------

    /* -----------------------------------------------------------------------------------------------------------------------------------------------------------------
     Possible ways to handle the recieved payload using Pyze SDK

     // Option 1 : */

    [PyzeNotification handlePushNotificationResponseWithUserinfo:userInfo actionIdentifier:identifier];

    /*
     // The above method does the following:
     // a. If the action selected is of type 'Share text', above method call will present a share dialog.
     // b. If the action selected is of type 'Follow Deeplink', above method call will process payload and give callback to the method :
             func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {}
             So implement this in your AppDelegate to handle it further
     // c. If the action selected is of type 'Open Webpage' the respective url will open in Safari.
     ----------------------------------------------------------------------------------------------------------------------------------------------------------------- */

    /*
     // Option 2 :

    [PyzeNotification parsePushNotificatoinResponseWithUserinfo:userInfo actionIdentifier:identifier
                                              completionHandler:^(PyzeNotificationContent *pyzePushObject) {

                                                  if (pyzePushObject) {
                                                      if (pyzePushObject.selectedAction) {

                                                          switch (pyzePushObject.selectedAction.buttonActionType) {

                                                              case ePyzeNotificationActionTypeShare: {
                                                                  if (pyzePushObject.selectedAction.shareText && pyzePushObject.selectedAction.shareText.length) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.shareText);
                                                                  }
                                                              }
                                                                  break;
                                                              case ePyzeNotificationActionTypeDeepLink: {
                                                                  if (pyzePushObject.selectedAction.deepLinkURL && pyzePushObject.selectedAction.deepLinkURL) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.deepLinkURL);
                                                                  }
                                                              }
                                                                  break;
                                                              case ePyzeNotificationActionTypeWebLink: {
                                                                  if (pyzePushObject.selectedAction.webPageURL && pyzePushObject.selectedAction.webPageURL) {
                                                                      NSLog(@"%@",pyzePushObject.selectedAction.webPageURL);
                                                                  }
                                                              }
                                                                  break;

                                                              case ePyzeNotificationActionTypeHome: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                  break;
                                                              case ePyzeNotificationActionTypeNone: NSLog(@"%@",pyzePushObject.selectedAction.buttonActionTypeString);
                                                                  break;

                                                              default:
                                                                  break;
                                                          }
                                                      }
                                                  }
                                              }];

         // The above method will parse the payload and return 'PyzeNotificationContent' object. from which the required info like 'share text' 'deep link url' or 'webpage url' can be obtained as shown above
      */

}

#pragma -
#pragma mark - Handling deep link

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    NSLog(@"\nDeep link URL : %@\n", url);
    return NO;
}

#pragma mark -
#pragma mark - App life cycle methods

- (void)applicationWillResignActive:(UIApplication *)application {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end


text:
<?php

namespace phpseclib3\Math\BigInteger\Engines\BCMath;

use phpseclib3\Math\BigInteger\Engines\BCMath;

/**
 * Built-In BCMath Modular Exponentiation Engine
 *
 * @package BCMath
 * @author  Jim Wigginton <terrafrost@php.net>
 * @access  public
 */
abstract class BuiltIn extends BCMath
{
    /**
     * Performs modular exponentiation.
     *
     * @param BCMath $x
     * @param BCMath $e
     * @param BCMath $n
     * @return BCMath
     */
    protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n)
    {
        $temp = new BCMath();
        $temp->value = bcpowmod($x->value, $e->value, $n->value);

        return $x->normalize($temp);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

<?php
include('header.php');
?>

‹ ›

Powered By Kaguya & Xiao

2014


text:
<?php
/**
 * @author @ct-jensschulze <jens.schulze@commercetools.de>
 */

namespace Commercetools\Commons\Helper;

use Commercetools\Core\Model\Channel\ChannelReference;
use Commercetools\Core\Model\Common\Money;
use Commercetools\Core\Model\Common\Price;
use Commercetools\Core\Model\Common\PriceCollection;
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;

class PriceFinder
{
    private $currency;
    private $country;
    private $customerGroup;
    private $channel;

    public function __construct($currency, $country = null, CustomerGroupReference $customerGroup = null, ChannelReference $channel = null)
    {
        $this->currency = $currency;
        $this->country = $country;
        $this->customerGroup = $customerGroup;
        $this->channel = $channel;
    }

    /**
     * @param PriceCollection $prices
     * @return Price
     */
    public function findPrice(PriceCollection $prices)
    {
        $currency = $this->currency;
        $country = $this->country;
        $customerGroup = $this->customerGroup;
        $channel = $this->channel;

        $prices = new \CallbackFilterIterator(
            $prices,
            function ($price) use ($currency, $country, $customerGroup, $channel) {
                if (!$this->priceHasCurrency($price, $currency)) {
                    return false;
                }
                if (!$this->priceHasNoDate($price) && !$this->priceHasValidDate($price, new \DateTime())) {
                    return false;
                }
                if (is_null($country)) {
                    if ($this->priceHas($price, 'country')) {
                        return false;
                    }
                } elseif (!$this->priceHasCountry($price, $country)) {
                    return false;
                }
                if (is_null($customerGroup)) {
                    if ($this->priceHas($price, 'customerGroup')) {
                        return false;
                    }
                } elseif (!$this->priceHasCustomerGroup($price, $customerGroup)) {
                    return false;
                }
                if (is_null($channel)) {
                    if ($this->priceHas($price, 'channel')) {
                        return false;
                    }
                } elseif (!$this->priceHasChannel($price, $channel)) {
                    return false;
                }
                return true;
            }
        );

        foreach ($prices as $price) {
            return $price;
        }
        return null;
    }

    /**
     * @param $prices
     * @param $currency
     * @param string $country
     * @param CustomerGroupReference $customerGroup
     * @param ChannelReference $channel
     * @return Price|null
     */
    public static function findPriceFor(
        $prices,
        $currency,
        $country = null,
        CustomerGroupReference $customerGroup = null,
        ChannelReference $channel = null
    ) {
        $priceFinder = new static($currency, $country, $customerGroup, $channel);

        return $priceFinder->findPrice($prices);
    }

    private function priceHasCurrency(Price $price, $currency)
    {
        return !is_null($price->getValue()) && $price->getValue()->getCurrencyCode() == $currency;

    }

    private function priceHasCountry(Price $price, $country)
    {
        return !is_null($price->getCountry()) && $price->getCountry() == $country;
    }

    private function priceHasCustomerGroup(Price $price, CustomerGroupReference $customerGroup)
    {
        return !is_null($price->getCustomerGroup()) && $price->getCustomerGroup()->getId() == $customerGroup->getId();
    }

    private function priceHasChannel(Price $price, ChannelReference $channel)
    {
        return !is_null($price->getChannel()) && $price->getChannel()->getId() == $channel->getId();
    }

    private function priceHasValidDate(Price $price, \DateTime $date)
    {
        $tooEarly = !is_null($price->getValidFrom()) && $price->getValidFrom()->getDateTime() > $date;
        $tooLate = !is_null($price->getValidUntil()) && $price->getValidUntil()->getDateTime() < $date;
        return !$tooEarly && !$tooLate;
    }

    private function priceHasNoDate(Price $price)
    {
        return is_null($price->getValidFrom()) && is_null($price->getValidUntil());
    }

    private function priceHas(Price $price, $field) {
        return !is_null($price->get($field));
    }
}


text: const unsafe fn x() {}


text:
require_relative './../../../spec_helper'

describe 'image_streamer_test_api300::artifact_bundle_update_name' do
  let(:complete_resource_name) { 'image_streamer_artifact_bundle' }
  include_context 'chef context'

  let(:base_sdk) { OneviewSDK::ImageStreamer::API300 }

  it 'updates it when it exists but is not alike' do
    allow_any_instance_of(base_sdk::ArtifactBundle).to receive(:retrieve!).and_return(true)
    allow_any_instance_of(base_sdk::ArtifactBundle).to receive(:exists?).and_return(false)
    expect_any_instance_of(base_sdk::ArtifactBundle).to receive(:update_name).and_return(true)
    expect(real_chef_run).to update_image_streamer_artifact_bundle_name('ArtifactBundle1')
  end

  it 'does nothing when it exists and is alike' do
    expect_any_instance_of(base_sdk::ArtifactBundle).to receive(:retrieve!).and_return(true)
    allow_any_instance_of(base_sdk::ArtifactBundle).to receive(:[]).with('name').and_return('ArtifactBundle2')
    expect_any_instance_of(base_sdk::ArtifactBundle).to_not receive(:update_name)
    expect(real_chef_run).to update_image_streamer_artifact_bundle_name('ArtifactBundle1')
  end

  it 'raises an error when a resource passed in does not exist' do
    expect_any_instance_of(base_sdk::ArtifactBundle).to receive(:retrieve!).and_return(false)
    expect { real_chef_run }.to raise_error(RuntimeError, /not found/)
  end

  it 'raises an error when the new name is already in use' do
    expect_any_instance_of(base_sdk::ArtifactBundle).to receive(:retrieve!).and_return(true)
    expect_any_instance_of(base_sdk::ArtifactBundle).to receive(:exists?).and_return(true)
    expect { real_chef_run }.to raise_error(RuntimeError, /ArtifactBundle name 'ArtifactBundle2' is already in use./)
  end
end


text:
//
//  DTActivityTitleView.h
//  DTFoundation
//
//  Created by Rene Pirringer on 12.09.12.
//  Copyright (c) 2012 Cocoanetics. All rights reserved.
//

#import <Availability.h>
#import <TargetConditionals.h>

#if TARGET_OS_IPHONE && !TARGET_OS_WATCH

#import <UIKit/UIKit.h>

/**
 Alternative view for showing titles with a configurable activity indicator
 instead of default title view in navigationItem.
 */
@interface DTActivityTitleView : UIView

/**
 Title that is shown
 */
@property (nonatomic, copy) NSString *title;

/**
 When busy is set to YES the activity indicator starts spinning
 When set to NO the activity indicator stops spinning
 */
@property (nonatomic, assign) BOOL busy;

@end

#endif


text:
```html
<ion-content>
  <ion-slides pager="true">
    <ion-slide>
      <h1>Slide 1</h1>
    </ion-slide>

    <ion-slide>
      <h1>Slide 2</h1>
    </ion-slide>

    <ion-slide>
      <h1>Slide 3</h1>
    </ion-slide>
  </ion-slides>
</ion-content>
```

```javascript
var slides = document.querySelector('ion-slides');

// Optional parameters to pass to the swiper instance.
// See http://idangero.us/swiper/api/ for valid options.
slides.options = {
  initialSlide: 1,
  speed: 400
}
```

```css
/* Without setting height the slides will take up the height of the slide's content */
ion-slides {
  height: 100%;
}
```


text:
class InfoBarsTest : public InProcessBrowserTest {
 public:
  InfoBarsTest() {}

  void InstallExtension(const char* filename) {
    base::FilePath path = ui_test_utils::GetTestFilePath(
        base::FilePath().AppendASCII("extensions"),
        base::FilePath().AppendASCII(filename));
    ExtensionService* service = extensions::ExtensionSystem::Get(
        browser()->profile())->extension_service();

    content::WindowedNotificationObserver observer(
        extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
        content::NotificationService::AllSources());

    scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt(
        browser()->tab_strip_model()->GetActiveWebContents()));
    scoped_refptr<extensions::CrxInstaller> installer(
        extensions::CrxInstaller::Create(service, client.Pass()));
    installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION);
    installer->InstallCrx(path);

    observer.Wait();
  }
};

IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) {
  extensions::ScopedTestDialogAutoConfirm auto_confirm(
      extensions::ScopedTestDialogAutoConfirm::ACCEPT);

#if defined(OS_WIN) && defined(USE_ASH)
  // Disable this test in Metro+Ash for now (http://crbug.com/262796).
  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
          switches::kAshBrowserTests))
    return;
#endif

  ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());

  ui_test_utils::NavigateToURL(
      browser(), embedded_test_server()->GetURL("/simple.html"));

  content::WindowedNotificationObserver infobar_added_1(
        chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
        content::NotificationService::AllSources());
  InstallExtension("theme.crx");
  infobar_added_1.Wait();

  ui_test_utils::NavigateToURLWithDisposition(
      browser(), embedded_test_server()->GetURL("/simple.html"),
      NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
  content::WindowedNotificationObserver infobar_added_2(
        chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
        content::NotificationService::AllSources());
  content::WindowedNotificationObserver infobar_removed_1(
      chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
        content::NotificationService::AllSources());
  InstallExtension("theme2.crx");
  infobar_added_2.Wait();
  infobar_removed_1.Wait();
  EXPECT_EQ(
      0u,
      InfoBarService::FromWebContents(
          browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count());

  content::WindowedNotificationObserver infobar_removed_2(
      chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
        content::NotificationService::AllSources());
  ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme();
  infobar_removed_2.Wait();
  EXPECT_EQ(0u,
            InfoBarService::FromWebContents(
                browser()->tab_strip_model()->GetActiveWebContents())->
                infobar_count());
}


text:
"""
pytils.numeral templatetags for Django web-framework
"""

from django import template, conf

from pytils import numeral
from pytils.templatetags import init_defaults
from pytils.third import six

try:
    # Django 1.4+
    from django.utils.encoding import smart_text
except ImportError:
    from django.utils.encoding import smart_unicode
    smart_text = smart_unicode

register = template.Library()  #: Django template tag/filter registrator
encoding = conf.settings.DEFAULT_CHARSET  #: Current charset (sets in Django project's settings)
debug = conf.settings.DEBUG  #: Debug mode (sets in Django project's settings)
show_value = getattr(conf.settings, 'PYTILS_SHOW_VALUES_ON_ERROR', False)  #: Show values on errors (sets in Django project's settings)

default_value, default_uvalue = init_defaults(debug, show_value)

# -- filters

def choose_plural(amount, variants):
    """
    Choose proper form for plural.

    Value is a amount, parameters are forms of noun.
    Forms are variants for 1, 2, 5 nouns. It may be tuple
    of elements, or string where variants separates each other
    by comma.

    Examples::
        {{ some_int|choose_plural:"пример,примера,примеров" }}
    """
    try:
        if isinstance(variants, six.string_types):
            uvariants = smart_text(variants, encoding)
        else:
            uvariants = [smart_text(v, encoding) for v in variants]
        res = numeral.choose_plural(amount, uvariants)
    except Exception as err:
        # because filter must die silently
        try:
            default_variant = variants
        except Exception:
            default_variant = ""
        res = default_value % {'error': err, 'value': default_variant}
    return res

def get_plural(amount, variants):
    """
    Get proper form for plural and it value.

    Value is a amount, parameters are forms of noun.
    Forms are variants for 1, 2, 5 nouns. It may be tuple
    of elements, or string where variants separates each other
    by comma. You can append 'absence variant' after all over variants

    Examples::
        {{ some_int|get_plural:"пример,примера,примеров,нет примеров" }}
    """
    try:
        if isinstance(variants, six.string_types):
            uvariants = smart_text(variants, encoding)
        else:
            uvariants = [smart_text(v, encoding) for v in variants]
        res = numeral._get_plural_legacy(amount, uvariants)
    except Exception as err:
        # because filter must die silently
        try:
            default_variant = variants
        except Exception:
            default_variant = ""
        res = default_value % {'error': err, 'value': default_variant}
    return res

def rubles(amount, zero_for_kopeck=False):
    """Converts float value to in-words representation (for money)"""
    try:
        res = numeral.rubles(amount, zero_for_kopeck)
    except Exception as err:
        # because filter must die silently
        res = default_value % {'error': err, 'value': str(amount)}
    return res

def in_words(amount, gender=None, case=numeral.NOMINATIVE):
    """
    In-words representation of amount.

    Parameter is a gender: MALE, FEMALE or NEUTER

    Examples::
        {{ some_int|in_words }}
        {{ some_other_int|in_words:FEMALE }}
    """
    try:
        res = numeral.in_words(amount, getattr(numeral, str(gender), None), case)
    except Exception as err:
        # because filter must die silently
        res = default_value % {'error': err, 'value': str(amount)}
    return res

def in_words_genitive(amount, gender=None):
    """
    In-words representation of amount, in genitive case.

    Parameter is a gender: MALE, FEMALE or NEUTER

    Examples::
        {{ some_int|in_words_genitive }}
        {{ some_other_int|in_words_genitive:FEMALE }}
    """

    return in_words(amount, gender, numeral.GENITIVE)

# -- register filters

register.filter('choose_plural', choose_plural)
register.filter('get_plural', get_plural)
register.filter('rubles', rubles)
register.filter('in_words', in_words)
register.filter('in_words_genitive', in_words_genitive)

# -- tags

def sum_string(amount, gender, items):
    """
    in_words and choose_plural in a one flask
    Makes in-words representation of value with
    choosing correct form of noun.

    First parameter is an amount of objects. Second is a
    gender (MALE, FEMALE, NEUTER). Third is a variants
    of forms for object name.

    Examples::
        {% sum_string some_int MALE "пример,примера,примеров" %}
        {% sum_string some_other_int FEMALE "задача,задачи,задач" %}
    """
    try:
        if isinstance(items, six.string_types):
            uitems = smart_text(items, encoding, default_uvalue)
        else:
            uitems = [smart_text(i, encoding) for i in items]
        res = numeral.sum_string(amount, getattr(numeral, str(gender), None), uitems)
    except Exception as err:
        # because tag's renderer must die silently
        res = default_value % {'error': err, 'value': str(amount)}
    return res

# -- register tags

register.simple_tag(sum_string)


text:
const assert = require('assert');
const app = require('../../src/app');

describe('\'schema\' service', () => {
  it('registered the service', () => {
    const service = app.service('schema');

    assert.ok(service, 'Registered the service');
  });
});


text:
module SemiAuto
  module Util
    def self.convert_to_native_types(response)
      if response.is_a?(String) || !(response.respond_to?(:to_h) || response.respond_to?(:to_a))
        result = response
      elsif response.respond_to?(:to_h)
        result = {}

        response.to_h.each do |key, value|
          result[key] = convert_to_native_types(value)
        end
      elsif response.respond_to?(:to_a)
        result = []

        response.to_a.each do |entry|
          result << convert_to_native_types(entry)
        end
      end

      result
    end
  end
end


text:
// JSLint is used as a tool

var b,
    addScroll = false,
    turnOff = 0,
    text = "",
    positionX = 0,
    positionY = 0,
    event,
    window,
    navigator,
    document,
    theLayer,
    mouseMove;

b = navigator.appName;

if ((navigator.userAgent.indexOf('MSIE 5') > 0) ||
        (navigator.userAgent.indexOf('MSIE 6') > 0)) {
    addScroll = true;
}

document.onmousemove = mouseMove;

if (b === "Netscape") {
    document.captureEvents(event.MOUSEMOVE);
}

function popTip() {
    if (b === "Netscape") {
        theLayer = 'document.layers[\'ToolTip\']';

        if ((positionX + 120) > window.innerWidth) {
            positionX = window.innerWidth - 150;
        }

        theLayer.left = positionX + 10;
        theLayer.top = positionY + 15;
        theLayer.visibility = 'show';
    } else {
        theLayer = 'document.all[\'ToolTip\']';

        if (theLayer) {
            positionX = event.x - 5;
            positionY = event.y;

            if (addScroll) {
                positionX = positionX + document.body.scrollLeft;
                positionY = positionY + document.body.scrollTop;
            }

            if ((positionX + 120) > document.body.clientWidth) {
                positionX = positionX - 150;
            }

            theLayer.style.pixelLeft = positionX + 10;
            theLayer.style.pixelTop = positionY + 15;
            theLayer.style.visibility = 'visible';
        }
    }
}

function mouseMove(evn) {
    'use strict';

    if (b === "Netscape") {
        positionX = evn.pageX - 5;
        positionY = evn.pageY;
    } else {
        positionX = event.x - 5;
        positionY = event.y;
    }

    if (b === "Netscape") {
        if ('document.layers[\'ToolTip\']'.visibility === 'show') {
            popTip();
        }
    } else {
        if ('document.all[\'ToolTip\']'.style.visibility === 'visible') {
            popTip();
        }
    }
}

function hideTip() {
    'use strict';

    //var args = hideTip.arguments;
    if (b === "Netscape") {
        'document.layers[\'ToolTip\']'.visibility = 'hide';
    } else {
        'document.all[\'ToolTip\']'.style.visibility = 'hidden';
    }
}

function hideFirstMenu() {
    'use strict';

    if (b === "Netscape") {
        'document.layers[\'ToolTip\']'.visibility = 'hide';
    } else {
        'document.all[\'ToolTip\']'.style.visibility = 'hidden';
    }
}

function showFirstMenu() {
    var theLayer;

    if (b === "Netscape") {
        theLayer = 'document.layers[\'menu1\']';
        theLayer.visibility = 'show';
    } else {
        theLayer = 'document.all[\'menu1\']';
        theLayer.style.visibility = 'visible';
    }
}

function hideSecondMenu() {
    'use strict';

    if (b === "Netscape") {
        'document.layers[\'menu2\']'.visibility = 'hide';
    } else {
        'document.all[\'menu2\']'.style.visibility = 'hidden';
    }
}

function showSecondMenu() {
    'use strict';

    if (b === "Netscape") {
        theLayer = 'document.layers[\'menu2\']';
        theLayer.visibility = 'show';
    } else {
        theLayer = 'document.all[\'menu2\']';
        theLayer.style.visibility = 'visible';
    }
}


text:
/*global require, module, console*/
(function () {
  'use strict';
  var mongoose = require('mongoose');

  var ContactSchema = new mongoose.Schema({
    email: {
      type: String,
      required: true
    },
    message: {
      type: String
    }
  }), contactModel = mongoose.model('Contact', ContactSchema);

  module.exports = contactModel;
})();


text:
<?php

namespace RCorpWechat\Core;

use Exception as BaseException;

class Exception extends BaseException
{

}


text:
import React, { Component, Fragment } from 'react'
import styled from '@emotion/styled'
import { css, ClassNames } from '@emotion/react'

import EyeRegularIcon from './icons/EyeRegular'

const eyeRegularStyle = css`
  margin: 0 0.25em 0 0;
`

const ReadingTimeContainer = styled.span`
  vertical-align: middle;
  font-size: inherit;
  margin: 0 0.5em;
  display: inline-block;

  span {
    vertical-align: text-bottom;
  }
`

class ReadingTime extends Component {
  render () {
    const { time } = this.props
    return (
      <ReadingTimeContainer title={`${time} minute${time > 1 ? 's' : ''} read`}>
        <ClassNames>
          { ({ css, cx }) => (
            <Fragment>
              <EyeRegularIcon className={css(eyeRegularStyle)} />
              <span>{time} min</span>
            </Fragment>
          )}
        </ClassNames>
      </ReadingTimeContainer>
    )
  }
}

export default ReadingTime


text:
<?php

namespace Crm\AccountBundle\Controller;

/**
 * This code has been auto-generated by the JMSDiExtraBundle.
 *
 * Manual changes to it will be lost.
 */
class DefaultController__JMSInjector
{
    public static function inject($container) {
        $instance = new \Crm\AccountBundle\Controller\DefaultController();
        return $instance;
    }
}


text:
namespace rocksdb {
namespace port {

// This class is a replacement for std::thread
// 2 reasons we do not like std::thread:
//  -- is that it dynamically allocates its internals that are automatically
//     freed when  the thread terminates and not on the destruction of the
//     object. This makes it difficult to control the source of memory
//     allocation
//  -  This implements Pimpl so we can easily replace the guts of the
//      object in our private version if necessary.
class WindowsThread {

  struct Data;

  std::unique_ptr<Data>  data_;
  unsigned int           th_id_;

  void Init(std::function<void()>&&);

public:

  typedef void* native_handle_type;

  // Construct with no thread
  WindowsThread();

  // Template constructor
  //
  // This templated constructor accomplishes several things
  //
  // - Allows the class as whole to be not a template
  //
  // - take "universal" references to support both _lvalues and _rvalues
  //
  // -  because this constructor is a catchall case in many respects it
  //    may prevent us from using both the default __ctor, the move __ctor.
  //    Also it may circumvent copy __ctor deletion. To work around this
  //    we make sure this one has at least one argument and eliminate
  //    it from the overload  selection when WindowsThread is the first
  //    argument.
  //
  // - construct with Fx(Ax...) with a variable number of types/arguments.
  //
  // - Gathers together the callable object with its arguments and constructs
  //   a single callable entity
  //
  // - Makes use of std::function to convert it to a specification-template
  //   dependent type that both checks the signature conformance to ensure
  //   that all of the necessary arguments are provided and allows pimpl
  //   implementation.
  template<class Fn,
    class... Args,
    class = typename std::enable_if<
      !std::is_same<typename std::decay<Fn>::type,
                    WindowsThread>::value>::type>
  explicit WindowsThread(Fn&& fx, Args&&... ax) :
      WindowsThread() {

    // Use binder to create a single callable entity
    auto binder = std::bind(std::forward<Fn>(fx),
      std::forward<Args>(ax)...);
    // Use std::function to take advantage of the type erasure
    // so we can still hide implementation within pimpl
    // This also makes sure that the binder signature is compliant
    std::function<void()> target = binder;

    Init(std::move(target));
  }

  ~WindowsThread();

  WindowsThread(const WindowsThread&) = delete;

  WindowsThread& operator=(const WindowsThread&) = delete;

  WindowsThread(WindowsThread&&) noexcept;

  WindowsThread& operator=(WindowsThread&&) noexcept;

  bool joinable() const;

  unsigned int get_id() const { return th_id_; }

  native_handle_type native_handle() const;

  static unsigned hardware_concurrency();

  void join();

  bool detach();

  void swap(WindowsThread&);
};
} // namespace port
} // namespace rocksdb

namespace std {
  inline
  void swap(rocksdb::port::WindowsThread& th1,
    rocksdb::port::WindowsThread& th2) {
    th1.swap(th2);
  }
} // namespace std


text:
<!DOCTYPE html>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="0" http-equiv="Expires">
<meta content="The UCR Dining Services Team has a long standing history of providing students, faculty and staff with outstanding food and service in a welcoming environment." name="Description">
<meta content="" name="Author">
<meta content="ucr, uc riverside, dining, restaurants, retail, residential, catering" name="keywords">
<meta content="" name="copyright">
<meta content="" name="geo.country">
<title>
         UCR Dining Services

      </title>
<link href="http://dining.ucr.edu/css/_global.import.css" rel="stylesheet" type="text/css">
<link href="http://dining.ucr.edu/css/masthead.css" media="all" rel="stylesheet" type="text/css">
<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" rel="stylesheet"><link href="/favicon.ico" rel="icon" type="image/x-icon"><link href="http://dining.ucr.edu/css/default.local.css" media="all" rel="stylesheet" type="text/css"></link></link></link></link></link></meta></meta></meta></meta></meta></meta></meta>

University of California, Riverside

Home

UCR Home >
            VCSA >
            Home >

            UCR Dining Services

A to Z Listing

Campus Map

Find People

Search for:<input class="watermark" id="search-textbox" onblur="OnBlur()" onfocus="OnFocus()" title="search" type="text"><input onclick="Search()" type="button" value="Go"/></input>

               UCR Dining Services

Home

Residential Restaurants

Aberdeen-Inverness Restaurant

Lothian Restaurants

Campus Restaurants

The Barn

Bytes

The Coffee Bean & Tea Leaf

The Grill at Latitude Fifty‑Five

HUB Food Court

Ivan's at Hinderaker

Subway

Market at Glen Mor

SHOP

SIZZLE

SAVOR

Starbucks

Scotty's Convenience Stores

Food Trucks

Bear Tracks Coffee Truck

The Culinary Chameleon

Highlander Truck

Moo Moo Truck

Catering, HUB2Go
Subway to go!

Citrus Grove Catering

HUB2Go

Subway to go!

Dining Plan Options

Nutrition

Ask the Nutritionist

Sustainability

Contact Us

Customer Feedback

Dining Request Forms

The Barn has Burgers
 And more American Western classics such as grilled sandwiches,
 daily soups, and a selection of salads and sides. Visit the Barn.

Salads Dressed to Perfection
 Find made-to-order classic chicken Caesar and other tasty signature
 salads at La Fiamma. Located inside the food court at the HUB.

Snack at Your Convenience
 Find delicious snacks in dozens of varieties, freshly baked pastries and desserts,

 and refreshing soft drinks, juices, and smoothies at Scotty's at the HUB.

Cater Your Event
 From breakfasts to multi-course dinners, Citrus Grove Catering
 offers gourmet menus for any occasion on campus.

Dine Outside
 Meet friends at Bytes or your favorite dining spot and relax.

Welcome to UCR Dining Services

The UCR Dining Services Team has a long standing history of providing students, faculty
                     and staff with outstanding food and service in a welcoming environment. We look forward
                     to serving you! Please view our current hours of operation below.

Announcements

Events

New Menu Items

Bear Tracks Coffee Truck to Close for Scheduled Maintenance
The Coffee Truck will close starting Tuesday, November 22. Regular hours will resume
                           Monday, November 28. We apologize for any inconvenience.

Sunday Brunch at The Market at Glen Mor
Savor is now offering Sunday Brunch. Join us from 10:30am–2:30pm at the Market at Glen Mor.

From "Campus Dining Today":
Vegetables Take Center Plate

 Article on how Chef Burke Reeves, Executive Chef of Retail Dining and Catering, uses
                           vegetables from local farms to create healthy and elegant recipes - such as his Tomato
                           Gazpacho with Avocado & Cucumber Salad and Roasted Vegetable Platter. Includes recipes.
                           Read article

Healthy Dining at the HUB
Want to know how to eat healthy when dining at the HUB? Use this handy guide. Or, try the vegetarian and vegan options at any of our campus restaurants by using this brochure.

UCR Farmer's Market
Every Thursday (excluding holidays)
UC Riverside now has it's very own weekly Farmers Market, held every Thursday from
                           4pm-8pm in Lot 14. Come by and shop for fresh produce, baked goods, natural products,
                           and more. A variety of vendors will be selling each week. For more info, contact us
                           at UCRFarmersMarket@ucr.edu.

The Market at Glen Mor
 Fresh Fruits & Vegetables
 There is a variety of fresh fruits and vegetables available at the Market at Glen
                              Mor. We sell all sorts of produce like potatoes, onions, zucchini, green and red peppers,
                              apples, bananas, etc.

Today's Menu

Dining Hours

360º Virtual Tours

Order HUB2Go Online

Citrus Grove Catering

Career Opportunities

Student Jobs

Comments / Feedback

Conference & Events

Follow Us

  Dining Hours:

Fall Hours

View or print enlarged PDF.

More Information

General Campus Information

<address>University of California, Riverside
900 University Ave.
Riverside, CA 92521

                        Tel: (951) 827-1012

</address>

UCR Libraries

Campus Status

Campus Store

Career Opportunities

Diversity

Maps and Directions

Visit UCR

Department Information

<address>Dining, Conference, Events & Catering Services
3637 Canyon Crest Drive, Suite F-101
Riverside, CA 92507

                                 Tel: 951-827-5173

Student Employment Office
3637 Canyon Crest Drive, Suite J-115
Riverside, CA 92507

                                 Tel: 951-827-6123

</address>

Related Links

Housing Services

Conference, Events & Catering Services

Child Development Center

Off-Campus Housing

Apply to UC Riverside

Financial Aid

Sustainability

Transportation & Parking Services

UCR Academic Calendar

Campuswide Navigation

Home

About UCR

Academics

Admissions

Athletics

Happenings

Research

Campus Resources

Giving to UCR

Footer

Privacy Policy

Terms and Conditions

                     ©

                     Regents of the University of California

Last Modified: 11/28/16


text:
This is a URL Shortening service.

## Dependencies:
[mongodb](https://docs.mongodb.org/v3.0/installation/#installation-guides)

[redis](http://redis.io/download#installation)

## Installation:
```
pip install -r requirements

```

## Basic API Usage

you can configure your enviroment editing the settings.py file.

just start the service and enjoy =D.

```
python run.py
```

create user:
```
curl -i -H "Content-Type: application/json" -X POST -d '{"name":"hugo", "password": 123}' http://localhost:8000/user/
```

get user:
```
curl -i  http://localhost:8000/user/hugo
```

create url:
```
curl -i -H "Content-Type: application/json" -X POST -d '{"original":"http://google.com"}' http://localhost:8000/user/hugo/url
curl -i -H "Content-Type: application/json" -X POST -d '{"original":"http://facebook.com", "shortened": "myurl"}' http://localhost:8000/user/hugo/url
```
You can choose you pattern for shortener

get url:
```
curl -i  http://localhost:8000/user/hugo/url/PgEBTdkYQx+AXSoLCFh9zg=
curl -i  http://localhost:8000/user/hugo/url/myurl=
```

to access the redirect:
```
curl -i  http://localhost:8000/PgEBTdkYQx+AXSoLCFh9zg=
curl -i  http://localhost:8000/myurl=
```

In addition you can also change and delete User and url using PUT and DELETE.


text:
from dateutil.relativedelta import relativedelta

from django.db.models import Q
from django.utils import timezone

three_years = relativedelta(years=3)
five_years = relativedelta(years=5)
one_hundred_years = relativedelta(years=100)
one_month = relativedelta(months=1)
now = timezone.now()

stout = (
    (Q(style__name__icontains='stout') | Q(style__parent__name__icontains='stout')
    & Q(date_produced__range=(now - three_years, now - five_years))
)
ipa = Q(date_produced__gte=(now - one_month)) & Q(ibu__gte=90)
sour = Q(time_to_produce__gte=three_years)
belgian = (
    (Q(style__name__icontains='belgian') | Q(style__parent__name__icontains='belgian'))
    & Q(brewery__country='Belgium') & Q(brewery__established__lte=(now - one_hundred_years))
)

best_beers = (
    (stout | ipa | sour | belgian) & Q(avg_rating__gte=4.5)
    & ~Q(brewery__name__icontains='inbev')
)

beers = Beer.objects.filter(best_beers)


text:
'use strict';

angular.module('app')
    .controller('RegisterCtrl', ['$rootScope', '$scope', '$state', 'FnUtils', 'UserService',
        function ($rootScope, $scope, $state, FnUtils, UserService) {

            var user = $scope.user = {};

            $scope.submit = FnUtils.debounce(function () {

                if ($scope.form.$invalid) {
                    return;
                }

                $scope.registering = true;

                UserService.register(user)
                    .done(function (user) {
                        UserService.setCurrentUser(user);
                        $rootScope.goHome();
                    })
                    .fail(function (resp) {
                        resp.message && alert(resp.message);
                    });

            }, 1000, true);

        }]);


text:
<?php

namespace MultipleFileUpload;

// TODO: http://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md


text:
#import "SBUIStarkScreenAnimationController.h"

@class SBAlert, UIView;

@interface SBUIStarkAnimationSlideDownApp : SBUIStarkScreenAnimationController
{
    UIView *_viewToAnimate;
    UIView *_activatingContextHostView;
    UIView *_deactivatingContextHostView;
    UIView *_deactivatingDimmingView;
    SBAlert *_alertImpersonator;
}

- (void)_cleanupAnimation;
- (void)_startAnimation;
- (void)_prepareAnimation;
- (void)dealloc;
- (id)initWithActivatingApp:(id)arg1 alertImpersonator:(id)arg2 deactivatingApp:(id)arg3 starkScreenController:(id)arg4;

@end


text:
#include "libxml.h"
#ifdef LIBXML_SCHEMAS_ENABLED

#include <libxml/xmlversion.h>
#include <libxml/parser.h>

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
/* seems needed for Solaris */
#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
#endif
#endif

#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/xmlschemas.h>
#include <libxml/xmlschemastypes.h>

#ifdef LIBXML_DEBUG_ENABLED
static int debug = 0;
#endif
static int noout = 0;
#ifdef HAVE_MMAP
static int memory = 0;
#endif

int main(int argc, char **argv) {
    int i;
    int files = 0;
    xmlSchemaPtr schema = NULL;

    for (i = 1; i < argc ; i++) {
#ifdef LIBXML_DEBUG_ENABLED
	if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
	    debug++;
	else
#endif
#ifdef HAVE_MMAP
	if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) {
	    memory++;
        } else
#endif
	if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) {
	    noout++;
        }
    }
    xmlLineNumbersDefault(1);
    for (i = 1; i < argc ; i++) {
	if (argv[i][0] != '-') {
	    if (schema == NULL) {
		xmlSchemaParserCtxtPtr ctxt;

#ifdef HAVE_MMAP
		if (memory) {
		    int fd;
		    struct stat info;
		    const char *base;
		    if (stat(argv[i], &info) < 0)
			break;
		    if ((fd = open(argv[i], O_RDONLY)) < 0)
			break;
		    base = mmap(NULL, info.st_size, PROT_READ,
			        MAP_SHARED, fd, 0) ;
		    if (base == (void *) MAP_FAILED)
			break;

		    ctxt = xmlSchemaNewMemParserCtxt((char *)base,info.st_size);

		    xmlSchemaSetParserErrors(ctxt,
                            xmlGenericError, xmlGenericError, NULL);
		    schema = xmlSchemaParse(ctxt);
		    xmlSchemaFreeParserCtxt(ctxt);
		    munmap((char *) base, info.st_size);
		} else
#endif
		{
		    ctxt = xmlSchemaNewParserCtxt(argv[i]);
		    xmlSchemaSetParserErrors(ctxt,
                            xmlGenericError, xmlGenericError, NULL);
		    schema = xmlSchemaParse(ctxt);
		    xmlSchemaFreeParserCtxt(ctxt);
		}
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED
		if (debug)
		    xmlSchemaDump(stdout, schema);
#endif
#endif /* LIBXML_OUTPUT_ENABLED */
		if (schema == NULL)
		    goto failed_schemas;
	    } else {
		xmlDocPtr doc;

		doc = xmlReadFile(argv[i],NULL,0);

		if (doc == NULL) {
		    fprintf(stderr, "Could not parse %s\n", argv[i]);
		} else {
		    xmlSchemaValidCtxtPtr ctxt;
		    int ret;

		    ctxt = xmlSchemaNewValidCtxt(schema);
		    xmlSchemaSetValidErrors(ctxt,
                            xmlGenericError, xmlGenericError, NULL);
		    ret = xmlSchemaValidateDoc(ctxt, doc);
		    if (ret == 0) {
			printf("%s validates\n", argv[i]);
		    } else if (ret > 0) {
			printf("%s fails to validate\n", argv[i]);
		    } else {
			printf("%s validation generated an internal error\n",
			       argv[i]);
		    }
		    xmlSchemaFreeValidCtxt(ctxt);
		    xmlFreeDoc(doc);
		}
	    }
	    files ++;
	}
    }
    if (schema != NULL)
	xmlSchemaFree(schema);
    if (files == 0) {
	printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n",
	       argv[0]);
	printf("\tParse the HTML files and output the result of the parsing\n");
#ifdef LIBXML_DEBUG_ENABLED
	printf("\t--debug : dump a debug tree of the in-memory document\n");
#endif
	printf("\t--noout : do not print the result\n");
#ifdef HAVE_MMAP
	printf("\t--memory : test the schemas in memory parsing\n");
#endif
    }
failed_schemas:
    xmlSchemaCleanupTypes();
    xmlCleanupParser();
    xmlMemoryDump();

    return(0);
}

#else
#include <stdio.h>
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
    printf("%s : Schemas support not compiled in\n", argv[0]);
    return(0);
}
#endif /* LIBXML_SCHEMAS_ENABLED */


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
  <title>Starter Template - Materialize</title>

  <link rel="icon" href="../../../images/favicon-32x32.png" sizes="32x32">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="../../../css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link href="../../../css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>

ABOUT US

ABOUT US

      menu

Hello Priya!

Im your helpful Web Data Connector for Tableau :)

        Get Earthquake Data!

Global Logistics Cluster

We are responsible for coordination, information management, and for facilitating access to common logistics services to ensure an effective and efficient logistics response takes place in humanitarian emergency missions.

      Powered by ReportHub


text:
This showcases downloading of data from an HTTP Endpoint to Azure Blob Storage using
[Azure Data Factory Custom C# Activity](http://azure.microsoft.com/en-us/documentation/articles/data-factory-use-custom-activities/). Once the data is downloaded into Azure Blob, it can be consumed for further processing.

## Contents

* /CustomDotNetActivity - Contains custom activities
* /LinkedServices - Contains linked services definitions
* /Pipelines - Contains pipeline definition
* /Tables - Contains datasets/table definitions

## Getting Started

### Azure Data Factory

1. `Switch-AzureMode AzureResourceManager `
2. `New-AzureResourceGroup -Name [RESOURCE_GROUP_NAME]  -Location "West US"`
3. `New-AzureDataFactory -ResourceGroupName [RESOURCE_GROUP_NAME] -Name [DATA_FACTORY_NAME] –Location "West US"`

### Linked Services

1. `New-AzureDataFactoryLinkedService -ResourceGroupName [RESOURCE_GROUP_NAME] -DataFactoryName [DATA_FACTORY_NAME] -File /LinkedServices/RawEventsLinkedService.json`

Optionally, if you choose to run your own instance of HDInsight in lieu of the on-demand HDInsight cluster:

1. `New-AzureDataFactoryLinkedService -ResourceGroupName [RESOURCE_GROUP_NAME] -DataFactoryName [DATA_FACTORY_NAME] -File /LinkedServices/HDInsightLinkedService.json`

### Dataset

1. `New-AzureDataFactoryTable -ResourceGroupName [RESOURCE_GROUP_NAME] -DataFactoryName [DATA_FACTORY_NAME] -File /Tables/RawEventsTable.json`

### Custom Activity

Given each time splice, the custom activity (DataDownloader.cs) will download data from a URL (ie. [http://dumps.wikimedia.org/other/pagecounts-raw/](http://dumps.wikimedia.org/other/pagecounts-raw/), uncompress the file, and then upload the data into Microsoft Azure blob storage.

1. Via Visual Studio, create a .NET class library project and include DataDownloader.cs
2. Install NuGet dependencies:
   * `Install-Package Microsoft.Azure.Management.DataFactories –Pre`
   * `Install-Package Microsoft.DataFactories.Runtime –Pre`
   * `Install-Package Azure.Storage`
3. Build the DLL and name it according to what is defined in pipeline json (ie. DataDownloaderActivity.dll)
4. Zip the contents of bin/debug or bin/release and upload it to blob storage to the container/path defined in pipeline json (ie. <container>/package/DataDownloaderActivity.zip)

### Pipeline

1. `New-AzureDataFactoryPipeline -ResourceGroupName [RESOURCE_GROUP_NAME] -DataFactoryName [DATA_FACTORY_NAME]  -File /Pipelines/DataDownloaderSamplePipeline.json`

## Known Issues

* Manually create the *adfjobs* container in your Azure Storage. When the custom activity runs, Azure Data Factory will be able to capture that output from the HDInsight cluster, and save it in the adfjobs storage container in your Azure Blob Storage account.


text:
package org.yield4j;

import java.util.Iterator;
import java.util.NoSuchElementException;

public abstract class ArrayIterator<E> implements Iterator<E> {

    private int idx;

    protected ArrayIterator() {
        idx = -1;
    }

    public static <T> ArrayIterator<T> create(T[] array) {
        return new ReferenceArrayIterator<T>(array);
    }

    public static ArrayIterator<Integer> create(int[] array) {
        return new IntArrayIterator(array);
    }

    public static ArrayIterator<Long> create(long[] array) {
        return new LongArrayIterator(array);
    }

    public static ArrayIterator<Float> create(float[] array) {
        return new FloatArrayIterator(array);
    }

    public static ArrayIterator<Double> create(double[] array) {
        return new DoubleArrayIterator(array);
    }

    public static ArrayIterator<Character> create(char[] array) {
        return new CharArrayIterator(array);
    }

    public static ArrayIterator<Short> create(short[] array) {
        return new ShortArrayIterator(array);
    }

    public static ArrayIterator<Byte> create(byte[] array) {
        return new ByteArrayIterator(array);
    }

    public static ArrayIterator<Boolean> create(boolean[] array) {
        return new BooleanArrayIterator(array);
    }

    @Override
    public boolean hasNext() {
        return idx < getLength() - 1;
    }

    @Override
    public E next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        return getElement(++idx);
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException();
    }

    protected abstract int getLength();

    protected abstract E getElement(int index);

    private static class ReferenceArrayIterator<T> extends ArrayIterator<T> {
        private T[] array;

        private ReferenceArrayIterator(T[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected T getElement(int index) {
            return array[index];
        }
    }

    private static class IntArrayIterator extends ArrayIterator<Integer> {
        private int[] array;

        private IntArrayIterator(int[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Integer getElement(int index) {
            return array[index];
        }
    }

    private static class LongArrayIterator extends ArrayIterator<Long> {
        private long[] array;

        private LongArrayIterator(long[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Long getElement(int index) {
            return array[index];
        }
    }

    private static class FloatArrayIterator extends ArrayIterator<Float> {
        private float[] array;

        private FloatArrayIterator(float[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Float getElement(int index) {
            return array[index];
        }
    }

    private static class DoubleArrayIterator extends ArrayIterator<Double> {
        private double[] array;

        private DoubleArrayIterator(double[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Double getElement(int index) {
            return array[index];
        }
    }

    private static class CharArrayIterator extends ArrayIterator<Character> {
        private char[] array;

        private CharArrayIterator(char[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Character getElement(int index) {
            return array[index];
        }
    }

    private static class ShortArrayIterator extends ArrayIterator<Short> {
        private short[] array;

        private ShortArrayIterator(short[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Short getElement(int index) {
            return array[index];
        }
    }

    private static class ByteArrayIterator extends ArrayIterator<Byte> {
        private byte[] array;

        private ByteArrayIterator(byte[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Byte getElement(int index) {
            return array[index];
        }
    }

    private static class BooleanArrayIterator extends ArrayIterator<Boolean> {
        private boolean[] array;

        private BooleanArrayIterator(boolean[] array) {
            this.array = array;
        }

        @Override
        protected int getLength() {
            return array.length;
        }

        @Override
        protected Boolean getElement(int index) {
            return array[index];
        }
    }
}


text:
RSpec.describe LinkTypeValidator do
  it "validates incorrect link types" do
    record = build_stubbed(:tag_mapping, link_type: "organisations")
    described_class.new.validate(record)

    expect(record.errors[:link_type]).to include(/invalid link types found/i)
  end

  it "does not add validation errors when we have expected link types" do
    record = build_stubbed(:tag_mapping, link_type: "taxons")
    described_class.new.validate(record)

    expect(record.errors).to be_empty
  end
end


text:
/**
 * Unit tests for the metric arithmetic element.
 */
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {TestBed} from '@angular/core/testing';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatChipsModule} from '@angular/material/chips';
import {MatInputModule} from '@angular/material/input';
import {By} from '@angular/platform-browser';
import {Action, Store} from '@ngrx/store';
import {MockStore, provideMockStore} from '@ngrx/store/testing';
import {State} from '../../../../../../app_state';
import * as npmiActions from '../../../../actions';
import {
  getEmbeddingDataSet,
  getMetricFilters,
} from '../../../../store/npmi_selectors';
import {
  appStateFromNpmiState,
  createNpmiState,
  createSampleEmbeddingData,
} from '../../../../testing';
import {MetricArithmeticElementComponent} from './metric_arithmetic_element_component';
import {MetricArithmeticElementContainer} from './metric_arithmetic_element_container';

describe('Npmi Metric Arithmetic Element Container', () => {
  let store: MockStore<State>;
  let dispatchedActions: Action[];
  const css = {
    FILTER_CHIP: By.css('.filter-chip'),
    ELEMENT_REMOVE: By.css('.mat-chip-remove'),
    INPUT: By.css('input'),
    VALUE_INVALID: By.css('.value-invalid'),
    EMBEDDINGS_TOGGLE: By.css('.embeddings-button'),
  };

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [
        MetricArithmeticElementContainer,
        MetricArithmeticElementComponent,
      ],
      imports: [
        FormsModule,
        ReactiveFormsModule,
        MatInputModule,
        MatChipsModule,
      ],
      providers: [
        provideMockStore({
          initialState: appStateFromNpmiState(createNpmiState()),
        }),
      ],
      schemas: [NO_ERRORS_SCHEMA],
    }).compileComponents();

    store = TestBed.inject<Store<State>>(Store) as MockStore<State>;

    dispatchedActions = [];
    spyOn(store, 'dispatch').and.callFake((action: Action) => {
      dispatchedActions.push(action);
    });
    store.overrideSelector(getMetricFilters, {
      'npmi@test': {max: 1.0, min: -1.0, includeNaN: false},
    });
  });

  afterEach(() => {
    store?.resetSelectors();
  });

  it('renders npmi metric arithmetic element component', () => {
    const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
    fixture.componentInstance.metric = 'npmi@test';
    fixture.detectChanges();

    const filterDiv = fixture.debugElement.query(css.FILTER_CHIP);
    expect(filterDiv).toBeTruthy();
  });

  it('removes metric on click on remove button', () => {
    const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
    fixture.componentInstance.metric = 'npmi@test';
    fixture.detectChanges();

    const removeButton = fixture.debugElement.query(css.ELEMENT_REMOVE);
    removeButton.nativeElement.click();
    expect(dispatchedActions).toEqual([
      npmiActions.npmiRemoveMetricFilter({metric: 'npmi@test'}),
    ]);
  });

  describe('metric embeddings selection', () => {
    it('does not render the embeddings button when no embeddings present', () => {
      const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
      fixture.componentInstance.metric = 'npmi@test';
      fixture.detectChanges();

      const embeddingsButton = fixture.debugElement.query(
        css.EMBEDDINGS_TOGGLE
      );
      expect(embeddingsButton).toBeNull();
    });

    it('renders the embeddings button when embeddings present', () => {
      const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
      const embeddingData = createSampleEmbeddingData();
      fixture.componentInstance.metric = 'npmi@test';
      store.overrideSelector(getEmbeddingDataSet, embeddingData);
      fixture.detectChanges();

      const embeddingsButton = fixture.debugElement.query(
        css.EMBEDDINGS_TOGGLE
      );
      expect(embeddingsButton).toBeTruthy();
    });

    it('dispatches metric selected action on click on chip', () => {
      const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
      const embeddingData = createSampleEmbeddingData();
      fixture.componentInstance.metric = 'npmi@test';
      store.overrideSelector(getEmbeddingDataSet, embeddingData);
      fixture.detectChanges();

      const embeddingsButton = fixture.debugElement.query(
        css.EMBEDDINGS_TOGGLE
      );
      embeddingsButton.nativeElement.click();
      expect(dispatchedActions).toEqual([
        npmiActions.npmiEmbeddingsViewToggled({metric: 'npmi@test'}),
      ]);
    });
  });

  describe('input interaction', () => {
    describe('min input', () => {
      it('changes the filter when interacting with the input', () => {
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[0];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = '0.2';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: '0.2'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([
          npmiActions.npmiMetricFilterChanged({
            metric: 'npmi@test',
            max: 1.0,
            min: 0.2,
            includeNaN: false,
          }),
        ]);
      });

      it('changes the filter to NaN', () => {
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[0];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = 'NaN';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: 'NaN'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([
          npmiActions.npmiMetricFilterChanged({
            metric: 'npmi@test',
            max: 1.0,
            min: -1.0,
            includeNaN: true,
          }),
        ]);
      });

      it('does not change the filter when an incorrect value is entered', () => {
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[0];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = '-';
        input.nativeElement.dispatchEvent(new InputEvent('input', {data: '-'}));
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([]);

        const invalidInput = fixture.debugElement.query(css.VALUE_INVALID);
        expect(invalidInput).toBeTruthy();
      });

      it('does not change the filter when min is larger than max', () => {
        store.overrideSelector(getMetricFilters, {
          'npmi@test': {max: 0.5, min: -1.0, includeNaN: false},
        });
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[0];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = '0.6';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: '0.6'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([]);

        const invalidInput = fixture.debugElement.query(css.VALUE_INVALID);
        expect(invalidInput).toBeTruthy();
      });
    });

    describe('max input', () => {
      it('changes the filter when interacting with the input', () => {
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[1];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = '0.2';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: '0.2'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([
          npmiActions.npmiMetricFilterChanged({
            metric: 'npmi@test',
            max: 0.2,
            min: -1.0,
            includeNaN: false,
          }),
        ]);
      });

      it('does not change the filter when max is smaler than min', () => {
        store.overrideSelector(getMetricFilters, {
          'npmi@test': {max: 1.0, min: 0.2, includeNaN: false},
        });
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[1];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = '0.1';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: '0.1'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([]);

        const invalidInput = fixture.debugElement.query(css.VALUE_INVALID);
        expect(invalidInput).toBeTruthy();
      });

      it('does not change the filter when NaN is entered but min is not NaN', () => {
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[1];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = 'NaN';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: 'NaN'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([]);

        const invalidInput = fixture.debugElement.query(css.VALUE_INVALID);
        expect(invalidInput).toBeTruthy();
      });

      it('changes the filter when NaN is entered and min is also NaN', () => {
        store.overrideSelector(getMetricFilters, {
          'npmi@test': {max: 1.0, min: -1.0, includeNaN: true},
        });
        const fixture = TestBed.createComponent(
          MetricArithmeticElementContainer
        );
        fixture.componentInstance.metric = 'npmi@test';
        fixture.detectChanges();

        const inputs = fixture.debugElement.queryAll(css.INPUT);
        const input = inputs[1];
        input.nativeElement.focus();
        fixture.detectChanges();

        input.nativeElement.value = 'NaN';
        input.nativeElement.dispatchEvent(
          new InputEvent('input', {data: 'NaN'})
        );
        fixture.detectChanges();

        expect(dispatchedActions).toEqual([
          npmiActions.npmiMetricFilterChanged({
            metric: 'npmi@test',
            max: -2.0,
            min: -1.0,
            includeNaN: true,
          }),
        ]);

        const invalidInput = fixture.debugElement.query(css.VALUE_INVALID);
        expect(invalidInput).toBeNull();
      });
    });

    it('changes the form controls when the filter is updated', () => {
      store.overrideSelector(getMetricFilters, {
        'npmi@test': {max: 1.0, min: -1.0, includeNaN: true},
      });
      const fixture = TestBed.createComponent(MetricArithmeticElementContainer);
      fixture.componentInstance.metric = 'npmi@test';
      fixture.detectChanges();

      const inputs = fixture.debugElement.queryAll(css.INPUT);
      expect(inputs[0].nativeElement.value).toBe('NaN');
      expect(inputs[1].nativeElement.value).toBe('1');

      store.overrideSelector(getMetricFilters, {
        'npmi@test': {max: 0.0, min: -0.3, includeNaN: false},
      });
      store.refreshState();
      fixture.detectChanges();

      expect(inputs[0].nativeElement.value).toBe('-0.3');
      expect(inputs[1].nativeElement.value).toBe('0');
    });
  });
});


text:
package shippingrate

import (
	"net/http"

	stripe "github.com/stripe/stripe-go/v74"
	"github.com/stripe/stripe-go/v74/form"
)

// Client is used to invoke /shipping_rates APIs.
type Client struct {
	B   stripe.Backend
	Key string
}

// New creates a new shipping rate.
func New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	return getC().New(params)
}

// New creates a new shipping rate.
func (c Client) New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	shippingrate := &stripe.ShippingRate{}
	err := c.B.Call(
		http.MethodPost,
		"/v1/shipping_rates",
		c.Key,
		params,
		shippingrate,
	)
	return shippingrate, err
}

// Get returns the details of a shipping rate.
func Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	return getC().Get(id, params)
}

// Get returns the details of a shipping rate.
func (c Client) Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	path := stripe.FormatURLPath("/v1/shipping_rates/%s", id)
	shippingrate := &stripe.ShippingRate{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, shippingrate)
	return shippingrate, err
}

// Update updates a shipping rate's properties.
func Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	return getC().Update(id, params)
}

// Update updates a shipping rate's properties.
func (c Client) Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) {
	path := stripe.FormatURLPath("/v1/shipping_rates/%s", id)
	shippingrate := &stripe.ShippingRate{}
	err := c.B.Call(http.MethodPost, path, c.Key, params, shippingrate)
	return shippingrate, err
}

// List returns a list of shipping rates.
func List(params *stripe.ShippingRateListParams) *Iter {
	return getC().List(params)
}

// List returns a list of shipping rates.
func (c Client) List(listParams *stripe.ShippingRateListParams) *Iter {
	return &Iter{
		Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
			list := &stripe.ShippingRateList{}
			err := c.B.CallRaw(http.MethodGet, "/v1/shipping_rates", c.Key, b, p, list)

			ret := make([]interface{}, len(list.Data))
			for i, v := range list.Data {
				ret[i] = v
			}

			return ret, list, err
		}),
	}
}

// Iter is an iterator for shipping rates.
type Iter struct {
	*stripe.Iter
}

// ShippingRate returns the shipping rate which the iterator is currently pointing to.
func (i *Iter) ShippingRate() *stripe.ShippingRate {
	return i.Current().(*stripe.ShippingRate)
}

// ShippingRateList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) ShippingRateList() *stripe.ShippingRateList {
	return i.List().(*stripe.ShippingRateList)
}

func getC() Client {
	return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}


text:
import { Component } from "@angular/core";
import { State } from "ui-router-ng2";

/* UI-router dependencies - we need to read data from the current state. */
import { StateService } from "ui-router-ng2";
import { TransitionService } from "ui-router-ng2";

/**
 * AppBodyContainer
 *
 * This component contains the frame & routing view about which the meat of our application's
 * content will be presented.  The component includes two key parts:
 * 1. The body view frame - includes a few basic presentation elements that surround
 * the body's content - page title, whitespace, padding, etc.
 * 2. The main application viewport - the ui-router view instance definition that
 * will contain our application's top-level feature views.
 *
 * The page title segment is dynamically managed by this component through the
 * use of the ui-router state definitions.  This component will read the pageTitle
 * property from the current state's "data" object property, and if present, will
 * set the defined pageTitle value as the view's title.  The page title is updated
 * automatically by this component upon successful ui-router state changes.
 */
@Component({
    selector: "[app-body-container]",
    templateUrl: "../templates/app-body-container.tpl.html",
    styleUrls: ["../styles/app-body-container.css"]
})
export class AppBodyContainer {
    title: string;

    constructor(private stateService: StateService, private txService: TransitionService) {
        this.title = "";
    }

    /**
     * On init, we need to set the default page title (i.e. the title from the current
     * application state upon component bootstrapping), as well as register a state
     * transition hook that automatically updates the state name.
     */
    ngOnInit() {
        // Extract the default title from the current state
        let cs = this.stateService.$current;
        this.setPageTitle(cs.data);

        /* Register a state transition hook that updates the page title upon
         * succesful state change... */
        this.txService.onSuccess({}, transition =>  {
            let newState = transition.$to();
            this.setPageTitle(newState.data);
        });
    }

    /**
     * @method
     * @name setPageTitle
     * @description
     * Sets the title property of this component class with the pageTitle property
     * from the supplied ui-router State data object.
     * This functionality is abstracted into a method to allow for the graceful
     * implementation of type checking and negative case handling.
     * checking type checking
     * @param {Object} state UI-router state data object
     */
    private setPageTitle(stateData) {
        this.title = stateData && stateData.pageTitle.constructor === String ? stateData.pageTitle : "Missing page title!";
    }

}


text:
import React, { Component } from "react";
import { ListItem as Item } from "material-ui/List";
import FlatButton from "material-ui/FlatButton";
import DeleteIcon from "material-ui/svg-icons/action/delete";

class ListItem extends Component {
    deleteItem = () => {
        this.props.delete(this.props.id);
    };

    render() {
        return (
            <Item
                className="playlist-item"
                primaryText={
{this.props.title}
}
                secondaryText={

                        {this.props.artist} - {this.props.album}

                }
                rightIcon={
                    <FlatButton onClick={this.deleteItem}>
                        <DeleteIcon />
                    </FlatButton>
                }
            />
        );
    }
}

export default ListItem;


text:
module GoDaddyReseller
  module Util

  end
end


text:
package jtux;

public class USysVIPC {
	/*
		Not sure yet where this should be.
	*/
	static {
		System.loadLibrary("jtux");
		System.out.println("Loaded OK.");
	}

	/**
		Java version of C struct ipc_perm.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class s_ipc_perm {
		public long uid;		// owner user-ID
		public long gid;		// owner group-ID
		public long cuid;		// creator user-ID
		public long cgid;		// creator group-ID
		public int mode;		// permission bits
	}

	/**
		Java version of C struct msqid_ds.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class s_msqid_ds {
		public s_ipc_perm msg_perm;	// permission structure
		public int msg_qnum;			// number of messages currently on queue
		public int msg_qbytes;			// maximum number of bytes allowed on queue
		public long msg_lspid;			// process ID of last msgsnd
		public long msg_lrpid;			// process ID of last msgrcv
		public long msg_stime;			// time of last msgsnd
		public long msg_rtime;			// time of last msgrcv
		public long msg_ctime;			// time of last msgctl change

		public s_msqid_ds() {
			msg_perm = new s_ipc_perm();
		}
	}

	/**
		Java version of C struct semid_ds.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class s_semid_ds {
		public s_ipc_perm sem_perm;		// permission structure
		public short sem_nsems;			// size of set
		public long sem_otime;			// time of last semop
		public long sem_ctime;			// time of last semctl

		public s_semid_ds() {
			sem_perm = new s_ipc_perm();
		}
	}

	/**
		Java version of C struct shmid_ds.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class s_shmid_ds {
		public s_ipc_perm shm_perm;		// permission structure
		public int shm_segsz;			// size of segment in bytes
		public long shm_lpid;			// process ID of last shared memory operation
		public long shm_cpid;			// process ID of creator
		public int shm_nattch;			// number of current attaches
		public long shm_atime;			// time of last shmat
		public long shm_dtime;			// time of last shmdt
		public long shm_ctime;			// time of last change by shmctl

		public s_shmid_ds() {
			shm_perm = new s_ipc_perm();
		}
	}

	/**
		Java version of C union semun. Use subclasses for different types.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class u_semun {
	}

	static public class u_semun_int extends u_semun {
		public int val;
	}

	static public class u_semun_struct extends u_semun {
		public s_semid_ds buf;
	}

	static public class u_semun_array extends u_semun {
		public short[] array;
	}

	/**
		Java version of C struct sembuf.

		Click {@link here} for Posix/SUS C API.
	*/
	static public class s_sembuf {
		public short sem_num;			// semaphore number
		public short sem_op;			// Semaphore operation
		public short sem_flg;			// Operation flags
	}

	/**
		Calls ftok.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static long ftok(String path, int id) throws UErrorException;
	/**
		Set message type.

		Convenience function (non-standard) to set the first few bytes of a message to
		the message type. Number of bytes used for the type (typically 4) is retunred.
		Data should start at the next byte.
	*/
	public native static int msg_set_type(long msgtype, byte[] msgp) throws UErrorException;
	/**
		Calls msgctl.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static void msgctl(int msqid, int cmd, s_msqid_ds data) throws UErrorException;
	/**
		Calls msgget.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static int msgget(long key, int flags) throws UErrorException;
	/**
		Calls msgrcv.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static int msgrcv(int msqid, byte[] msgp, int mtextsize, long msgtype, int flags) throws UErrorException;
	/**
		Calls msgsnd.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static void msgsnd(int msqid, byte[] msgp, int msgsize, int flags) throws UErrorException;
	/**
		Calls semctl.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static int semctl(int semid, int semnum, int cmd, u_semun arg) throws UErrorException;
	/**
		Calls semget.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static int semget(long key, int nsems, int flags) throws UErrorException;
	/**
		Calls semop.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static void semop(int semid, s_sembuf[] sops, int nsops) throws UErrorException;
	/**
		Calls shmat.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static long shmat(int shmid, long shmaddr, int flags) throws UErrorException;
	/**
		Calls shmctl.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static void shmctl(int shmid, int cmd, s_shmid_ds data) throws UErrorException;
	/**
		Calls shmdt.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static void shmdt(long shmaddr) throws UErrorException;
	/**
		Calls shmget.

		Click {@link here} for Posix/SUS C API.
	*/
	public native static int shmget(long key, int size, int flags) throws UErrorException;
}


text:
<?php

namespace PhpSpec\Formatter\Html;

use PhpSpec\Event\ExampleEvent;
use PhpSpec\Formatter\Template as TemplateInterface;

class ReportPendingItem {

    /**
     * @var \PhpSpec\Formatter\Template
     */
    private $template;

    /**
     * @var \PhpSpec\Event\ExampleEvent
     */
    private $event;

    /**
     * @var int
     */
    private static $pendingExamplesCount = 1;

    /**
     * @param TemplateInterface $template
     * @param ExampleEvent      $event
     */
    public function __construct(TemplateInterface $template, ExampleEvent $event) {
        $this->template = $template;
        $this->event = $event;
    }

    /**
     *
     */
    public function write() {
        $this->template->render(Template::DIR . '/Template/ReportPending.html', array(
            'title' => $this->event->getTitle(),
            'pendingExamplesCount' => self::$pendingExamplesCount
        ));
        self::$pendingExamplesCount++;
    }

}


text: Encode(Decode) URL String


text:
using FluentAssertions;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nest.Tests.Integration.Core
{
	[TestFixture]
	public class PingTests : IntegrationTests
	{
		[Test]
		public void PingTest()
		{
			var r = this.Client.Ping();
			r.IsValid.Should().BeTrue();
			r.ConnectionStatus.HttpStatusCode.ShouldBeEquivalentTo(200);
		}
	}
}